diff --git a/.gitignore b/.gitignore index 4c60af9..2edf6af 100644 --- a/.gitignore +++ b/.gitignore @@ -44,4 +44,5 @@ app.*.map.json /android/app/profile /android/app/release -.env \ No newline at end of file +.env +ios/Podfile.lock diff --git a/.metadata b/.metadata index 5b39692..9a674c6 100644 --- a/.metadata +++ b/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled and should not be manually edited. version: - revision: "d8a9f9a52e5af486f80d932e838ee93861ffd863" + revision: "35c388afb57ef061d06a39b537336c87e0e3d1b1" channel: "stable" project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 - base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 + base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 - platform: android - create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 - base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 + base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 - platform: ios - create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 - base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 + base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 - platform: linux - create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 - base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 + base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 - platform: macos - create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 - base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 + base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 - platform: web - create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 - base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 + base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 - platform: windows - create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 - base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 + base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 # User provided section diff --git a/Dockerfile b/Dockerfile index 45a63a6..669a241 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,8 @@ COPY . . # Get dependencies RUN flutter pub get +RUN dart pub run build_runner build --delete-conflicting-outputs + # Build Flutter Web RUN flutter build web --release diff --git a/README.md b/README.md index 059ef68..1486429 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ An **open-source, privacy-first** wardrobe app built with **Flutter & Supabase** ![Flutter](https://img.shields.io/badge/Flutter-3.0-blue?logo=flutter) ![Supabase](https://img.shields.io/badge/Supabase-Database-green?logo=supabase) ![MIT License](https://img.shields.io/badge/License-MIT-blue.svg) - + --- ## 🚀 Features diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts new file mode 100644 index 0000000..28bc47a --- /dev/null +++ b/android/app/build.gradle.kts @@ -0,0 +1,44 @@ +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.example.openwardrobe" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.example.openwardrobe" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/android/build.gradle.kts b/android/build.gradle.kts new file mode 100644 index 0000000..89176ef --- /dev/null +++ b/android/build.gradle.kts @@ -0,0 +1,21 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts new file mode 100644 index 0000000..a439442 --- /dev/null +++ b/android/settings.gradle.kts @@ -0,0 +1,25 @@ +pluginManagement { + val flutterSdkPath = run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.7.0" apply false + id("org.jetbrains.kotlin.android") version "1.8.22" apply false +} + +include(":app") diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 0000000..fa0b357 --- /dev/null +++ b/devtools_options.yaml @@ -0,0 +1,3 @@ +description: This file stores settings for Dart & Flutter DevTools. +documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states +extensions: diff --git a/flutter_01.png b/flutter_01.png new file mode 100644 index 0000000..bdd5323 Binary files /dev/null and b/flutter_01.png differ diff --git a/ios/.gitignore b/ios/.gitignore index 7a7f987..30315d8 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -32,3 +32,5 @@ Runner/GeneratedPluginRegistrant.* !default.mode2v3 !default.pbxuser !default.perspectivev3 + +Runner.xcodeproj/project.pbxproj \ No newline at end of file diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..d97f17e --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,44 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 5777d52..0000000 --- a/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,616 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 97C146E61CF9000F007C117D /* Project object */; - proxyType = 1; - remoteGlobalIDString = 97C146ED1CF9000F007C117D; - remoteInfo = Runner; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; - 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 331C8082294A63A400263BE5 /* RunnerTests */ = { - isa = PBXGroup; - children = ( - 331C807B294A618700263BE5 /* RunnerTests.swift */, - ); - path = RunnerTests; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 331C8082294A63A400263BE5 /* RunnerTests */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - 331C8081294A63A400263BE5 /* RunnerTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 331C8080294A63A400263BE5 /* RunnerTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; - buildPhases = ( - 331C807D294A63A400263BE5 /* Sources */, - 331C807F294A63A400263BE5 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 331C8086294A63A400263BE5 /* PBXTargetDependency */, - ); - name = RunnerTests; - productName = RunnerTests; - productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1510; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 331C8080294A63A400263BE5 = { - CreatedOnToolsVersion = 14.0; - TestTargetID = 97C146ED1CF9000F007C117D; - }; - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - 331C8080294A63A400263BE5 /* RunnerTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 331C807F294A63A400263BE5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 331C807D294A63A400263BE5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 97C146ED1CF9000F007C117D /* Runner */; - targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.openwardrobe; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 331C8088294A63A400263BE5 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.openwardrobe.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Debug; - }; - 331C8089294A63A400263BE5 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.openwardrobe.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Release; - }; - 331C808A294A63A400263BE5 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.openwardrobe.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.openwardrobe; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.openwardrobe; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 331C8088294A63A400263BE5 /* Debug */, - 331C8089294A63A400263BE5 /* Release */, - 331C808A294A63A400263BE5 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8e3ca5d..15cada4 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -59,6 +59,7 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + enableGPUValidationMode = "1" allowLocationSimulation = "YES"> diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a1..21a3cc1 100644 --- a/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index fb76b67..59ad31b 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -24,6 +26,12 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + NSCameraUsageDescription + This app needs camera access to take photos for wardrobe items. + NSPhotoLibraryAddUsageDescription + This app needs access to your photo library to save captured images. + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,9 +49,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - diff --git a/lib/brick/adapters/brand_adapter.g.dart b/lib/brick/adapters/brand_adapter.g.dart new file mode 100644 index 0000000..2bdc789 --- /dev/null +++ b/lib/brick/adapters/brand_adapter.g.dart @@ -0,0 +1,149 @@ +// GENERATED CODE DO NOT EDIT +part of '../brick.g.dart'; + +Future _$BrandFromSupabase(Map data, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return Brand( + id: data['id'] as String?, + name: data['name'] as String, + userProfile: data['user_profile'] == null + ? null + : await UserProfileAdapter().fromSupabase(data['user_profile'], + provider: provider, repository: repository)); +} + +Future> _$BrandToSupabase(Brand instance, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'name': instance.name, + 'user_profile': instance.userProfile != null + ? await UserProfileAdapter().toSupabase(instance.userProfile!, + provider: provider, repository: repository) + : null + }; +} + +Future _$BrandFromSqlite(Map data, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return Brand( + id: data['id'] as String, + name: data['name'] as String, + userProfile: data['user_profile_UserProfile_brick_id'] == null + ? null + : (data['user_profile_UserProfile_brick_id'] > -1 + ? (await repository?.getAssociation( + Query.where('primaryKey', + data['user_profile_UserProfile_brick_id'] as int, + limit1: true), + )) + ?.first + : null)) + ..primaryKey = data['_brick_id'] as int; +} + +Future> _$BrandToSqlite(Brand instance, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'name': instance.name, + 'user_profile_UserProfile_brick_id': instance.userProfile != null + ? instance.userProfile!.primaryKey ?? + await provider.upsert(instance.userProfile!, + repository: repository) + : null + }; +} + +/// Construct a [Brand] +class BrandAdapter extends OfflineFirstWithSupabaseAdapter { + BrandAdapter(); + + @override + final supabaseTableName = 'brand'; + @override + final defaultToNull = true; + @override + final fieldsToSupabaseColumns = { + 'id': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'id', + ), + 'name': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'name', + ), + 'userProfile': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'user_profile', + associationType: UserProfile, + associationIsNullable: true, + foreignKey: 'user_profile_id', + ) + }; + @override + final ignoreDuplicates = false; + @override + final uniqueFields = {'id'}; + @override + final Map fieldsToSqliteColumns = { + 'primaryKey': const RuntimeSqliteColumnDefinition( + association: false, + columnName: '_brick_id', + iterable: false, + type: int, + ), + 'id': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'id', + iterable: false, + type: String, + ), + 'name': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'name', + iterable: false, + type: String, + ), + 'userProfile': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'user_profile_UserProfile_brick_id', + iterable: false, + type: UserProfile, + ) + }; + @override + Future primaryKeyByUniqueColumns( + Brand instance, DatabaseExecutor executor) async => + instance.primaryKey; + @override + final String tableName = 'Brand'; + + @override + Future fromSupabase(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$BrandFromSupabase(input, + provider: provider, repository: repository); + @override + Future> toSupabase(Brand input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$BrandToSupabase(input, + provider: provider, repository: repository); + @override + Future fromSqlite(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$BrandFromSqlite(input, + provider: provider, repository: repository); + @override + Future> toSqlite(Brand input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$BrandToSqlite(input, provider: provider, repository: repository); +} diff --git a/lib/brick/adapters/category_summary_adapter.g.dart b/lib/brick/adapters/category_summary_adapter.g.dart new file mode 100644 index 0000000..18b2f70 --- /dev/null +++ b/lib/brick/adapters/category_summary_adapter.g.dart @@ -0,0 +1,148 @@ +// GENERATED CODE DO NOT EDIT +part of '../brick.g.dart'; + +Future _$CategorySummaryFromSupabase(Map data, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return CategorySummary( + categoryId: data['category_id'] as String, + categoryName: data['category_name'] as String, + itemCount: data['item_count'] as int, + categoryImage: data['category_image'] == null + ? null + : data['category_image'] as String?); +} + +Future> _$CategorySummaryToSupabase( + CategorySummary instance, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'category_id': instance.categoryId, + 'category_name': instance.categoryName, + 'item_count': instance.itemCount, + 'category_image': instance.categoryImage + }; +} + +Future _$CategorySummaryFromSqlite(Map data, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return CategorySummary( + categoryId: data['category_id'] as String, + categoryName: data['category_name'] as String, + itemCount: data['item_count'] as int, + categoryImage: data['category_image'] == null + ? null + : data['category_image'] as String?) + ..primaryKey = data['_brick_id'] as int; +} + +Future> _$CategorySummaryToSqlite(CategorySummary instance, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'category_id': instance.categoryId, + 'category_name': instance.categoryName, + 'item_count': instance.itemCount, + 'category_image': instance.categoryImage + }; +} + +/// Construct a [CategorySummary] +class CategorySummaryAdapter + extends OfflineFirstWithSupabaseAdapter { + CategorySummaryAdapter(); + + @override + final supabaseTableName = 'v_user_category_summary'; + @override + final defaultToNull = true; + @override + final fieldsToSupabaseColumns = { + 'categoryId': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'category_id', + ), + 'categoryName': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'category_name', + ), + 'itemCount': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'item_count', + ), + 'categoryImage': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'category_image', + ) + }; + @override + final ignoreDuplicates = false; + @override + final uniqueFields = {}; + @override + final Map fieldsToSqliteColumns = { + 'primaryKey': const RuntimeSqliteColumnDefinition( + association: false, + columnName: '_brick_id', + iterable: false, + type: int, + ), + 'categoryId': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'category_id', + iterable: false, + type: String, + ), + 'categoryName': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'category_name', + iterable: false, + type: String, + ), + 'itemCount': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'item_count', + iterable: false, + type: int, + ), + 'categoryImage': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'category_image', + iterable: false, + type: String, + ) + }; + @override + Future primaryKeyByUniqueColumns( + CategorySummary instance, DatabaseExecutor executor) async => + instance.primaryKey; + @override + final String tableName = 'CategorySummary'; + + @override + Future fromSupabase(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CategorySummaryFromSupabase(input, + provider: provider, repository: repository); + @override + Future> toSupabase(CategorySummary input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CategorySummaryToSupabase(input, + provider: provider, repository: repository); + @override + Future fromSqlite(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CategorySummaryFromSqlite(input, + provider: provider, repository: repository); + @override + Future> toSqlite(CategorySummary input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CategorySummaryToSqlite(input, + provider: provider, repository: repository); +} diff --git a/lib/brick/adapters/community_post_adapter.g.dart b/lib/brick/adapters/community_post_adapter.g.dart new file mode 100644 index 0000000..03503f8 --- /dev/null +++ b/lib/brick/adapters/community_post_adapter.g.dart @@ -0,0 +1,211 @@ +// GENERATED CODE DO NOT EDIT +part of '../brick.g.dart'; + +Future _$CommunityPostFromSupabase(Map data, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return CommunityPost( + id: data['id'] as String?, + userProfile: data['user_profile'] == null + ? null + : await UserProfileAdapter().fromSupabase(data['user_profile'], + provider: provider, repository: repository), + content: data['content'] as String, + imageUrl: data['image_url'] == null ? null : data['image_url'] as String?, + isPublic: data['is_public'] as bool?, + createdAt: data['created_at'] == null + ? null + : DateTime.tryParse(data['created_at'] as String), + updatedAt: data['updated_at'] == null + ? null + : DateTime.tryParse(data['updated_at'] as String)); +} + +Future> _$CommunityPostToSupabase(CommunityPost instance, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'user_profile': instance.userProfile != null + ? await UserProfileAdapter().toSupabase(instance.userProfile!, + provider: provider, repository: repository) + : null, + 'content': instance.content, + 'image_url': instance.imageUrl, + 'is_public': instance.isPublic, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String() + }; +} + +Future _$CommunityPostFromSqlite(Map data, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return CommunityPost( + id: data['id'] as String, + userProfile: data['user_profile_UserProfile_brick_id'] == null + ? null + : (data['user_profile_UserProfile_brick_id'] > -1 + ? (await repository?.getAssociation( + Query.where('primaryKey', + data['user_profile_UserProfile_brick_id'] as int, + limit1: true), + )) + ?.first + : null), + content: data['content'] as String, + imageUrl: data['image_url'] == null ? null : data['image_url'] as String?, + isPublic: data['is_public'] == 1, + createdAt: DateTime.parse(data['created_at'] as String), + updatedAt: DateTime.parse(data['updated_at'] as String)) + ..primaryKey = data['_brick_id'] as int; +} + +Future> _$CommunityPostToSqlite(CommunityPost instance, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'user_profile_UserProfile_brick_id': instance.userProfile != null + ? instance.userProfile!.primaryKey ?? + await provider.upsert(instance.userProfile!, + repository: repository) + : null, + 'content': instance.content, + 'image_url': instance.imageUrl, + 'is_public': instance.isPublic ? 1 : 0, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String() + }; +} + +/// Construct a [CommunityPost] +class CommunityPostAdapter + extends OfflineFirstWithSupabaseAdapter { + CommunityPostAdapter(); + + @override + final supabaseTableName = 'community_posts'; + @override + final defaultToNull = true; + @override + final fieldsToSupabaseColumns = { + 'id': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'id', + ), + 'userProfile': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'user_profile', + associationType: UserProfile, + associationIsNullable: true, + foreignKey: 'user_profile_id', + ), + 'content': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'content', + ), + 'imageUrl': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'image_url', + ), + 'isPublic': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'is_public', + ), + 'createdAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'created_at', + ), + 'updatedAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'updated_at', + ) + }; + @override + final ignoreDuplicates = false; + @override + final uniqueFields = {'id'}; + @override + final Map fieldsToSqliteColumns = { + 'primaryKey': const RuntimeSqliteColumnDefinition( + association: false, + columnName: '_brick_id', + iterable: false, + type: int, + ), + 'id': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'id', + iterable: false, + type: String, + ), + 'userProfile': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'user_profile_UserProfile_brick_id', + iterable: false, + type: UserProfile, + ), + 'content': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'content', + iterable: false, + type: String, + ), + 'imageUrl': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'image_url', + iterable: false, + type: String, + ), + 'isPublic': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'is_public', + iterable: false, + type: bool, + ), + 'createdAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'created_at', + iterable: false, + type: DateTime, + ), + 'updatedAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'updated_at', + iterable: false, + type: DateTime, + ) + }; + @override + Future primaryKeyByUniqueColumns( + CommunityPost instance, DatabaseExecutor executor) async => + instance.primaryKey; + @override + final String tableName = 'CommunityPost'; + + @override + Future fromSupabase(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CommunityPostFromSupabase(input, + provider: provider, repository: repository); + @override + Future> toSupabase(CommunityPost input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CommunityPostToSupabase(input, + provider: provider, repository: repository); + @override + Future fromSqlite(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CommunityPostFromSqlite(input, + provider: provider, repository: repository); + @override + Future> toSqlite(CommunityPost input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CommunityPostToSqlite(input, + provider: provider, repository: repository); +} diff --git a/lib/brick/adapters/community_post_comment_adapter.g.dart b/lib/brick/adapters/community_post_comment_adapter.g.dart new file mode 100644 index 0000000..eea5933 --- /dev/null +++ b/lib/brick/adapters/community_post_comment_adapter.g.dart @@ -0,0 +1,196 @@ +// GENERATED CODE DO NOT EDIT +part of '../brick.g.dart'; + +Future _$CommunityPostCommentFromSupabase( + Map data, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return CommunityPostComment( + id: data['id'] as String?, + post: await CommunityPostAdapter().fromSupabase(data['post'], + provider: provider, repository: repository), + userProfile: data['user_profile'] == null + ? null + : await UserProfileAdapter().fromSupabase(data['user_profile'], + provider: provider, repository: repository), + comment: data['comment'] as String, + createdAt: data['created_at'] == null + ? null + : DateTime.tryParse(data['created_at'] as String)); +} + +Future> _$CommunityPostCommentToSupabase( + CommunityPostComment instance, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'post': await CommunityPostAdapter() + .toSupabase(instance.post, provider: provider, repository: repository), + 'user_profile': instance.userProfile != null + ? await UserProfileAdapter().toSupabase(instance.userProfile!, + provider: provider, repository: repository) + : null, + 'comment': instance.comment, + 'created_at': instance.createdAt.toIso8601String() + }; +} + +Future _$CommunityPostCommentFromSqlite( + Map data, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return CommunityPostComment( + id: data['id'] as String, + post: (await repository!.getAssociation( + Query.where('primaryKey', data['post_CommunityPost_brick_id'] as int, + limit1: true), + ))! + .first, + userProfile: data['user_profile_UserProfile_brick_id'] == null + ? null + : (data['user_profile_UserProfile_brick_id'] > -1 + ? (await repository.getAssociation( + Query.where('primaryKey', + data['user_profile_UserProfile_brick_id'] as int, + limit1: true), + )) + ?.first + : null), + comment: data['comment'] as String, + createdAt: DateTime.parse(data['created_at'] as String)) + ..primaryKey = data['_brick_id'] as int; +} + +Future> _$CommunityPostCommentToSqlite( + CommunityPostComment instance, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'post_CommunityPost_brick_id': instance.post.primaryKey ?? + await provider.upsert(instance.post, + repository: repository), + 'user_profile_UserProfile_brick_id': instance.userProfile != null + ? instance.userProfile!.primaryKey ?? + await provider.upsert(instance.userProfile!, + repository: repository) + : null, + 'comment': instance.comment, + 'created_at': instance.createdAt.toIso8601String() + }; +} + +/// Construct a [CommunityPostComment] +class CommunityPostCommentAdapter + extends OfflineFirstWithSupabaseAdapter { + CommunityPostCommentAdapter(); + + @override + final supabaseTableName = 'community_post_comments'; + @override + final defaultToNull = true; + @override + final fieldsToSupabaseColumns = { + 'id': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'id', + ), + 'post': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'post', + associationType: CommunityPost, + associationIsNullable: false, + foreignKey: 'post_id', + ), + 'userProfile': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'user_profile', + associationType: UserProfile, + associationIsNullable: true, + foreignKey: 'user_profile_id', + ), + 'comment': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'comment', + ), + 'createdAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'created_at', + ) + }; + @override + final ignoreDuplicates = false; + @override + final uniqueFields = {'id'}; + @override + final Map fieldsToSqliteColumns = { + 'primaryKey': const RuntimeSqliteColumnDefinition( + association: false, + columnName: '_brick_id', + iterable: false, + type: int, + ), + 'id': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'id', + iterable: false, + type: String, + ), + 'post': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'post_CommunityPost_brick_id', + iterable: false, + type: CommunityPost, + ), + 'userProfile': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'user_profile_UserProfile_brick_id', + iterable: false, + type: UserProfile, + ), + 'comment': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'comment', + iterable: false, + type: String, + ), + 'createdAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'created_at', + iterable: false, + type: DateTime, + ) + }; + @override + Future primaryKeyByUniqueColumns( + CommunityPostComment instance, DatabaseExecutor executor) async => + instance.primaryKey; + @override + final String tableName = 'CommunityPostComment'; + + @override + Future fromSupabase(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CommunityPostCommentFromSupabase(input, + provider: provider, repository: repository); + @override + Future> toSupabase(CommunityPostComment input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CommunityPostCommentToSupabase(input, + provider: provider, repository: repository); + @override + Future fromSqlite(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CommunityPostCommentFromSqlite(input, + provider: provider, repository: repository); + @override + Future> toSqlite(CommunityPostComment input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CommunityPostCommentToSqlite(input, + provider: provider, repository: repository); +} diff --git a/lib/brick/adapters/community_post_like_adapter.g.dart b/lib/brick/adapters/community_post_like_adapter.g.dart new file mode 100644 index 0000000..8e0e514 --- /dev/null +++ b/lib/brick/adapters/community_post_like_adapter.g.dart @@ -0,0 +1,182 @@ +// GENERATED CODE DO NOT EDIT +part of '../brick.g.dart'; + +Future _$CommunityPostLikeFromSupabase( + Map data, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return CommunityPostLike( + id: data['id'] as String?, + post: await CommunityPostAdapter().fromSupabase(data['post'], + provider: provider, repository: repository), + userProfile: data['user_profile'] == null + ? null + : await UserProfileAdapter().fromSupabase(data['user_profile'], + provider: provider, repository: repository), + createdAt: data['created_at'] == null + ? null + : DateTime.tryParse(data['created_at'] as String)); +} + +Future> _$CommunityPostLikeToSupabase( + CommunityPostLike instance, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'post': await CommunityPostAdapter() + .toSupabase(instance.post, provider: provider, repository: repository), + 'user_profile': instance.userProfile != null + ? await UserProfileAdapter().toSupabase(instance.userProfile!, + provider: provider, repository: repository) + : null, + 'created_at': instance.createdAt.toIso8601String() + }; +} + +Future _$CommunityPostLikeFromSqlite( + Map data, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return CommunityPostLike( + id: data['id'] as String, + post: (await repository!.getAssociation( + Query.where('primaryKey', data['post_CommunityPost_brick_id'] as int, + limit1: true), + ))! + .first, + userProfile: data['user_profile_UserProfile_brick_id'] == null + ? null + : (data['user_profile_UserProfile_brick_id'] > -1 + ? (await repository.getAssociation( + Query.where('primaryKey', + data['user_profile_UserProfile_brick_id'] as int, + limit1: true), + )) + ?.first + : null), + createdAt: DateTime.parse(data['created_at'] as String)) + ..primaryKey = data['_brick_id'] as int; +} + +Future> _$CommunityPostLikeToSqlite( + CommunityPostLike instance, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'post_CommunityPost_brick_id': instance.post.primaryKey ?? + await provider.upsert(instance.post, + repository: repository), + 'user_profile_UserProfile_brick_id': instance.userProfile != null + ? instance.userProfile!.primaryKey ?? + await provider.upsert(instance.userProfile!, + repository: repository) + : null, + 'created_at': instance.createdAt.toIso8601String() + }; +} + +/// Construct a [CommunityPostLike] +class CommunityPostLikeAdapter + extends OfflineFirstWithSupabaseAdapter { + CommunityPostLikeAdapter(); + + @override + final supabaseTableName = 'community_post_likes'; + @override + final defaultToNull = true; + @override + final fieldsToSupabaseColumns = { + 'id': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'id', + ), + 'post': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'post', + associationType: CommunityPost, + associationIsNullable: false, + foreignKey: 'post_id', + ), + 'userProfile': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'user_profile', + associationType: UserProfile, + associationIsNullable: true, + foreignKey: 'user_profile_id', + ), + 'createdAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'created_at', + ) + }; + @override + final ignoreDuplicates = false; + @override + final uniqueFields = {'id'}; + @override + final Map fieldsToSqliteColumns = { + 'primaryKey': const RuntimeSqliteColumnDefinition( + association: false, + columnName: '_brick_id', + iterable: false, + type: int, + ), + 'id': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'id', + iterable: false, + type: String, + ), + 'post': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'post_CommunityPost_brick_id', + iterable: false, + type: CommunityPost, + ), + 'userProfile': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'user_profile_UserProfile_brick_id', + iterable: false, + type: UserProfile, + ), + 'createdAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'created_at', + iterable: false, + type: DateTime, + ) + }; + @override + Future primaryKeyByUniqueColumns( + CommunityPostLike instance, DatabaseExecutor executor) async => + instance.primaryKey; + @override + final String tableName = 'CommunityPostLike'; + + @override + Future fromSupabase(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CommunityPostLikeFromSupabase(input, + provider: provider, repository: repository); + @override + Future> toSupabase(CommunityPostLike input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CommunityPostLikeToSupabase(input, + provider: provider, repository: repository); + @override + Future fromSqlite(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CommunityPostLikeFromSqlite(input, + provider: provider, repository: repository); + @override + Future> toSqlite(CommunityPostLike input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$CommunityPostLikeToSqlite(input, + provider: provider, repository: repository); +} diff --git a/lib/brick/adapters/item_category_adapter.g.dart b/lib/brick/adapters/item_category_adapter.g.dart new file mode 100644 index 0000000..4c66fbd --- /dev/null +++ b/lib/brick/adapters/item_category_adapter.g.dart @@ -0,0 +1,105 @@ +// GENERATED CODE DO NOT EDIT +part of '../brick.g.dart'; + +Future _$ItemCategoryFromSupabase(Map data, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return ItemCategory(id: data['id'] as String?, name: data['name'] as String); +} + +Future> _$ItemCategoryToSupabase(ItemCategory instance, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return {'id': instance.id, 'name': instance.name}; +} + +Future _$ItemCategoryFromSqlite(Map data, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return ItemCategory(id: data['id'] as String, name: data['name'] as String) + ..primaryKey = data['_brick_id'] as int; +} + +Future> _$ItemCategoryToSqlite(ItemCategory instance, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return {'id': instance.id, 'name': instance.name}; +} + +/// Construct a [ItemCategory] +class ItemCategoryAdapter + extends OfflineFirstWithSupabaseAdapter { + ItemCategoryAdapter(); + + @override + final supabaseTableName = 'item_category'; + @override + final defaultToNull = true; + @override + final fieldsToSupabaseColumns = { + 'id': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'id', + ), + 'name': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'name', + ) + }; + @override + final ignoreDuplicates = false; + @override + final uniqueFields = {'id'}; + @override + final Map fieldsToSqliteColumns = { + 'primaryKey': const RuntimeSqliteColumnDefinition( + association: false, + columnName: '_brick_id', + iterable: false, + type: int, + ), + 'id': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'id', + iterable: false, + type: String, + ), + 'name': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'name', + iterable: false, + type: String, + ) + }; + @override + Future primaryKeyByUniqueColumns( + ItemCategory instance, DatabaseExecutor executor) async => + instance.primaryKey; + @override + final String tableName = 'ItemCategory'; + + @override + Future fromSupabase(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$ItemCategoryFromSupabase(input, + provider: provider, repository: repository); + @override + Future> toSupabase(ItemCategory input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$ItemCategoryToSupabase(input, + provider: provider, repository: repository); + @override + Future fromSqlite(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$ItemCategoryFromSqlite(input, + provider: provider, repository: repository); + @override + Future> toSqlite(ItemCategory input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$ItemCategoryToSqlite(input, + provider: provider, repository: repository); +} diff --git a/lib/brick/adapters/item_metadata_adapter.g.dart b/lib/brick/adapters/item_metadata_adapter.g.dart new file mode 100644 index 0000000..e6ca730 --- /dev/null +++ b/lib/brick/adapters/item_metadata_adapter.g.dart @@ -0,0 +1,287 @@ +// GENERATED CODE DO NOT EDIT +part of '../brick.g.dart'; + +Future _$ItemMetadataFromSupabase(Map data, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return ItemMetadata( + id: data['id'] as String?, + wardrobeItem: await WardrobeItemAdapter().fromSupabase( + data['wardrobe_item'], + provider: provider, + repository: repository), + boughtFor: + data['bought_for'] == null ? null : data['bought_for'] as double?, + currency: data['currency'] as String?, + purchaseDate: data['purchase_date'] == null + ? null + : data['purchase_date'] == null + ? null + : DateTime.tryParse(data['purchase_date'] as String), + condition: + data['condition'] == null ? null : data['condition'] as String?, + material: data['material'] == null ? null : data['material'] as String?, + size: data['size'] == null ? null : data['size'] as String?, + color: data['color'] == null ? null : data['color'] as String?, + notes: data['notes'] == null ? null : data['notes'] as String?, + createdAt: data['created_at'] == null + ? null + : DateTime.tryParse(data['created_at'] as String), + updatedAt: data['updated_at'] == null + ? null + : DateTime.tryParse(data['updated_at'] as String)); +} + +Future> _$ItemMetadataToSupabase(ItemMetadata instance, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'wardrobe_item': await WardrobeItemAdapter().toSupabase( + instance.wardrobeItem, + provider: provider, + repository: repository), + 'bought_for': instance.boughtFor, + 'currency': instance.currency, + 'purchase_date': instance.purchaseDate?.toIso8601String(), + 'condition': instance.condition, + 'material': instance.material, + 'size': instance.size, + 'color': instance.color, + 'notes': instance.notes, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String() + }; +} + +Future _$ItemMetadataFromSqlite(Map data, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return ItemMetadata( + id: data['id'] as String, + wardrobeItem: (await repository!.getAssociation( + Query.where( + 'primaryKey', data['wardrobe_item_WardrobeItem_brick_id'] as int, + limit1: true), + ))! + .first, + boughtFor: + data['bought_for'] == null ? null : data['bought_for'] as double?, + currency: data['currency'] as String, + purchaseDate: data['purchase_date'] == null + ? null + : data['purchase_date'] == null + ? null + : DateTime.tryParse(data['purchase_date'] as String), + condition: + data['condition'] == null ? null : data['condition'] as String?, + material: data['material'] == null ? null : data['material'] as String?, + size: data['size'] == null ? null : data['size'] as String?, + color: data['color'] == null ? null : data['color'] as String?, + notes: data['notes'] == null ? null : data['notes'] as String?, + createdAt: DateTime.parse(data['created_at'] as String), + updatedAt: DateTime.parse(data['updated_at'] as String)) + ..primaryKey = data['_brick_id'] as int; +} + +Future> _$ItemMetadataToSqlite(ItemMetadata instance, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'wardrobe_item_WardrobeItem_brick_id': instance.wardrobeItem.primaryKey ?? + await provider.upsert(instance.wardrobeItem, + repository: repository), + 'bought_for': instance.boughtFor, + 'currency': instance.currency, + 'purchase_date': instance.purchaseDate?.toIso8601String(), + 'condition': instance.condition, + 'material': instance.material, + 'size': instance.size, + 'color': instance.color, + 'notes': instance.notes, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String() + }; +} + +/// Construct a [ItemMetadata] +class ItemMetadataAdapter + extends OfflineFirstWithSupabaseAdapter { + ItemMetadataAdapter(); + + @override + final supabaseTableName = 'item_metadata'; + @override + final defaultToNull = true; + @override + final fieldsToSupabaseColumns = { + 'id': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'id', + ), + 'wardrobeItem': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'wardrobe_item', + associationType: WardrobeItem, + associationIsNullable: false, + foreignKey: 'wardrobe_item_id', + ), + 'boughtFor': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'bought_for', + ), + 'currency': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'currency', + ), + 'purchaseDate': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'purchase_date', + ), + 'condition': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'condition', + ), + 'material': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'material', + ), + 'size': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'size', + ), + 'color': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'color', + ), + 'notes': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'notes', + ), + 'createdAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'created_at', + ), + 'updatedAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'updated_at', + ) + }; + @override + final ignoreDuplicates = false; + @override + final uniqueFields = {'id'}; + @override + final Map fieldsToSqliteColumns = { + 'primaryKey': const RuntimeSqliteColumnDefinition( + association: false, + columnName: '_brick_id', + iterable: false, + type: int, + ), + 'id': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'id', + iterable: false, + type: String, + ), + 'wardrobeItem': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'wardrobe_item_WardrobeItem_brick_id', + iterable: false, + type: WardrobeItem, + ), + 'boughtFor': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'bought_for', + iterable: false, + type: double, + ), + 'currency': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'currency', + iterable: false, + type: String, + ), + 'purchaseDate': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'purchase_date', + iterable: false, + type: DateTime, + ), + 'condition': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'condition', + iterable: false, + type: String, + ), + 'material': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'material', + iterable: false, + type: String, + ), + 'size': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'size', + iterable: false, + type: String, + ), + 'color': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'color', + iterable: false, + type: String, + ), + 'notes': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'notes', + iterable: false, + type: String, + ), + 'createdAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'created_at', + iterable: false, + type: DateTime, + ), + 'updatedAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'updated_at', + iterable: false, + type: DateTime, + ) + }; + @override + Future primaryKeyByUniqueColumns( + ItemMetadata instance, DatabaseExecutor executor) async => + instance.primaryKey; + @override + final String tableName = 'ItemMetadata'; + + @override + Future fromSupabase(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$ItemMetadataFromSupabase(input, + provider: provider, repository: repository); + @override + Future> toSupabase(ItemMetadata input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$ItemMetadataToSupabase(input, + provider: provider, repository: repository); + @override + Future fromSqlite(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$ItemMetadataFromSqlite(input, + provider: provider, repository: repository); + @override + Future> toSqlite(ItemMetadata input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$ItemMetadataToSqlite(input, + provider: provider, repository: repository); +} diff --git a/lib/brick/adapters/lookbook_adapter.g.dart b/lib/brick/adapters/lookbook_adapter.g.dart new file mode 100644 index 0000000..60d7ef4 --- /dev/null +++ b/lib/brick/adapters/lookbook_adapter.g.dart @@ -0,0 +1,246 @@ +// GENERATED CODE DO NOT EDIT +part of '../brick.g.dart'; + +Future _$LookbookFromSupabase(Map data, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return Lookbook( + id: data['id'] as String?, + userProfile: data['user_profile'] == null + ? null + : await UserProfileAdapter().fromSupabase(data['user_profile'], + provider: provider, repository: repository), + title: data['title'] as String, + description: + data['description'] == null ? null : data['description'] as String?, + coverImageUrl: data['cover_image_url'] == null + ? null + : data['cover_image_url'] as String?, + tags: data['tags'] == null ? null : data['tags']?.toList().cast(), + isPublic: data['is_public'] as bool?, + createdAt: data['created_at'] == null + ? null + : DateTime.tryParse(data['created_at'] as String), + updatedAt: data['updated_at'] == null + ? null + : DateTime.tryParse(data['updated_at'] as String)); +} + +Future> _$LookbookToSupabase(Lookbook instance, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'user_profile': instance.userProfile != null + ? await UserProfileAdapter().toSupabase(instance.userProfile!, + provider: provider, repository: repository) + : null, + 'title': instance.title, + 'description': instance.description, + 'cover_image_url': instance.coverImageUrl, + 'tags': instance.tags, + 'is_public': instance.isPublic, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String() + }; +} + +Future _$LookbookFromSqlite(Map data, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return Lookbook( + id: data['id'] as String, + userProfile: data['user_profile_UserProfile_brick_id'] == null + ? null + : (data['user_profile_UserProfile_brick_id'] > -1 + ? (await repository?.getAssociation( + Query.where('primaryKey', + data['user_profile_UserProfile_brick_id'] as int, + limit1: true), + )) + ?.first + : null), + title: data['title'] as String, + description: + data['description'] == null ? null : data['description'] as String?, + coverImageUrl: data['cover_image_url'] == null + ? null + : data['cover_image_url'] as String?, + tags: data['tags'] == null + ? null + : jsonDecode(data['tags']).toList().cast(), + isPublic: data['is_public'] == 1, + createdAt: DateTime.parse(data['created_at'] as String), + updatedAt: DateTime.parse(data['updated_at'] as String)) + ..primaryKey = data['_brick_id'] as int; +} + +Future> _$LookbookToSqlite(Lookbook instance, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'user_profile_UserProfile_brick_id': instance.userProfile != null + ? instance.userProfile!.primaryKey ?? + await provider.upsert(instance.userProfile!, + repository: repository) + : null, + 'title': instance.title, + 'description': instance.description, + 'cover_image_url': instance.coverImageUrl, + 'tags': instance.tags == null ? null : jsonEncode(instance.tags), + 'is_public': instance.isPublic ? 1 : 0, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String() + }; +} + +/// Construct a [Lookbook] +class LookbookAdapter extends OfflineFirstWithSupabaseAdapter { + LookbookAdapter(); + + @override + final supabaseTableName = 'lookbooks'; + @override + final defaultToNull = true; + @override + final fieldsToSupabaseColumns = { + 'id': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'id', + ), + 'userProfile': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'user_profile', + associationType: UserProfile, + associationIsNullable: true, + foreignKey: 'user_profile_id', + ), + 'title': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'title', + ), + 'description': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'description', + ), + 'coverImageUrl': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'cover_image_url', + ), + 'tags': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'tags', + ), + 'isPublic': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'is_public', + ), + 'createdAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'created_at', + ), + 'updatedAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'updated_at', + ) + }; + @override + final ignoreDuplicates = false; + @override + final uniqueFields = {'id'}; + @override + final Map fieldsToSqliteColumns = { + 'primaryKey': const RuntimeSqliteColumnDefinition( + association: false, + columnName: '_brick_id', + iterable: false, + type: int, + ), + 'id': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'id', + iterable: false, + type: String, + ), + 'userProfile': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'user_profile_UserProfile_brick_id', + iterable: false, + type: UserProfile, + ), + 'title': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'title', + iterable: false, + type: String, + ), + 'description': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'description', + iterable: false, + type: String, + ), + 'coverImageUrl': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'cover_image_url', + iterable: false, + type: String, + ), + 'tags': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'tags', + iterable: true, + type: String, + ), + 'isPublic': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'is_public', + iterable: false, + type: bool, + ), + 'createdAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'created_at', + iterable: false, + type: DateTime, + ), + 'updatedAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'updated_at', + iterable: false, + type: DateTime, + ) + }; + @override + Future primaryKeyByUniqueColumns( + Lookbook instance, DatabaseExecutor executor) async => + instance.primaryKey; + @override + final String tableName = 'Lookbook'; + + @override + Future fromSupabase(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$LookbookFromSupabase(input, + provider: provider, repository: repository); + @override + Future> toSupabase(Lookbook input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$LookbookToSupabase(input, + provider: provider, repository: repository); + @override + Future fromSqlite(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$LookbookFromSqlite(input, + provider: provider, repository: repository); + @override + Future> toSqlite(Lookbook input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$LookbookToSqlite(input, + provider: provider, repository: repository); +} diff --git a/lib/brick/adapters/lookbook_item_adapter.g.dart b/lib/brick/adapters/lookbook_item_adapter.g.dart new file mode 100644 index 0000000..d8c726b --- /dev/null +++ b/lib/brick/adapters/lookbook_item_adapter.g.dart @@ -0,0 +1,170 @@ +// GENERATED CODE DO NOT EDIT +part of '../brick.g.dart'; + +Future _$LookbookItemFromSupabase(Map data, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return LookbookItem( + id: data['id'] as String?, + lookbook: await LookbookAdapter().fromSupabase(data['lookbook'], + provider: provider, repository: repository), + itemId: data['item_id'] as String, + itemType: data['item_type'] as String, + createdAt: data['created_at'] == null + ? null + : DateTime.tryParse(data['created_at'] as String)); +} + +Future> _$LookbookItemToSupabase(LookbookItem instance, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'lookbook': await LookbookAdapter().toSupabase(instance.lookbook, + provider: provider, repository: repository), + 'item_id': instance.itemId, + 'item_type': instance.itemType, + 'created_at': instance.createdAt.toIso8601String() + }; +} + +Future _$LookbookItemFromSqlite(Map data, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return LookbookItem( + id: data['id'] as String, + lookbook: (await repository!.getAssociation( + Query.where('primaryKey', data['lookbook_Lookbook_brick_id'] as int, + limit1: true), + ))! + .first, + itemId: data['item_id'] as String, + itemType: data['item_type'] as String, + createdAt: DateTime.parse(data['created_at'] as String)) + ..primaryKey = data['_brick_id'] as int; +} + +Future> _$LookbookItemToSqlite(LookbookItem instance, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'lookbook_Lookbook_brick_id': instance.lookbook.primaryKey ?? + await provider.upsert(instance.lookbook, + repository: repository), + 'item_id': instance.itemId, + 'item_type': instance.itemType, + 'created_at': instance.createdAt.toIso8601String() + }; +} + +/// Construct a [LookbookItem] +class LookbookItemAdapter + extends OfflineFirstWithSupabaseAdapter { + LookbookItemAdapter(); + + @override + final supabaseTableName = 'lookbook_items'; + @override + final defaultToNull = true; + @override + final fieldsToSupabaseColumns = { + 'id': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'id', + ), + 'lookbook': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'lookbook', + associationType: Lookbook, + associationIsNullable: false, + foreignKey: 'lookbook_id', + ), + 'itemId': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'item_id', + ), + 'itemType': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'item_type', + ), + 'createdAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'created_at', + ) + }; + @override + final ignoreDuplicates = false; + @override + final uniqueFields = {'id'}; + @override + final Map fieldsToSqliteColumns = { + 'primaryKey': const RuntimeSqliteColumnDefinition( + association: false, + columnName: '_brick_id', + iterable: false, + type: int, + ), + 'id': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'id', + iterable: false, + type: String, + ), + 'lookbook': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'lookbook_Lookbook_brick_id', + iterable: false, + type: Lookbook, + ), + 'itemId': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'item_id', + iterable: false, + type: String, + ), + 'itemType': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'item_type', + iterable: false, + type: String, + ), + 'createdAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'created_at', + iterable: false, + type: DateTime, + ) + }; + @override + Future primaryKeyByUniqueColumns( + LookbookItem instance, DatabaseExecutor executor) async => + instance.primaryKey; + @override + final String tableName = 'LookbookItem'; + + @override + Future fromSupabase(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$LookbookItemFromSupabase(input, + provider: provider, repository: repository); + @override + Future> toSupabase(LookbookItem input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$LookbookItemToSupabase(input, + provider: provider, repository: repository); + @override + Future fromSqlite(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$LookbookItemFromSqlite(input, + provider: provider, repository: repository); + @override + Future> toSqlite(LookbookItem input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$LookbookItemToSqlite(input, + provider: provider, repository: repository); +} diff --git a/lib/brick/adapters/outfit_adapter.g.dart b/lib/brick/adapters/outfit_adapter.g.dart new file mode 100644 index 0000000..08ce6cf --- /dev/null +++ b/lib/brick/adapters/outfit_adapter.g.dart @@ -0,0 +1,276 @@ +// GENERATED CODE DO NOT EDIT +part of '../brick.g.dart'; + +Future _$OutfitFromSupabase(Map data, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return Outfit( + id: data['id'] as String?, + userProfile: data['user_profile'] == null + ? null + : await UserProfileAdapter().fromSupabase(data['user_profile'], + provider: provider, repository: repository), + name: data['name'] as String, + createdAt: data['created_at'] == null + ? null + : DateTime.tryParse(data['created_at'] as String), + updatedAt: data['updated_at'] == null + ? null + : DateTime.tryParse(data['updated_at'] as String), + deletedAt: data['deleted_at'] == null + ? null + : data['deleted_at'] == null + ? null + : DateTime.tryParse(data['deleted_at'] as String), + outfitItems: await Future.wait(data['outfit_items'] + ?.map((d) => OutfitItemAdapter() + .fromSupabase(d, provider: provider, repository: repository)) + .toList() + .cast>() ?? + [])); +} + +Future> _$OutfitToSupabase(Outfit instance, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'user_profile': instance.userProfile != null + ? await UserProfileAdapter().toSupabase(instance.userProfile!, + provider: provider, repository: repository) + : null, + 'name': instance.name, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), + 'deleted_at': instance.deletedAt?.toIso8601String(), + 'outfit_items': await Future.wait>(instance.outfitItems + .map((s) => OutfitItemAdapter() + .toSupabase(s, provider: provider, repository: repository)) + .toList()) + }; +} + +Future _$OutfitFromSqlite(Map data, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return Outfit( + id: data['id'] as String, + userProfile: data['user_profile_UserProfile_brick_id'] == null + ? null + : (data['user_profile_UserProfile_brick_id'] > -1 + ? (await repository?.getAssociation( + Query.where('primaryKey', + data['user_profile_UserProfile_brick_id'] as int, + limit1: true), + )) + ?.first + : null), + name: data['name'] as String, + createdAt: DateTime.parse(data['created_at'] as String), + updatedAt: DateTime.parse(data['updated_at'] as String), + deletedAt: data['deleted_at'] == null + ? null + : data['deleted_at'] == null + ? null + : DateTime.tryParse(data['deleted_at'] as String), + outfitItems: (await provider.rawQuery( + 'SELECT DISTINCT `f_OutfitItem_brick_id` FROM `_brick_Outfit_outfit_items` WHERE l_Outfit_brick_id = ?', + [data['_brick_id'] as int]).then((results) { + final ids = results.map((r) => r['f_OutfitItem_brick_id']); + return Future.wait(ids.map((primaryKey) => repository! + .getAssociation( + Query.where('primaryKey', primaryKey, limit1: true), + ) + .then((r) => r!.first))); + })) + .toList() + .cast()) + ..primaryKey = data['_brick_id'] as int; +} + +Future> _$OutfitToSqlite(Outfit instance, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'user_profile_UserProfile_brick_id': instance.userProfile != null + ? instance.userProfile!.primaryKey ?? + await provider.upsert(instance.userProfile!, + repository: repository) + : null, + 'name': instance.name, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), + 'deleted_at': instance.deletedAt?.toIso8601String() + }; +} + +/// Construct a [Outfit] +class OutfitAdapter extends OfflineFirstWithSupabaseAdapter { + OutfitAdapter(); + + @override + final supabaseTableName = 'outfit'; + @override + final defaultToNull = true; + @override + final fieldsToSupabaseColumns = { + 'id': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'id', + ), + 'userProfile': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'user_profile', + associationType: UserProfile, + associationIsNullable: true, + foreignKey: 'user_profile_id', + ), + 'name': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'name', + ), + 'createdAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'created_at', + ), + 'updatedAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'updated_at', + ), + 'deletedAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'deleted_at', + ), + 'outfitItems': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'outfit_items', + associationType: OutfitItem, + associationIsNullable: false, + foreignKey: 'outfit_id', + ) + }; + @override + final ignoreDuplicates = false; + @override + final uniqueFields = {'id'}; + @override + final Map fieldsToSqliteColumns = { + 'primaryKey': const RuntimeSqliteColumnDefinition( + association: false, + columnName: '_brick_id', + iterable: false, + type: int, + ), + 'id': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'id', + iterable: false, + type: String, + ), + 'userProfile': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'user_profile_UserProfile_brick_id', + iterable: false, + type: UserProfile, + ), + 'name': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'name', + iterable: false, + type: String, + ), + 'createdAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'created_at', + iterable: false, + type: DateTime, + ), + 'updatedAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'updated_at', + iterable: false, + type: DateTime, + ), + 'deletedAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'deleted_at', + iterable: false, + type: DateTime, + ), + 'outfitItems': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'outfit_items', + iterable: true, + type: OutfitItem, + ) + }; + @override + Future primaryKeyByUniqueColumns( + Outfit instance, DatabaseExecutor executor) async { + final results = await executor.rawQuery(''' + SELECT * FROM `Outfit` WHERE id = ? LIMIT 1''', [instance.id]); + + // SQFlite returns [{}] when no results are found + if (results.isEmpty || (results.length == 1 && results.first.isEmpty)) { + return null; + } + + return results.first['_brick_id'] as int; + } + + @override + final String tableName = 'Outfit'; + @override + Future afterSave(instance, {required provider, repository}) async { + if (instance.primaryKey != null) { + final outfitItemsOldColumns = await provider.rawQuery( + 'SELECT `f_OutfitItem_brick_id` FROM `_brick_Outfit_outfit_items` WHERE `l_Outfit_brick_id` = ?', + [instance.primaryKey]); + final outfitItemsOldIds = + outfitItemsOldColumns.map((a) => a['f_OutfitItem_brick_id']); + final outfitItemsNewIds = + instance.outfitItems.map((s) => s.primaryKey).whereType(); + final outfitItemsIdsToDelete = + outfitItemsOldIds.where((id) => !outfitItemsNewIds.contains(id)); + + await Future.wait(outfitItemsIdsToDelete.map((id) async { + return await provider.rawExecute( + 'DELETE FROM `_brick_Outfit_outfit_items` WHERE `l_Outfit_brick_id` = ? AND `f_OutfitItem_brick_id` = ?', + [instance.primaryKey, id]).catchError((e) => null); + })); + + await Future.wait(instance.outfitItems.map((s) async { + final id = s.primaryKey ?? + await provider.upsert(s, repository: repository); + return await provider.rawInsert( + 'INSERT OR IGNORE INTO `_brick_Outfit_outfit_items` (`l_Outfit_brick_id`, `f_OutfitItem_brick_id`) VALUES (?, ?)', + [instance.primaryKey, id]); + })); + } + } + + @override + Future fromSupabase(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$OutfitFromSupabase(input, + provider: provider, repository: repository); + @override + Future> toSupabase(Outfit input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$OutfitToSupabase(input, + provider: provider, repository: repository); + @override + Future fromSqlite(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$OutfitFromSqlite(input, + provider: provider, repository: repository); + @override + Future> toSqlite(Outfit input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$OutfitToSqlite(input, provider: provider, repository: repository); +} diff --git a/lib/brick/adapters/outfit_item_adapter.g.dart b/lib/brick/adapters/outfit_item_adapter.g.dart new file mode 100644 index 0000000..11de51e --- /dev/null +++ b/lib/brick/adapters/outfit_item_adapter.g.dart @@ -0,0 +1,154 @@ +// GENERATED CODE DO NOT EDIT +part of '../brick.g.dart'; + +Future _$OutfitItemFromSupabase(Map data, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return OutfitItem( + id: data['id'] as String?, + outfit: await OutfitAdapter().fromSupabase(data['outfit'], + provider: provider, repository: repository), + wardrobeItem: await WardrobeItemAdapter().fromSupabase( + data['wardrobe_item'], + provider: provider, + repository: repository)); +} + +Future> _$OutfitItemToSupabase(OutfitItem instance, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'outfit': await OutfitAdapter().toSupabase(instance.outfit, + provider: provider, repository: repository), + 'wardrobe_item': await WardrobeItemAdapter().toSupabase( + instance.wardrobeItem, + provider: provider, + repository: repository) + }; +} + +Future _$OutfitItemFromSqlite(Map data, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return OutfitItem( + id: data['id'] as String, + outfit: (await repository!.getAssociation( + Query.where('primaryKey', data['outfit_Outfit_brick_id'] as int, + limit1: true), + ))! + .first, + wardrobeItem: (await repository.getAssociation( + Query.where( + 'primaryKey', data['wardrobe_item_WardrobeItem_brick_id'] as int, + limit1: true), + ))! + .first) + ..primaryKey = data['_brick_id'] as int; +} + +Future> _$OutfitItemToSqlite(OutfitItem instance, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'outfit_Outfit_brick_id': instance.outfit.primaryKey ?? + await provider.upsert(instance.outfit, repository: repository), + 'wardrobe_item_WardrobeItem_brick_id': instance.wardrobeItem.primaryKey ?? + await provider.upsert(instance.wardrobeItem, + repository: repository) + }; +} + +/// Construct a [OutfitItem] +class OutfitItemAdapter extends OfflineFirstWithSupabaseAdapter { + OutfitItemAdapter(); + + @override + final supabaseTableName = 'outfit_items'; + @override + final defaultToNull = true; + @override + final fieldsToSupabaseColumns = { + 'id': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'id', + ), + 'outfit': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'outfit', + associationType: Outfit, + associationIsNullable: false, + foreignKey: 'outfit_id', + ), + 'wardrobeItem': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'wardrobe_item', + associationType: WardrobeItem, + associationIsNullable: false, + foreignKey: 'wardrobe_item_id', + ) + }; + @override + final ignoreDuplicates = false; + @override + final uniqueFields = {'id'}; + @override + final Map fieldsToSqliteColumns = { + 'primaryKey': const RuntimeSqliteColumnDefinition( + association: false, + columnName: '_brick_id', + iterable: false, + type: int, + ), + 'id': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'id', + iterable: false, + type: String, + ), + 'outfit': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'outfit_Outfit_brick_id', + iterable: false, + type: Outfit, + ), + 'wardrobeItem': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'wardrobe_item_WardrobeItem_brick_id', + iterable: false, + type: WardrobeItem, + ) + }; + @override + Future primaryKeyByUniqueColumns( + OutfitItem instance, DatabaseExecutor executor) async => + instance.primaryKey; + @override + final String tableName = 'OutfitItem'; + + @override + Future fromSupabase(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$OutfitItemFromSupabase(input, + provider: provider, repository: repository); + @override + Future> toSupabase(OutfitItem input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$OutfitItemToSupabase(input, + provider: provider, repository: repository); + @override + Future fromSqlite(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$OutfitItemFromSqlite(input, + provider: provider, repository: repository); + @override + Future> toSqlite(OutfitItem input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$OutfitItemToSqlite(input, + provider: provider, repository: repository); +} diff --git a/lib/brick/adapters/use_item_adapter.g.dart b/lib/brick/adapters/use_item_adapter.g.dart new file mode 100644 index 0000000..76c8012 --- /dev/null +++ b/lib/brick/adapters/use_item_adapter.g.dart @@ -0,0 +1,182 @@ +// GENERATED CODE DO NOT EDIT +part of '../brick.g.dart'; + +Future _$UseItemFromSupabase(Map data, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return UseItem( + id: data['id'] as String?, + wardrobeItem: await WardrobeItemAdapter().fromSupabase( + data['wardrobe_item'], + provider: provider, + repository: repository), + usedAt: data['used_at'] == null + ? null + : DateTime.tryParse(data['used_at'] as String), + userProfile: data['user_profile'] == null + ? null + : await UserProfileAdapter().fromSupabase(data['user_profile'], + provider: provider, repository: repository)); +} + +Future> _$UseItemToSupabase(UseItem instance, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'wardrobe_item': await WardrobeItemAdapter().toSupabase( + instance.wardrobeItem, + provider: provider, + repository: repository), + 'used_at': instance.usedAt.toIso8601String(), + 'user_profile': instance.userProfile != null + ? await UserProfileAdapter().toSupabase(instance.userProfile!, + provider: provider, repository: repository) + : null + }; +} + +Future _$UseItemFromSqlite(Map data, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return UseItem( + id: data['id'] as String, + wardrobeItem: (await repository!.getAssociation( + Query.where( + 'primaryKey', data['wardrobe_item_WardrobeItem_brick_id'] as int, + limit1: true), + ))! + .first, + usedAt: DateTime.parse(data['used_at'] as String), + userProfile: data['user_profile_UserProfile_brick_id'] == null + ? null + : (data['user_profile_UserProfile_brick_id'] > -1 + ? (await repository.getAssociation( + Query.where('primaryKey', + data['user_profile_UserProfile_brick_id'] as int, + limit1: true), + )) + ?.first + : null)) + ..primaryKey = data['_brick_id'] as int; +} + +Future> _$UseItemToSqlite(UseItem instance, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'wardrobe_item_WardrobeItem_brick_id': instance.wardrobeItem.primaryKey ?? + await provider.upsert(instance.wardrobeItem, + repository: repository), + 'used_at': instance.usedAt.toIso8601String(), + 'user_profile_UserProfile_brick_id': instance.userProfile != null + ? instance.userProfile!.primaryKey ?? + await provider.upsert(instance.userProfile!, + repository: repository) + : null + }; +} + +/// Construct a [UseItem] +class UseItemAdapter extends OfflineFirstWithSupabaseAdapter { + UseItemAdapter(); + + @override + final supabaseTableName = 'use_item'; + @override + final defaultToNull = true; + @override + final fieldsToSupabaseColumns = { + 'id': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'id', + ), + 'wardrobeItem': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'wardrobe_item', + associationType: WardrobeItem, + associationIsNullable: false, + foreignKey: 'wardrobe_item_id', + ), + 'usedAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'used_at', + ), + 'userProfile': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'user_profile', + associationType: UserProfile, + associationIsNullable: true, + foreignKey: 'user_profile_id', + ) + }; + @override + final ignoreDuplicates = false; + @override + final uniqueFields = {'id'}; + @override + final Map fieldsToSqliteColumns = { + 'primaryKey': const RuntimeSqliteColumnDefinition( + association: false, + columnName: '_brick_id', + iterable: false, + type: int, + ), + 'id': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'id', + iterable: false, + type: String, + ), + 'wardrobeItem': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'wardrobe_item_WardrobeItem_brick_id', + iterable: false, + type: WardrobeItem, + ), + 'usedAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'used_at', + iterable: false, + type: DateTime, + ), + 'userProfile': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'user_profile_UserProfile_brick_id', + iterable: false, + type: UserProfile, + ) + }; + @override + Future primaryKeyByUniqueColumns( + UseItem instance, DatabaseExecutor executor) async => + instance.primaryKey; + @override + final String tableName = 'UseItem'; + + @override + Future fromSupabase(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$UseItemFromSupabase(input, + provider: provider, repository: repository); + @override + Future> toSupabase(UseItem input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$UseItemToSupabase(input, + provider: provider, repository: repository); + @override + Future fromSqlite(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$UseItemFromSqlite(input, + provider: provider, repository: repository); + @override + Future> toSqlite(UseItem input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$UseItemToSqlite(input, + provider: provider, repository: repository); +} diff --git a/lib/brick/adapters/use_outfit_adapter.g.dart b/lib/brick/adapters/use_outfit_adapter.g.dart new file mode 100644 index 0000000..5f4f9ec --- /dev/null +++ b/lib/brick/adapters/use_outfit_adapter.g.dart @@ -0,0 +1,176 @@ +// GENERATED CODE DO NOT EDIT +part of '../brick.g.dart'; + +Future _$UseOutfitFromSupabase(Map data, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return UseOutfit( + id: data['id'] as String?, + outfit: await OutfitAdapter().fromSupabase(data['outfit'], + provider: provider, repository: repository), + usedAt: data['used_at'] == null + ? null + : DateTime.tryParse(data['used_at'] as String), + userProfile: data['user_profile'] == null + ? null + : await UserProfileAdapter().fromSupabase(data['user_profile'], + provider: provider, repository: repository)); +} + +Future> _$UseOutfitToSupabase(UseOutfit instance, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'outfit': await OutfitAdapter().toSupabase(instance.outfit, + provider: provider, repository: repository), + 'used_at': instance.usedAt.toIso8601String(), + 'user_profile': instance.userProfile != null + ? await UserProfileAdapter().toSupabase(instance.userProfile!, + provider: provider, repository: repository) + : null + }; +} + +Future _$UseOutfitFromSqlite(Map data, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return UseOutfit( + id: data['id'] as String, + outfit: (await repository!.getAssociation( + Query.where('primaryKey', data['outfit_Outfit_brick_id'] as int, + limit1: true), + ))! + .first, + usedAt: DateTime.parse(data['used_at'] as String), + userProfile: data['user_profile_UserProfile_brick_id'] == null + ? null + : (data['user_profile_UserProfile_brick_id'] > -1 + ? (await repository.getAssociation( + Query.where('primaryKey', + data['user_profile_UserProfile_brick_id'] as int, + limit1: true), + )) + ?.first + : null)) + ..primaryKey = data['_brick_id'] as int; +} + +Future> _$UseOutfitToSqlite(UseOutfit instance, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'outfit_Outfit_brick_id': instance.outfit.primaryKey ?? + await provider.upsert(instance.outfit, repository: repository), + 'used_at': instance.usedAt.toIso8601String(), + 'user_profile_UserProfile_brick_id': instance.userProfile != null + ? instance.userProfile!.primaryKey ?? + await provider.upsert(instance.userProfile!, + repository: repository) + : null + }; +} + +/// Construct a [UseOutfit] +class UseOutfitAdapter extends OfflineFirstWithSupabaseAdapter { + UseOutfitAdapter(); + + @override + final supabaseTableName = 'use_outfit'; + @override + final defaultToNull = true; + @override + final fieldsToSupabaseColumns = { + 'id': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'id', + ), + 'outfit': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'outfit', + associationType: Outfit, + associationIsNullable: false, + foreignKey: 'outfit_id', + ), + 'usedAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'used_at', + ), + 'userProfile': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'user_profile', + associationType: UserProfile, + associationIsNullable: true, + foreignKey: 'user_profile_id', + ) + }; + @override + final ignoreDuplicates = false; + @override + final uniqueFields = {'id'}; + @override + final Map fieldsToSqliteColumns = { + 'primaryKey': const RuntimeSqliteColumnDefinition( + association: false, + columnName: '_brick_id', + iterable: false, + type: int, + ), + 'id': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'id', + iterable: false, + type: String, + ), + 'outfit': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'outfit_Outfit_brick_id', + iterable: false, + type: Outfit, + ), + 'usedAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'used_at', + iterable: false, + type: DateTime, + ), + 'userProfile': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'user_profile_UserProfile_brick_id', + iterable: false, + type: UserProfile, + ) + }; + @override + Future primaryKeyByUniqueColumns( + UseOutfit instance, DatabaseExecutor executor) async => + instance.primaryKey; + @override + final String tableName = 'UseOutfit'; + + @override + Future fromSupabase(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$UseOutfitFromSupabase(input, + provider: provider, repository: repository); + @override + Future> toSupabase(UseOutfit input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$UseOutfitToSupabase(input, + provider: provider, repository: repository); + @override + Future fromSqlite(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$UseOutfitFromSqlite(input, + provider: provider, repository: repository); + @override + Future> toSqlite(UseOutfit input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$UseOutfitToSqlite(input, + provider: provider, repository: repository); +} diff --git a/lib/brick/adapters/user_profile_adapter.g.dart b/lib/brick/adapters/user_profile_adapter.g.dart new file mode 100644 index 0000000..80b4d26 --- /dev/null +++ b/lib/brick/adapters/user_profile_adapter.g.dart @@ -0,0 +1,223 @@ +// GENERATED CODE DO NOT EDIT +part of '../brick.g.dart'; + +Future _$UserProfileFromSupabase(Map data, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return UserProfile( + id: data['id'] as String, + username: data['username'] as String, + displayName: + data['display_name'] == null ? null : data['display_name'] as String?, + bio: data['bio'] == null ? null : data['bio'] as String?, + avatarUrl: + data['avatar_url'] == null ? null : data['avatar_url'] as String?, + socialLinks: data['social_links'] == null ? null : data['social_links'], + isPublic: data['is_public'] as bool?, + createdAt: data['created_at'] == null + ? null + : DateTime.tryParse(data['created_at'] as String), + updatedAt: data['updated_at'] == null + ? null + : DateTime.tryParse(data['updated_at'] as String)); +} + +Future> _$UserProfileToSupabase(UserProfile instance, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'username': instance.username, + 'display_name': instance.displayName, + 'bio': instance.bio, + 'avatar_url': instance.avatarUrl, + 'social_links': instance.socialLinks, + 'is_public': instance.isPublic, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String() + }; +} + +Future _$UserProfileFromSqlite(Map data, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return UserProfile( + id: data['id'] as String, + username: data['username'] as String, + displayName: + data['display_name'] == null ? null : data['display_name'] as String?, + bio: data['bio'] == null ? null : data['bio'] as String?, + avatarUrl: + data['avatar_url'] == null ? null : data['avatar_url'] as String?, + socialLinks: data['social_links'] == null + ? null + : jsonDecode(data['social_links']), + isPublic: data['is_public'] == 1, + createdAt: DateTime.parse(data['created_at'] as String), + updatedAt: DateTime.parse(data['updated_at'] as String)) + ..primaryKey = data['_brick_id'] as int; +} + +Future> _$UserProfileToSqlite(UserProfile instance, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'username': instance.username, + 'display_name': instance.displayName, + 'bio': instance.bio, + 'avatar_url': instance.avatarUrl, + 'social_links': + instance.socialLinks != null ? jsonEncode(instance.socialLinks) : null, + 'is_public': instance.isPublic ? 1 : 0, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String() + }; +} + +/// Construct a [UserProfile] +class UserProfileAdapter extends OfflineFirstWithSupabaseAdapter { + UserProfileAdapter(); + + @override + final supabaseTableName = 'user_profiles'; + @override + final defaultToNull = true; + @override + final fieldsToSupabaseColumns = { + 'id': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'id', + ), + 'username': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'username', + ), + 'displayName': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'display_name', + ), + 'bio': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'bio', + ), + 'avatarUrl': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'avatar_url', + ), + 'socialLinks': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'social_links', + ), + 'isPublic': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'is_public', + ), + 'createdAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'created_at', + ), + 'updatedAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'updated_at', + ) + }; + @override + final ignoreDuplicates = false; + @override + final uniqueFields = {'id'}; + @override + final Map fieldsToSqliteColumns = { + 'primaryKey': const RuntimeSqliteColumnDefinition( + association: false, + columnName: '_brick_id', + iterable: false, + type: int, + ), + 'id': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'id', + iterable: false, + type: String, + ), + 'username': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'username', + iterable: false, + type: String, + ), + 'displayName': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'display_name', + iterable: false, + type: String, + ), + 'bio': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'bio', + iterable: false, + type: String, + ), + 'avatarUrl': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'avatar_url', + iterable: false, + type: String, + ), + 'socialLinks': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'social_links', + iterable: false, + type: Map, + ), + 'isPublic': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'is_public', + iterable: false, + type: bool, + ), + 'createdAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'created_at', + iterable: false, + type: DateTime, + ), + 'updatedAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'updated_at', + iterable: false, + type: DateTime, + ) + }; + @override + Future primaryKeyByUniqueColumns( + UserProfile instance, DatabaseExecutor executor) async => + instance.primaryKey; + @override + final String tableName = 'UserProfile'; + + @override + Future fromSupabase(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$UserProfileFromSupabase(input, + provider: provider, repository: repository); + @override + Future> toSupabase(UserProfile input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$UserProfileToSupabase(input, + provider: provider, repository: repository); + @override + Future fromSqlite(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$UserProfileFromSqlite(input, + provider: provider, repository: repository); + @override + Future> toSqlite(UserProfile input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$UserProfileToSqlite(input, + provider: provider, repository: repository); +} diff --git a/lib/brick/adapters/wardrobe_item_adapter.g.dart b/lib/brick/adapters/wardrobe_item_adapter.g.dart new file mode 100644 index 0000000..ba78e38 --- /dev/null +++ b/lib/brick/adapters/wardrobe_item_adapter.g.dart @@ -0,0 +1,266 @@ +// GENERATED CODE DO NOT EDIT +part of '../brick.g.dart'; + +Future _$WardrobeItemFromSupabase(Map data, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return WardrobeItem( + id: data['id'] as String?, + userProfile: await UserProfileAdapter().fromSupabase(data['user_profile'], + provider: provider, repository: repository), + brand: data['brand'] == null + ? null + : await BrandAdapter().fromSupabase(data['brand'], + provider: provider, repository: repository), + itemCategory: data['item_category'] == null + ? null + : await ItemCategoryAdapter().fromSupabase(data['item_category'], + provider: provider, repository: repository), + createdAt: data['created_at'] == null + ? null + : DateTime.tryParse(data['created_at'] as String), + updatedAt: data['updated_at'] == null + ? null + : DateTime.tryParse(data['updated_at'] as String), + deletedAt: data['deleted_at'] == null + ? null + : data['deleted_at'] == null + ? null + : DateTime.tryParse(data['deleted_at'] as String), + imagePath: data['image_path'] as String); +} + +Future> _$WardrobeItemToSupabase(WardrobeItem instance, + {required SupabaseProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'user_profile': await UserProfileAdapter().toSupabase(instance.userProfile, + provider: provider, repository: repository), + 'brand': instance.brand != null + ? await BrandAdapter().toSupabase(instance.brand!, + provider: provider, repository: repository) + : null, + 'item_category': instance.itemCategory != null + ? await ItemCategoryAdapter().toSupabase(instance.itemCategory!, + provider: provider, repository: repository) + : null, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), + 'deleted_at': instance.deletedAt?.toIso8601String(), + 'image_path': instance.imagePath + }; +} + +Future _$WardrobeItemFromSqlite(Map data, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return WardrobeItem( + id: data['id'] as String, + userProfile: (await repository!.getAssociation( + Query.where( + 'primaryKey', data['user_profile_UserProfile_brick_id'] as int, + limit1: true), + ))! + .first, + brand: data['brand_Brand_brick_id'] == null + ? null + : (data['brand_Brand_brick_id'] > -1 + ? (await repository.getAssociation( + Query.where('primaryKey', data['brand_Brand_brick_id'] as int, + limit1: true), + )) + ?.first + : null), + itemCategory: data['item_category_ItemCategory_brick_id'] == null + ? null + : (data['item_category_ItemCategory_brick_id'] > -1 + ? (await repository.getAssociation( + Query.where('primaryKey', + data['item_category_ItemCategory_brick_id'] as int, + limit1: true), + )) + ?.first + : null), + createdAt: DateTime.parse(data['created_at'] as String), + updatedAt: DateTime.parse(data['updated_at'] as String), + deletedAt: data['deleted_at'] == null + ? null + : data['deleted_at'] == null + ? null + : DateTime.tryParse(data['deleted_at'] as String), + imagePath: data['image_path'] as String) + ..primaryKey = data['_brick_id'] as int; +} + +Future> _$WardrobeItemToSqlite(WardrobeItem instance, + {required SqliteProvider provider, + OfflineFirstWithSupabaseRepository? repository}) async { + return { + 'id': instance.id, + 'user_profile_UserProfile_brick_id': instance.userProfile.primaryKey ?? + await provider.upsert(instance.userProfile, + repository: repository), + 'brand_Brand_brick_id': instance.brand != null + ? instance.brand!.primaryKey ?? + await provider.upsert(instance.brand!, + repository: repository) + : null, + 'item_category_ItemCategory_brick_id': instance.itemCategory != null + ? instance.itemCategory!.primaryKey ?? + await provider.upsert(instance.itemCategory!, + repository: repository) + : null, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), + 'deleted_at': instance.deletedAt?.toIso8601String(), + 'image_path': instance.imagePath + }; +} + +/// Construct a [WardrobeItem] +class WardrobeItemAdapter + extends OfflineFirstWithSupabaseAdapter { + WardrobeItemAdapter(); + + @override + final supabaseTableName = 'wardrobe_item'; + @override + final defaultToNull = true; + @override + final fieldsToSupabaseColumns = { + 'id': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'id', + ), + 'userProfile': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'user_profile', + associationType: UserProfile, + associationIsNullable: false, + foreignKey: 'user_profile_id', + ), + 'brand': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'brand', + associationType: Brand, + associationIsNullable: true, + foreignKey: 'brand_id', + ), + 'itemCategory': const RuntimeSupabaseColumnDefinition( + association: true, + columnName: 'item_category', + associationType: ItemCategory, + associationIsNullable: true, + foreignKey: 'category_id', + ), + 'createdAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'created_at', + ), + 'updatedAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'updated_at', + ), + 'deletedAt': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'deleted_at', + ), + 'imagePath': const RuntimeSupabaseColumnDefinition( + association: false, + columnName: 'image_path', + ) + }; + @override + final ignoreDuplicates = false; + @override + final uniqueFields = {'id'}; + @override + final Map fieldsToSqliteColumns = { + 'primaryKey': const RuntimeSqliteColumnDefinition( + association: false, + columnName: '_brick_id', + iterable: false, + type: int, + ), + 'id': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'id', + iterable: false, + type: String, + ), + 'userProfile': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'user_profile_UserProfile_brick_id', + iterable: false, + type: UserProfile, + ), + 'brand': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'brand_Brand_brick_id', + iterable: false, + type: Brand, + ), + 'itemCategory': const RuntimeSqliteColumnDefinition( + association: true, + columnName: 'item_category_ItemCategory_brick_id', + iterable: false, + type: ItemCategory, + ), + 'createdAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'created_at', + iterable: false, + type: DateTime, + ), + 'updatedAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'updated_at', + iterable: false, + type: DateTime, + ), + 'deletedAt': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'deleted_at', + iterable: false, + type: DateTime, + ), + 'imagePath': const RuntimeSqliteColumnDefinition( + association: false, + columnName: 'image_path', + iterable: false, + type: String, + ) + }; + @override + Future primaryKeyByUniqueColumns( + WardrobeItem instance, DatabaseExecutor executor) async => + instance.primaryKey; + @override + final String tableName = 'WardrobeItem'; + + @override + Future fromSupabase(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$WardrobeItemFromSupabase(input, + provider: provider, repository: repository); + @override + Future> toSupabase(WardrobeItem input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$WardrobeItemToSupabase(input, + provider: provider, repository: repository); + @override + Future fromSqlite(Map input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$WardrobeItemFromSqlite(input, + provider: provider, repository: repository); + @override + Future> toSqlite(WardrobeItem input, + {required provider, + covariant OfflineFirstWithSupabaseRepository? repository}) async => + await _$WardrobeItemToSqlite(input, + provider: provider, repository: repository); +} diff --git a/lib/brick/brick.g.dart b/lib/brick/brick.g.dart new file mode 100644 index 0000000..583779e --- /dev/null +++ b/lib/brick/brick.g.dart @@ -0,0 +1,108 @@ +// ignore: unused_import, unused_shown_name, unnecessary_import +import 'package:brick_core/query.dart'; +// ignore: unused_import, unused_shown_name, unnecessary_import +import 'package:brick_sqlite/db.dart'; +// ignore: unused_import, unused_shown_name, unnecessary_import +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +// ignore: unused_import, unused_shown_name, unnecessary_import +import 'package:brick_sqlite/brick_sqlite.dart'; +// ignore: unused_import, unused_shown_name, unnecessary_import +import 'package:brick_supabase/brick_supabase.dart'; +// ignore: unused_import, unused_shown_name, unnecessary_import +import 'package:uuid/uuid.dart'; +// ignore: unused_import, unused_shown_name, unnecessary_import +import 'package:openwardrobe/brick/models/community_post.model.dart'; +// ignore: unused_import, unused_shown_name, unnecessary_import +import 'package:openwardrobe/brick/models/user_profile.model.dart'; +// ignore: unused_import, unused_shown_name, unnecessary_import +import 'package:openwardrobe/brick/models/wardrobe_item.model.dart'; +// ignore: unused_import, unused_shown_name, unnecessary_import +import 'package:openwardrobe/brick/models/outfit_item.model.dart'; +// ignore: unused_import, unused_shown_name, unnecessary_import +import 'package:openwardrobe/brick/models/brand.model.dart'; +// ignore: unused_import, unused_shown_name, unnecessary_import +import 'package:openwardrobe/brick/models/item_category.model.dart'; +// ignore: unused_import, unused_shown_name, unnecessary_import +import 'package:openwardrobe/brick/models/outfit.model.dart'; +// ignore: unused_import, unused_shown_name, unnecessary_import +import 'package:openwardrobe/brick/models/lookbook.model.dart';// GENERATED CODE DO NOT EDIT +// ignore: unused_import +import 'dart:convert'; +import 'package:brick_sqlite/brick_sqlite.dart' show SqliteModel, SqliteAdapter, SqliteModelDictionary, RuntimeSqliteColumnDefinition, SqliteProvider; +import 'package:brick_supabase/brick_supabase.dart' show SupabaseProvider, SupabaseModel, SupabaseAdapter, SupabaseModelDictionary; +// ignore: unused_import, unused_shown_name +import 'package:brick_offline_first/brick_offline_first.dart' show RuntimeOfflineFirstDefinition; +// ignore: unused_import, unused_shown_name +import 'package:sqflite_common/sqlite_api.dart' show DatabaseExecutor; + +import '../brick/models/community_post_like.model.dart'; +import '../brick/models/community_post_comment.model.dart'; +import '../brick/models/use_item.model.dart'; +import '../brick/models/outfit.model.dart'; +import '../brick/models/user_profile.model.dart'; +import '../brick/models/wardrobe_item.model.dart'; +import '../brick/models/use_outfit.model.dart'; +import '../brick/models/brand.model.dart'; +import '../brick/models/outfit_item.model.dart'; +import '../brick/models/lookbook.model.dart'; +import '../brick/models/category_summary.model.dart'; +import '../brick/models/item_metadata.model.dart'; +import '../brick/models/lookbook_item.model.dart'; +import '../brick/models/item_category.model.dart'; +import '../brick/models/community_post.model.dart'; + +part 'adapters/community_post_like_adapter.g.dart'; +part 'adapters/community_post_comment_adapter.g.dart'; +part 'adapters/use_item_adapter.g.dart'; +part 'adapters/outfit_adapter.g.dart'; +part 'adapters/user_profile_adapter.g.dart'; +part 'adapters/wardrobe_item_adapter.g.dart'; +part 'adapters/use_outfit_adapter.g.dart'; +part 'adapters/brand_adapter.g.dart'; +part 'adapters/outfit_item_adapter.g.dart'; +part 'adapters/lookbook_adapter.g.dart'; +part 'adapters/category_summary_adapter.g.dart'; +part 'adapters/item_metadata_adapter.g.dart'; +part 'adapters/lookbook_item_adapter.g.dart'; +part 'adapters/item_category_adapter.g.dart'; +part 'adapters/community_post_adapter.g.dart'; + +/// Supabase mappings should only be used when initializing a [SupabaseProvider] +final Map> supabaseMappings = { + CommunityPostLike: CommunityPostLikeAdapter(), + CommunityPostComment: CommunityPostCommentAdapter(), + UseItem: UseItemAdapter(), + Outfit: OutfitAdapter(), + UserProfile: UserProfileAdapter(), + WardrobeItem: WardrobeItemAdapter(), + UseOutfit: UseOutfitAdapter(), + Brand: BrandAdapter(), + OutfitItem: OutfitItemAdapter(), + Lookbook: LookbookAdapter(), + CategorySummary: CategorySummaryAdapter(), + ItemMetadata: ItemMetadataAdapter(), + LookbookItem: LookbookItemAdapter(), + ItemCategory: ItemCategoryAdapter(), + CommunityPost: CommunityPostAdapter() +}; +final supabaseModelDictionary = SupabaseModelDictionary(supabaseMappings); + +/// Sqlite mappings should only be used when initializing a [SqliteProvider] +final Map> sqliteMappings = { + CommunityPostLike: CommunityPostLikeAdapter(), + CommunityPostComment: CommunityPostCommentAdapter(), + UseItem: UseItemAdapter(), + Outfit: OutfitAdapter(), + UserProfile: UserProfileAdapter(), + WardrobeItem: WardrobeItemAdapter(), + UseOutfit: UseOutfitAdapter(), + Brand: BrandAdapter(), + OutfitItem: OutfitItemAdapter(), + Lookbook: LookbookAdapter(), + CategorySummary: CategorySummaryAdapter(), + ItemMetadata: ItemMetadataAdapter(), + LookbookItem: LookbookItemAdapter(), + ItemCategory: ItemCategoryAdapter(), + CommunityPost: CommunityPostAdapter() +}; +final sqliteModelDictionary = SqliteModelDictionary(sqliteMappings); diff --git a/lib/brick/db/20250216160740.migration.dart b/lib/brick/db/20250216160740.migration.dart new file mode 100644 index 0000000..81007ae --- /dev/null +++ b/lib/brick/db/20250216160740.migration.dart @@ -0,0 +1,234 @@ +// GENERATED CODE EDIT WITH CAUTION +// THIS FILE **WILL NOT** BE REGENERATED +// This file should be version controlled and can be manually edited. +part of 'schema.g.dart'; + +// While migrations are intelligently created, the difference between some commands, such as +// DropTable vs. RenameTable, cannot be determined. For this reason, please review migrations after +// they are created to ensure the correct inference was made. + +// The migration version must **always** mirror the file name + +const List _migration_20250216160740_up = [ + InsertTable('CommunityPostLike'), + InsertTable('CommunityPostComment'), + InsertTable('UseItem'), + InsertTable('_brick_Outfit_outfit_items'), + InsertTable('Outfit'), + InsertTable('UserProfile'), + InsertTable('WardrobeItem'), + InsertTable('UseOutfit'), + InsertTable('Brand'), + InsertTable('OutfitItem'), + InsertTable('Lookbook'), + InsertTable('ItemMetadata'), + InsertTable('LookbookItem'), + InsertTable('ItemCategory'), + InsertTable('CommunityPost'), + InsertColumn('id', Column.varchar, onTable: 'CommunityPostLike'), + InsertForeignKey('CommunityPostLike', 'CommunityPost', foreignKeyColumn: 'post_CommunityPost_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertForeignKey('CommunityPostLike', 'UserProfile', foreignKeyColumn: 'user_profile_UserProfile_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertColumn('created_at', Column.datetime, onTable: 'CommunityPostLike'), + InsertColumn('id', Column.varchar, onTable: 'CommunityPostComment'), + InsertForeignKey('CommunityPostComment', 'CommunityPost', foreignKeyColumn: 'post_CommunityPost_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertForeignKey('CommunityPostComment', 'UserProfile', foreignKeyColumn: 'user_profile_UserProfile_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertColumn('comment', Column.varchar, onTable: 'CommunityPostComment'), + InsertColumn('created_at', Column.datetime, onTable: 'CommunityPostComment'), + InsertColumn('id', Column.varchar, onTable: 'UseItem'), + InsertForeignKey('UseItem', 'WardrobeItem', foreignKeyColumn: 'wardrobe_item_WardrobeItem_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertColumn('used_at', Column.datetime, onTable: 'UseItem'), + InsertForeignKey('UseItem', 'UserProfile', foreignKeyColumn: 'user_profile_UserProfile_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertForeignKey('_brick_Outfit_outfit_items', 'Outfit', foreignKeyColumn: 'l_Outfit_brick_id', onDeleteCascade: true, onDeleteSetDefault: false), + InsertForeignKey('_brick_Outfit_outfit_items', 'OutfitItem', foreignKeyColumn: 'f_OutfitItem_brick_id', onDeleteCascade: true, onDeleteSetDefault: false), + InsertColumn('id', Column.varchar, onTable: 'Outfit', unique: true), + InsertForeignKey('Outfit', 'UserProfile', foreignKeyColumn: 'user_profile_UserProfile_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertColumn('name', Column.varchar, onTable: 'Outfit'), + InsertColumn('created_at', Column.datetime, onTable: 'Outfit'), + InsertColumn('updated_at', Column.datetime, onTable: 'Outfit'), + InsertColumn('deleted_at', Column.datetime, onTable: 'Outfit'), + InsertColumn('id', Column.varchar, onTable: 'UserProfile'), + InsertColumn('username', Column.varchar, onTable: 'UserProfile'), + InsertColumn('display_name', Column.varchar, onTable: 'UserProfile'), + InsertColumn('bio', Column.varchar, onTable: 'UserProfile'), + InsertColumn('avatar_url', Column.varchar, onTable: 'UserProfile'), + InsertColumn('social_links', Column.varchar, onTable: 'UserProfile'), + InsertColumn('is_public', Column.boolean, onTable: 'UserProfile'), + InsertColumn('created_at', Column.datetime, onTable: 'UserProfile'), + InsertColumn('updated_at', Column.datetime, onTable: 'UserProfile'), + InsertColumn('id', Column.varchar, onTable: 'WardrobeItem'), + InsertForeignKey('WardrobeItem', 'UserProfile', foreignKeyColumn: 'user_profile_UserProfile_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertForeignKey('WardrobeItem', 'Brand', foreignKeyColumn: 'brand_Brand_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertForeignKey('WardrobeItem', 'ItemCategory', foreignKeyColumn: 'item_category_ItemCategory_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertColumn('created_at', Column.datetime, onTable: 'WardrobeItem'), + InsertColumn('updated_at', Column.datetime, onTable: 'WardrobeItem'), + InsertColumn('deleted_at', Column.datetime, onTable: 'WardrobeItem'), + InsertColumn('image_path', Column.varchar, onTable: 'WardrobeItem'), + InsertColumn('id', Column.varchar, onTable: 'UseOutfit'), + InsertForeignKey('UseOutfit', 'Outfit', foreignKeyColumn: 'outfit_Outfit_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertColumn('used_at', Column.datetime, onTable: 'UseOutfit'), + InsertForeignKey('UseOutfit', 'UserProfile', foreignKeyColumn: 'user_profile_UserProfile_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertColumn('id', Column.varchar, onTable: 'Brand'), + InsertColumn('name', Column.varchar, onTable: 'Brand'), + InsertForeignKey('Brand', 'UserProfile', foreignKeyColumn: 'user_profile_UserProfile_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertColumn('id', Column.varchar, onTable: 'OutfitItem'), + InsertForeignKey('OutfitItem', 'Outfit', foreignKeyColumn: 'outfit_Outfit_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertForeignKey('OutfitItem', 'WardrobeItem', foreignKeyColumn: 'wardrobe_item_WardrobeItem_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertColumn('id', Column.varchar, onTable: 'Lookbook'), + InsertForeignKey('Lookbook', 'UserProfile', foreignKeyColumn: 'user_profile_UserProfile_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertColumn('title', Column.varchar, onTable: 'Lookbook'), + InsertColumn('description', Column.varchar, onTable: 'Lookbook'), + InsertColumn('cover_image_url', Column.varchar, onTable: 'Lookbook'), + InsertColumn('tags', Column.varchar, onTable: 'Lookbook'), + InsertColumn('is_public', Column.boolean, onTable: 'Lookbook'), + InsertColumn('created_at', Column.datetime, onTable: 'Lookbook'), + InsertColumn('updated_at', Column.datetime, onTable: 'Lookbook'), + InsertColumn('id', Column.varchar, onTable: 'ItemMetadata'), + InsertForeignKey('ItemMetadata', 'WardrobeItem', foreignKeyColumn: 'wardrobe_item_WardrobeItem_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertColumn('bought_for', Column.Double, onTable: 'ItemMetadata'), + InsertColumn('currency', Column.varchar, onTable: 'ItemMetadata'), + InsertColumn('purchase_date', Column.datetime, onTable: 'ItemMetadata'), + InsertColumn('condition', Column.varchar, onTable: 'ItemMetadata'), + InsertColumn('material', Column.varchar, onTable: 'ItemMetadata'), + InsertColumn('size', Column.varchar, onTable: 'ItemMetadata'), + InsertColumn('color', Column.varchar, onTable: 'ItemMetadata'), + InsertColumn('notes', Column.varchar, onTable: 'ItemMetadata'), + InsertColumn('created_at', Column.datetime, onTable: 'ItemMetadata'), + InsertColumn('updated_at', Column.datetime, onTable: 'ItemMetadata'), + InsertColumn('id', Column.varchar, onTable: 'LookbookItem'), + InsertForeignKey('LookbookItem', 'Lookbook', foreignKeyColumn: 'lookbook_Lookbook_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertColumn('item_id', Column.varchar, onTable: 'LookbookItem'), + InsertColumn('item_type', Column.varchar, onTable: 'LookbookItem'), + InsertColumn('created_at', Column.datetime, onTable: 'LookbookItem'), + InsertColumn('id', Column.varchar, onTable: 'ItemCategory'), + InsertColumn('name', Column.varchar, onTable: 'ItemCategory'), + InsertColumn('id', Column.varchar, onTable: 'CommunityPost'), + InsertForeignKey('CommunityPost', 'UserProfile', foreignKeyColumn: 'user_profile_UserProfile_brick_id', onDeleteCascade: false, onDeleteSetDefault: false), + InsertColumn('content', Column.varchar, onTable: 'CommunityPost'), + InsertColumn('image_url', Column.varchar, onTable: 'CommunityPost'), + InsertColumn('is_public', Column.boolean, onTable: 'CommunityPost'), + InsertColumn('created_at', Column.datetime, onTable: 'CommunityPost'), + InsertColumn('updated_at', Column.datetime, onTable: 'CommunityPost'), + CreateIndex(columns: ['l_Outfit_brick_id', 'f_OutfitItem_brick_id'], onTable: '_brick_Outfit_outfit_items', unique: true), + CreateIndex(columns: ['id'], onTable: 'Outfit', unique: true) +]; + +const List _migration_20250216160740_down = [ + DropTable('CommunityPostLike'), + DropTable('CommunityPostComment'), + DropTable('UseItem'), + DropTable('_brick_Outfit_outfit_items'), + DropTable('Outfit'), + DropTable('UserProfile'), + DropTable('WardrobeItem'), + DropTable('UseOutfit'), + DropTable('Brand'), + DropTable('OutfitItem'), + DropTable('Lookbook'), + DropTable('ItemMetadata'), + DropTable('LookbookItem'), + DropTable('ItemCategory'), + DropTable('CommunityPost'), + DropColumn('id', onTable: 'CommunityPostLike'), + DropColumn('post_CommunityPost_brick_id', onTable: 'CommunityPostLike'), + DropColumn('user_profile_UserProfile_brick_id', onTable: 'CommunityPostLike'), + DropColumn('created_at', onTable: 'CommunityPostLike'), + DropColumn('id', onTable: 'CommunityPostComment'), + DropColumn('post_CommunityPost_brick_id', onTable: 'CommunityPostComment'), + DropColumn('user_profile_UserProfile_brick_id', onTable: 'CommunityPostComment'), + DropColumn('comment', onTable: 'CommunityPostComment'), + DropColumn('created_at', onTable: 'CommunityPostComment'), + DropColumn('id', onTable: 'UseItem'), + DropColumn('wardrobe_item_WardrobeItem_brick_id', onTable: 'UseItem'), + DropColumn('used_at', onTable: 'UseItem'), + DropColumn('user_profile_UserProfile_brick_id', onTable: 'UseItem'), + DropColumn('l_Outfit_brick_id', onTable: '_brick_Outfit_outfit_items'), + DropColumn('f_OutfitItem_brick_id', onTable: '_brick_Outfit_outfit_items'), + DropColumn('id', onTable: 'Outfit'), + DropColumn('user_profile_UserProfile_brick_id', onTable: 'Outfit'), + DropColumn('name', onTable: 'Outfit'), + DropColumn('created_at', onTable: 'Outfit'), + DropColumn('updated_at', onTable: 'Outfit'), + DropColumn('deleted_at', onTable: 'Outfit'), + DropColumn('id', onTable: 'UserProfile'), + DropColumn('username', onTable: 'UserProfile'), + DropColumn('display_name', onTable: 'UserProfile'), + DropColumn('bio', onTable: 'UserProfile'), + DropColumn('avatar_url', onTable: 'UserProfile'), + DropColumn('social_links', onTable: 'UserProfile'), + DropColumn('is_public', onTable: 'UserProfile'), + DropColumn('created_at', onTable: 'UserProfile'), + DropColumn('updated_at', onTable: 'UserProfile'), + DropColumn('id', onTable: 'WardrobeItem'), + DropColumn('user_profile_UserProfile_brick_id', onTable: 'WardrobeItem'), + DropColumn('brand_Brand_brick_id', onTable: 'WardrobeItem'), + DropColumn('item_category_ItemCategory_brick_id', onTable: 'WardrobeItem'), + DropColumn('created_at', onTable: 'WardrobeItem'), + DropColumn('updated_at', onTable: 'WardrobeItem'), + DropColumn('deleted_at', onTable: 'WardrobeItem'), + DropColumn('image_path', onTable: 'WardrobeItem'), + DropColumn('id', onTable: 'UseOutfit'), + DropColumn('outfit_Outfit_brick_id', onTable: 'UseOutfit'), + DropColumn('used_at', onTable: 'UseOutfit'), + DropColumn('user_profile_UserProfile_brick_id', onTable: 'UseOutfit'), + DropColumn('id', onTable: 'Brand'), + DropColumn('name', onTable: 'Brand'), + DropColumn('user_profile_UserProfile_brick_id', onTable: 'Brand'), + DropColumn('id', onTable: 'OutfitItem'), + DropColumn('outfit_Outfit_brick_id', onTable: 'OutfitItem'), + DropColumn('wardrobe_item_WardrobeItem_brick_id', onTable: 'OutfitItem'), + DropColumn('id', onTable: 'Lookbook'), + DropColumn('user_profile_UserProfile_brick_id', onTable: 'Lookbook'), + DropColumn('title', onTable: 'Lookbook'), + DropColumn('description', onTable: 'Lookbook'), + DropColumn('cover_image_url', onTable: 'Lookbook'), + DropColumn('tags', onTable: 'Lookbook'), + DropColumn('is_public', onTable: 'Lookbook'), + DropColumn('created_at', onTable: 'Lookbook'), + DropColumn('updated_at', onTable: 'Lookbook'), + DropColumn('id', onTable: 'ItemMetadata'), + DropColumn('wardrobe_item_WardrobeItem_brick_id', onTable: 'ItemMetadata'), + DropColumn('bought_for', onTable: 'ItemMetadata'), + DropColumn('currency', onTable: 'ItemMetadata'), + DropColumn('purchase_date', onTable: 'ItemMetadata'), + DropColumn('condition', onTable: 'ItemMetadata'), + DropColumn('material', onTable: 'ItemMetadata'), + DropColumn('size', onTable: 'ItemMetadata'), + DropColumn('color', onTable: 'ItemMetadata'), + DropColumn('notes', onTable: 'ItemMetadata'), + DropColumn('created_at', onTable: 'ItemMetadata'), + DropColumn('updated_at', onTable: 'ItemMetadata'), + DropColumn('id', onTable: 'LookbookItem'), + DropColumn('lookbook_Lookbook_brick_id', onTable: 'LookbookItem'), + DropColumn('item_id', onTable: 'LookbookItem'), + DropColumn('item_type', onTable: 'LookbookItem'), + DropColumn('created_at', onTable: 'LookbookItem'), + DropColumn('id', onTable: 'ItemCategory'), + DropColumn('name', onTable: 'ItemCategory'), + DropColumn('id', onTable: 'CommunityPost'), + DropColumn('user_profile_UserProfile_brick_id', onTable: 'CommunityPost'), + DropColumn('content', onTable: 'CommunityPost'), + DropColumn('image_url', onTable: 'CommunityPost'), + DropColumn('is_public', onTable: 'CommunityPost'), + DropColumn('created_at', onTable: 'CommunityPost'), + DropColumn('updated_at', onTable: 'CommunityPost'), + DropIndex('index__brick_Outfit_outfit_items_on_l_Outfit_brick_id_f_OutfitItem_brick_id'), + DropIndex('index_Outfit_on_id') +]; + +// +// DO NOT EDIT BELOW THIS LINE +// + +@Migratable( + version: '20250216160740', + up: _migration_20250216160740_up, + down: _migration_20250216160740_down, +) +class Migration20250216160740 extends Migration { + const Migration20250216160740() + : super( + version: 20250216160740, + up: _migration_20250216160740_up, + down: _migration_20250216160740_down, + ); +} diff --git a/lib/brick/db/20250221154502.migration.dart b/lib/brick/db/20250221154502.migration.dart new file mode 100644 index 0000000..45efee5 --- /dev/null +++ b/lib/brick/db/20250221154502.migration.dart @@ -0,0 +1,44 @@ +// GENERATED CODE EDIT WITH CAUTION +// THIS FILE **WILL NOT** BE REGENERATED +// This file should be version controlled and can be manually edited. +part of 'schema.g.dart'; + +// While migrations are intelligently created, the difference between some commands, such as +// DropTable vs. RenameTable, cannot be determined. For this reason, please review migrations after +// they are created to ensure the correct inference was made. + +// The migration version must **always** mirror the file name + +const List _migration_20250221154502_up = [ + InsertTable('CategorySummary'), + InsertColumn('category_id', Column.varchar, onTable: 'CategorySummary'), + InsertColumn('category_name', Column.varchar, onTable: 'CategorySummary'), + InsertColumn('item_count', Column.integer, onTable: 'CategorySummary'), + InsertColumn('category_image', Column.varchar, onTable: 'CategorySummary') +]; + +const List _migration_20250221154502_down = [ + DropTable('CategorySummary'), + DropColumn('category_id', onTable: 'CategorySummary'), + DropColumn('category_name', onTable: 'CategorySummary'), + DropColumn('item_count', onTable: 'CategorySummary'), + DropColumn('category_image', onTable: 'CategorySummary') +]; + +// +// DO NOT EDIT BELOW THIS LINE +// + +@Migratable( + version: '20250221154502', + up: _migration_20250221154502_up, + down: _migration_20250221154502_down, +) +class Migration20250221154502 extends Migration { + const Migration20250221154502() + : super( + version: 20250221154502, + up: _migration_20250221154502_up, + down: _migration_20250221154502_down, + ); +} diff --git a/lib/brick/db/20250221180912.migration.dart b/lib/brick/db/20250221180912.migration.dart new file mode 100644 index 0000000..dddaa4c --- /dev/null +++ b/lib/brick/db/20250221180912.migration.dart @@ -0,0 +1,36 @@ +// GENERATED CODE EDIT WITH CAUTION +// THIS FILE **WILL NOT** BE REGENERATED +// This file should be version controlled and can be manually edited. +part of 'schema.g.dart'; + +// While migrations are intelligently created, the difference between some commands, such as +// DropTable vs. RenameTable, cannot be determined. For this reason, please review migrations after +// they are created to ensure the correct inference was made. + +// The migration version must **always** mirror the file name + +const List _migration_20250221180912_up = [ + CreateIndex(columns: ['item_category_ItemCategory_brick_id'], onTable: 'WardrobeItem', unique: false) +]; + +const List _migration_20250221180912_down = [ + DropIndex('index_WardrobeItem_on_item_category_ItemCategory_brick_id') +]; + +// +// DO NOT EDIT BELOW THIS LINE +// + +@Migratable( + version: '20250221180912', + up: _migration_20250221180912_up, + down: _migration_20250221180912_down, +) +class Migration20250221180912 extends Migration { + const Migration20250221180912() + : super( + version: 20250221180912, + up: _migration_20250221180912_up, + down: _migration_20250221180912_down, + ); +} diff --git a/lib/brick/db/20250221180926.migration.dart b/lib/brick/db/20250221180926.migration.dart new file mode 100644 index 0000000..cbd0245 --- /dev/null +++ b/lib/brick/db/20250221180926.migration.dart @@ -0,0 +1,36 @@ +// GENERATED CODE EDIT WITH CAUTION +// THIS FILE **WILL NOT** BE REGENERATED +// This file should be version controlled and can be manually edited. +part of 'schema.g.dart'; + +// While migrations are intelligently created, the difference between some commands, such as +// DropTable vs. RenameTable, cannot be determined. For this reason, please review migrations after +// they are created to ensure the correct inference was made. + +// The migration version must **always** mirror the file name + +const List _migration_20250221180926_up = [ + CreateIndex(columns: ['brand_Brand_brick_id'], onTable: 'WardrobeItem', unique: false) +]; + +const List _migration_20250221180926_down = [ + DropIndex('index_WardrobeItem_on_brand_Brand_brick_id') +]; + +// +// DO NOT EDIT BELOW THIS LINE +// + +@Migratable( + version: '20250221180926', + up: _migration_20250221180926_up, + down: _migration_20250221180926_down, +) +class Migration20250221180926 extends Migration { + const Migration20250221180926() + : super( + version: 20250221180926, + up: _migration_20250221180926_up, + down: _migration_20250221180926_down, + ); +} diff --git a/lib/brick/db/schema.g.dart b/lib/brick/db/schema.g.dart new file mode 100644 index 0000000..6df93b8 --- /dev/null +++ b/lib/brick/db/schema.g.dart @@ -0,0 +1,262 @@ +// GENERATED CODE DO NOT EDIT +// This file should be version controlled +import 'package:brick_sqlite/db.dart'; +part '20250221180926.migration.dart'; +part '20250216160740.migration.dart'; +part '20250221154502.migration.dart'; +part '20250221180912.migration.dart'; + +/// All intelligently-generated migrations from all `@Migratable` classes on disk +final migrations = { + const Migration20250221180926(), + const Migration20250216160740(), + const Migration20250221154502(), + const Migration20250221180912() +}; + +/// A consumable database structure including the latest generated migration. +final schema = Schema(20250221180926, generatorVersion: 1, tables: { + SchemaTable('CommunityPostLike', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('id', Column.varchar), + SchemaColumn('post_CommunityPost_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'CommunityPost', + onDeleteCascade: false, + onDeleteSetDefault: false), + SchemaColumn('user_profile_UserProfile_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'UserProfile', + onDeleteCascade: false, + onDeleteSetDefault: false), + SchemaColumn('created_at', Column.datetime) + }, indices: {}), + SchemaTable('CommunityPostComment', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('id', Column.varchar), + SchemaColumn('post_CommunityPost_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'CommunityPost', + onDeleteCascade: false, + onDeleteSetDefault: false), + SchemaColumn('user_profile_UserProfile_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'UserProfile', + onDeleteCascade: false, + onDeleteSetDefault: false), + SchemaColumn('comment', Column.varchar), + SchemaColumn('created_at', Column.datetime) + }, indices: {}), + SchemaTable('UseItem', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('id', Column.varchar), + SchemaColumn('wardrobe_item_WardrobeItem_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'WardrobeItem', + onDeleteCascade: false, + onDeleteSetDefault: false), + SchemaColumn('used_at', Column.datetime), + SchemaColumn('user_profile_UserProfile_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'UserProfile', + onDeleteCascade: false, + onDeleteSetDefault: false) + }, indices: {}), + SchemaTable('_brick_Outfit_outfit_items', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('l_Outfit_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'Outfit', + onDeleteCascade: true, + onDeleteSetDefault: false), + SchemaColumn('f_OutfitItem_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'OutfitItem', + onDeleteCascade: true, + onDeleteSetDefault: false) + }, indices: { + SchemaIndex( + columns: ['l_Outfit_brick_id', 'f_OutfitItem_brick_id'], unique: true) + }), + SchemaTable('Outfit', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('id', Column.varchar, unique: true), + SchemaColumn('user_profile_UserProfile_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'UserProfile', + onDeleteCascade: false, + onDeleteSetDefault: false), + SchemaColumn('name', Column.varchar), + SchemaColumn('created_at', Column.datetime), + SchemaColumn('updated_at', Column.datetime), + SchemaColumn('deleted_at', Column.datetime) + }, indices: { + SchemaIndex(columns: ['id'], unique: true) + }), + SchemaTable('UserProfile', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('id', Column.varchar), + SchemaColumn('username', Column.varchar), + SchemaColumn('display_name', Column.varchar), + SchemaColumn('bio', Column.varchar), + SchemaColumn('avatar_url', Column.varchar), + SchemaColumn('social_links', Column.varchar), + SchemaColumn('is_public', Column.boolean), + SchemaColumn('created_at', Column.datetime), + SchemaColumn('updated_at', Column.datetime) + }, indices: {}), + SchemaTable('WardrobeItem', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('id', Column.varchar), + SchemaColumn('user_profile_UserProfile_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'UserProfile', + onDeleteCascade: false, + onDeleteSetDefault: false), + SchemaColumn('brand_Brand_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'Brand', + onDeleteCascade: false, + onDeleteSetDefault: false), + SchemaColumn('item_category_ItemCategory_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'ItemCategory', + onDeleteCascade: false, + onDeleteSetDefault: false), + SchemaColumn('created_at', Column.datetime), + SchemaColumn('updated_at', Column.datetime), + SchemaColumn('deleted_at', Column.datetime), + SchemaColumn('image_path', Column.varchar) + }, indices: { + SchemaIndex(columns: ['brand_Brand_brick_id'], unique: false), + SchemaIndex(columns: ['item_category_ItemCategory_brick_id'], unique: false) + }), + SchemaTable('UseOutfit', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('id', Column.varchar), + SchemaColumn('outfit_Outfit_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'Outfit', + onDeleteCascade: false, + onDeleteSetDefault: false), + SchemaColumn('used_at', Column.datetime), + SchemaColumn('user_profile_UserProfile_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'UserProfile', + onDeleteCascade: false, + onDeleteSetDefault: false) + }, indices: {}), + SchemaTable('Brand', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('id', Column.varchar), + SchemaColumn('name', Column.varchar), + SchemaColumn('user_profile_UserProfile_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'UserProfile', + onDeleteCascade: false, + onDeleteSetDefault: false) + }, indices: {}), + SchemaTable('OutfitItem', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('id', Column.varchar), + SchemaColumn('outfit_Outfit_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'Outfit', + onDeleteCascade: false, + onDeleteSetDefault: false), + SchemaColumn('wardrobe_item_WardrobeItem_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'WardrobeItem', + onDeleteCascade: false, + onDeleteSetDefault: false) + }, indices: {}), + SchemaTable('Lookbook', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('id', Column.varchar), + SchemaColumn('user_profile_UserProfile_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'UserProfile', + onDeleteCascade: false, + onDeleteSetDefault: false), + SchemaColumn('title', Column.varchar), + SchemaColumn('description', Column.varchar), + SchemaColumn('cover_image_url', Column.varchar), + SchemaColumn('tags', Column.varchar), + SchemaColumn('is_public', Column.boolean), + SchemaColumn('created_at', Column.datetime), + SchemaColumn('updated_at', Column.datetime) + }, indices: {}), + SchemaTable('CategorySummary', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('category_id', Column.varchar), + SchemaColumn('category_name', Column.varchar), + SchemaColumn('item_count', Column.integer), + SchemaColumn('category_image', Column.varchar) + }, indices: {}), + SchemaTable('ItemMetadata', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('id', Column.varchar), + SchemaColumn('wardrobe_item_WardrobeItem_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'WardrobeItem', + onDeleteCascade: false, + onDeleteSetDefault: false), + SchemaColumn('bought_for', Column.Double), + SchemaColumn('currency', Column.varchar), + SchemaColumn('purchase_date', Column.datetime), + SchemaColumn('condition', Column.varchar), + SchemaColumn('material', Column.varchar), + SchemaColumn('size', Column.varchar), + SchemaColumn('color', Column.varchar), + SchemaColumn('notes', Column.varchar), + SchemaColumn('created_at', Column.datetime), + SchemaColumn('updated_at', Column.datetime) + }, indices: {}), + SchemaTable('LookbookItem', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('id', Column.varchar), + SchemaColumn('lookbook_Lookbook_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'Lookbook', + onDeleteCascade: false, + onDeleteSetDefault: false), + SchemaColumn('item_id', Column.varchar), + SchemaColumn('item_type', Column.varchar), + SchemaColumn('created_at', Column.datetime) + }, indices: {}), + SchemaTable('ItemCategory', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('id', Column.varchar), + SchemaColumn('name', Column.varchar) + }, indices: {}), + SchemaTable('CommunityPost', columns: { + SchemaColumn('_brick_id', Column.integer, + autoincrement: true, nullable: false, isPrimaryKey: true), + SchemaColumn('id', Column.varchar), + SchemaColumn('user_profile_UserProfile_brick_id', Column.integer, + isForeignKey: true, + foreignTableName: 'UserProfile', + onDeleteCascade: false, + onDeleteSetDefault: false), + SchemaColumn('content', Column.varchar), + SchemaColumn('image_url', Column.varchar), + SchemaColumn('is_public', Column.boolean), + SchemaColumn('created_at', Column.datetime), + SchemaColumn('updated_at', Column.datetime) + }, indices: {}) +}); diff --git a/lib/brick/models/brand.model.dart b/lib/brick/models/brand.model.dart new file mode 100644 index 0000000..3f4219e --- /dev/null +++ b/lib/brick/models/brand.model.dart @@ -0,0 +1,25 @@ +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_supabase/brick_supabase.dart'; +import 'package:uuid/uuid.dart'; +import 'package:openwardrobe/brick/models/user_profile.model.dart'; + +@ConnectOfflineFirstWithSupabase( + supabaseConfig: SupabaseSerializable(tableName: 'brand'), + sqliteConfig: SqliteSerializable(), +) +class Brand extends OfflineFirstWithSupabaseModel { + @Supabase(unique: true) + final String id; + final String name; + + // Association: foreign key 'user_id' references user_profiles.id + @Supabase(foreignKey: 'user_profile_id') + final UserProfile? userProfile; + + Brand({ + String? id, + required this.name, + this.userProfile, + }) : id = id ?? const Uuid().v4(); +} diff --git a/lib/brick/models/category_summary.model.dart b/lib/brick/models/category_summary.model.dart new file mode 100644 index 0000000..50463c0 --- /dev/null +++ b/lib/brick/models/category_summary.model.dart @@ -0,0 +1,29 @@ +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_supabase/brick_supabase.dart'; + +@ConnectOfflineFirstWithSupabase( + supabaseConfig: SupabaseSerializable(tableName: 'v_user_category_summary'), + sqliteConfig: SqliteSerializable(), +) +class CategorySummary extends OfflineFirstWithSupabaseModel { + @Supabase() + final String categoryId; + + @Supabase() + final String categoryName; + + @Supabase() + final int itemCount; + + @Supabase() + final String? categoryImage; + + + CategorySummary({ + required this.categoryId, + required this.categoryName, + required this.itemCount, + this.categoryImage, + }); +} \ No newline at end of file diff --git a/lib/brick/models/community_post.model.dart b/lib/brick/models/community_post.model.dart new file mode 100644 index 0000000..f1c6a09 --- /dev/null +++ b/lib/brick/models/community_post.model.dart @@ -0,0 +1,36 @@ +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_supabase/brick_supabase.dart'; +import 'package:uuid/uuid.dart'; +import 'package:openwardrobe/brick/models/user_profile.model.dart'; + +@ConnectOfflineFirstWithSupabase( + supabaseConfig: SupabaseSerializable(tableName: 'community_posts'), + sqliteConfig: SqliteSerializable(), +) +class CommunityPost extends OfflineFirstWithSupabaseModel { + @Supabase(unique: true) + final String id; + + @Supabase(foreignKey: 'user_profile_id') + final UserProfile? userProfile; + + final String content; + final String? imageUrl; + final bool isPublic; + final DateTime createdAt; + final DateTime updatedAt; + + CommunityPost({ + String? id, + required this.userProfile, + required this.content, + this.imageUrl, + bool? isPublic, + DateTime? createdAt, + DateTime? updatedAt, + }) : id = id ?? const Uuid().v4(), + isPublic = isPublic ?? true, + createdAt = createdAt ?? DateTime.now(), + updatedAt = updatedAt ?? DateTime.now(); +} diff --git a/lib/brick/models/community_post_comment.model.dart b/lib/brick/models/community_post_comment.model.dart new file mode 100644 index 0000000..f1b3757 --- /dev/null +++ b/lib/brick/models/community_post_comment.model.dart @@ -0,0 +1,35 @@ +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_supabase/brick_supabase.dart'; +import 'package:uuid/uuid.dart'; +import 'package:openwardrobe/brick/models/community_post.model.dart'; +import 'package:openwardrobe/brick/models/user_profile.model.dart'; + +@ConnectOfflineFirstWithSupabase( + supabaseConfig: SupabaseSerializable(tableName: 'community_post_comments'), + sqliteConfig: SqliteSerializable(), +) +class CommunityPostComment extends OfflineFirstWithSupabaseModel { + @Supabase(unique: true) + final String id; + + // Association to CommunityPost via post_id + @Supabase(foreignKey: 'post_id') + final CommunityPost post; + + // Association to UserProfile via user_id + @Supabase(foreignKey: 'user_profile_id') + final UserProfile? userProfile; + + final String comment; + final DateTime createdAt; + + CommunityPostComment({ + String? id, + required this.post, + required this.userProfile, + required this.comment, + DateTime? createdAt, + }) : id = id ?? const Uuid().v4(), + createdAt = createdAt ?? DateTime.now(); +} diff --git a/lib/brick/models/community_post_like.model.dart b/lib/brick/models/community_post_like.model.dart new file mode 100644 index 0000000..581652f --- /dev/null +++ b/lib/brick/models/community_post_like.model.dart @@ -0,0 +1,31 @@ +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_supabase/brick_supabase.dart'; +import 'package:uuid/uuid.dart'; +import 'package:openwardrobe/brick/models/community_post.model.dart'; +import 'package:openwardrobe/brick/models/user_profile.model.dart'; + +@ConnectOfflineFirstWithSupabase( + supabaseConfig: SupabaseSerializable(tableName: 'community_post_likes'), + sqliteConfig: SqliteSerializable(), +) +class CommunityPostLike extends OfflineFirstWithSupabaseModel { + @Supabase(unique: true) + final String id; + + @Supabase(foreignKey: 'post_id') + final CommunityPost post; + + @Supabase(foreignKey: 'user_profile_id') + final UserProfile? userProfile; + + final DateTime createdAt; + + CommunityPostLike({ + String? id, + required this.post, + required this.userProfile, + DateTime? createdAt, + }) : id = id ?? const Uuid().v4(), + createdAt = createdAt ?? DateTime.now(); +} diff --git a/lib/brick/models/item_category.model.dart b/lib/brick/models/item_category.model.dart new file mode 100644 index 0000000..fc8059f --- /dev/null +++ b/lib/brick/models/item_category.model.dart @@ -0,0 +1,19 @@ +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_supabase/brick_supabase.dart'; +import 'package:uuid/uuid.dart'; + +@ConnectOfflineFirstWithSupabase( + supabaseConfig: SupabaseSerializable(tableName: 'item_category'), + sqliteConfig: SqliteSerializable(), +) +class ItemCategory extends OfflineFirstWithSupabaseModel { + @Supabase(unique: true) + final String id; + final String name; + + ItemCategory({ + String? id, + required this.name, + }) : id = id ?? const Uuid().v4(); +} diff --git a/lib/brick/models/item_metadata.model.dart b/lib/brick/models/item_metadata.model.dart new file mode 100644 index 0000000..f685aeb --- /dev/null +++ b/lib/brick/models/item_metadata.model.dart @@ -0,0 +1,47 @@ +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_supabase/brick_supabase.dart'; +import 'package:uuid/uuid.dart'; +import 'package:openwardrobe/brick/models/wardrobe_item.model.dart'; + +@ConnectOfflineFirstWithSupabase( + supabaseConfig: SupabaseSerializable(tableName: 'item_metadata'), + sqliteConfig: SqliteSerializable(), +) +class ItemMetadata extends OfflineFirstWithSupabaseModel { + @Supabase(unique: true) + final String id; + + // Association: foreign key 'wardrobe_item_id' + @Supabase(foreignKey: 'wardrobe_item_id') + final WardrobeItem wardrobeItem; + + final double? boughtFor; + final String currency; + final DateTime? purchaseDate; + final String? condition; + final String? material; + final String? size; + final String? color; + final String? notes; + final DateTime createdAt; + final DateTime updatedAt; + + ItemMetadata({ + String? id, + required this.wardrobeItem, + this.boughtFor, + String? currency, + this.purchaseDate, + this.condition, + this.material, + this.size, + this.color, + this.notes, + DateTime? createdAt, + DateTime? updatedAt, + }) : id = id ?? const Uuid().v4(), + currency = currency ?? 'USD', + createdAt = createdAt ?? DateTime.now(), + updatedAt = updatedAt ?? DateTime.now(); +} diff --git a/lib/brick/models/lookbook.model.dart b/lib/brick/models/lookbook.model.dart new file mode 100644 index 0000000..526999d --- /dev/null +++ b/lib/brick/models/lookbook.model.dart @@ -0,0 +1,40 @@ +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_supabase/brick_supabase.dart'; +import 'package:uuid/uuid.dart'; +import 'package:openwardrobe/brick/models/user_profile.model.dart'; + +@ConnectOfflineFirstWithSupabase( + supabaseConfig: SupabaseSerializable(tableName: 'lookbooks'), + sqliteConfig: SqliteSerializable(), +) +class Lookbook extends OfflineFirstWithSupabaseModel { + @Supabase(unique: true) + final String id; + + @Supabase(foreignKey: 'user_profile_id') + final UserProfile? userProfile; + + final String title; + final String? description; + final String? coverImageUrl; + final List? tags; + final bool isPublic; + final DateTime createdAt; + final DateTime updatedAt; + + Lookbook({ + String? id, + required this.userProfile, + required this.title, + this.description, + this.coverImageUrl, + this.tags, + bool? isPublic, + DateTime? createdAt, + DateTime? updatedAt, + }) : id = id ?? const Uuid().v4(), + isPublic = isPublic ?? true, + createdAt = createdAt ?? DateTime.now(), + updatedAt = updatedAt ?? DateTime.now(); +} diff --git a/lib/brick/models/lookbook_item.model.dart b/lib/brick/models/lookbook_item.model.dart new file mode 100644 index 0000000..83aaa16 --- /dev/null +++ b/lib/brick/models/lookbook_item.model.dart @@ -0,0 +1,30 @@ +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_supabase/brick_supabase.dart'; +import 'package:uuid/uuid.dart'; +import 'package:openwardrobe/brick/models/lookbook.model.dart'; + +@ConnectOfflineFirstWithSupabase( + supabaseConfig: SupabaseSerializable(tableName: 'lookbook_items'), + sqliteConfig: SqliteSerializable(), +) +class LookbookItem extends OfflineFirstWithSupabaseModel { + @Supabase(unique: true) + final String id; + + @Supabase(foreignKey: 'lookbook_id') + final Lookbook lookbook; + + final String itemId; // Assuming polymorphic, keep as scalar. + final String itemType; + final DateTime createdAt; + + LookbookItem({ + String? id, + required this.lookbook, + required this.itemId, + required this.itemType, + DateTime? createdAt, + }) : id = id ?? const Uuid().v4(), + createdAt = createdAt ?? DateTime.now(); +} diff --git a/lib/brick/models/outfit.model.dart b/lib/brick/models/outfit.model.dart new file mode 100644 index 0000000..d74b7e9 --- /dev/null +++ b/lib/brick/models/outfit.model.dart @@ -0,0 +1,39 @@ +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_supabase/brick_supabase.dart'; +import 'package:openwardrobe/brick/models/outfit_item.model.dart'; +import 'package:openwardrobe/brick/models/wardrobe_item.model.dart'; +import 'package:uuid/uuid.dart'; +import 'package:openwardrobe/brick/models/user_profile.model.dart'; +@ConnectOfflineFirstWithSupabase( + supabaseConfig: SupabaseSerializable(tableName: 'outfit'), + sqliteConfig: SqliteSerializable(), +) +class Outfit extends OfflineFirstWithSupabaseModel { + @Supabase(unique: true) + @Sqlite(index: true, unique: true) + final String id; + + @Supabase(foreignKey: 'user_profile_id') + final UserProfile? userProfile; + + final String name; + final DateTime createdAt; + final DateTime updatedAt; + final DateTime? deletedAt; + + @Supabase(foreignKey: 'outfit_id') + final List outfitItems; + + Outfit({ + String? id, + required this.userProfile, + required this.name, + required this.outfitItems, + DateTime? createdAt, + DateTime? updatedAt, + this.deletedAt, + }) : id = id ?? const Uuid().v4(), + createdAt = createdAt ?? DateTime.now(), + updatedAt = updatedAt ?? DateTime.now(); +} \ No newline at end of file diff --git a/lib/brick/models/outfit_item.model.dart b/lib/brick/models/outfit_item.model.dart new file mode 100644 index 0000000..d7bc36b --- /dev/null +++ b/lib/brick/models/outfit_item.model.dart @@ -0,0 +1,27 @@ +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_supabase/brick_supabase.dart'; +import 'package:uuid/uuid.dart'; +import 'package:openwardrobe/brick/models/outfit.model.dart'; +import 'package:openwardrobe/brick/models/wardrobe_item.model.dart'; + +@ConnectOfflineFirstWithSupabase( + supabaseConfig: SupabaseSerializable(tableName: 'outfit_items'), + sqliteConfig: SqliteSerializable(), +) +class OutfitItem extends OfflineFirstWithSupabaseModel { + @Supabase(unique: true) + final String id; + + @Supabase(foreignKey: 'outfit_id') + final Outfit outfit; + + @Supabase(foreignKey: 'wardrobe_item_id') + final WardrobeItem wardrobeItem; + + OutfitItem({ + String? id, + required this.outfit, + required this.wardrobeItem, + }) : id = id ?? const Uuid().v4(); +} \ No newline at end of file diff --git a/lib/brick/models/use_item.model.dart b/lib/brick/models/use_item.model.dart new file mode 100644 index 0000000..6a5540c --- /dev/null +++ b/lib/brick/models/use_item.model.dart @@ -0,0 +1,31 @@ +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_supabase/brick_supabase.dart'; +import 'package:uuid/uuid.dart'; +import 'package:openwardrobe/brick/models/wardrobe_item.model.dart'; +import 'package:openwardrobe/brick/models/user_profile.model.dart'; + +@ConnectOfflineFirstWithSupabase( + supabaseConfig: SupabaseSerializable(tableName: 'use_item'), + sqliteConfig: SqliteSerializable(), +) +class UseItem extends OfflineFirstWithSupabaseModel { + @Supabase(unique: true) + final String id; + + @Supabase(foreignKey: 'wardrobe_item_id') + final WardrobeItem wardrobeItem; + + final DateTime usedAt; + + @Supabase(foreignKey: 'user_profile_id') + final UserProfile? userProfile; + + UseItem({ + String? id, + required this.wardrobeItem, + DateTime? usedAt, + required this.userProfile, + }) : id = id ?? const Uuid().v4(), + usedAt = usedAt ?? DateTime.now(); +} diff --git a/lib/brick/models/use_outfit.model.dart b/lib/brick/models/use_outfit.model.dart new file mode 100644 index 0000000..670b70d --- /dev/null +++ b/lib/brick/models/use_outfit.model.dart @@ -0,0 +1,31 @@ +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_supabase/brick_supabase.dart'; +import 'package:uuid/uuid.dart'; +import 'package:openwardrobe/brick/models/outfit.model.dart'; +import 'package:openwardrobe/brick/models/user_profile.model.dart'; + +@ConnectOfflineFirstWithSupabase( + supabaseConfig: SupabaseSerializable(tableName: 'use_outfit'), + sqliteConfig: SqliteSerializable(), +) +class UseOutfit extends OfflineFirstWithSupabaseModel { + @Supabase(unique: true) + final String id; + + @Supabase(foreignKey: 'outfit_id') + final Outfit outfit; + + final DateTime usedAt; + + @Supabase(foreignKey: 'user_profile_id') + final UserProfile? userProfile; + + UseOutfit({ + String? id, + required this.outfit, + DateTime? usedAt, + required this.userProfile, + }) : id = id ?? const Uuid().v4(), + usedAt = usedAt ?? DateTime.now(); +} diff --git a/lib/brick/models/user_profile.model.dart b/lib/brick/models/user_profile.model.dart new file mode 100644 index 0000000..1b6d4a5 --- /dev/null +++ b/lib/brick/models/user_profile.model.dart @@ -0,0 +1,35 @@ +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_supabase/brick_supabase.dart'; + +@ConnectOfflineFirstWithSupabase( + supabaseConfig: SupabaseSerializable(tableName: 'user_profiles'), + sqliteConfig: SqliteSerializable(), +) +class UserProfile extends OfflineFirstWithSupabaseModel { + @Supabase(unique: true) + final String id; + final String username; + final String? displayName; + final String? bio; + final String? avatarUrl; + final Map? socialLinks; + final bool isPublic; + final DateTime createdAt; + final DateTime updatedAt; + + UserProfile({ + required this.id, + required this.username, + this.displayName, + this.bio, + this.avatarUrl, + this.socialLinks, + bool? isPublic, + DateTime? createdAt, + DateTime? updatedAt, + }) : isPublic = isPublic ?? true, + createdAt = createdAt ?? DateTime.now(), + updatedAt = updatedAt ?? DateTime.now(); +} + diff --git a/lib/brick/models/wardrobe_item.model.dart b/lib/brick/models/wardrobe_item.model.dart new file mode 100644 index 0000000..f7bc26b --- /dev/null +++ b/lib/brick/models/wardrobe_item.model.dart @@ -0,0 +1,47 @@ +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_supabase/brick_supabase.dart'; +import 'package:uuid/uuid.dart'; +import 'package:openwardrobe/brick/models/user_profile.model.dart'; +import 'package:openwardrobe/brick/models/brand.model.dart'; +import 'package:openwardrobe/brick/models/item_category.model.dart'; + +@ConnectOfflineFirstWithSupabase( + supabaseConfig: SupabaseSerializable(tableName: 'wardrobe_item'), + sqliteConfig: SqliteSerializable(), +) +class WardrobeItem extends OfflineFirstWithSupabaseModel { + @Supabase(unique: true) + final String id; + + @Supabase(foreignKey: 'user_profile_id') + final UserProfile userProfile; + + @Supabase(foreignKey: 'brand_id') + @Sqlite(nullable: true, index: true) + final Brand? brand; + + @Supabase(foreignKey: 'category_id') + @Sqlite(nullable: true, index: true) + final ItemCategory? itemCategory; + + final DateTime createdAt; + final DateTime updatedAt; + + @Sqlite(nullable: true) + final DateTime? deletedAt; + final String imagePath; + + WardrobeItem({ + String? id, + required this.userProfile, + this.brand, + this.itemCategory, + DateTime? createdAt, + DateTime? updatedAt, + this.deletedAt, + required this.imagePath, + }) : id = id ?? const Uuid().v4(), + createdAt = createdAt ?? DateTime.now(), + updatedAt = updatedAt ?? DateTime.now(); +} diff --git a/lib/controllers/camera_controller.dart b/lib/controllers/camera_controller.dart new file mode 100644 index 0000000..a843bb1 --- /dev/null +++ b/lib/controllers/camera_controller.dart @@ -0,0 +1,66 @@ +import 'dart:io'; +import 'package:file_picker/file_picker.dart'; +import 'package:flutter/foundation.dart' show Uint8List, kIsWeb; +import 'package:image_picker/image_picker.dart'; +import 'package:get_it/get_it.dart'; +import 'package:openwardrobe/repositories/app_repository.dart'; + +class CameraController { + final AppRepository _appRepository = GetIt.instance(); + + List _selectedImages = []; + List _selectedWebImages = []; + + Future> pickImages({bool fromGallery = false}) async { + _selectedImages.clear(); + _selectedWebImages.clear(); + + if (kIsWeb) { + final result = await FilePicker.platform.pickFiles( + type: FileType.image, + allowMultiple: true, + ); + + if (result != null && result.files.isNotEmpty) { + _selectedWebImages = result.files.map((file) => file.bytes!).toList(); + return result.files.map((file) => File(file.path!)).toList(); + } else { + throw Exception('No images selected'); + } + } else { + final picker = ImagePicker(); + final pickedFile = await picker.pickImage( + source: fromGallery ? ImageSource.gallery : ImageSource.camera, + ); + + if (pickedFile != null) { + _selectedImages = [File(pickedFile.path)]; + return [File(pickedFile.path)]; + } else { + throw Exception('No image selected'); + } + } + } + + Future uploadImages(List images) async { + try { + for (var imageFile in images) { + // Implement upload logic for images (e.g., upload to Supabase) + // Example: await _appRepository.supabaseProvider.client.storage.from('wardrobe').upload(imageFile.path, imageFile); + } + } catch (e) { + throw Exception('Failed to upload images: $e'); + } + } + + Future uploadWebImages(List images, List names) async { + try { + for (int i = 0; i < images.length; i++) { + // Implement upload logic for Web images (e.g., upload to Supabase) + // Example: await _appRepository.supabaseProvider.client.storage.from('wardrobe').uploadBinary(names[i], images[i]); + } + } catch (e) { + throw Exception('Failed to upload web images: $e'); + } + } +} diff --git a/lib/controllers/home_controller.dart b/lib/controllers/home_controller.dart new file mode 100644 index 0000000..c982938 --- /dev/null +++ b/lib/controllers/home_controller.dart @@ -0,0 +1,19 @@ +import 'package:get_it/get_it.dart'; +import 'package:openwardrobe/repositories/app_repository.dart'; +import 'package:openwardrobe/brick/models/user_profile.model.dart'; +import 'package:supabase_flutter/supabase_flutter.dart'; + + +class HomeController { + final AppRepository _appRepository = GetIt.instance(); + + + + Future> fetchUserProfile() { + final usersStream = _appRepository.get(); + + return usersStream; + + } + +} diff --git a/lib/controllers/settings_account_controller.dart b/lib/controllers/settings_account_controller.dart new file mode 100644 index 0000000..96a7ac1 --- /dev/null +++ b/lib/controllers/settings_account_controller.dart @@ -0,0 +1,81 @@ +import 'dart:io'; +import 'package:flutter/foundation.dart' show Uint8List, kIsWeb; +import 'package:get_it/get_it.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:openwardrobe/brick/models/user_profile.model.dart'; +import 'package:openwardrobe/repositories/app_repository.dart'; +import 'package:supabase_flutter/supabase_flutter.dart'; + +class SettingsAccountController { + final AppRepository _appRepository = GetIt.instance(); + + final List _selectedImages = []; + final List _selectedWebImages = []; + + Future fetchUserProfile() async { + try { + final profiles = await _appRepository.get(); + return profiles.first; + } catch (e) { + throw Exception('Failed to fetch user profile: $e'); + } + } + + Future upsertUserProfile(UserProfile profile) async { + try { + await _appRepository.upsert(profile); + } catch (e) { + throw Exception('Failed to upsert user profile: $e'); + } + } + + Future uploadAvatar(File imageFile) async { + try { + final response = await Supabase.instance.client.storage + .from('avatars') + .upload(imageFile.path, imageFile); + return response; + } catch (e) { + throw Exception('Failed to upload avatar: $e'); + } + } + + Future uploadWebAvatar(Uint8List imageBytes, String fileName) async { + try { + final response = await Supabase.instance.client.storage + .from('avatars') + .uploadBinary(fileName, imageBytes); + return response; + } catch (e) { + throw Exception('Failed to upload web avatar: $e'); + } + } + + Future pickImage({bool fromGallery = false}) async { + final picker = ImagePicker(); + final pickedFile = await picker.pickImage( + source: fromGallery ? ImageSource.gallery : ImageSource.camera, + ); + + if (pickedFile != null) { + _selectedImages.clear(); + return File(pickedFile.path); + } else { + return null; + } + } + + Future pickWebImage() async { + final picker = ImagePicker(); + final pickedFile = await picker.pickImage( + source: ImageSource.gallery, + ); + + if (pickedFile != null) { + _selectedWebImages.clear(); + return await pickedFile.readAsBytes(); + } else { + return null; + } + } +} diff --git a/lib/di/service_locator.dart b/lib/di/service_locator.dart new file mode 100644 index 0000000..05d80f1 --- /dev/null +++ b/lib/di/service_locator.dart @@ -0,0 +1,18 @@ +import 'package:get_it/get_it.dart'; + +import '../repositories/app_repository.dart'; +import '../controllers/camera_controller.dart'; +import '../controllers/home_controller.dart'; +import '../controllers/settings_account_controller.dart'; // Import the new controller + +final getIt = GetIt.instance; + +void setupLocator() { + // Register the AppRepository instance. + getIt.registerLazySingleton(() => AppRepository()); + + // Register controllers + getIt.registerLazySingleton(() => CameraController()); + getIt.registerLazySingleton(() => HomeController()); + getIt.registerLazySingleton(() => SettingsAccountController()); // Register the new controller +} diff --git a/lib/main.dart b/lib/main.dart index 2e2d417..4214bb1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,34 +1,49 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:supabase_flutter/supabase_flutter.dart'; -import 'package:hive_flutter/hive_flutter.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:openwardrobe/presentation/blocs/lookbook/lookbook_cubit.dart'; +import 'package:openwardrobe/repositories/app_repository.dart'; import 'router/app_router.dart'; -import 'models/wardrobe_item.dart'; -import 'models/outfit.dart'; -import 'models/brand.dart'; -import 'models/item_category.dart'; +import 'package:openwardrobe/di/service_locator.dart'; +import 'package:openwardrobe/presentation/blocs/wardrobe/wardrobe_cubit.dart'; +import 'package:openwardrobe/presentation/blocs/home/home_cubit.dart'; +import 'package:openwardrobe/presentation/blocs/camera/camera_cubit.dart'; +import 'package:openwardrobe/presentation/blocs/category/category_cubit.dart'; + +// sqflite_common_ffi_web +import 'package:sqflite_common_ffi_web/sqflite_ffi_web.dart'; + +import 'package:flutter/foundation.dart' show kIsWeb; +import 'package:sqflite/sqflite.dart' show databaseFactory; Future main() async { WidgetsFlutterBinding.ensureInitialized(); - // Initialize Hive for local storage - await Hive.initFlutter(); + if (kIsWeb) { + databaseFactory = databaseFactoryFfiWeb; + } + + await AppRepository.configure(databaseFactory); + + - // Initialize Supabase - await Supabase.initialize( - url: "https://openwdsupdemo.sug.lol", - anonKey: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzdXBhYmFzZSIsImlhdCI6MTczODg5ODA0MCwiZXhwIjo0ODk0NTcxNjQwLCJyb2xlIjoiYW5vbiJ9.bv0LuM7PP9JxKSrI7XTzw_I2IS7-86L8iqIkHiN-aQI", - debug: true, - ); + await AppRepository().initialize(); - Hive.registerAdapter(WardrobeItemAdapter()); - Hive.registerAdapter(OutfitAdapter()); - Hive.registerAdapter(BrandAdapter()); - Hive.registerAdapter(ItemCategoryAdapter()); + setupLocator(); - runApp(const MyApp()); + runApp(MultiBlocProvider( + providers: [ + BlocProvider(create: (context) => WardrobeCubit()..fetchWardrobeItems()..fetchOutfits()), + BlocProvider(create: (context) => HomeCubit()), + BlocProvider(create: (context) => LookbookCubit()), + BlocProvider(create: (context) => CameraCubit()), + BlocProvider(create: (context) => CategoryCubit()), + ], + child: const MyApp(), + )); } class MyApp extends StatelessWidget { @@ -39,7 +54,7 @@ class MyApp extends StatelessWidget { return MaterialApp.router( title: 'OpenWardrobe', theme: ThemeData( - colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue), + colorScheme: ColorScheme.fromSeed(seedColor: const Color.fromARGB(255, 33, 243, 163)), useMaterial3: true, // Enable Material 3 (modern UI) ), darkTheme: ThemeData.dark(), // Support dark mode diff --git a/lib/models/brand.dart b/lib/models/brand.dart deleted file mode 100644 index f7c9ffc..0000000 --- a/lib/models/brand.dart +++ /dev/null @@ -1,35 +0,0 @@ -import 'package:hive/hive.dart'; - -part 'brand.g.dart'; - -@HiveType(typeId: 2) -class Brand extends HiveObject { - @HiveField(0) - final String id; - - @HiveField(1) - final String name; - - @HiveField(2) - final String userId; - - Brand({ - required this.id, - required this.name, - required this.userId, - }); - - factory Brand.fromJson(Map json) { - return Brand( - id: json['id'], - name: json['name'], - userId: json['user_id'], - ); - } - - Map toJson() => { - 'id': id, - 'name': name, - 'user_id': userId, - }; -} diff --git a/lib/models/brand.g.dart b/lib/models/brand.g.dart deleted file mode 100644 index 73e9920..0000000 --- a/lib/models/brand.g.dart +++ /dev/null @@ -1,47 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'brand.dart'; - -// ************************************************************************** -// TypeAdapterGenerator -// ************************************************************************** - -class BrandAdapter extends TypeAdapter { - @override - final int typeId = 2; - - @override - Brand read(BinaryReader reader) { - final numOfFields = reader.readByte(); - final fields = { - for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), - }; - return Brand( - id: fields[0] as String, - name: fields[1] as String, - userId: fields[2] as String, - ); - } - - @override - void write(BinaryWriter writer, Brand obj) { - writer - ..writeByte(3) - ..writeByte(0) - ..write(obj.id) - ..writeByte(1) - ..write(obj.name) - ..writeByte(2) - ..write(obj.userId); - } - - @override - int get hashCode => typeId.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is BrandAdapter && - runtimeType == other.runtimeType && - typeId == other.typeId; -} diff --git a/lib/models/item_category.dart b/lib/models/item_category.dart deleted file mode 100644 index b4fef56..0000000 --- a/lib/models/item_category.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:hive/hive.dart'; - -part 'item_category.g.dart'; - -@HiveType(typeId: 3) -class ItemCategory extends HiveObject { - @HiveField(0) - final String id; - - @HiveField(1) - final String name; - - ItemCategory({required this.id, required this.name}); - - factory ItemCategory.fromJson(Map json) { - return ItemCategory( - id: json['id'], - name: json['name'], - ); - } - - Map toJson() => { - 'id': id, - 'name': name, - }; -} diff --git a/lib/models/item_category.g.dart b/lib/models/item_category.g.dart deleted file mode 100644 index 2214c4e..0000000 --- a/lib/models/item_category.g.dart +++ /dev/null @@ -1,44 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'item_category.dart'; - -// ************************************************************************** -// TypeAdapterGenerator -// ************************************************************************** - -class ItemCategoryAdapter extends TypeAdapter { - @override - final int typeId = 3; - - @override - ItemCategory read(BinaryReader reader) { - final numOfFields = reader.readByte(); - final fields = { - for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), - }; - return ItemCategory( - id: fields[0] as String, - name: fields[1] as String, - ); - } - - @override - void write(BinaryWriter writer, ItemCategory obj) { - writer - ..writeByte(2) - ..writeByte(0) - ..write(obj.id) - ..writeByte(1) - ..write(obj.name); - } - - @override - int get hashCode => typeId.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ItemCategoryAdapter && - runtimeType == other.runtimeType && - typeId == other.typeId; -} diff --git a/lib/models/outfit.dart b/lib/models/outfit.dart deleted file mode 100644 index 7b599ac..0000000 --- a/lib/models/outfit.dart +++ /dev/null @@ -1,57 +0,0 @@ -import 'package:hive/hive.dart'; - -part 'outfit.g.dart'; - -@HiveType(typeId: 1) -class Outfit extends HiveObject { - @HiveField(0) - final String id; - - @HiveField(1) - final String userId; - - @HiveField(2) - final String name; - - @HiveField(3) - final DateTime createdAt; - - @HiveField(4) - final DateTime updatedAt; - - @HiveField(5) - List wardrobeItemIds; // To link wardrobe items to the outfit - - @HiveField(6) - bool isSynced; - - Outfit({ - required this.id, - required this.userId, - required this.name, - required this.createdAt, - required this.updatedAt, - this.wardrobeItemIds = const [], - this.isSynced = true, - }); - - factory Outfit.fromJson(Map json) { - return Outfit( - id: json['id'], - userId: json['user_id'], - name: json['name'], - createdAt: DateTime.parse(json['created_at']), - updatedAt: DateTime.parse(json['updated_at']), - wardrobeItemIds: List.from(json['wardrobe_item_ids'] ?? []), - ); - } - - Map toJson() => { - 'id': id, - 'user_id': userId, - 'name': name, - 'created_at': createdAt.toIso8601String(), - 'updated_at': updatedAt.toIso8601String(), - 'wardrobe_item_ids': wardrobeItemIds, - }; -} diff --git a/lib/models/outfit.g.dart b/lib/models/outfit.g.dart deleted file mode 100644 index 787cc9e..0000000 --- a/lib/models/outfit.g.dart +++ /dev/null @@ -1,59 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'outfit.dart'; - -// ************************************************************************** -// TypeAdapterGenerator -// ************************************************************************** - -class OutfitAdapter extends TypeAdapter { - @override - final int typeId = 1; - - @override - Outfit read(BinaryReader reader) { - final numOfFields = reader.readByte(); - final fields = { - for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), - }; - return Outfit( - id: fields[0] as String, - userId: fields[1] as String, - name: fields[2] as String, - createdAt: fields[3] as DateTime, - updatedAt: fields[4] as DateTime, - wardrobeItemIds: (fields[5] as List).cast(), - isSynced: fields[6] as bool, - ); - } - - @override - void write(BinaryWriter writer, Outfit obj) { - writer - ..writeByte(7) - ..writeByte(0) - ..write(obj.id) - ..writeByte(1) - ..write(obj.userId) - ..writeByte(2) - ..write(obj.name) - ..writeByte(3) - ..write(obj.createdAt) - ..writeByte(4) - ..write(obj.updatedAt) - ..writeByte(5) - ..write(obj.wardrobeItemIds) - ..writeByte(6) - ..write(obj.isSynced); - } - - @override - int get hashCode => typeId.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is OutfitAdapter && - runtimeType == other.runtimeType && - typeId == other.typeId; -} diff --git a/lib/models/wardrobe_item.dart b/lib/models/wardrobe_item.dart deleted file mode 100644 index 740df39..0000000 --- a/lib/models/wardrobe_item.dart +++ /dev/null @@ -1,65 +0,0 @@ -import 'package:hive/hive.dart'; - -part 'wardrobe_item.g.dart'; - -@HiveType(typeId: 0) -class WardrobeItem extends HiveObject { - @HiveField(0) - final String id; - - @HiveField(1) - final String userId; - - @HiveField(2) - final String name; - - @HiveField(3) - final String? brandId; - - @HiveField(4) - final String? categoryId; - - @HiveField(5) - final DateTime createdAt; - - @HiveField(6) - final DateTime updatedAt; - - @HiveField(7) - bool isSynced; // For tracking sync status with Supabase - - WardrobeItem({ - required this.id, - required this.userId, - required this.name, - this.brandId, - this.categoryId, - required this.createdAt, - required this.updatedAt, - this.isSynced = true, - }); - - // From Supabase JSON - factory WardrobeItem.fromJson(Map json) { - return WardrobeItem( - id: json['id'], - userId: json['user_id'], - name: json['name'], - brandId: json['brand_id'], - categoryId: json['category_id'], - createdAt: DateTime.parse(json['created_at']), - updatedAt: DateTime.parse(json['updated_at']), - ); - } - - // To Supabase JSON - Map toJson() => { - 'id': id, - 'user_id': userId, - 'name': name, - 'brand_id': brandId, - 'category_id': categoryId, - 'created_at': createdAt.toIso8601String(), - 'updated_at': updatedAt.toIso8601String(), - }; -} diff --git a/lib/models/wardrobe_item.g.dart b/lib/models/wardrobe_item.g.dart deleted file mode 100644 index 3bdea0f..0000000 --- a/lib/models/wardrobe_item.g.dart +++ /dev/null @@ -1,62 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'wardrobe_item.dart'; - -// ************************************************************************** -// TypeAdapterGenerator -// ************************************************************************** - -class WardrobeItemAdapter extends TypeAdapter { - @override - final int typeId = 0; - - @override - WardrobeItem read(BinaryReader reader) { - final numOfFields = reader.readByte(); - final fields = { - for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), - }; - return WardrobeItem( - id: fields[0] as String, - userId: fields[1] as String, - name: fields[2] as String, - brandId: fields[3] as String?, - categoryId: fields[4] as String?, - createdAt: fields[5] as DateTime, - updatedAt: fields[6] as DateTime, - isSynced: fields[7] as bool, - ); - } - - @override - void write(BinaryWriter writer, WardrobeItem obj) { - writer - ..writeByte(8) - ..writeByte(0) - ..write(obj.id) - ..writeByte(1) - ..write(obj.userId) - ..writeByte(2) - ..write(obj.name) - ..writeByte(3) - ..write(obj.brandId) - ..writeByte(4) - ..write(obj.categoryId) - ..writeByte(5) - ..write(obj.createdAt) - ..writeByte(6) - ..write(obj.updatedAt) - ..writeByte(7) - ..write(obj.isSynced); - } - - @override - int get hashCode => typeId.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is WardrobeItemAdapter && - runtimeType == other.runtimeType && - typeId == other.typeId; -} diff --git a/lib/presentation/blocs/camera/camera_cubit.dart b/lib/presentation/blocs/camera/camera_cubit.dart new file mode 100644 index 0000000..a914d2e --- /dev/null +++ b/lib/presentation/blocs/camera/camera_cubit.dart @@ -0,0 +1,50 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:camera/camera.dart'; +import 'package:openwardrobe/presentation/blocs/camera/camera_state.dart'; + +class CameraCubit extends Cubit { + CameraCubit() : super(CameraInitial()); + + Future initializeCamera() async { + try { + emit(CameraLoading()); + final cameras = await availableCameras(); + if (cameras.isEmpty) { + emit(const CameraError('No cameras available')); + return; + } + + final controller = CameraController( + cameras[0], + ResolutionPreset.max, + enableAudio: false, + ); + + await controller.initialize(); + emit(CameraReady(controller, cameras)); + } catch (e) { + emit(CameraError('Failed to initialize camera: $e')); + } + } + + Future captureImage() async { + final state = this.state; + if (state is CameraReady) { + try { + final image = await state.controller.takePicture(); + emit(CameraCaptureSuccess(image.path)); + } catch (e) { + emit(CameraError('Failed to capture image: $e')); + } + } + } + + @override + Future close() { + final state = this.state; + if (state is CameraReady) { + state.controller.dispose(); + } + return super.close(); + } +} diff --git a/lib/presentation/blocs/camera/camera_state.dart b/lib/presentation/blocs/camera/camera_state.dart new file mode 100644 index 0000000..aa62449 --- /dev/null +++ b/lib/presentation/blocs/camera/camera_state.dart @@ -0,0 +1,41 @@ +import 'package:equatable/equatable.dart'; +import 'package:camera/camera.dart'; + +sealed class CameraState extends Equatable { + const CameraState(); + + @override + List get props => []; +} + +class CameraInitial extends CameraState {} + +class CameraLoading extends CameraState {} + +class CameraReady extends CameraState { + final CameraController controller; + final List cameras; + + const CameraReady(this.controller, this.cameras); + + @override + List get props => [controller, cameras]; +} + +class CameraCaptureSuccess extends CameraState { + final String imagePath; + + const CameraCaptureSuccess(this.imagePath); + + @override + List get props => [imagePath]; +} + +class CameraError extends CameraState { + final String message; + + const CameraError(this.message); + + @override + List get props => [message]; +} \ No newline at end of file diff --git a/lib/presentation/blocs/category/category_cubit.dart b/lib/presentation/blocs/category/category_cubit.dart new file mode 100644 index 0000000..77010a6 --- /dev/null +++ b/lib/presentation/blocs/category/category_cubit.dart @@ -0,0 +1,55 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:get_it/get_it.dart'; +import 'package:openwardrobe/brick/models/category_summary.model.dart'; +import 'package:openwardrobe/brick/models/item_category.model.dart'; +import 'package:openwardrobe/repositories/app_repository.dart'; +import 'package:openwardrobe/presentation/blocs/category/category_state.dart'; + +class CategoryCubit extends Cubit { + final AppRepository _repository = GetIt.instance(); + + + CategoryCubit() : super(CategoryState()); + + Future loadCategories(String userId) async { + emit(state.copyWith(isLoading: true)); + try { + final categories = await _repository.get(); + + // Create a map to store unique categories by name + final Map uniqueCategories = {}; + for (var category in categories) { + uniqueCategories[category.name] = category; + } + + emit(state.copyWith( + categories: uniqueCategories.values.toList(), + isLoading: false, + selectedCategoryIds: [], + )); + } catch (e) { + emit(state.copyWith( + error: e.toString(), + isLoading: false, + )); + } + } + + void toggleCategory(String categoryId) { + final currentSelected = List.from(state.selectedCategoryIds); + if (currentSelected.contains(categoryId)) { + currentSelected.remove(categoryId); + } else { + currentSelected.add(categoryId); + } + emit(state.copyWith(selectedCategoryIds: currentSelected)); + } + + void clearSelection() { + emit(state.copyWith(selectedCategoryIds: [])); + } + + bool isCategorySelected(String categoryId) { + return state.selectedCategoryIds.contains(categoryId); + } +} \ No newline at end of file diff --git a/lib/presentation/blocs/category/category_state.dart b/lib/presentation/blocs/category/category_state.dart new file mode 100644 index 0000000..ccd6850 --- /dev/null +++ b/lib/presentation/blocs/category/category_state.dart @@ -0,0 +1,29 @@ +import 'package:openwardrobe/brick/models/item_category.model.dart'; + +class CategoryState { + final List categories; + final List selectedCategoryIds; + final bool isLoading; + final String? error; + + CategoryState({ + this.categories = const [], + this.selectedCategoryIds = const [], + this.isLoading = false, + this.error, + }); + + CategoryState copyWith({ + List? categories, + List? selectedCategoryIds, + bool? isLoading, + String? error, + }) { + return CategoryState( + categories: categories ?? this.categories, + selectedCategoryIds: selectedCategoryIds ?? this.selectedCategoryIds, + isLoading: isLoading ?? this.isLoading, + error: error, + ); + } +} \ No newline at end of file diff --git a/lib/presentation/blocs/category_filter/category_filter_cubit.dart b/lib/presentation/blocs/category_filter/category_filter_cubit.dart new file mode 100644 index 0000000..f40794f --- /dev/null +++ b/lib/presentation/blocs/category_filter/category_filter_cubit.dart @@ -0,0 +1,26 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:openwardrobe/presentation/blocs/category_filter/category_filter_state.dart'; + +class CategoryFilterCubit extends Cubit { + CategoryFilterCubit() : super(const CategoryFilterState()); + + void toggleCategory(String categoryId) { + final currentSelected = List.from(state.selectedCategoryIds); + + if (currentSelected.contains(categoryId)) { + currentSelected.remove(categoryId); + } else { + currentSelected.add(categoryId); + } + + emit(state.copyWith(selectedCategoryIds: currentSelected)); + } + + void clearFilter() { + emit(state.copyWith(selectedCategoryIds: const [])); + } + + void setLoading(bool isLoading) { + emit(state.copyWith(isLoading: isLoading)); + } +} \ No newline at end of file diff --git a/lib/presentation/blocs/category_filter/category_filter_state.dart b/lib/presentation/blocs/category_filter/category_filter_state.dart new file mode 100644 index 0000000..9aa5712 --- /dev/null +++ b/lib/presentation/blocs/category_filter/category_filter_state.dart @@ -0,0 +1,33 @@ +import 'package:equatable/equatable.dart'; +import 'package:openwardrobe/brick/models/wardrobe_item.model.dart'; + +class CategoryFilterState extends Equatable { + final List selectedCategoryIds; + final bool isLoading; + + const CategoryFilterState({ + this.selectedCategoryIds = const [], + this.isLoading = false, + }); + + List filterItems(List items) { + if (selectedCategoryIds.isEmpty) return items; + return items.where((item) => + item.itemCategory != null && + selectedCategoryIds.contains(item.itemCategory!.id) + ).toList(); + } + + CategoryFilterState copyWith({ + List? selectedCategoryIds, + bool? isLoading, + }) { + return CategoryFilterState( + selectedCategoryIds: selectedCategoryIds ?? this.selectedCategoryIds, + isLoading: isLoading ?? this.isLoading, + ); + } + + @override + List get props => [selectedCategoryIds, isLoading]; +} \ No newline at end of file diff --git a/lib/presentation/blocs/home/home_cubit.dart b/lib/presentation/blocs/home/home_cubit.dart new file mode 100644 index 0000000..34da94c --- /dev/null +++ b/lib/presentation/blocs/home/home_cubit.dart @@ -0,0 +1,21 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:get_it/get_it.dart'; +import 'package:openwardrobe/repositories/app_repository.dart'; +import 'package:openwardrobe/presentation/blocs/home/home_state.dart'; +import 'package:openwardrobe/brick/models/user_profile.model.dart'; + +class HomeCubit extends Cubit { + final AppRepository _appRepository = GetIt.instance(); + + HomeCubit() : super(HomeInitial()); + + Future fetchUserProfile() async { + try { + emit(HomeLoading()); + final userProfiles = await _appRepository.get(); + emit(HomeUserProfileLoaded(userProfiles)); + } catch (e) { + emit(HomeError('Failed to fetch user profile: $e')); + } + } +} \ No newline at end of file diff --git a/lib/presentation/blocs/home/home_state.dart b/lib/presentation/blocs/home/home_state.dart new file mode 100644 index 0000000..9feac61 --- /dev/null +++ b/lib/presentation/blocs/home/home_state.dart @@ -0,0 +1,31 @@ +import 'package:equatable/equatable.dart'; +import 'package:openwardrobe/brick/models/user_profile.model.dart'; + +sealed class HomeState extends Equatable { + const HomeState(); + + @override + List get props => []; +} + +class HomeInitial extends HomeState {} + +class HomeLoading extends HomeState {} + +class HomeUserProfileLoaded extends HomeState { + final List userProfiles; + + const HomeUserProfileLoaded(this.userProfiles); + + @override + List get props => [userProfiles]; +} + +class HomeError extends HomeState { + final String message; + + const HomeError(this.message); + + @override + List get props => [message]; +} \ No newline at end of file diff --git a/lib/presentation/blocs/lookbook/lookbook_cubit.dart b/lib/presentation/blocs/lookbook/lookbook_cubit.dart new file mode 100644 index 0000000..e96c915 --- /dev/null +++ b/lib/presentation/blocs/lookbook/lookbook_cubit.dart @@ -0,0 +1,21 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:get_it/get_it.dart'; +import 'package:openwardrobe/brick/models/lookbook.model.dart'; +import 'package:openwardrobe/repositories/app_repository.dart'; +import 'package:openwardrobe/presentation/blocs/lookbook/lookbook_state.dart'; + +class LookbookCubit extends Cubit { + final AppRepository _appRepository = GetIt.instance(); + + LookbookCubit() : super(LookbookInitial()); + + Future fetchLookbookItems() async { + try { + emit(LookbookLoading()); + final lookbookItems = await _appRepository.get(); + emit(LookbookLoaded(lookbookItems)); + } catch (e) { + emit(LookbookError('Failed to fetch lookbook items: $e')); + } + } +} \ No newline at end of file diff --git a/lib/presentation/blocs/lookbook/lookbook_state.dart b/lib/presentation/blocs/lookbook/lookbook_state.dart new file mode 100644 index 0000000..b17fe61 --- /dev/null +++ b/lib/presentation/blocs/lookbook/lookbook_state.dart @@ -0,0 +1,31 @@ +import 'package:equatable/equatable.dart'; +import 'package:openwardrobe/brick/models/lookbook.model.dart'; + +sealed class LookbookState extends Equatable { + const LookbookState(); + + @override + List get props => []; +} + +class LookbookInitial extends LookbookState {} + +class LookbookLoading extends LookbookState {} + +class LookbookLoaded extends LookbookState { + final List lookbookItems; + + const LookbookLoaded(this.lookbookItems); + + @override + List get props => [lookbookItems]; +} + +class LookbookError extends LookbookState { + final String message; + + const LookbookError(this.message); + + @override + List get props => [message]; +} \ No newline at end of file diff --git a/lib/presentation/blocs/wardrobe/wardrobe_cubit.dart b/lib/presentation/blocs/wardrobe/wardrobe_cubit.dart new file mode 100644 index 0000000..2160d41 --- /dev/null +++ b/lib/presentation/blocs/wardrobe/wardrobe_cubit.dart @@ -0,0 +1,82 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:get_it/get_it.dart'; +import 'package:openwardrobe/brick/models/outfit.model.dart'; +import 'package:openwardrobe/brick/models/wardrobe_item.model.dart'; +import 'package:openwardrobe/repositories/app_repository.dart'; +import 'package:openwardrobe/presentation/blocs/wardrobe/wardrobe_state.dart'; + +class WardrobeCubit extends Cubit { + final AppRepository _appRepository = GetIt.instance(); + + WardrobeCubit() : super(const WardrobeInitial()); + + Future fetchWardrobeItems() async { + if (state is! WardrobeLoading) { + emit(const WardrobeLoading()); + } + + try { + final items = await _appRepository.get(); + final currentOutfits = state is WardrobeItemsAndOutfitsLoaded + ? (state as WardrobeItemsAndOutfitsLoaded).outfits + : []; + + emit(WardrobeItemsAndOutfitsLoaded( + items: items, + outfits: List.from(currentOutfits), + )); + } catch (e) { + emit(WardrobeError('Failed to fetch wardrobe items: $e')); + } + } + + void clearCategoryFilter() { + if (state is WardrobeItemsAndOutfitsLoaded) { + final currentState = state as WardrobeItemsAndOutfitsLoaded; + emit(WardrobeItemsAndOutfitsLoaded( + items: currentState.items, + outfits: currentState.outfits, + selectedCategoryIds: [], + )); + } + } + +void toggleCategory(String categoryId) { + if (state is WardrobeItemsAndOutfitsLoaded) { + final currentState = state as WardrobeItemsAndOutfitsLoaded; + final selectedCategories = List.from(currentState.selectedCategoryIds ?? []); + + if (selectedCategories.contains(categoryId)) { + selectedCategories.remove(categoryId); + } else { + selectedCategories.add(categoryId); + } + + emit(WardrobeItemsAndOutfitsLoaded( + items: currentState.items, + outfits: currentState.outfits, + selectedCategoryIds: selectedCategories, + )); + } +} + + Future fetchOutfits() async { + if (state is! WardrobeLoading) { + emit(const WardrobeLoading()); + } + + try { + final outfits = await _appRepository.get(); + final currentItems = state is WardrobeItemsAndOutfitsLoaded + ? (state as WardrobeItemsAndOutfitsLoaded).items + : []; + + emit(WardrobeItemsAndOutfitsLoaded( + items: List.from(currentItems), + outfits: outfits, + )); + } catch (e) { + emit(WardrobeError('Failed to fetch outfits: $e')); + } + } +} \ No newline at end of file diff --git a/lib/presentation/blocs/wardrobe/wardrobe_state.dart b/lib/presentation/blocs/wardrobe/wardrobe_state.dart new file mode 100644 index 0000000..a936aca --- /dev/null +++ b/lib/presentation/blocs/wardrobe/wardrobe_state.dart @@ -0,0 +1,88 @@ +import 'package:equatable/equatable.dart'; +import 'package:openwardrobe/brick/models/wardrobe_item.model.dart'; +import 'package:openwardrobe/brick/models/outfit.model.dart'; + +sealed class WardrobeState extends Equatable { + final List selectedCategoryIds; + + const WardrobeState({this.selectedCategoryIds = const []}); + + @override + List get props => [selectedCategoryIds]; + + List filterItemsByCategory(List items) { + if (selectedCategoryIds.isEmpty) return items; + return items.where((item) => + item.itemCategory != null && + selectedCategoryIds.contains(item.itemCategory!.id) + ).toList(); + } + + // Outfits are not affected by category filtering + List getOutfits(List outfits) => outfits; +} + +class WardrobeInitial extends WardrobeState { + const WardrobeInitial({super.selectedCategoryIds}); +} + +class WardrobeLoading extends WardrobeState { + const WardrobeLoading({super.selectedCategoryIds}); +} + +class WardrobeItemsAndOutfitsLoaded extends WardrobeState { + final List items; + final List outfits; + + const WardrobeItemsAndOutfitsLoaded({ + required this.items, + required this.outfits, + super.selectedCategoryIds, + }); + + @override + List get props => [items, outfits, selectedCategoryIds]; + + WardrobeItemsAndOutfitsLoaded copyWith({ + List? items, + List? outfits, + List? selectedCategoryIds, + }) { + return WardrobeItemsAndOutfitsLoaded( + items: items ?? this.items, + outfits: outfits ?? this.outfits, + selectedCategoryIds: selectedCategoryIds ?? this.selectedCategoryIds, + ); + } + + List get filteredItems => filterItemsByCategory(items); +} + +class WardrobeItemsLoaded extends WardrobeState { + final List items; + + const WardrobeItemsLoaded(this.items, {super.selectedCategoryIds}); + + @override + List get props => [items, selectedCategoryIds]; + + List get filteredItems => filterItemsByCategory(items); +} + +class OutfitsLoaded extends WardrobeState { + final List outfits; + + const OutfitsLoaded(this.outfits, {super.selectedCategoryIds}); + + @override + List get props => [outfits, selectedCategoryIds]; +} + +class WardrobeError extends WardrobeState { + final String message; + + const WardrobeError(this.message, {super.selectedCategoryIds}); + + @override + List get props => [message, selectedCategoryIds]; +} \ No newline at end of file diff --git a/lib/presentation/blocs/wardrobe_item/wardrobe_item_cubit.dart b/lib/presentation/blocs/wardrobe_item/wardrobe_item_cubit.dart new file mode 100644 index 0000000..76d2887 --- /dev/null +++ b/lib/presentation/blocs/wardrobe_item/wardrobe_item_cubit.dart @@ -0,0 +1,44 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:get_it/get_it.dart'; +import 'package:openwardrobe/brick/models/wardrobe_item.model.dart'; +import 'package:openwardrobe/repositories/app_repository.dart'; +import 'package:openwardrobe/presentation/blocs/wardrobe_item/wardrobe_item_state.dart'; + +class WardrobeItemCubit extends Cubit { + final AppRepository _appRepository = GetIt.instance(); + + WardrobeItemCubit() : super(WardrobeItemInitial()); + + Future loadWardrobeItem(String itemId) async { + emit(WardrobeItemLoading()); + try { + final items = await _appRepository.get(); + final item = items.firstWhere((item) => item.id == itemId); + emit(WardrobeItemLoaded(item: item)); + } catch (e) { + emit(WardrobeItemError('Failed to load wardrobe item: $e')); + } + } + + void toggleEditing() { + if (state is WardrobeItemLoaded) { + final currentState = state as WardrobeItemLoaded; + emit(WardrobeItemLoaded( + item: currentState.item, + isEditing: !currentState.isEditing, + )); + } + } + + Future updateWardrobeItem(WardrobeItem updatedItem) async { + if (state is WardrobeItemLoaded) { + emit(WardrobeItemLoading()); + try { + await _appRepository.upsert(updatedItem); + emit(WardrobeItemLoaded(item: updatedItem)); + } catch (e) { + emit(WardrobeItemError('Failed to update wardrobe item: $e')); + } + } + } +} \ No newline at end of file diff --git a/lib/presentation/blocs/wardrobe_item/wardrobe_item_state.dart b/lib/presentation/blocs/wardrobe_item/wardrobe_item_state.dart new file mode 100644 index 0000000..c73d007 --- /dev/null +++ b/lib/presentation/blocs/wardrobe_item/wardrobe_item_state.dart @@ -0,0 +1,25 @@ +import 'package:openwardrobe/brick/models/wardrobe_item.model.dart'; + +abstract class WardrobeItemState {} + +class WardrobeItemInitial extends WardrobeItemState {} + +class WardrobeItemLoading extends WardrobeItemState {} + +class WardrobeItemLoaded extends WardrobeItemState { + final WardrobeItem item; + final bool isEditing; + + WardrobeItemLoaded({ + required this.item, + this.isEditing = false, + }); +} + +class WardrobeItemError extends WardrobeItemState { + final String message; + + WardrobeItemError(this.message); +} + +class WardrobeItemDeleted extends WardrobeItemState {} \ No newline at end of file diff --git a/lib/repositories/app_repository.dart b/lib/repositories/app_repository.dart new file mode 100644 index 0000000..ffde7d6 --- /dev/null +++ b/lib/repositories/app_repository.dart @@ -0,0 +1,55 @@ +// Saved in my_app/lib/src/brick/repository.dart +import 'package:brick_offline_first_with_supabase/brick_offline_first_with_supabase.dart'; +import 'package:brick_sqlite/brick_sqlite.dart'; +import 'package:brick_sqlite/memory_cache_provider.dart'; +// This hide is for Brick's @Supabase annotation; in most cases, +// supabase_flutter **will not** be imported in application code. +import 'package:brick_supabase/brick_supabase.dart' hide Supabase; +import 'package:openwardrobe/brick/db/schema.g.dart'; +import 'package:sqflite_common/sqlite_api.dart'; +import 'package:supabase_flutter/supabase_flutter.dart'; + +import 'package:openwardrobe/brick/brick.g.dart'; + +class AppRepository extends OfflineFirstWithSupabaseRepository { + static late AppRepository? _instance; + + AppRepository._({ + required super.supabaseProvider, + required super.sqliteProvider, + required super.migrations, + required super.offlineRequestQueue, + required super.memoryCacheProvider, + }); + + factory AppRepository() => _instance!; + + static Future configure(DatabaseFactory databaseFactory) async { + final (client, queue) = OfflineFirstWithSupabaseRepository.clientQueue( + databaseFactory: databaseFactory, + ); + + await Supabase.initialize( + url: "https://openwdsupdemo.sug.lol", + anonKey: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzdXBhYmFzZSIsImlhdCI6MTczODg5ODA0MCwiZXhwIjo0ODk0NTcxNjQwLCJyb2xlIjoiYW5vbiJ9.bv0LuM7PP9JxKSrI7XTzw_I2IS7-86L8iqIkHiN-aQI", + debug: true, + ); + + final provider = SupabaseProvider( + Supabase.instance.client, + modelDictionary: supabaseModelDictionary, + ); + + _instance = AppRepository._( + supabaseProvider: provider, + sqliteProvider: SqliteProvider( + 'openwd.sqlite', + databaseFactory: databaseFactory, + modelDictionary: sqliteModelDictionary, + ), + migrations: migrations, + offlineRequestQueue: queue, + memoryCacheProvider: MemoryCacheProvider(), + ); + } +} diff --git a/lib/repositories/wardrobe_repository.dart b/lib/repositories/wardrobe_repository.dart deleted file mode 100644 index 41d98b5..0000000 --- a/lib/repositories/wardrobe_repository.dart +++ /dev/null @@ -1,76 +0,0 @@ -import 'package:supabase_flutter/supabase_flutter.dart'; -import 'package:hive/hive.dart'; -import '../models/wardrobe_item.dart'; -import 'package:connectivity_plus/connectivity_plus.dart'; - -class WardrobeRepository { - final SupabaseClient supabaseClient = Supabase.instance.client; - - // Fetch items from Supabase or from local storage if offline - Future> fetchItems() async { - final isOnline = await _checkConnectivity(); - if (isOnline) { - try { - final response = await supabaseClient.from('wardrobe').select(); // Gebruik get() in plaats van execute() - final items = (response as List).map((item) => WardrobeItem.fromJson(item)).toList(); - await _cacheItemsLocally(items); // Cache de items lokaal - return items; - } catch (error) { - print('Error fetching items: $error'); - return await _fetchItemsFromLocal(); // Haal items op uit lokale opslag - } - } else { - return await _fetchItemsFromLocal(); // Haal items op uit lokale opslag - } - } - - // Voeg een nieuw item toe, afhankelijk van netwerkstatus - Future addItem(WardrobeItem item) async { - final isOnline = await _checkConnectivity(); - if (isOnline) { - await supabaseClient.from('wardrobe').insert(item.toJson()).select(); // Gebruik select() om de insert te bevestigen - } else { - await _saveItemLocally(item, isSynced: false); // Opslaan als niet-gesynchroniseerd - } - } - - // Synchroniseer lokale wijzigingen met Supabase - Future syncLocalChanges() async { - final box = await Hive.openBox('wardrobe'); - final unsyncedItems = box.values.where((item) => !item.isSynced).toList(); - - for (var item in unsyncedItems) { - await supabaseClient.from('wardrobe').insert(item.toJson()).select(); - item.isSynced = true; - await item.save(); // Update lokale opslagstatus - } - } - - // Cache items lokaal met Hive - Future _cacheItemsLocally(List items) async { - final box = await Hive.openBox('wardrobe'); - await box.clear(); - for (var item in items) { - await box.put(item.id, item); - } - } - - // Haal items op uit lokale Hive opslag - Future> _fetchItemsFromLocal() async { - final box = await Hive.openBox('wardrobe'); - return box.values.toList(); - } - - // Controleer netwerkverbinding - Future _checkConnectivity() async { - final connectivityResult = await Connectivity().checkConnectivity(); - return connectivityResult != ConnectivityResult.none; - } - - // Voeg ontbrekende methode toe voor lokaal opslaan van items - Future _saveItemLocally(WardrobeItem item, {bool isSynced = true}) async { - final box = await Hive.openBox('wardrobe'); - item.isSynced = isSynced; - await box.put(item.id, item); - } -} diff --git a/lib/router/app_router.dart b/lib/router/app_router.dart index ed1d2fc..38f4961 100644 --- a/lib/router/app_router.dart +++ b/lib/router/app_router.dart @@ -1,50 +1,106 @@ import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; +import 'package:openwardrobe/brick/models/lookbook.model.dart'; +import 'package:openwardrobe/ui/screens/camera/page.dart'; +import 'package:openwardrobe/ui/screens/lookbook/page.dart'; +import 'package:openwardrobe/ui/screens/wardrobe/settings/page.dart'; +import 'package:openwardrobe/ui/screens/wardrobe_item/page.dart'; import 'package:supabase_flutter/supabase_flutter.dart'; -import '../ui/screens/home_page.dart'; -import '../ui/screens/auth_page.dart'; -import '../ui/widgets/tab_scaffold.dart'; +import '../ui/screens/auth/page.dart'; +import '../ui/screens/home/page.dart'; +import '../ui/screens/wardrobe/page.dart'; +import '../ui/screens/wardrobe/add/page.dart'; +import '../ui/widgets/scaffold_with_navbar.dart'; +import '../ui/screens/wardrobe/settings/account_page.dart'; class AppRouter { + static final GlobalKey _rootNavigatorKey = + GlobalKey(); + static final GoRouter router = GoRouter( - initialLocation: '/home', - - // Handle redirection based on auth status + initialLocation: '/', + navigatorKey: _rootNavigatorKey, redirect: (BuildContext context, GoRouterState state) { final session = Supabase.instance.client.auth.currentSession; final isLoggedIn = session != null; final isLoggingIn = state.uri.toString() == '/auth'; if (!isLoggedIn && !isLoggingIn) { - return '/auth'; // Redirect unauthenticated users to login + return '/auth'; } else if (isLoggedIn && isLoggingIn) { - return '/home'; // Redirect logged-in users away from login + return '/'; } - return null; // No redirection needed + return null; }, - routes: [ - // Login Route (accessible without authentication) GoRoute( path: '/auth', name: 'Auth', - pageBuilder: (context, state) => NoTransitionPage(child: AuthScreen()), + builder: (context, state) => const AuthScreen(), ), - - // Protected Routes (require authentication) - ShellRoute( - builder: (context, state, child) { - return TabScaffold(child: child); + GoRoute( + path: '/camera', + name: 'Add Item', + builder: (context, state) => const CameraScreen(), + ), + GoRoute( + path: '/settings/account', + name: 'SettingsAccount', + builder: (context, state) => const SettingsAccountPage(), + ), + GoRoute( + path: '/wardrobe/item/:id', + name: 'WardrobeItem', + builder: (context, state) => WardrobeItemPage( + itemId: state.pathParameters['id']!, + ), + ), + StatefulShellRoute.indexedStack( + builder: (context, state, navigationShell) { + return ScaffoldWithNavBar(navigationShell: navigationShell); }, - routes: [ - GoRoute( - path: '/home', - name: 'Home', - pageBuilder: (context, state) => NoTransitionPage(child: HomeScreen()), + branches: [ + StatefulShellBranch( + routes: [ + GoRoute( + path: '/', + name: 'Home', + builder: (context, state) => HomeScreen(), + ), + ], + ), + + StatefulShellBranch( + routes: [ + GoRoute( + path: '/wardrobe', + name: 'Wardrobe', + builder: (context, state) => WardrobeScreen(), + ), + ], ), - // We still need to wardrobe, analytics, and settings routes, and subroutes + + StatefulShellBranch( + routes: [ + GoRoute( + path: '/lookbook', + name: 'Lookbook', + builder: (context, state) => LookbookScreen(), + ), + ], + ), + + StatefulShellBranch( + routes: [ + GoRoute( + path: '/settings', + name: 'Settings', + builder: (context, state) => const SettingsPage(), + ), + ], + ), ], ), ], diff --git a/lib/services/wardrobe_service.dart b/lib/services/wardrobe_service.dart deleted file mode 100644 index 749c3d5..0000000 --- a/lib/services/wardrobe_service.dart +++ /dev/null @@ -1,20 +0,0 @@ -import '../repositories/wardrobe_repository.dart'; -import '../models/wardrobe_item.dart'; - -class WardrobeService { - final WardrobeRepository wardrobeRepository; - - WardrobeService(this.wardrobeRepository); - - Future> getWardrobeItems() async { - return await wardrobeRepository.fetchItems(); - } - - Future addWardrobeItem(WardrobeItem item) async { - await wardrobeRepository.addItem(item); - } - - Future syncWardrobe() async { - await wardrobeRepository.syncLocalChanges(); - } -} diff --git a/lib/ui/screens/auth_page.dart b/lib/ui/screens/auth/page.dart similarity index 90% rename from lib/ui/screens/auth_page.dart rename to lib/ui/screens/auth/page.dart index af1f05a..95d7476 100644 --- a/lib/ui/screens/auth_page.dart +++ b/lib/ui/screens/auth/page.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:supabase_auth_ui/supabase_auth_ui.dart'; -import 'package:supabase_flutter/supabase_flutter.dart'; import 'package:go_router/go_router.dart'; class AuthScreen extends StatelessWidget { @@ -16,10 +15,10 @@ class AuthScreen extends StatelessWidget { // Logo and auth UI child: SupaEmailAuth( - redirectTo: '/home', // Redirect to home after successful login + redirectTo: '/', // Redirect to home after successful login onSignInComplete: (AuthResponse response) { if (response.session != null) { - context.go('/home'); + context.go('/'); } else { ScaffoldMessenger.of(context).showSnackBar( const SnackBar(content: Text('Login failed. Please try again.')), @@ -50,4 +49,4 @@ class AuthScreen extends StatelessWidget { ), ); } -} +} \ No newline at end of file diff --git a/lib/ui/screens/camera/page.dart b/lib/ui/screens/camera/page.dart new file mode 100644 index 0000000..d97eeca --- /dev/null +++ b/lib/ui/screens/camera/page.dart @@ -0,0 +1,273 @@ +import 'dart:io'; +import 'package:camera/camera.dart'; +import 'package:file_picker/file_picker.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:go_router/go_router.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:flutter/foundation.dart' show Uint8List, kIsWeb; +import 'package:get_it/get_it.dart'; +import 'package:openwardrobe/repositories/app_repository.dart'; +import 'package:openwardrobe/brick/models/wardrobe_item.model.dart'; +import 'package:openwardrobe/presentation/blocs/camera/camera_cubit.dart'; +import 'package:openwardrobe/presentation/blocs/camera/camera_state.dart'; +import 'package:supabase_flutter/supabase_flutter.dart'; + +class CameraScreen extends StatefulWidget { + const CameraScreen({Key? key}) : super(key: key); + + @override + _CameraScreenState createState() => _CameraScreenState(); +} + +class _CameraScreenState extends State { + final AppRepository _appRepository = GetIt.instance(); + final supabase = Supabase.instance.client; + bool get isWeb => kIsWeb; + + List _selectedImages = []; + List _selectedWebImages = []; + List _selectedWebNames = []; + + @override + void initState() { + super.initState(); + if (!isWeb) { + context.read().initializeCamera(); + } + } + + Future _pickImage({bool fromGallery = false}) async { + if (isWeb) { + final result = await FilePicker.platform.pickFiles( + type: FileType.image, + allowMultiple: true, // Allows multiple file selection + ); + + if (result != null && result.files.isNotEmpty) { + for (var file in result.files) { + if (file.bytes != null) { + setState(() { + _selectedWebImages.add(file.bytes!); + _selectedWebNames.add(file.name); + }); + } + } + } + } else { + final picker = ImagePicker(); + final pickedFile = await picker.pickImage( + source: fromGallery ? ImageSource.gallery : ImageSource.camera, + ); + + if (pickedFile != null) { + setState(() { + _selectedImages.add(File(pickedFile.path)); + }); + } + } + } + + void _removeImage(int index) { + setState(() { + if (isWeb) { + _selectedWebImages.removeAt(index); + _selectedWebNames.removeAt(index); + } else { + _selectedImages.removeAt(index); + } + }); + } + + Future _confirmUpload() async { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: const Text('Confirm Upload'), + content: const Text('Are you sure you want to upload these wardrobe items?'), + actions: [ + TextButton( + onPressed: () => context.pop(), + child: const Text('Cancel'), + ), + ElevatedButton( + onPressed: () { + _submitImages(); + context.pop(); + + }, + child: const Text('Upload'), + ), + ], + ); + }, + ); + } +Future _submitImages() async { + try { + final userId = supabase.auth.currentUser?.id; + if (userId == null) throw Exception("User not authenticated"); + + if (isWeb) { + for (int i = 0; i < _selectedWebImages.length; i++) { + final bytes = _selectedWebImages[i]; + final fileName = _selectedWebNames[i]; + final String path = + '$userId/${DateTime.now().toIso8601String()}_$fileName'; + print("Uploading (web): $path"); // Log path + + final response = await supabase.storage + .from('wardrobe_items') + .uploadBinary( + path, + bytes, + fileOptions: FileOptions(contentType: 'image/jpeg'), + ); + print("Upload response (web): $response"); + } + } else { + for (var imageFile in _selectedImages) { + final fileName = imageFile.path.split('/').last; + final String path = + '$userId/${DateTime.now().toIso8601String()}_$fileName'; + print("Uploading (mobile): $path"); // Log path + + final response = await supabase.storage + .from('wardrobe_items') + .upload( + path, + imageFile, + fileOptions: FileOptions(contentType: 'image/jpeg'), + ); + print("Upload response (mobile): $response"); + } + } + + setState(() { + _selectedImages.clear(); + _selectedWebImages.clear(); + _selectedWebNames.clear(); + }); + + if (mounted) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Successfully uploaded to wardrobe!')), + ); + + + } + } catch (e) { + print("Error uploading images: $e"); // Log error details + if (mounted) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text('Error uploading images: ${e.toString()}')), + ); + } + } +} + + @override + void dispose() { + context.read().close(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Add Wardrobe Item'), + centerTitle: true, + leading: IconButton( + icon: const Icon(Icons.arrow_back), + onPressed: () => context.pop() + ), + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: _selectedImages.isNotEmpty || _selectedWebImages.isNotEmpty + ? Padding( + padding: const EdgeInsets.all(10), + child: GridView.builder( + itemCount: isWeb ? _selectedWebImages.length : _selectedImages.length, + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: 10, + mainAxisSpacing: 10, + ), + itemBuilder: (context, index) { + return Stack( + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(10), + child: isWeb + ? Image.memory(_selectedWebImages[index], fit: BoxFit.cover, width: double.infinity) + : Image.file(_selectedImages[index], fit: BoxFit.cover, width: double.infinity), + ), + Positioned( + top: 5, + right: 5, + child: CircleAvatar( + backgroundColor: Colors.black54, + child: IconButton( + icon: const Icon(Icons.close, color: Colors.white, size: 18), + onPressed: () => _removeImage(index), + ), + ), + ), + ], + ); + }, + ), + ) + : Column( + mainAxisAlignment: MainAxisAlignment.center, + children: const [ + Icon(Icons.cloud_upload, size: 80, color: Colors.grey), + SizedBox(height: 10), + Text("No images selected", style: TextStyle(fontSize: 16)), + Text("Choose an option below to add an item to your wardrobe"), + ], + ), + ), + const SizedBox(height: 20), + if (isWeb) + ElevatedButton.icon( + onPressed: () => _pickImage(), + icon: const Icon(Icons.upload), + label: const Text('Select Images from Computer'), + ) + else + Column( + children: [ + ElevatedButton.icon( + onPressed: () => _pickImage(fromGallery: true), + icon: const Icon(Icons.photo_library), + label: const Text('Choose from Gallery'), + ), + const SizedBox(height: 10), + ElevatedButton.icon( + onPressed: () => _pickImage(), + icon: const Icon(Icons.camera_alt), + label: const Text('Take a Photo'), + ), + ], + ), + const SizedBox(height: 20), + if (_selectedImages.isNotEmpty || _selectedWebImages.isNotEmpty) + ElevatedButton.icon( + onPressed: _confirmUpload, + icon: const Icon(Icons.cloud_upload), + label: const Text('Submit to Wardrobe'), + ), + const SizedBox(height: 30), + ], + ), + ), + ); + } +} diff --git a/lib/ui/screens/home/page.dart b/lib/ui/screens/home/page.dart new file mode 100644 index 0000000..511f1a9 --- /dev/null +++ b/lib/ui/screens/home/page.dart @@ -0,0 +1,97 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:go_router/go_router.dart'; +import 'package:openwardrobe/presentation/blocs/home/home_cubit.dart'; +import 'package:openwardrobe/presentation/blocs/home/home_state.dart'; +import 'package:openwardrobe/ui/widgets/dashboard/link.dart'; +import 'package:openwardrobe/ui/widgets/user_profile/user_profile_component.dart'; + +class HomeScreen extends StatelessWidget { + const HomeScreen({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (context) => HomeCubit()..fetchUserProfile(), + child: Scaffold( + appBar: AppBar( + title: const Text('Home'), + ), + body: SingleChildScrollView( + child: Align( + alignment: Alignment.topCenter, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Column( + children: [ + const SizedBox(height: 20), + ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 500), + child: BlocBuilder( + builder: (context, state) { + return switch (state) { + HomeLoading() => const Center(child: CircularProgressIndicator()), + HomeError(message: var message) => Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Icon(Icons.error_outline, size: 48, color: Colors.red), + const SizedBox(height: 16), + Text('Error: $message'), + ], + ), + ), + HomeUserProfileLoaded(userProfiles: var profiles) when profiles.isEmpty => + const Center(child: Text('No profile found')), + HomeUserProfileLoaded(userProfiles: var profiles) => + UserProfileComponent(item: profiles.first), + _ => const SizedBox(), + }; + }, + ), + ), + const SizedBox(height: 20), + ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 500), + child: Wrap( + spacing: 16, + runSpacing: 16, + alignment: WrapAlignment.center, + children: [ + DashboardLink( + text: 'Add Items', + icon: Icons.add, + color: Colors.blue, + onTap: () => context.push("/camera"), + ), + DashboardLink( + text: 'Create Outfit', + color: Colors.red, + icon: Icons.list, + onTap: () => context.push("/wardrobe"), + ), + DashboardLink( + text: 'Schedule Outfit', + color: Colors.green, + icon: Icons.calendar_today, + onTap: () {}, + ), + DashboardLink( + text: 'View Stats', + color: Colors.purple, + icon: Icons.bar_chart, + onTap: () {}, + ), + ], + ), + ), + const SizedBox(height: 20), + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/ui/screens/home_page.dart b/lib/ui/screens/home_page.dart deleted file mode 100644 index 1a8d525..0000000 --- a/lib/ui/screens/home_page.dart +++ /dev/null @@ -1,68 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:supabase_flutter/supabase_flutter.dart'; -import 'package:go_router/go_router.dart'; -// import waardrobe service from this project -import 'package:openwardrobe/services/wardrobe_service.dart'; -import 'package:openwardrobe/repositories/wardrobe_repository.dart'; -import 'package:openwardrobe/models/wardrobe_item.dart'; - - -class HomeScreen extends StatelessWidget { - const HomeScreen({super.key}); - Future> _getClothes() async { - final wardrobeService = WardrobeService(WardrobeRepository()); - return await wardrobeService.getWardrobeItems(); - } - - @override - Widget build(BuildContext context) { - final supabase = Supabase.instance.client; - - - - - Future _signOut() async { - await supabase.auth.signOut(); - if (context.mounted) context.go('/'); - } - - return Scaffold( - appBar: AppBar( - title: const Text('Home'), - actions: [ - IconButton(icon: const Icon(Icons.logout), onPressed: _signOut), - ], - ), - body: Center( - // A dashboard with all the wardrobe items - child: FutureBuilder>( - future: _getClothes(), - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return const CircularProgressIndicator(); - } else if (snapshot.hasError) { - return Text('Error: ${snapshot.error}'); - } else if (snapshot.hasData) { - final clothes = snapshot.data; - return ListView.builder( - itemCount: clothes?.length ?? 0, - itemBuilder: (context, index) { - final item = clothes![index]; - return ListTile( - title: Text(item.name), - ); - }, - ); - } else { - return const Text('No data'); - } - }, - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: () => context.go('/wardrobe'), - child: const Icon(Icons.add), - ), - ); - } -} diff --git a/lib/ui/screens/lookbook/page.dart b/lib/ui/screens/lookbook/page.dart new file mode 100644 index 0000000..9dfaf13 --- /dev/null +++ b/lib/ui/screens/lookbook/page.dart @@ -0,0 +1,81 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:openwardrobe/brick/models/lookbook.model.dart'; +import 'package:openwardrobe/presentation/blocs/lookbook/lookbook_cubit.dart'; +import 'package:openwardrobe/presentation/blocs/lookbook/lookbook_state.dart'; +import 'package:openwardrobe/ui/widgets/lookbook/lookbook_component.dart'; + +class LookbookScreen extends StatefulWidget { + const LookbookScreen({super.key}); + + @override + _LookbookScreenState createState() => _LookbookScreenState(); +} + +class _LookbookScreenState extends State { + @override + void initState() { + super.initState(); + context.read().fetchLookbookItems(); + } + + @override + void dispose() { + context.read().close(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Lookbook'), + ), + body: SingleChildScrollView( + child: IntrinsicHeight( + child: Align( + alignment: Alignment.topCenter, + child: Column( + children: [ + const SizedBox(height: 20), + Expanded( + child: ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 500), + child: BlocBuilder( + builder: (context, state) { + return switch (state) { + LookbookLoading() => const Center( + child: CircularProgressIndicator(), + ), + LookbookError(message: var message) => Center( + child: Text('Error: $message'), + ), + LookbookLoaded(lookbookItems: final items) => items.isEmpty + ? const Center(child: Text('No items found')) + : SingleChildScrollView( + child: Wrap( + spacing: 8.0, + runSpacing: 8.0, + alignment: WrapAlignment.start, + children: items.map((item) => Container( + width: 150, + child: LookbookComponent(item: item), + )).toList(), + ), + ), + LookbookInitial() => const Center( + child: CircularProgressIndicator(), + ), + }; + }, + ), + ), + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/ui/screens/lookbook_page.dart b/lib/ui/screens/lookbook_page.dart new file mode 100644 index 0000000..a7469b3 --- /dev/null +++ b/lib/ui/screens/lookbook_page.dart @@ -0,0 +1,58 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:openwardrobe/presentation/blocs/lookbook/lookbook_cubit.dart'; +import 'package:openwardrobe/presentation/blocs/lookbook/lookbook_state.dart'; + +class LookbookPage extends StatelessWidget { + const LookbookPage({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (context) => LookbookCubit()..fetchLookbookItems(), + child: Scaffold( + appBar: AppBar( + title: const Text('Lookbook'), + ), + body: BlocBuilder( + builder: (context, state) { + return switch (state) { + LookbookInitial() => const Center( + child: Text('Initialize your lookbook'), + ), + LookbookLoading() => const Center( + child: CircularProgressIndicator(), + ), + LookbookLoaded(lookbookItems: final items) => items.isEmpty + ? const Center( + child: Text('No lookbook items yet'), + ) + : ListView.builder( + itemCount: items.length, + itemBuilder: (context, index) { + final item = items[index]; + return ListTile( + title: Text(item.title ?? 'Unnamed Look'), + + onTap: () { + // TODO: Navigate to lookbook item detail page + }, + ); + }, + ), + LookbookError(message: final message) => Center( + child: Text('Error: $message'), + ), + }; + }, + ), + floatingActionButton: FloatingActionButton( + onPressed: () { + // TODO: Implement add new lookbook item + }, + child: const Icon(Icons.add), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/ui/screens/settings/page.dart b/lib/ui/screens/settings/page.dart new file mode 100644 index 0000000..ee30792 --- /dev/null +++ b/lib/ui/screens/settings/page.dart @@ -0,0 +1,63 @@ +import 'package:flutter/material.dart'; +import 'package:get_it/get_it.dart'; + +class SettingsScreen extends StatefulWidget { + const SettingsScreen({Key? key}) : super(key: key); + + @override + _SettingsScreenState createState() => _SettingsScreenState(); +} + +class _SettingsScreenState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Settings'), + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'Settings', + style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), + ), + const SizedBox(height: 20), + ListTile( + title: const Text('Account'), + onTap: () { + // Navigate to account settings + }, + ), + ListTile( + title: const Text('Notifications'), + onTap: () { + // Navigate to notification settings + }, + ), + ListTile( + title: const Text('Privacy'), + onTap: () { + // Navigate to privacy settings + }, + ), + ListTile( + title: const Text('About'), + onTap: () { + // Navigate to about page + }, + ), + ], + ), + ), + ); + } + + @override + void dispose() { + // Dispose of any resources or controllers to prevent memory leaks + super.dispose(); + } +} diff --git a/lib/ui/screens/wardrobe.dart b/lib/ui/screens/wardrobe/add/page.dart similarity index 100% rename from lib/ui/screens/wardrobe.dart rename to lib/ui/screens/wardrobe/add/page.dart diff --git a/lib/ui/screens/wardrobe/page.dart b/lib/ui/screens/wardrobe/page.dart new file mode 100644 index 0000000..4db11c1 --- /dev/null +++ b/lib/ui/screens/wardrobe/page.dart @@ -0,0 +1,179 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:go_router/go_router.dart'; +import 'package:openwardrobe/presentation/blocs/category/category_cubit.dart'; +import 'package:openwardrobe/presentation/blocs/category/category_state.dart'; +import 'package:openwardrobe/presentation/blocs/wardrobe/wardrobe_cubit.dart'; +import 'package:openwardrobe/presentation/blocs/wardrobe/wardrobe_state.dart'; +import 'package:openwardrobe/ui/widgets/category/category_component.dart'; +import 'package:openwardrobe/ui/widgets/outfit/outfit_component.dart'; +import 'package:openwardrobe/ui/widgets/wardrobe_item/wardrobe_item_component.dart'; + +class WardrobeScreen extends StatefulWidget { + const WardrobeScreen({super.key}); + + @override + State createState() => _WardrobeScreenState(); +} + +class _WardrobeScreenState extends State { + @override + void initState() { + super.initState(); + // Load categories first, then wardrobe items and outfits + _initializeData(); + } + + Future _initializeData() async { + final categoryCubit = context.read(); + final wardrobeCubit = context.read(); + + await categoryCubit.loadCategories(''); + await Future.wait([ + wardrobeCubit.fetchWardrobeItems(), + wardrobeCubit.fetchOutfits(), + ]); + } + + @override + void dispose() { + // Dispose of any resources or controllers to prevent memory leaks + context.read().close(); + context.read().close(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: const Text('Wardrobe')), + body: BlocBuilder( + builder: (context, state) { + if (state is WardrobeLoading) { + return const Center(child: CircularProgressIndicator()); + } else if (state is WardrobeError) { + return Center(child: Text('Error: ${state.message}')); + } else if (state is WardrobeItemsAndOutfitsLoaded) { + final items = state.items; + final outfits = state.outfits; + + return SingleChildScrollView( + child: Align( + alignment: Alignment.topCenter, + child: Container( + constraints: const BoxConstraints(maxWidth: 1200), + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (outfits.isNotEmpty) ...[ + const Padding( + padding: EdgeInsets.symmetric(vertical: 16), + child: Text( + 'Outfits', + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + ), + SizedBox( + height: 200, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: outfits.length, + itemBuilder: (context, index) { + return Padding( + padding: const EdgeInsets.only(right: 16), + child: OutfitComponent(item: outfits[index]), + ); + }, + ), + ), + const SizedBox(height: 32), + ] else + Container( + margin: const EdgeInsets.symmetric(vertical: 32), + child: const Center(child: Text('No outfits found')), + ), + BlocBuilder( + builder: (context, categoryState) { + return Container( + margin: const EdgeInsets.symmetric(vertical: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + 'Categories', + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + if (categoryState.selectedCategoryIds.isNotEmpty) + TextButton( + onPressed: () { + context.read().clearSelection(); + context.read().clearCategoryFilter(); + }, + child: const Text('Clear Filters'), + ), + ], + ), + const SizedBox(height: 8), + Wrap( + spacing: 8, + runSpacing: 8, + children: categoryState.categories.map((category) { + final isSelected = categoryState.selectedCategoryIds.contains(category.id); + return CategoryComponent( + category: category, + isSelected: isSelected, + onTap: () { + context.read().toggleCategory(category.id); + context.read().toggleCategory(category.id); + context.read().fetchWardrobeItems(); + }, + ); + }).toList(), + ), + ], + ), + ); + }, + ), + if (items.isNotEmpty) ...[ + Wrap( + spacing: 16, + runSpacing: 16, + children: state.filterItemsByCategory(items) + .map((item) => WardrobeItemComponent( + item: item, + onTap: () => context.push( + '/wardrobe/item/${item.id}', + ), + )) + .toList(), + ), + const SizedBox(height: 32), + ] else + Container( + margin: const EdgeInsets.symmetric(vertical: 32), + child: const Center(child: Text('No items found')), + ), + const SizedBox(height: 100), + ], + ), + ), + ), + ); + } + return const SizedBox(); + }, + ), + ); + } +} diff --git a/lib/ui/screens/wardrobe/settings/account_page.dart b/lib/ui/screens/wardrobe/settings/account_page.dart new file mode 100644 index 0000000..8995283 --- /dev/null +++ b/lib/ui/screens/wardrobe/settings/account_page.dart @@ -0,0 +1,124 @@ +import 'package:flutter/material.dart'; +import 'package:get_it/get_it.dart'; +import 'package:openwardrobe/controllers/settings_account_controller.dart'; +import 'package:openwardrobe/brick/models/user_profile.model.dart'; + +class SettingsAccountPage extends StatefulWidget { + const SettingsAccountPage({Key? key}) : super(key: key); + + @override + _SettingsAccountPageState createState() => _SettingsAccountPageState(); +} + +class _SettingsAccountPageState extends State { + final SettingsAccountController _controller = GetIt.instance(); + late Future _userProfileFuture; + final TextEditingController _usernameController = TextEditingController(); + final TextEditingController _displayNameController = TextEditingController(); + final TextEditingController _bioController = TextEditingController(); + String? _avatarUrl; + + @override + void initState() { + super.initState(); + _userProfileFuture = _controller.fetchUserProfile(); + } + + @override + void dispose() { + _usernameController.dispose(); + _displayNameController.dispose(); + _bioController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Account Settings'), + ), + body: FutureBuilder( + future: _userProfileFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: CircularProgressIndicator()); + } else if (snapshot.hasError) { + return Center(child: Text('Error: ${snapshot.error}')); + } else if (!snapshot.hasData) { + return const Center(child: Text('No profile found')); + } + + final userProfile = snapshot.data!; + _usernameController.text = userProfile.username; + _displayNameController.text = userProfile.displayName ?? ''; + _bioController.text = userProfile.bio ?? ''; + _avatarUrl = userProfile.avatarUrl; + + return Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Center( + child: GestureDetector( + onTap: () async { + final imageFile = await _controller.pickImage(fromGallery: true); + if (imageFile != null) { + final avatarUrl = await _controller.uploadAvatar(imageFile); + setState(() { + _avatarUrl = avatarUrl; + }); + } + }, + child: CircleAvatar( + radius: 50, + backgroundImage: _avatarUrl != null ? NetworkImage(_avatarUrl!) : null, + child: _avatarUrl == null ? const Icon(Icons.person, size: 50) : null, + ), + ), + ), + const SizedBox(height: 16), + TextField( + controller: _usernameController, + decoration: const InputDecoration(labelText: 'Username'), + ), + const SizedBox(height: 16), + TextField( + controller: _displayNameController, + decoration: const InputDecoration(labelText: 'Display Name'), + ), + const SizedBox(height: 16), + TextField( + controller: _bioController, + decoration: const InputDecoration(labelText: 'Bio'), + ), + const SizedBox(height: 16), + ElevatedButton( + onPressed: () async { + final updatedProfile = UserProfile( + id: userProfile.id, + username: _usernameController.text, + displayName: _displayNameController.text, + bio: _bioController.text, + avatarUrl: _avatarUrl, + socialLinks: userProfile.socialLinks, + isPublic: userProfile.isPublic, + createdAt: userProfile.createdAt, + updatedAt: DateTime.now(), + ); + await _controller.upsertUserProfile(updatedProfile); + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Profile updated successfully')), + ); + }, + child: const Text('Save'), + ), + ], + ), + ); + }, + ), + ); + } +} diff --git a/lib/ui/screens/wardrobe/settings/page.dart b/lib/ui/screens/wardrobe/settings/page.dart new file mode 100644 index 0000000..f27e9c6 --- /dev/null +++ b/lib/ui/screens/wardrobe/settings/page.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; + +class SettingsPage extends StatelessWidget { + const SettingsPage({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Settings'), + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ListTile( + title: const Text('Account'), + onTap: () { + context.push('/settings/account'); + }, + ), + ListTile( + title: const Text('Notifications'), + onTap: () { + Navigator.pushNamed(context, '/settings/notifications'); + }, + ), + ListTile( + title: const Text('Privacy'), + onTap: () { + Navigator.pushNamed(context, '/settings/privacy'); + }, + ), + ListTile( + title: const Text('About'), + onTap: () { + Navigator.pushNamed(context, '/settings/about'); + }, + ), + ], + ), + ), + ); + } +} diff --git a/lib/ui/screens/wardrobe_item/page.dart b/lib/ui/screens/wardrobe_item/page.dart new file mode 100644 index 0000000..f5a8504 --- /dev/null +++ b/lib/ui/screens/wardrobe_item/page.dart @@ -0,0 +1,158 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:openwardrobe/brick/models/wardrobe_item.model.dart'; +import 'package:openwardrobe/presentation/blocs/wardrobe_item/wardrobe_item_cubit.dart'; +import 'package:openwardrobe/presentation/blocs/wardrobe_item/wardrobe_item_state.dart'; +import 'package:openwardrobe/ui/widgets/wardrobe_item/wardrobe_item_component.dart'; +import 'package:collection/collection.dart'; +import 'package:openwardrobe/presentation/blocs/category/category_cubit.dart'; // Added import +import 'package:openwardrobe/presentation/blocs/category/category_state.dart'; // Added import + +class WardrobeItemPage extends StatefulWidget { + final String itemId; + + const WardrobeItemPage({super.key, required this.itemId}); + + @override + _WardrobeItemPageState createState() => _WardrobeItemPageState(); +} + +class _WardrobeItemPageState extends State { + late WardrobeItemCubit _wardrobeItemCubit; + + @override + void initState() { + super.initState(); + _wardrobeItemCubit = WardrobeItemCubit()..loadWardrobeItem(widget.itemId); + } + + @override + void dispose() { + _wardrobeItemCubit.close(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (context) => _wardrobeItemCubit, + child: Scaffold( + appBar: AppBar( + title: const Text('Wardrobe Item'), + actions: [ + BlocBuilder( + builder: (context, state) { + if (state is WardrobeItemLoaded) { + return IconButton( + icon: Icon(state.isEditing ? Icons.save : Icons.edit), + onPressed: () { + if (state.isEditing) { + // Save changes + context + .read() + .updateWardrobeItem(state.item); + } + context.read().toggleEditing(); + }, + ); + } + return const SizedBox.shrink(); + }, + ), + ], + ), + body: BlocBuilder( + builder: (context, state) { + if (state is WardrobeItemLoading) { + return const Center(child: CircularProgressIndicator()); + } else if (state is WardrobeItemError) { + return Center(child: Text(state.message)); + } else if (state is WardrobeItemLoaded) { + return SingleChildScrollView( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Center( + child: SizedBox( + width: double.infinity, + height: MediaQuery.of(context).size.width, + child: WardrobeItemComponent( + item: state.item, + size: MediaQuery.of(context).size.width, + isSelected: false, + ), + ), + ), + const SizedBox(height: 24), + if (state.isEditing) + ..._buildEditingFields(context, state.item) + else + ..._buildViewFields(state.item), + ], + ), + ); + } + return const SizedBox.shrink(); + }, + ), + ), + ); + } + + List _buildEditingFields(BuildContext context, WardrobeItem item) { + return [ + TextFormField( + initialValue: item.brand?.name ?? '', + decoration: const InputDecoration( + labelText: 'Brand', + border: OutlineInputBorder(), + ), + onChanged: (value) { + // TODO: Update brand + }, + ), + const SizedBox(height: 16), + BlocBuilder( + builder: (context, state) { + if (state.isLoading) { + return const CircularProgressIndicator(); + } else if (state.error != null) { + return Text('Error: ${state.error}'); + } else { + return DropdownMenu( + initialSelection: item.itemCategory?.name ?? '', + onSelected: (String? value) { + // TODO: Update category + }, + dropdownMenuEntries: UnmodifiableListView>( + state.categories.map>( + (category) => DropdownMenuEntry(value: category.name, label: category.name), + ), + ), + ); + } + }, + ), + ]; + } + + List _buildViewFields(WardrobeItem item) { + return [ + Text( + 'Brand: ${item.brand?.name ?? 'Not specified'}', + style: const TextStyle(fontSize: 18), + ), + const SizedBox(height: 8), + Text( + 'Category: ${item.itemCategory?.name ?? 'Not specified'}', + style: const TextStyle(fontSize: 18), + ), + const SizedBox(height: 8), + Text( + 'Created: ${item.createdAt?.toString() ?? 'Unknown'}', + style: const TextStyle(fontSize: 16, color: Colors.grey), + ), + ]; + } +} diff --git a/lib/ui/widgets/brand/brand_component.dart b/lib/ui/widgets/brand/brand_component.dart new file mode 100644 index 0000000..3cc2091 --- /dev/null +++ b/lib/ui/widgets/brand/brand_component.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; +import 'package:openwardrobe/brick/models/brand.model.dart'; + +class BrandComponent extends StatelessWidget { + final Brand brand; + + const BrandComponent({super.key, required this.brand}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(10), + child: Text( + brand.name, + style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold), + ), + ); + } +} diff --git a/lib/ui/widgets/category/category_component.dart b/lib/ui/widgets/category/category_component.dart new file mode 100644 index 0000000..bef356a --- /dev/null +++ b/lib/ui/widgets/category/category_component.dart @@ -0,0 +1,103 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:openwardrobe/brick/models/category_summary.model.dart'; +import 'package:openwardrobe/brick/models/item_category.model.dart'; +import 'package:openwardrobe/presentation/blocs/category/category_cubit.dart'; +import 'package:openwardrobe/presentation/blocs/category/category_state.dart'; + + +class CategoryComponent extends StatelessWidget { + final ItemCategory category; + final bool isSelected; + final VoidCallback onTap; + + const CategoryComponent({ + super.key, + required this.category, + required this.isSelected, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: isSelected ? Theme.of(context).primaryColor : Colors.grey[300]!, + width: 2, + ), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + color: isSelected ? Theme.of(context).primaryColor.withOpacity(0.1) : null, + borderRadius: const BorderRadius.vertical(bottom: Radius.circular(6)), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + category.name, + style: TextStyle( + fontWeight: FontWeight.bold, + color: isSelected ? Theme.of(context).primaryColor : null, + ), + ), + + ], + ), + ), + ], + ), + ), + ); + } +} + +class CategoryFilterGrid extends StatelessWidget { + const CategoryFilterGrid({super.key}); + + @override + Widget build(BuildContext context) { + return BlocBuilder( + builder: (context, state) { + if (state.isLoading) { + return const Center(child: CircularProgressIndicator()); + } + + if (state.error != null) { + return Center(child: Text(state.error!)); + } + + return GridView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + padding: const EdgeInsets.all(16), + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + childAspectRatio: 0.8, + crossAxisSpacing: 16, + mainAxisSpacing: 16, + ), + itemCount: state.categories.length, + itemBuilder: (context, index) { + final category = state.categories[index]; + final isSelected = context.read().isCategorySelected(category.id); + + return CategoryComponent( + category: category, + isSelected: isSelected, + onTap: () => context.read().toggleCategory(category.id), + ); + }, + ); + }, + ); + } +} \ No newline at end of file diff --git a/lib/ui/widgets/community_post/community_post_component.dart b/lib/ui/widgets/community_post/community_post_component.dart new file mode 100644 index 0000000..fb3882d --- /dev/null +++ b/lib/ui/widgets/community_post/community_post_component.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; +import 'package:openwardrobe/brick/models/community_post.model.dart'; +import 'package:openwardrobe/ui/widgets/user_profile/user_profile_component.dart'; + +class CommunityPostComponent extends StatelessWidget { + final CommunityPost post; + + const CommunityPostComponent({super.key, required this.post}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (post.userProfile != null) + UserProfileComponent(item: post.userProfile!), + const SizedBox(height: 8), + Text( + post.content, + style: const TextStyle(fontSize: 16), + ), + if (post.imageUrl != null) + Image.network(post.imageUrl!), + ], + ), + ); + } +} diff --git a/lib/ui/widgets/community_post_comment/community_post_comment_component.dart b/lib/ui/widgets/community_post_comment/community_post_comment_component.dart new file mode 100644 index 0000000..e22c785 --- /dev/null +++ b/lib/ui/widgets/community_post_comment/community_post_comment_component.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; +import 'package:openwardrobe/brick/models/community_post_comment.model.dart'; +import 'package:openwardrobe/ui/widgets/user_profile/user_profile_component.dart'; + +class CommunityPostCommentComponent extends StatelessWidget { + final CommunityPostComment comment; + + const CommunityPostCommentComponent({super.key, required this.comment}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (comment.userProfile != null) + UserProfileComponent(item: comment.userProfile!), + const SizedBox(height: 8), + Text( + comment.comment, + style: const TextStyle(fontSize: 16), + ), + ], + ), + ); + } +} diff --git a/lib/ui/widgets/community_post_like/community_post_like_component.dart b/lib/ui/widgets/community_post_like/community_post_like_component.dart new file mode 100644 index 0000000..4937cdc --- /dev/null +++ b/lib/ui/widgets/community_post_like/community_post_like_component.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; +import 'package:openwardrobe/brick/models/community_post_like.model.dart'; +import 'package:openwardrobe/ui/widgets/user_profile/user_profile_component.dart'; + +class CommunityPostLikeComponent extends StatelessWidget { + final CommunityPostLike like; + + const CommunityPostLikeComponent({super.key, required this.like}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (like.userProfile != null) + UserProfileComponent(item: like.userProfile!), + ], + ), + ); + } +} diff --git a/lib/ui/widgets/dashboard/link.dart b/lib/ui/widgets/dashboard/link.dart new file mode 100644 index 0000000..0d201f6 --- /dev/null +++ b/lib/ui/widgets/dashboard/link.dart @@ -0,0 +1,47 @@ +// A link stateless widget that takes a text and a function as parameters +// Return a rectangle with a icon and text, with a onTap function +// The onTap function is used to navigate to a different page + + +import 'package:flutter/material.dart'; + +class DashboardLink extends StatelessWidget { + final String text; + final IconData icon; + final VoidCallback onTap; + final Color color; + + const DashboardLink({super.key, required this.text, required this.icon, required this.onTap, this.color = Colors.grey}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + // It should be a 25x25 square + width: 80, + height: 80, + decoration: BoxDecoration( + color: color, + borderRadius: BorderRadius.circular(5), + ), + child: Center( + child: Container( + padding: EdgeInsets.all(4), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(icon, color: Colors.white), + Text( + text, + style: const TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500), + textAlign: TextAlign.center, + ), + ], + ), + ) + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/ui/widgets/item_category/item_category_component.dart b/lib/ui/widgets/item_category/item_category_component.dart new file mode 100644 index 0000000..6be40b7 --- /dev/null +++ b/lib/ui/widgets/item_category/item_category_component.dart @@ -0,0 +1,18 @@ +import 'package:flutter/material.dart'; +import 'package:openwardrobe/brick/models/item_category.model.dart'; + +class ItemCategoryComponent extends StatelessWidget { + final ItemCategory itemCategory; + + const ItemCategoryComponent({super.key, required this.itemCategory}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(10), + child: Text( + itemCategory.name, + ), + ); + } +} diff --git a/lib/ui/widgets/item_metadata/item_metadata_component.dart b/lib/ui/widgets/item_metadata/item_metadata_component.dart new file mode 100644 index 0000000..503194c --- /dev/null +++ b/lib/ui/widgets/item_metadata/item_metadata_component.dart @@ -0,0 +1,34 @@ +import 'package:flutter/material.dart'; +import 'package:openwardrobe/brick/models/item_metadata.model.dart'; + +class ItemMetadataComponent extends StatelessWidget { + final ItemMetadata item; + + const ItemMetadataComponent({super.key, required this.item}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Item Metadata Details', + style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), + ), + const SizedBox(height: 8), + Text('Bought For: ${item.boughtFor ?? 'N/A'} ${item.currency}'), + Text('Purchase Date: ${item.purchaseDate ?? 'N/A'}'), + Text('Condition: ${item.condition ?? 'N/A'}'), + Text('Material: ${item.material ?? 'N/A'}'), + Text('Size: ${item.size ?? 'N/A'}'), + Text('Color: ${item.color ?? 'N/A'}'), + Text('Notes: ${item.notes ?? 'N/A'}'), + Text('Created At: ${item.createdAt}'), + Text('Updated At: ${item.updatedAt}'), + ], + ), + ); + } +} diff --git a/lib/ui/widgets/lookbook/lookbook_component.dart b/lib/ui/widgets/lookbook/lookbook_component.dart new file mode 100644 index 0000000..31ddb48 --- /dev/null +++ b/lib/ui/widgets/lookbook/lookbook_component.dart @@ -0,0 +1,41 @@ +import 'package:flutter/material.dart'; +import 'package:openwardrobe/brick/models/lookbook.model.dart'; + +class LookbookComponent extends StatelessWidget { + final Lookbook item; + + const LookbookComponent({super.key, required this.item}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(10), + constraints: BoxConstraints(maxWidth: 400), // Set max width like a card + + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + item.title, + style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), + ), + const SizedBox(height: 8), + if (item.description != null) + Text( + item.description!, + style: TextStyle(fontSize: 16), + ), + // If it has a cover image try to get it otherwise nothing, if it fails to render remove too + if (item.coverImageUrl != null && item.coverImageUrl!.isNotEmpty) + Image.network( + item.coverImageUrl!, + fit: BoxFit.cover, + errorBuilder: (context, error, stackTrace) { + return const SizedBox.shrink(); // Remove the image if it fails to render + }, + ) + ], + ), + ); + } +} \ No newline at end of file diff --git a/lib/ui/widgets/lookbook_item/lookbook_item_component.dart b/lib/ui/widgets/lookbook_item/lookbook_item_component.dart new file mode 100644 index 0000000..aa02116 --- /dev/null +++ b/lib/ui/widgets/lookbook_item/lookbook_item_component.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart'; +import 'package:openwardrobe/brick/models/lookbook_item.model.dart'; + +class LookbookItemComponent extends StatelessWidget { + final LookbookItem item; + + const LookbookItemComponent({super.key, required this.item}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(10), + constraints: BoxConstraints(maxWidth: 400), // Set max width like a card + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + item.itemId, + style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), + ), + const SizedBox(height: 8), + Text( + item.itemType, + style: TextStyle(fontSize: 16), + ), + const SizedBox(height: 8), + Text( + item.createdAt.toString(), + style: TextStyle(fontSize: 16), + ), + ], + ), + ); + } +} diff --git a/lib/ui/widgets/outfit/outfit_component.dart b/lib/ui/widgets/outfit/outfit_component.dart new file mode 100644 index 0000000..7e77a1f --- /dev/null +++ b/lib/ui/widgets/outfit/outfit_component.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; +import 'package:openwardrobe/brick/models/outfit.model.dart'; +import 'package:openwardrobe/brick/models/wardrobe_item.model.dart'; +import 'package:openwardrobe/ui/widgets/wardrobe_item/wardrobe_item_component.dart'; +import 'package:supabase_flutter/supabase_flutter.dart'; + +class OutfitComponent extends StatelessWidget { + final Outfit item; + + const OutfitComponent({super.key, required this.item}); + + @override + Widget build(BuildContext context) { + + return Container( + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Wrap( + children: item.outfitItems.map((outfitItem) { + return WardrobeItemComponent(item: outfitItem.wardrobeItem); + }).toList(), + ), + Text( + item.name, + style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + ), + ], + ), + ); + } +} \ No newline at end of file diff --git a/lib/ui/widgets/outfit_item/outfit_item_component.dart b/lib/ui/widgets/outfit_item/outfit_item_component.dart new file mode 100644 index 0000000..b275fa9 --- /dev/null +++ b/lib/ui/widgets/outfit_item/outfit_item_component.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; +import 'package:openwardrobe/brick/models/outfit_item.model.dart'; + +class OutfitItemComponent extends StatelessWidget { + final OutfitItem item; + + const OutfitItemComponent({super.key, required this.item}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(10), + constraints: const BoxConstraints(maxWidth: 400), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + item.outfit.name, + style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold), + ), + const SizedBox(height: 8), + Text( + item.wardrobeItem.imagePath, + style: const TextStyle(fontSize: 16), + ), + ], + ), + ); + } +} diff --git a/lib/ui/widgets/scaffold_with_navbar.dart b/lib/ui/widgets/scaffold_with_navbar.dart new file mode 100644 index 0000000..3765135 --- /dev/null +++ b/lib/ui/widgets/scaffold_with_navbar.dart @@ -0,0 +1,269 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; + +/// A simple data model for navigation destinations. +class NavigationDestination { + final IconData icon; + final String label; + final String route; // Add route info for navigation + + NavigationDestination({ + required this.icon, + required this.label, + required this.route, + }); +} + +/// A scaffold that adapts navigation UI based on screen size. +/// Uses a NavigationRail for wider screens and a curved bottom nav for smaller screens. +class ScaffoldWithNavBar extends StatelessWidget { + final StatefulNavigationShell navigationShell; + + ScaffoldWithNavBar({super.key, required this.navigationShell}); + + // Shared destinations array for both sidebar and bottom bar. + final List destinations = [ + NavigationDestination(icon: Icons.dashboard, label: 'Home', route: "/"), + NavigationDestination(icon: Icons.checkroom, label: 'Wardrobe', route: "/wardrobe"), + NavigationDestination(icon: Icons.photo_album, label: 'Lookbook', route: "/lookbook"), + NavigationDestination(icon: Icons.settings, label: 'Settings', route: "/settings"), + ]; + + @override + Widget build(BuildContext context) { + final screenWidth = MediaQuery.of(context).size.width; + const double breakpoint = 600; + + if (screenWidth >= breakpoint) { + return Scaffold( + body: Row( + children: [ + NavigationRail( + selectedIndex: navigationShell.currentIndex, + onDestinationSelected: (index) { + navigationShell.goBranch( + index, + initialLocation: index == navigationShell.currentIndex, + ); + }, + labelType: NavigationRailLabelType.selected, + destinations: destinations + .map( + (destination) => NavigationRailDestination( + icon: Icon(destination.icon), + label: Text(destination.label), + ), + ) + .toList(), + ), + Expanded(child: navigationShell), + ], + ), + ); + } else { + return Scaffold( + extendBody: true, + body: Column( + children: [ + Expanded(child: + navigationShell + ), + ], + ), + bottomNavigationBar: BottomNavBarCurvedFb1(destinations: destinations), + ); + } + } +} + +/// Custom curved bottom navigation bar with a centered floating action button. +class BottomNavBarCurvedFb1 extends StatefulWidget { + final List destinations; + + const BottomNavBarCurvedFb1({Key? key, required this.destinations}) : super(key: key); + + @override + _BottomNavBarCurvedFb1State createState() => _BottomNavBarCurvedFb1State(); +} + +class _BottomNavBarCurvedFb1State extends State { + int _selectedIndex = 0; // Tracks the selected tab + + @override + Widget build(BuildContext context) { + Size size = MediaQuery.of(context).size; + double height = 56; + final primaryColor = Colors.blue; + final secondaryColor = Colors.black54; + final backgroundColor = Colors.white; + + // Split the destinations list for left and right of FAB. + int mid = (widget.destinations.length / 2).floor(); + List leftItems = widget.destinations.sublist(0, mid); + List rightItems = widget.destinations.sublist(mid); + + return BottomAppBar( + color: Colors.transparent, + elevation: 0, + child: Stack( + children: [ + CustomPaint( + size: Size(size.width, height + 6), + painter: BottomNavCurvePainter(backgroundColor: backgroundColor), + ), + Center( + heightFactor: 0.6, + child: FloatingActionButton( + backgroundColor: primaryColor, + child: Icon(Icons.add), + elevation: 0.1, + onPressed: () { + context.push("/camera"); + }, + ), + ), + Container( + height: height, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + // Left side icons + ...List.generate(leftItems.length, (index) { + return NavBarIcon( + text: leftItems[index].label, + icon: leftItems[index].icon, + selected: _selectedIndex == index, + onPressed: () { + setState(() { + _selectedIndex = index; + }); + context.replace(leftItems[index].route); + }, + defaultColor: secondaryColor, + selectedColor: primaryColor, + ); + }), + SizedBox(width: 56), // Gap for the FAB + // Right side icons + ...List.generate(rightItems.length, (index) { + // Actual index is mid + index. + int actualIndex = mid + index; + return NavBarIcon( + text: rightItems[index].label, + icon: rightItems[index].icon, + selected: _selectedIndex == actualIndex, + onPressed: () { + setState(() { + _selectedIndex = actualIndex; + }); + context.go(rightItems[index].route); + }, + defaultColor: secondaryColor, + selectedColor: primaryColor, + ); + }), + ], + ), + ), + ], + ), + ); + } +} + +/// Custom painter that draws the curved shape for the bottom navigation bar. +class BottomNavCurvePainter extends CustomPainter { + BottomNavCurvePainter({this.backgroundColor = Colors.white, this.insetRadius = 38}); + + final Color backgroundColor; + final double insetRadius; + + @override + void paint(Canvas canvas, Size size) { + Paint paint = Paint() + ..color = backgroundColor + ..style = PaintingStyle.fill; + + Path path = Path()..moveTo(0, 12); + + double insetCurveBeginnningX = size.width / 2 - insetRadius; + double insetCurveEndX = size.width / 2 + insetRadius; + double transitionToInsetCurveWidth = size.width * 0.05; + + path.quadraticBezierTo( + size.width * 0.20, + 0, + insetCurveBeginnningX - transitionToInsetCurveWidth, + 0, + ); + path.quadraticBezierTo( + insetCurveBeginnningX, + 0, + insetCurveBeginnningX, + insetRadius / 2, + ); + path.arcToPoint( + Offset(insetCurveEndX, insetRadius / 2), + radius: Radius.circular(10.0), + clockwise: false, + ); + path.quadraticBezierTo( + insetCurveEndX, + 0, + insetCurveEndX + transitionToInsetCurveWidth, + 0, + ); + path.quadraticBezierTo( + size.width * 0.80, + 0, + size.width, + 12, + ); + path.lineTo(size.width, size.height + 56); + path.lineTo(0, size.height + 56); + + canvas.drawPath(path, paint); + } + + @override + bool shouldRepaint(CustomPainter oldDelegate) => false; +} + +/// A widget that represents an individual icon in the navigation bar. +class NavBarIcon extends StatelessWidget { + const NavBarIcon({ + Key? key, + required this.text, + required this.icon, + required this.selected, + required this.onPressed, + this.selectedColor = const Color(0xffFF8527), + this.defaultColor = Colors.black54, + }) : super(key: key); + + final String text; + final IconData icon; + final bool selected; + final Function() onPressed; + final Color defaultColor; + final Color selectedColor; + + @override + Widget build(BuildContext context) { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + IconButton( + onPressed: onPressed, + splashColor: Colors.transparent, + highlightColor: Colors.transparent, + icon: Icon( + icon, + size: 25, + color: selected ? selectedColor : defaultColor, + ), + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/ui/widgets/tab_scaffold.dart b/lib/ui/widgets/tab_scaffold.dart deleted file mode 100644 index 58051c5..0000000 --- a/lib/ui/widgets/tab_scaffold.dart +++ /dev/null @@ -1,49 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; - -class TabScaffold extends StatelessWidget { - final Widget child; - - const TabScaffold({Key? key, required this.child}) : super(key: key); - - int _getSelectedIndex(BuildContext context) { - final location = GoRouterState.of(context).uri.toString(); - if (location.startsWith('/home')) return 0; - if (location.startsWith('/profile')) return 1; - if (location.startsWith('/settings')) return 2; - return 0; // Default naar Home als geen match - } - - void _onItemTapped(BuildContext context, int index) { - switch (index) { - case 0: - context.go('/home'); - break; - case 1: - context.go('/wardrobe'); - break; - case 2: - context.go('/analytics'); - break; - } - } - - @override - Widget build(BuildContext context) { - final selectedIndex = _getSelectedIndex(context); - - return Scaffold( - body: child, - bottomNavigationBar: BottomNavigationBar( - currentIndex: selectedIndex, - onTap: (index) => _onItemTapped(context, index), - items: const [ - BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'), - BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Wardrobe'), - BottomNavigationBarItem(icon: Icon(Icons.settings), label: 'Analytics'), - - ], - ), - ); - } -} diff --git a/lib/ui/widgets/use_item/use_item_component.dart b/lib/ui/widgets/use_item/use_item_component.dart new file mode 100644 index 0000000..7ccaee9 --- /dev/null +++ b/lib/ui/widgets/use_item/use_item_component.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart'; +import 'package:openwardrobe/brick/models/use_item.model.dart'; + +class UseItemComponent extends StatelessWidget { + final UseItem item; + + const UseItemComponent({super.key, required this.item}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Used At: ${item.usedAt}', + style: const TextStyle(fontSize: 16), + ), + const SizedBox(height: 8), + Text( + 'Wardrobe Item: ${item.wardrobeItem.id}', + style: const TextStyle(fontSize: 16), + ), + const SizedBox(height: 8), + if (item.userProfile != null) + Text( + 'User: ${item.userProfile!.username}', + style: const TextStyle(fontSize: 16), + ), + ], + ), + ); + } +} diff --git a/lib/ui/widgets/use_outfit/use_outfit_component.dart b/lib/ui/widgets/use_outfit/use_outfit_component.dart new file mode 100644 index 0000000..553a345 --- /dev/null +++ b/lib/ui/widgets/use_outfit/use_outfit_component.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart'; +import 'package:openwardrobe/brick/models/use_outfit.model.dart'; + +class UseOutfitComponent extends StatelessWidget { + final UseOutfit item; + + const UseOutfitComponent({super.key, required this.item}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Outfit: ${item.outfit.name}', + style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + ), + const SizedBox(height: 8), + Text( + 'Used at: ${item.usedAt}', + style: const TextStyle(fontSize: 16), + ), + const SizedBox(height: 8), + if (item.userProfile != null) + Text( + 'User: ${item.userProfile!.username}', + style: const TextStyle(fontSize: 16), + ), + ], + ), + ); + } +} diff --git a/lib/ui/widgets/user_profile/user_profile_component.dart b/lib/ui/widgets/user_profile/user_profile_component.dart new file mode 100644 index 0000000..b419358 --- /dev/null +++ b/lib/ui/widgets/user_profile/user_profile_component.dart @@ -0,0 +1,78 @@ +import 'package:flutter/material.dart'; +import 'package:openwardrobe/brick/models/user_profile.model.dart'; +import 'package:supabase_flutter/supabase_flutter.dart'; + +class UserProfileComponent extends StatelessWidget { + final UserProfile item; + + const UserProfileComponent({super.key, required this.item}); + + @override + Widget build(BuildContext context) { + + return Container( + padding: EdgeInsets.all(10), + child: Row( + children: [ + CircleAvatar( + radius: 50, + backgroundImage: item.avatarUrl != null + ? NetworkImage(item.avatarUrl!) + : null, + child: item.avatarUrl == null + ? const Icon(Icons.person, size: 50) + : null, + ), + const SizedBox(height: 16), + + Container( + padding: EdgeInsets.all(10), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + item.displayName ?? item.username, + style: Theme.of(context).textTheme.titleLarge, + ), + + if (item.displayName != null) ...[ + Text( + '@${item.username}', + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: Colors.grey, + ), + ), + const SizedBox(height: 8), + ], + + if (item.bio != null) ...[ + Text( + item.bio!, + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodyMedium, + ), + const SizedBox(height: 16), + ], + + // Social links + if (item.socialLinks != null) + Wrap( + spacing: 8, + children: item.socialLinks!.entries.map((entry) { + return Chip( + label: Text(entry.key), + avatar: const Icon(Icons.link), + ); + }).toList(), + ), + ], + ), + ) + + + ], + ) + ); + } +} \ No newline at end of file diff --git a/lib/ui/widgets/wardrobe/category.dart b/lib/ui/widgets/wardrobe/category.dart new file mode 100644 index 0000000..25dedff --- /dev/null +++ b/lib/ui/widgets/wardrobe/category.dart @@ -0,0 +1,48 @@ +import 'package:flutter/material.dart'; + +class WarderobeCategory extends StatelessWidget { + final String text; + final Image image; + final bool isSelected; + final VoidCallback onTap; + + const WarderobeCategory({super.key, required this.text, required this.image, required this.isSelected, required this.onTap}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + width: 100, + // Padding top + margin: const EdgeInsets.only(top: 10), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 50, + height: 50, + decoration: BoxDecoration( + shape: BoxShape.circle, + image: DecorationImage( + image: image.image, + fit: BoxFit.cover, + ), + border: isSelected ? Border.all(color: Colors.primaries.last, width: 3) : null, + boxShadow: isSelected + ? [BoxShadow(color: Colors.primaries.last, blurRadius: 10, spreadRadius: 1)] + : [], + ), + ), + const SizedBox(height: 10), + Text( + text, + style: Theme.of(context).textTheme.bodyMedium, + textAlign: TextAlign.center, + ), + ], + ), + ), + ); + } +} diff --git a/lib/ui/widgets/wardrobe/item.dart b/lib/ui/widgets/wardrobe/item.dart new file mode 100644 index 0000000..0ce1b4f --- /dev/null +++ b/lib/ui/widgets/wardrobe/item.dart @@ -0,0 +1,83 @@ +import 'package:flutter/material.dart'; +import 'package:openwardrobe/brick/models/wardrobe_item.model.dart'; + +class WardrobeItemCard extends StatelessWidget { + final WardrobeItem item; + final VoidCallback? onTap; + // size + final double? size; + + const WardrobeItemCard({ + super.key, + required this.item, + this.onTap, + this.size = 200, + }); + + + + // Was this item added today? + bool get isNew => item.createdAt.difference(DateTime.now()).inDays == 0; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Card( + elevation: 4, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + side: isNew ? BorderSide(color: Colors.green, width: 2) : BorderSide.none, + ), + shadowColor: isNew ? Colors.green : Colors.black, + child: Stack( + children: [ + Column( + children: [ + ClipRRect( + borderRadius: const BorderRadius.all(Radius.circular(12)), + child: Image.network( + "https://images.unsplash.com/photo-1737587653765-94bc8fe7b541?q=80&w=1031&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + height: size, + width: size, + fit: BoxFit.cover, + ), + ), + ], + ), + if (isNew) + Positioned( + top: 8, + left: 8, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration( + color: Colors.green, + borderRadius: BorderRadius.circular(12), + ), + child: const Text( + 'New', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + Positioned( + top: 8, + right: 8, + child: IconButton( + icon: const Icon(Icons.favorite_border), + color: Colors.black, + onPressed: () { + // Handle heart button press + }, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/ui/widgets/wardrobe_item/wardrobe_item_component.dart b/lib/ui/widgets/wardrobe_item/wardrobe_item_component.dart new file mode 100644 index 0000000..67ca40d --- /dev/null +++ b/lib/ui/widgets/wardrobe_item/wardrobe_item_component.dart @@ -0,0 +1,160 @@ +import 'package:flutter/material.dart'; +import 'package:openwardrobe/brick/models/wardrobe_item.model.dart'; +import 'package:supabase_flutter/supabase_flutter.dart'; +import 'package:cached_network_image/cached_network_image.dart'; + +class WardrobeItemComponent extends StatelessWidget { + static final Map _urlCache = {}; + static const int _cacheExpirationSeconds = 3600; // 1 hour + + final WardrobeItem item; + final bool isSelected; + final VoidCallback? onTap; + final double size; + + const WardrobeItemComponent({ + super.key, + required this.item, + this.isSelected = false, + this.onTap, + this.size = 110, + }); + + Future _getSignedUrl(String? imagePath) async { + if (imagePath == null || item.id == null) return ''; + + final now = DateTime.now().millisecondsSinceEpoch; + final cacheKey = item.id!; + final cachedUrl = _urlCache[cacheKey]; + + if (cachedUrl != null && cachedUrl.expiresAt > now) { + return cachedUrl.url; + } + + try { + final cleanPath = imagePath.trim().replaceAll('//', '/').replaceAll('\\', '/').replaceFirst(RegExp('^/+'), ''); + final signedUrl = await Supabase.instance.client.storage + .from('wardrobe_items') + .createSignedUrl(cleanPath, _cacheExpirationSeconds); + + _urlCache[cacheKey] = _SignedUrlCache( + url: signedUrl, + expiresAt: now + (_cacheExpirationSeconds * 1000), + ); + + return signedUrl; + } catch (error) { + debugPrint('Error signing URL: $error'); + return ''; + } + } + + @override + Widget build(BuildContext context) { + + return GestureDetector( + onTap: onTap, + child: Container( + decoration: BoxDecoration( + border: isSelected ? Border.all(color: Colors.blue, width: 2) : null, + boxShadow: isSelected + ? [BoxShadow(color: Colors.blue.withOpacity(0.5), blurRadius: 8, spreadRadius: 1)] + : null, + ), + child: Column( + children: [ + FutureBuilder( + future: item.imagePath != null + ? _getSignedUrl(item.imagePath!) + : Future.value(''), + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return Container( + height: size, + width: size, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(8), + ), + child: const Center( + child: Padding( + padding: EdgeInsets.all(16.0), + child: AspectRatio( + aspectRatio: 1, + child: DecoratedBox( + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [Color(0xFFEEEEEE), Color(0xFFE0E0E0), Color(0xFFEEEEEE)], + stops: [0.1, 0.5, 0.9], + begin: Alignment(-1.0, -0.3), + end: Alignment(1.0, 0.3), + tileMode: TileMode.mirror, + ), + ), + ), + ), + ), + ), + ); + } + + if (snapshot.hasError || !snapshot.hasData || snapshot.data!.isEmpty || item.imagePath == null) { + return Container( + height: size, + width: size, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(8), + ), + child: const Center( + child: Icon(Icons.image_not_supported, size: 50, color: Colors.grey), + ), + ); + } + + return ClipRRect( + borderRadius: BorderRadius.circular(8), + child: CachedNetworkImage( + imageUrl: snapshot.data!, + height: size, + width: size, + fit: BoxFit.cover, + maxHeightDiskCache: 1024, + maxWidthDiskCache: 1024, + useOldImageOnUrlChange: true, + placeholder: (context, url) => Container( + height: size, + width: size, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(8), + ), + ), + errorWidget: (context, url, error) => Container( + height: size, + width: size, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(8), + ), + child: const Center( + child: Icon(Icons.error_outline, size: 50, color: Colors.grey), + ), + ), + ), + ); + }, + ), + ], + ), + ), + ); + } +} + +class _SignedUrlCache { + final String url; + final int expiresAt; + + _SignedUrlCache({required this.url, required this.expiresAt}); +} \ No newline at end of file diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 3792af4..e12c657 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,10 +6,14 @@ #include "generated_plugin_registrant.h" +#include #include #include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); + file_selector_plugin_register_with_registrar(file_selector_linux_registrar); g_autoptr(FlPluginRegistrar) gtk_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin"); gtk_plugin_register_with_registrar(gtk_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 5d07423..4453582 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + file_selector_linux gtk url_launcher_linux ) diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig index c2efd0b..4b81f9b 100644 --- a/macos/Flutter/Flutter-Debug.xcconfig +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/Flutter-Release.xcconfig b/macos/Flutter/Flutter-Release.xcconfig index c2efd0b..5caa9d1 100644 --- a/macos/Flutter/Flutter-Release.xcconfig +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 4e45a1e..154e1a9 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -7,18 +7,24 @@ import Foundation import app_links import connectivity_plus +import file_picker +import file_selector_macos import google_sign_in_ios import path_provider_foundation import shared_preferences_foundation import sign_in_with_apple +import sqflite_darwin import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin")) ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) + FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin")) + FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SignInWithApplePlugin.register(with: registry.registrar(forPlugin: "SignInWithApplePlugin")) + SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/macos/Podfile b/macos/Podfile new file mode 100644 index 0000000..c795730 --- /dev/null +++ b/macos/Podfile @@ -0,0 +1,43 @@ +platform :osx, '10.14' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/pubspec.lock b/pubspec.lock index 4ff8013..ec2d323 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -66,10 +66,10 @@ packages: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.12.0" bloc: dependency: transitive description: @@ -82,10 +82,114 @@ packages: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" + brick_build: + dependency: transitive + description: + name: brick_build + sha256: "76c829aad5974e210bf8123ba336e82228eea134a5bbfa92ecb7942edc3fb02c" + url: "https://pub.dev" + source: hosted + version: "3.3.1" + brick_core: + dependency: "direct main" + description: + name: brick_core + sha256: "5e53019cd287b4d0a379e0bcb2f9508f5eb9cadce020721089fad88544065b38" + url: "https://pub.dev" + source: hosted + version: "1.4.0" + brick_json_generators: + dependency: transitive + description: + name: brick_json_generators + sha256: d223977e9c2daa427dff94437cb82692ba2bc038af77de75acec5f7ce6d84d7c + url: "https://pub.dev" + source: hosted + version: "3.2.0+1" + brick_offline_first: + dependency: transitive + description: + name: brick_offline_first + sha256: "10bbd484a0b6ee35ce9ac3caf9563b7f3219c8a357eae89985a02d928e1932f6" + url: "https://pub.dev" + source: hosted + version: "3.4.0" + brick_offline_first_build: + dependency: transitive + description: + name: brick_offline_first_build + sha256: "514f20205ff0becaa1138e94607aaac09b9064a3dfd2fc7d1267c505cfe67adf" + url: "https://pub.dev" + source: hosted + version: "3.3.0" + brick_offline_first_with_rest: + dependency: transitive + description: + name: brick_offline_first_with_rest + sha256: c8fe8c5c3060010997f089103eb0aec0d2b8e98a41289cb199a0163b43e8d8bf + url: "https://pub.dev" + source: hosted + version: "3.3.0" + brick_offline_first_with_supabase: + dependency: "direct main" + description: + name: brick_offline_first_with_supabase + sha256: b11e0d26e896432f09b1b96c1f3a138880a534ae0c301dc5a2040cd0a8338ffc + url: "https://pub.dev" + source: hosted + version: "1.3.0" + brick_offline_first_with_supabase_build: + dependency: "direct dev" + description: + name: brick_offline_first_with_supabase_build + sha256: adc8e2487c4b69ffb3a03cb4e1c14b4138a2853d7989f012e4997cc6383f5dc0 + url: "https://pub.dev" + source: hosted + version: "1.1.0" + brick_rest: + dependency: transitive + description: + name: brick_rest + sha256: a79ca1c36390c0006a14eb1d05b1dbc19667fe53a365447443fe433367cf34be + url: "https://pub.dev" + source: hosted + version: "3.2.0" + brick_sqlite: + dependency: "direct main" + description: + name: brick_sqlite + sha256: f6870c4c9f72241ad16065df942fb51f5ff832d58ea199f401b22348fc4ef7ac + url: "https://pub.dev" + source: hosted + version: "3.2.2" + brick_sqlite_generators: + dependency: transitive + description: + name: brick_sqlite_generators + sha256: c69da837b31a50280d47cd97be1bd85664eb8fcce7ef037a0a72b6044e67db1b + url: "https://pub.dev" + source: hosted + version: "3.3.1" + brick_supabase: + dependency: "direct main" + description: + name: brick_supabase + sha256: "93e62c14399ddf5d5598f69c3aafc7c5507b4b0d5779eb0a71426afe062c6aec" + url: "https://pub.dev" + source: hosted + version: "1.4.1+1" + brick_supabase_generators: + dependency: transitive + description: + name: brick_supabase_generators + sha256: "14b4702facae1e0020bb0398c479267001f4cdf1d318d5269bc00fe069690f62" + url: "https://pub.dev" + source: hosted + version: "1.2.0" build: dependency: transitive description: @@ -106,26 +210,26 @@ packages: dependency: transitive description: name: build_daemon - sha256: "294a2edaf4814a378725bfe6358210196f5ea37af89ecd81bfa32960113d4948" + sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa" url: "https://pub.dev" source: hosted - version: "4.0.3" + version: "4.0.4" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: "99d3980049739a985cf9b21f30881f46db3ebc62c5b8d5e60e27440876b1ba1e" + sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0 url: "https://pub.dev" source: hosted - version: "2.4.3" + version: "2.4.4" build_runner: - dependency: "direct main" + dependency: "direct dev" description: name: build_runner - sha256: "74691599a5bc750dc96a6b4bfd48f7d9d66453eab04c7f4063134800d6a5c573" + sha256: "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99" url: "https://pub.dev" source: hosted - version: "2.4.14" + version: "2.4.15" build_runner_core: dependency: transitive description: @@ -150,14 +254,78 @@ packages: url: "https://pub.dev" source: hosted version: "8.9.3" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + sha256: "7c1183e361e5c8b0a0f21a28401eecdbde252441106a9816400dd4c2b2424916" + url: "https://pub.dev" + source: hosted + version: "3.4.1" + cached_network_image_platform_interface: + dependency: transitive + description: + name: cached_network_image_platform_interface + sha256: "35814b016e37fbdc91f7ae18c8caf49ba5c88501813f73ce8a07027a395e2829" + url: "https://pub.dev" + source: hosted + version: "4.1.1" + cached_network_image_web: + dependency: transitive + description: + name: cached_network_image_web + sha256: "980842f4e8e2535b8dbd3d5ca0b1f0ba66bf61d14cc3a17a9b4788a3685ba062" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + camera: + dependency: "direct main" + description: + name: camera + sha256: dfa8fc5a1adaeb95e7a54d86a5bd56f4bb0e035515354c8ac6d262e35cec2ec8 + url: "https://pub.dev" + source: hosted + version: "0.10.6" + camera_android: + dependency: transitive + description: + name: camera_android + sha256: "007c57cdcace4751014071e3d42f2eb8a64a519254abed35b714223d81d66234" + url: "https://pub.dev" + source: hosted + version: "0.10.10" + camera_avfoundation: + dependency: transitive + description: + name: camera_avfoundation + sha256: eff7ed630b1ac3994737c790368fe006388ad9f271d7148e432263721e45dc75 + url: "https://pub.dev" + source: hosted + version: "0.9.18+7" + camera_platform_interface: + dependency: transitive + description: + name: camera_platform_interface + sha256: "953e7baed3a7c8fae92f7200afeb2be503ff1a17c3b4e4ed7b76f008c2810a31" + url: "https://pub.dev" + source: hosted + version: "2.9.0" + camera_web: + dependency: transitive + description: + name: camera_web + sha256: "595f28c89d1fb62d77c73c633193755b781c6d2e0ebcd8dc25b763b514e6ba8f" + url: "https://pub.dev" + source: hosted + version: "0.3.5" characters: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" checked_yaml: dependency: transitive description: @@ -170,10 +338,10 @@ packages: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" code_builder: dependency: transitive description: @@ -186,18 +354,18 @@ packages: dependency: transitive description: name: collection - sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.19.0" + version: "1.19.1" connectivity_plus: dependency: "direct main" description: name: connectivity_plus - sha256: "8a68739d3ee113e51ad35583fdf9ab82c55d09d693d3c39da1aebab87c938412" + sha256: "04bf81bb0b77de31557b58d052b24b3eee33f09a6e7a8c68a3e247c7df19ec27" url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "6.1.3" connectivity_plus_platform_interface: dependency: transitive description: @@ -214,6 +382,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.2" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" + url: "https://pub.dev" + source: hosted + version: "0.3.4+2" crypto: dependency: transitive description: @@ -246,6 +422,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.11" + dev_build: + dependency: transitive + description: + name: dev_build + sha256: "6cb4c65446aedd671ffdaacbede599b6fb9c462b17d006f11f7b82fe90706bff" + url: "https://pub.dev" + source: hosted + version: "1.1.1+8" email_validator: dependency: transitive description: @@ -266,10 +450,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" ffi: dependency: transitive description: @@ -286,6 +470,46 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.1" + file_picker: + dependency: "direct main" + description: + name: file_picker + sha256: "3d57312a53746ed4eb8c843dc50372454bbda37dd0c01a4d40fedc83e2ce4921" + url: "https://pub.dev" + source: hosted + version: "8.3.5" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "54cbbd957e1156d29548c7d9b9ec0c0ebb6de0a90452198683a7d23aed617a33" + url: "https://pub.dev" + source: hosted + version: "0.9.3+2" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: "271ab9986df0c135d45c3cdb6bd0faa5db6f4976d3e4b437cf7d0f258d941bfc" + url: "https://pub.dev" + source: hosted + version: "0.9.4+2" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b + url: "https://pub.dev" + source: hosted + version: "2.6.2" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: "8f5d2f6590d51ecd9179ba39c64f722edc15226cc93dcc8698466ad36a4a85a4" + url: "https://pub.dev" + source: hosted + version: "0.9.3+3" fixnum: dependency: transitive description: @@ -307,14 +531,14 @@ packages: url: "https://pub.dev" source: hosted version: "9.0.0" - flutter_dotenv: - dependency: "direct main" + flutter_cache_manager: + dependency: transitive description: - name: flutter_dotenv - sha256: b7c7be5cd9f6ef7a78429cabd2774d3c4af50e79cb2b7593e3d5d763ef95c61b + name: flutter_cache_manager + sha256: "400b6592f16a4409a7f2bb929a9a7e38c72cceb8ffb99ee57bbf2cb2cecf8386" url: "https://pub.dev" source: hosted - version: "5.2.1" + version: "3.4.1" flutter_lints: dependency: "direct dev" description: @@ -323,6 +547,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.0.0" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: "615a505aef59b151b46bbeef55b36ce2b6ed299d160c51d84281946f0aa0ce0e" + url: "https://pub.dev" + source: hosted + version: "2.0.24" flutter_test: dependency: "direct dev" description: flutter @@ -357,6 +589,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.0" + get_it: + dependency: "direct main" + description: + name: get_it + sha256: f126a3e286b7f5b578bf436d5592968706c4c1de28a228b870ce375d9f743103 + url: "https://pub.dev" + source: hosted + version: "8.0.3" glob: dependency: transitive description: @@ -369,10 +609,10 @@ packages: dependency: "direct main" description: name: go_router - sha256: "9b736a9fa879d8ad6df7932cbdcc58237c173ab004ef90d8377923d7ad731eaa" + sha256: "04539267a740931c6d4479a10d466717ca5901c6fdfd3fcda09391bbb8ebd651" url: "https://pub.dev" source: hosted - version: "14.7.2" + version: "14.8.0" google_identity_services_web: dependency: transitive description: @@ -401,10 +641,10 @@ packages: dependency: transitive description: name: google_sign_in_ios - sha256: "83f015169102df1ab2905cf8abd8934e28f87db9ace7a5fa676998842fed228a" + sha256: "8468465516a6fdc283ffbbb06ec03a860ee34e9ff84b0454074978705b42379b" url: "https://pub.dev" source: hosted - version: "5.7.8" + version: "5.8.0" google_sign_in_platform_interface: dependency: transitive description: @@ -445,30 +685,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.0" - hive: - dependency: "direct main" - description: - name: hive - sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941" - url: "https://pub.dev" - source: hosted - version: "2.2.3" - hive_flutter: - dependency: "direct main" - description: - name: hive_flutter - sha256: dca1da446b1d808a51689fb5d0c6c9510c0a2ba01e22805d492c73b68e33eecc - url: "https://pub.dev" - source: hosted - version: "1.1.0" - hive_generator: - dependency: "direct dev" - description: - name: hive_generator - sha256: "06cb8f58ace74de61f63500564931f9505368f45f98958bd7a6c35ba24159db4" - url: "https://pub.dev" - source: hosted - version: "2.0.1" http: dependency: transitive description: @@ -493,6 +709,70 @@ packages: url: "https://pub.dev" source: hosted version: "4.1.2" + image_picker: + dependency: "direct main" + description: + name: image_picker + sha256: "021834d9c0c3de46bf0fe40341fa07168407f694d9b2bb18d532dc1261867f7a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: b62d34a506e12bb965e824b6db4fbf709ee4589cf5d3e99b45ab2287b008ee0c + url: "https://pub.dev" + source: hosted + version: "0.8.12+20" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "717eb042ab08c40767684327be06a5d8dbb341fe791d514e4b92c7bbe1b7bb83" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: "05da758e67bc7839e886b3959848aa6b44ff123ab4b28f67891008afe8ef9100" + url: "https://pub.dev" + source: hosted + version: "0.8.12+2" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "4ed1d9bb36f7cd60aa6e6cd479779cc56a4cb4e4de8f49d487b1aaad831300fa" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "1b90ebbd9dcf98fb6c1d01427e49a55bd96b5d67b8c67cf955d60a5de74207c1" + url: "https://pub.dev" + source: hosted + version: "0.2.1+2" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + sha256: "886d57f0be73c4b140004e78b9f28a8914a09e50c2d816bdd0520051a71236a0" + url: "https://pub.dev" + source: hosted + version: "2.10.1" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" io: dependency: transitive description: @@ -529,18 +809,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec url: "https://pub.dev" source: hosted - version: "10.0.7" + version: "10.0.8" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 url: "https://pub.dev" source: hosted - version: "3.0.8" + version: "3.0.9" leak_tracker_testing: dependency: transitive description: @@ -577,10 +857,10 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.17" material_color_utilities: dependency: transitive description: @@ -593,10 +873,10 @@ packages: dependency: transitive description: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.16.0" mime: dependency: transitive description: @@ -621,6 +901,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.0" + octo_image: + dependency: transitive + description: + name: octo_image + sha256: "34faa6639a78c7e3cbe79be6f9f96535867e879748ade7d17c9b1ae7536293bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" package_config: dependency: transitive description: @@ -633,10 +921,10 @@ packages: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" path_provider: dependency: "direct main" description: @@ -725,6 +1013,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.1" + process_run: + dependency: transitive + description: + name: process_run + sha256: a68fa9727392edad97a2a96a77ce8b0c17d28336ba1b284b1dfac9595a4299ea + url: "https://pub.dev" + source: hosted + version: "1.2.2+1" provider: dependency: transitive description: @@ -777,18 +1073,18 @@ packages: dependency: transitive description: name: shared_preferences - sha256: "688ee90fbfb6989c980254a56cb26ebe9bb30a3a2dff439a78894211f73de67a" + sha256: "846849e3e9b68f3ef4b60c60cf4b3e02e9321bc7f4d8c4692cf87ffa82fc8a3a" url: "https://pub.dev" source: hosted - version: "2.5.1" + version: "2.5.2" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "650584dcc0a39856f369782874e562efd002a9c94aec032412c9eb81419cce1f" + sha256: ea86be7b7114f9e94fddfbb52649e59a03d6627ccd2387ebddcd6624719e9f16 url: "https://pub.dev" source: hosted - version: "2.4.4" + version: "2.4.5" shared_preferences_foundation: dependency: transitive description: @@ -841,10 +1137,10 @@ packages: dependency: transitive description: name: shelf_web_socket - sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.0" sign_in_with_apple: dependency: transitive description: @@ -882,30 +1178,94 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.0" - source_helper: + source_span: dependency: transitive description: - name: source_helper - sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" url: "https://pub.dev" source: hosted - version: "1.3.5" - source_span: + version: "1.10.1" + sprintf: dependency: transitive description: - name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + sqflite: + dependency: "direct main" + description: + name: sqflite + sha256: "2d7299468485dca85efeeadf5d38986909c5eb0cd71fd3db2c2f000e6c9454bb" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + sqflite_android: + dependency: transitive + description: + name: sqflite_android + sha256: "78f489aab276260cdd26676d2169446c7ecd3484bbd5fead4ca14f3ed4dd9ee3" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + sha256: "761b9740ecbd4d3e66b8916d784e581861fd3c3553eda85e167bc49fdb68f709" + url: "https://pub.dev" + source: hosted + version: "2.5.4+6" + sqflite_common_ffi: + dependency: "direct main" + description: + name: sqflite_common_ffi + sha256: "883dd810b2b49e6e8c3b980df1829ef550a94e3f87deab5d864917d27ca6bf36" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "2.3.4+4" + sqflite_common_ffi_web: + dependency: "direct main" + description: + name: sqflite_common_ffi_web + sha256: "61ea702e7aba727f28be7ead00b84c19c745cd4a4934d0c41473303df11ac9ea" + url: "https://pub.dev" + source: hosted + version: "0.4.5+4" + sqflite_darwin: + dependency: transitive + description: + name: sqflite_darwin + sha256: "22adfd9a2c7d634041e96d6241e6e1c8138ca6817018afc5d443fef91dcefa9c" + url: "https://pub.dev" + source: hosted + version: "2.4.1+1" + sqflite_platform_interface: + dependency: transitive + description: + name: sqflite_platform_interface + sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + sqlite3: + dependency: transitive + description: + name: sqlite3 + sha256: decd58236d7c59e01ae81b34ebd158e6a1b61e0ae5397fc428736eb91ab82808 + url: "https://pub.dev" + source: hosted + version: "2.7.3" stack_trace: dependency: transitive description: name: stack_trace - sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.12.1" storage_client: dependency: transitive description: @@ -918,10 +1278,10 @@ packages: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" stream_transform: dependency: transitive description: @@ -934,10 +1294,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.1" supabase: dependency: transitive description: @@ -962,22 +1322,30 @@ packages: url: "https://pub.dev" source: hosted version: "2.8.3" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: "69fe30f3a8b04a0be0c15ae6490fc859a78ef4c43ae2dd5e8a623d45bfcf9225" + url: "https://pub.dev" + source: hosted + version: "3.3.0+3" term_glyph: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" test_api: dependency: transitive description: name: test_api - sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd url: "https://pub.dev" source: hosted - version: "0.7.3" + version: "0.7.4" timing: dependency: transitive description: @@ -1058,6 +1426,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.4" + uuid: + dependency: "direct main" + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" vector_math: dependency: transitive description: @@ -1070,10 +1446,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" url: "https://pub.dev" source: hosted - version: "14.3.0" + version: "14.3.1" watcher: dependency: transitive description: @@ -1106,6 +1482,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.2" + win32: + dependency: transitive + description: + name: win32 + sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e + url: "https://pub.dev" + source: hosted + version: "5.10.1" xdg_directories: dependency: transitive description: @@ -1139,5 +1523,5 @@ packages: source: hosted version: "2.0.3" sdks: - dart: ">=3.6.2 <4.0.0" + dart: ">=3.7.0-0 <4.0.0" flutter: ">=3.27.0" diff --git a/pubspec.yaml b/pubspec.yaml index 318b1f2..8d9ea64 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,103 +1,45 @@ name: openwardrobe -description: "A open source wardrobe management app" -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +description: "An open source wardrobe management app" +publish_to: 'none' -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -# In Windows, build-name is used as the major, minor, and patch parts -# of the product and file versions while build-number is used as the build suffix. version: 1.0.0+1 environment: - sdk: ^3.6.2 + sdk: '>=3.6.2 <4.0.0' + +flutter: + uses-material-design: true + -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 - flutter_dotenv: ^5.2.1 - supabase_flutter: ^2.8.3 go_router: ^14.7.2 - hive: ^2.2.3 - hive_flutter: ^1.1.0 connectivity_plus: ^6.1.2 path_provider: ^2.1.5 flutter_bloc: ^9.0.0 equatable: ^2.0.7 supabase_auth_ui: ^0.5.4 - build_runner: ^2.4.6 + file_picker: ^8.3.5 + supabase_flutter: ^2.8.3 + brick_offline_first_with_supabase: ^1.3.0 + get_it: ^8.0.3 + sqflite: ^2.4.1 + brick_sqlite: ^3.2.2 + brick_supabase: ^1.4.1+1 + uuid: ^4.5.1 + sqflite_common_ffi: any + brick_core: any + sqflite_common_ffi_web: any + camera: ^0.10.0+4 + image_picker: any + cached_network_image: ^3.4.1 dev_dependencies: flutter_test: sdk: flutter - - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. flutter_lints: ^5.0.0 - - hive_generator: ^2.0.0 - build_runner: ^2.4.6 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. -flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. - uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/to/resolution-aware-images - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/to/asset-from-package - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/to/font-from-package + brick_offline_first_with_supabase_build: ^1.0.0 + build_runner: ^2.4.6 \ No newline at end of file diff --git a/web/sqflite_sw.js b/web/sqflite_sw.js new file mode 100644 index 0000000..a489aa5 --- /dev/null +++ b/web/sqflite_sw.js @@ -0,0 +1,9742 @@ +(function dartProgram(){function copyProperties(a,b){var s=Object.keys(a) +for(var r=0;r=0)return true +if(typeof version=="function"&&version.length==0){var q=version() +if(/^\d+\.\d+\.\d+\.\d+$/.test(q))return true}}catch(p){}return false}() +function inherit(a,b){a.prototype.constructor=a +a.prototype["$i"+a.name]=a +if(b!=null){if(z){Object.setPrototypeOf(a.prototype,b.prototype) +return}var s=Object.create(b.prototype) +copyProperties(a.prototype,s) +a.prototype=s}}function inheritMany(a,b){for(var s=0;s4294967295)throw A.c(A.S(a,0,4294967295,"length",null)) +return J.ox(new Array(a),b)}, +ow(a,b){if(a<0)throw A.c(A.a0("Length must be a non-negative integer: "+a,null)) +return A.u(new Array(a),b.h("E<0>"))}, +kC(a,b){if(a<0)throw A.c(A.a0("Length must be a non-negative integer: "+a,null)) +return A.u(new Array(a),b.h("E<0>"))}, +ox(a,b){var s=A.u(a,b.h("E<0>")) +s.$flags=1 +return s}, +oy(a,b){var s=t.e8 +return J.o3(s.a(a),s.a(b))}, +lY(a){if(a<256)switch(a){case 9:case 10:case 11:case 12:case 13:case 32:case 133:case 160:return!0 +default:return!1}switch(a){case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8232:case 8233:case 8239:case 8287:case 12288:case 65279:return!0 +default:return!1}}, +oA(a,b){var s,r +for(s=a.length;b0;b=r){r=b-1 +if(!(r>>0===b&&b").b(a))return new A.db(a,b.h("@<0>").t(c).h("db<1,2>")) +return new A.bp(a,b.h("@<0>").t(c).h("bp<1,2>"))}, +oC(a){return new A.c8("Field '"+a+"' has not been initialized.")}, +kb(a){var s,r=a^48 +if(r<=9)return r +s=a|32 +if(97<=s&&s<=102)return s-87 +return-1}, +bg(a,b){a=a+b&536870911 +a=a+((a&524287)<<10)&536870911 +return a^a>>>6}, +kX(a){a=a+((a&67108863)<<3)&536870911 +a^=a>>>11 +return a+((a&16383)<<15)&536870911}, +k6(a,b,c){return a}, +lt(a){var s,r +for(s=$.ar.length,r=0;rc)A.J(A.S(b,0,c,"start",null))}return new A.bF(a,b,c,d.h("bF<0>"))}, +m2(a,b,c,d){if(t.R.b(a))return new A.br(a,b,c.h("@<0>").t(d).h("br<1,2>")) +return new A.aS(a,b,c.h("@<0>").t(d).h("aS<1,2>"))}, +mg(a,b,c){var s="count" +if(t.R.b(a)){A.cw(b,s,t.S) +A.a7(b,s) +return new A.c1(a,b,c.h("c1<0>"))}A.cw(b,s,t.S) +A.a7(b,s) +return new A.aV(a,b,c.h("aV<0>"))}, +or(a,b,c){return new A.c0(a,b,c.h("c0<0>"))}, +aE(){return new A.bE("No element")}, +lW(){return new A.bE("Too few elements")}, +oF(a,b){return new A.cN(a,b.h("cN<0>"))}, +bi:function bi(){}, +cz:function cz(a,b){this.a=a +this.$ti=b}, +bp:function bp(a,b){this.a=a +this.$ti=b}, +db:function db(a,b){this.a=a +this.$ti=b}, +da:function da(){}, +ac:function ac(a,b){this.a=a +this.$ti=b}, +cA:function cA(a,b){this.a=a +this.$ti=b}, +fN:function fN(a,b){this.a=a +this.b=b}, +fM:function fM(a){this.a=a}, +c8:function c8(a){this.a=a}, +cB:function cB(a){this.a=a}, +hj:function hj(){}, +n:function n(){}, +X:function X(){}, +bF:function bF(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=c +_.$ti=d}, +bx:function bx(a,b,c){var _=this +_.a=a +_.b=b +_.c=0 +_.d=null +_.$ti=c}, +aS:function aS(a,b,c){this.a=a +this.b=b +this.$ti=c}, +br:function br(a,b,c){this.a=a +this.b=b +this.$ti=c}, +cP:function cP(a,b,c){var _=this +_.a=null +_.b=a +_.c=b +_.$ti=c}, +a3:function a3(a,b,c){this.a=a +this.b=b +this.$ti=c}, +iq:function iq(a,b,c){this.a=a +this.b=b +this.$ti=c}, +bJ:function bJ(a,b,c){this.a=a +this.b=b +this.$ti=c}, +aV:function aV(a,b,c){this.a=a +this.b=b +this.$ti=c}, +c1:function c1(a,b,c){this.a=a +this.b=b +this.$ti=c}, +cY:function cY(a,b,c){this.a=a +this.b=b +this.$ti=c}, +bs:function bs(a){this.$ti=a}, +cE:function cE(a){this.$ti=a}, +d6:function d6(a,b){this.a=a +this.$ti=b}, +d7:function d7(a,b){this.a=a +this.$ti=b}, +bu:function bu(a,b,c){this.a=a +this.b=b +this.$ti=c}, +c0:function c0(a,b,c){this.a=a +this.b=b +this.$ti=c}, +bv:function bv(a,b,c){var _=this +_.a=a +_.b=b +_.c=-1 +_.$ti=c}, +ad:function ad(){}, +bh:function bh(){}, +cg:function cg(){}, +f8:function f8(a){this.a=a}, +cN:function cN(a,b){this.a=a +this.$ti=b}, +cX:function cX(a,b){this.a=a +this.$ti=b}, +dB:function dB(){}, +nC(a){var s=v.mangledGlobalNames[a] +if(s!=null)return s +return"minified:"+a}, +rd(a,b){var s +if(b!=null){s=b.x +if(s!=null)return s}return t.aU.b(a)}, +o(a){var s +if(typeof a=="string")return a +if(typeof a=="number"){if(a!==0)return""+a}else if(!0===a)return"true" +else if(!1===a)return"false" +else if(a==null)return"null" +s=J.aC(a) +return s}, +er(a){var s,r=$.m5 +if(r==null)r=$.m5=Symbol("identityHashCode") +s=a[r] +if(s==null){s=Math.random()*0x3fffffff|0 +a[r]=s}return s}, +kI(a,b){var s,r,q,p,o,n=null,m=/^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i.exec(a) +if(m==null)return n +if(3>=m.length)return A.b(m,3) +s=m[3] +if(b==null){if(s!=null)return parseInt(a,10) +if(m[2]!=null)return parseInt(a,16) +return n}if(b<2||b>36)throw A.c(A.S(b,2,36,"radix",n)) +if(b===10&&s!=null)return parseInt(a,10) +if(b<10||s==null){r=b<=10?47+b:86+b +q=m[1] +for(p=q.length,o=0;or)return n}return parseInt(a,b)}, +he(a){return A.oL(a)}, +oL(a){var s,r,q,p +if(a instanceof A.p)return A.ai(A.ap(a),null) +s=J.bU(a) +if(s===B.K||s===B.N||t.ak.b(a)){r=B.p(a) +if(r!=="Object"&&r!=="")return r +q=a.constructor +if(typeof q=="function"){p=q.name +if(typeof p=="string"&&p!=="Object"&&p!=="")return p}}return A.ai(A.ap(a),null)}, +mc(a){if(a==null||typeof a=="number"||A.dE(a))return J.aC(a) +if(typeof a=="string")return JSON.stringify(a) +if(a instanceof A.ba)return a.j(0) +if(a instanceof A.bk)return a.cQ(!0) +return"Instance of '"+A.he(a)+"'"}, +oM(){if(!!self.location)return self.location.href +return null}, +oQ(a,b,c){var s,r,q,p +if(c<=500&&b===0&&c===a.length)return String.fromCharCode.apply(null,a) +for(s=b,r="";s>>0,s&1023|56320)}}throw A.c(A.S(a,0,1114111,null,null))}, +bA(a){if(a.date===void 0)a.date=new Date(a.a) +return a.date}, +mb(a){var s=A.bA(a).getFullYear()+0 +return s}, +m9(a){var s=A.bA(a).getMonth()+1 +return s}, +m6(a){var s=A.bA(a).getDate()+0 +return s}, +m7(a){var s=A.bA(a).getHours()+0 +return s}, +m8(a){var s=A.bA(a).getMinutes()+0 +return s}, +ma(a){var s=A.bA(a).getSeconds()+0 +return s}, +oO(a){var s=A.bA(a).getMilliseconds()+0 +return s}, +oP(a){var s=A.bA(a).getDay()+0 +return B.c.Y(s+6,7)+1}, +oN(a){var s=a.$thrownJsError +if(s==null)return null +return A.ab(s)}, +kJ(a,b){var s +if(a.$thrownJsError==null){s=A.c(a) +a.$thrownJsError=s +s.stack=b.j(0)}}, +r7(a){throw A.c(A.k4(a))}, +b(a,b){if(a==null)J.P(a) +throw A.c(A.k7(a,b))}, +k7(a,b){var s,r="index" +if(!A.fu(b))return new A.as(!0,b,r,null) +s=A.d(J.P(a)) +if(b<0||b>=s)return A.e8(b,s,a,null,r) +return A.md(b,r)}, +qZ(a,b,c){if(a>c)return A.S(a,0,c,"start",null) +if(b!=null)if(bc)return A.S(b,a,c,"end",null) +return new A.as(!0,b,"end",null)}, +k4(a){return new A.as(!0,a,null,null)}, +c(a){return A.nu(new Error(),a)}, +nu(a,b){var s +if(b==null)b=new A.aX() +a.dartException=b +s=A.rn +if("defineProperty" in Object){Object.defineProperty(a,"message",{get:s}) +a.name=""}else a.toString=s +return a}, +rn(){return J.aC(this.dartException)}, +J(a){throw A.c(a)}, +lx(a,b){throw A.nu(b,a)}, +y(a,b,c){var s +if(b==null)b=0 +if(c==null)c=0 +s=Error() +A.lx(A.qi(a,b,c),s)}, +qi(a,b,c){var s,r,q,p,o,n,m,l,k +if(typeof b=="string")s=b +else{r="[]=;add;removeWhere;retainWhere;removeRange;setRange;setInt8;setInt16;setInt32;setUint8;setUint16;setUint32;setFloat32;setFloat64".split(";") +q=r.length +p=b +if(p>q){c=p/q|0 +p%=q}s=r[p]}o=typeof c=="string"?c:"modify;remove from;add to".split(";")[c] +n=t.j.b(a)?"list":"ByteData" +m=a.$flags|0 +l="a " +if((m&4)!==0)k="constant " +else if((m&2)!==0){k="unmodifiable " +l="an "}else k=(m&1)!==0?"fixed-length ":"" +return new A.d4("'"+s+"': Cannot "+o+" "+l+k+n)}, +aJ(a){throw A.c(A.ag(a))}, +aY(a){var s,r,q,p,o,n +a=A.nA(a.replace(String({}),"$receiver$")) +s=a.match(/\\\$[a-zA-Z]+\\\$/g) +if(s==null)s=A.u([],t.s) +r=s.indexOf("\\$arguments\\$") +q=s.indexOf("\\$argumentsExpr\\$") +p=s.indexOf("\\$expr\\$") +o=s.indexOf("\\$method\\$") +n=s.indexOf("\\$receiver\\$") +return new A.ia(a.replace(new RegExp("\\\\\\$arguments\\\\\\$","g"),"((?:x|[^x])*)").replace(new RegExp("\\\\\\$argumentsExpr\\\\\\$","g"),"((?:x|[^x])*)").replace(new RegExp("\\\\\\$expr\\\\\\$","g"),"((?:x|[^x])*)").replace(new RegExp("\\\\\\$method\\\\\\$","g"),"((?:x|[^x])*)").replace(new RegExp("\\\\\\$receiver\\\\\\$","g"),"((?:x|[^x])*)"),r,q,p,o,n)}, +ib(a){return function($expr$){var $argumentsExpr$="$arguments$" +try{$expr$.$method$($argumentsExpr$)}catch(s){return s.message}}(a)}, +mn(a){return function($expr$){try{$expr$.$method$}catch(s){return s.message}}(a)}, +kE(a,b){var s=b==null,r=s?null:b.method +return new A.ee(a,r,s?null:b.receiver)}, +L(a){var s +if(a==null)return new A.hb(a) +if(a instanceof A.cF){s=a.a +return A.bo(a,s==null?t.K.a(s):s)}if(typeof a!=="object")return a +if("dartException" in a)return A.bo(a,a.dartException) +return A.qM(a)}, +bo(a,b){if(t.Q.b(b))if(b.$thrownJsError==null)b.$thrownJsError=a +return b}, +qM(a){var s,r,q,p,o,n,m,l,k,j,i,h,g +if(!("message" in a))return a +s=a.message +if("number" in a&&typeof a.number=="number"){r=a.number +q=r&65535 +if((B.c.E(r,16)&8191)===10)switch(q){case 438:return A.bo(a,A.kE(A.o(s)+" (Error "+q+")",null)) +case 445:case 5007:A.o(s) +return A.bo(a,new A.cT())}}if(a instanceof TypeError){p=$.nH() +o=$.nI() +n=$.nJ() +m=$.nK() +l=$.nN() +k=$.nO() +j=$.nM() +$.nL() +i=$.nQ() +h=$.nP() +g=p.a_(s) +if(g!=null)return A.bo(a,A.kE(A.M(s),g)) +else{g=o.a_(s) +if(g!=null){g.method="call" +return A.bo(a,A.kE(A.M(s),g))}else if(n.a_(s)!=null||m.a_(s)!=null||l.a_(s)!=null||k.a_(s)!=null||j.a_(s)!=null||m.a_(s)!=null||i.a_(s)!=null||h.a_(s)!=null){A.M(s) +return A.bo(a,new A.cT())}}return A.bo(a,new A.eF(typeof s=="string"?s:""))}if(a instanceof RangeError){if(typeof s=="string"&&s.indexOf("call stack")!==-1)return new A.d2() +s=function(b){try{return String(b)}catch(f){}return null}(a) +return A.bo(a,new A.as(!1,null,null,typeof s=="string"?s.replace(/^RangeError:\s*/,""):s))}if(typeof InternalError=="function"&&a instanceof InternalError)if(typeof s=="string"&&s==="too much recursion")return new A.d2() +return a}, +ab(a){var s +if(a instanceof A.cF)return a.b +if(a==null)return new A.dp(a) +s=a.$cachedTrace +if(s!=null)return s +s=new A.dp(a) +if(typeof a==="object")a.$cachedTrace=s +return s}, +lv(a){if(a==null)return J.aL(a) +if(typeof a=="object")return A.er(a) +return J.aL(a)}, +r2(a,b){var s,r,q,p=a.length +for(s=0;s=0 +else if(b instanceof A.cK){s=B.a.Z(a,c) +return b.b.test(s)}else return!J.o2(b,B.a.Z(a,c)).gW(0)}, +r0(a){if(a.indexOf("$",0)>=0)return a.replace(/\$/g,"$$$$") +return a}, +nA(a){if(/[[\]{}()*+?.\\^$|]/.test(a))return a.replace(/[[\]{}()*+?.\\^$|]/g,"\\$&") +return a}, +rl(a,b,c){var s=A.rm(a,b,c) +return s}, +rm(a,b,c){var s,r,q +if(b===""){if(a==="")return c +s=a.length +r=""+c +for(q=0;q=0)return a.split(b).join(c) +return a.replace(new RegExp(A.nA(b),"g"),A.r0(c))}, +bl:function bl(a,b){this.a=a +this.b=b}, +cn:function cn(a,b){this.a=a +this.b=b}, +cC:function cC(){}, +cD:function cD(a,b,c){this.a=a +this.b=b +this.$ti=c}, +bP:function bP(a,b){this.a=a +this.$ti=b}, +dd:function dd(a,b,c){var _=this +_.a=a +_.b=b +_.c=0 +_.d=null +_.$ti=c}, +ia:function ia(a,b,c,d,e,f){var _=this +_.a=a +_.b=b +_.c=c +_.d=d +_.e=e +_.f=f}, +cT:function cT(){}, +ee:function ee(a,b,c){this.a=a +this.b=b +this.c=c}, +eF:function eF(a){this.a=a}, +hb:function hb(a){this.a=a}, +cF:function cF(a,b){this.a=a +this.b=b}, +dp:function dp(a){this.a=a +this.b=null}, +ba:function ba(){}, +dT:function dT(){}, +dU:function dU(){}, +eD:function eD(){}, +eA:function eA(){}, +bY:function bY(a,b){this.a=a +this.b=b}, +eZ:function eZ(a){this.a=a}, +ev:function ev(a){this.a=a}, +eW:function eW(a){this.a=a}, +aQ:function aQ(a){var _=this +_.a=0 +_.f=_.e=_.d=_.c=_.b=null +_.r=0 +_.$ti=a}, +h4:function h4(a){this.a=a}, +h3:function h3(a){this.a=a}, +h5:function h5(a,b){var _=this +_.a=a +_.b=b +_.d=_.c=null}, +aR:function aR(a,b){this.a=a +this.$ti=b}, +cM:function cM(a,b,c){var _=this +_.a=a +_.b=b +_.d=_.c=null +_.$ti=c}, +kc:function kc(a){this.a=a}, +kd:function kd(a){this.a=a}, +ke:function ke(a){this.a=a}, +bk:function bk(){}, +bR:function bR(){}, +cK:function cK(a,b){var _=this +_.a=a +_.b=b +_.d=_.c=null}, +di:function di(a){this.b=a}, +eU:function eU(a,b,c){this.a=a +this.b=b +this.c=c}, +eV:function eV(a,b,c){var _=this +_.a=a +_.b=b +_.c=c +_.d=null}, +d3:function d3(a,b){this.a=a +this.c=b}, +fl:function fl(a,b,c){this.a=a +this.b=b +this.c=c}, +fm:function fm(a,b,c){var _=this +_.a=a +_.b=b +_.c=c +_.d=null}, +aK(a){A.lx(new A.c8("Field '"+a+"' has not been initialized."),new Error())}, +fz(a){A.lx(new A.c8("Field '"+a+"' has been assigned during initialization."),new Error())}, +iA(a){var s=new A.iz(a) +return s.b=s}, +iz:function iz(a){this.a=a +this.b=null}, +qf(a){return a}, +fs(a,b,c){}, +qj(a){return a}, +oI(a,b,c){var s +A.fs(a,b,c) +s=new DataView(a,b) +return s}, +by(a,b,c){A.fs(a,b,c) +c=B.c.F(a.byteLength-b,4) +return new Int32Array(a,b,c)}, +oJ(a,b,c){A.fs(a,b,c) +return new Uint32Array(a,b,c)}, +oK(a){return new Uint8Array(a)}, +aT(a,b,c){A.fs(a,b,c) +return c==null?new Uint8Array(a,b):new Uint8Array(a,b,c)}, +b2(a,b,c){if(a>>>0!==a||a>=c)throw A.c(A.k7(b,a))}, +qg(a,b,c){var s +if(!(a>>>0!==a))s=b>>>0!==b||a>b||b>c +else s=!0 +if(s)throw A.c(A.qZ(a,b,c)) +return b}, +cb:function cb(){}, +cR:function cR(){}, +fp:function fp(a){this.a=a}, +cQ:function cQ(){}, +a4:function a4(){}, +be:function be(){}, +al:function al(){}, +eg:function eg(){}, +eh:function eh(){}, +ei:function ei(){}, +ej:function ej(){}, +ek:function ek(){}, +el:function el(){}, +em:function em(){}, +cS:function cS(){}, +bz:function bz(){}, +dj:function dj(){}, +dk:function dk(){}, +dl:function dl(){}, +dm:function dm(){}, +me(a,b){var s=b.c +return s==null?b.c=A.lc(a,b.x,!0):s}, +kK(a,b){var s=b.c +return s==null?b.c=A.dt(a,"z",[b.x]):s}, +mf(a){var s=a.w +if(s===6||s===7||s===8)return A.mf(a.x) +return s===12||s===13}, +oU(a){return a.as}, +aB(a){return A.fo(v.typeUniverse,a,!1)}, +bn(a1,a2,a3,a4){var s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0=a2.w +switch(a0){case 5:case 1:case 2:case 3:case 4:return a2 +case 6:s=a2.x +r=A.bn(a1,s,a3,a4) +if(r===s)return a2 +return A.mN(a1,r,!0) +case 7:s=a2.x +r=A.bn(a1,s,a3,a4) +if(r===s)return a2 +return A.lc(a1,r,!0) +case 8:s=a2.x +r=A.bn(a1,s,a3,a4) +if(r===s)return a2 +return A.mL(a1,r,!0) +case 9:q=a2.y +p=A.cs(a1,q,a3,a4) +if(p===q)return a2 +return A.dt(a1,a2.x,p) +case 10:o=a2.x +n=A.bn(a1,o,a3,a4) +m=a2.y +l=A.cs(a1,m,a3,a4) +if(n===o&&l===m)return a2 +return A.la(a1,n,l) +case 11:k=a2.x +j=a2.y +i=A.cs(a1,j,a3,a4) +if(i===j)return a2 +return A.mM(a1,k,i) +case 12:h=a2.x +g=A.bn(a1,h,a3,a4) +f=a2.y +e=A.qJ(a1,f,a3,a4) +if(g===h&&e===f)return a2 +return A.mK(a1,g,e) +case 13:d=a2.y +a4+=d.length +c=A.cs(a1,d,a3,a4) +o=a2.x +n=A.bn(a1,o,a3,a4) +if(c===d&&n===o)return a2 +return A.lb(a1,n,c,!0) +case 14:b=a2.x +if(b=p)return A.b(q,0) +s=A.dv(v.typeUniverse,A.ln(q[0]),"@<0>") +for(r=1;r=0)p+=" "+r[q];++q}return p+"})"}, +n9(a4,a5,a6){var s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2=", ",a3=null +if(a6!=null){s=a6.length +if(a5==null)a5=A.u([],t.s) +else a3=a5.length +r=a5.length +for(q=s;q>0;--q)B.b.n(a5,"T"+(r+q)) +for(p=t.X,o=t._,n="<",m="",q=0;q=0))return A.b(a5,k) +n=n+m+a5[k] +j=a6[q] +i=j.w +if(!(i===2||i===3||i===4||i===5||j===p))l=j===o +else l=!0 +if(!l)n+=" extends "+A.ai(j,a5)}n+=">"}else n="" +p=a4.x +h=a4.y +g=h.a +f=g.length +e=h.b +d=e.length +c=h.c +b=c.length +a=A.ai(p,a5) +for(a0="",a1="",q=0;q0){a0+=a1+"[" +for(a1="",q=0;q0){a0+=a1+"{" +for(a1="",q=0;q "+a}, +ai(a,b){var s,r,q,p,o,n,m,l=a.w +if(l===5)return"erased" +if(l===2)return"dynamic" +if(l===3)return"void" +if(l===1)return"Never" +if(l===4)return"any" +if(l===6)return A.ai(a.x,b) +if(l===7){s=a.x +r=A.ai(s,b) +q=s.w +return(q===12||q===13?"("+r+")":r)+"?"}if(l===8)return"FutureOr<"+A.ai(a.x,b)+">" +if(l===9){p=A.qL(a.x) +o=a.y +return o.length>0?p+("<"+A.nj(o,b)+">"):p}if(l===11)return A.qE(a,b) +if(l===12)return A.n9(a,b,null) +if(l===13)return A.n9(a.x,b,a.y) +if(l===14){n=a.x +m=b.length +n=m-1-n +if(!(n>=0&&n0)p+="<"+A.ds(c)+">" +s=a.eC.get(p) +if(s!=null)return s +r=new A.at(null,null) +r.w=9 +r.x=b +r.y=c +if(c.length>0)r.c=c[0] +r.as=p +q=A.b1(a,r) +a.eC.set(p,q) +return q}, +la(a,b,c){var s,r,q,p,o,n +if(b.w===10){s=b.x +r=b.y.concat(c)}else{r=c +s=b}q=s.as+(";<"+A.ds(r)+">") +p=a.eC.get(q) +if(p!=null)return p +o=new A.at(null,null) +o.w=10 +o.x=s +o.y=r +o.as=q +n=A.b1(a,o) +a.eC.set(q,n) +return n}, +mM(a,b,c){var s,r,q="+"+(b+"("+A.ds(c)+")"),p=a.eC.get(q) +if(p!=null)return p +s=new A.at(null,null) +s.w=11 +s.x=b +s.y=c +s.as=q +r=A.b1(a,s) +a.eC.set(q,r) +return r}, +mK(a,b,c){var s,r,q,p,o,n=b.as,m=c.a,l=m.length,k=c.b,j=k.length,i=c.c,h=i.length,g="("+A.ds(m) +if(j>0){s=l>0?",":"" +g+=s+"["+A.ds(k)+"]"}if(h>0){s=l>0?",":"" +g+=s+"{"+A.pJ(i)+"}"}r=n+(g+")") +q=a.eC.get(r) +if(q!=null)return q +p=new A.at(null,null) +p.w=12 +p.x=b +p.y=c +p.as=r +o=A.b1(a,p) +a.eC.set(r,o) +return o}, +lb(a,b,c,d){var s,r=b.as+("<"+A.ds(c)+">"),q=a.eC.get(r) +if(q!=null)return q +s=A.pL(a,b,c,r,d) +a.eC.set(r,s) +return s}, +pL(a,b,c,d,e){var s,r,q,p,o,n,m,l +if(e){s=c.length +r=A.jP(s) +for(q=0,p=0;p0){n=A.bn(a,b,r,0) +m=A.cs(a,c,r,0) +return A.lb(a,n,m,c!==m)}}l=new A.at(null,null) +l.w=13 +l.x=b +l.y=c +l.as=d +return A.b1(a,l)}, +mF(a,b,c,d){return{u:a,e:b,r:c,s:[],p:0,n:d}}, +mH(a){var s,r,q,p,o,n,m,l=a.r,k=a.s +for(s=l.length,r=0;r=48&&q<=57)r=A.pC(r+1,q,l,k) +else if((((q|32)>>>0)-97&65535)<26||q===95||q===36||q===124)r=A.mG(a,r,l,k,!1) +else if(q===46)r=A.mG(a,r,l,k,!0) +else{++r +switch(q){case 44:break +case 58:k.push(!1) +break +case 33:k.push(!0) +break +case 59:k.push(A.bj(a.u,a.e,k.pop())) +break +case 94:k.push(A.pO(a.u,k.pop())) +break +case 35:k.push(A.du(a.u,5,"#")) +break +case 64:k.push(A.du(a.u,2,"@")) +break +case 126:k.push(A.du(a.u,3,"~")) +break +case 60:k.push(a.p) +a.p=k.length +break +case 62:A.pE(a,k) +break +case 38:A.pD(a,k) +break +case 42:p=a.u +k.push(A.mN(p,A.bj(p,a.e,k.pop()),a.n)) +break +case 63:p=a.u +k.push(A.lc(p,A.bj(p,a.e,k.pop()),a.n)) +break +case 47:p=a.u +k.push(A.mL(p,A.bj(p,a.e,k.pop()),a.n)) +break +case 40:k.push(-3) +k.push(a.p) +a.p=k.length +break +case 41:A.pB(a,k) +break +case 91:k.push(a.p) +a.p=k.length +break +case 93:o=k.splice(a.p) +A.mI(a.u,a.e,o) +a.p=k.pop() +k.push(o) +k.push(-1) +break +case 123:k.push(a.p) +a.p=k.length +break +case 125:o=k.splice(a.p) +A.pG(a.u,a.e,o) +a.p=k.pop() +k.push(o) +k.push(-2) +break +case 43:n=l.indexOf("(",r) +k.push(l.substring(r,n)) +k.push(-4) +k.push(a.p) +a.p=k.length +r=n+1 +break +default:throw"Bad character "+q}}}m=k.pop() +return A.bj(a.u,a.e,m)}, +pC(a,b,c,d){var s,r,q=b-48 +for(s=c.length;a=48&&r<=57))break +q=q*10+(r-48)}d.push(q) +return a}, +mG(a,b,c,d,e){var s,r,q,p,o,n,m=b+1 +for(s=c.length;m>>0)-97&65535)<26||r===95||r===36||r===124))q=r>=48&&r<=57 +else q=!0 +if(!q)break}}p=c.substring(b,m) +if(e){s=a.u +o=a.e +if(o.w===10)o=o.x +n=A.pS(s,o.x)[p] +if(n==null)A.J('No "'+p+'" in "'+A.oU(o)+'"') +d.push(A.dv(s,o,n))}else d.push(p) +return m}, +pE(a,b){var s,r=a.u,q=A.mE(a,b),p=b.pop() +if(typeof p=="string")b.push(A.dt(r,p,q)) +else{s=A.bj(r,a.e,p) +switch(s.w){case 12:b.push(A.lb(r,s,q,a.n)) +break +default:b.push(A.la(r,s,q)) +break}}}, +pB(a,b){var s,r,q,p=a.u,o=b.pop(),n=null,m=null +if(typeof o=="number")switch(o){case-1:n=b.pop() +break +case-2:m=b.pop() +break +default:b.push(o) +break}else b.push(o) +s=A.mE(a,b) +o=b.pop() +switch(o){case-3:o=b.pop() +if(n==null)n=p.sEA +if(m==null)m=p.sEA +r=A.bj(p,a.e,o) +q=new A.f2() +q.a=s +q.b=n +q.c=m +b.push(A.mK(p,r,q)) +return +case-4:b.push(A.mM(p,b.pop(),s)) +return +default:throw A.c(A.dM("Unexpected state under `()`: "+A.o(o)))}}, +pD(a,b){var s=b.pop() +if(0===s){b.push(A.du(a.u,1,"0&")) +return}if(1===s){b.push(A.du(a.u,4,"1&")) +return}throw A.c(A.dM("Unexpected extended operation "+A.o(s)))}, +mE(a,b){var s=b.splice(a.p) +A.mI(a.u,a.e,s) +a.p=b.pop() +return s}, +bj(a,b,c){if(typeof c=="string")return A.dt(a,c,a.sEA) +else if(typeof c=="number"){b.toString +return A.pF(a,b,c)}else return c}, +mI(a,b,c){var s,r=c.length +for(s=0;sn)return!1 +m=n-o +l=s.b +k=r.b +j=l.length +i=k.length +if(o+j=d)return!1 +a1=f[b] +b+=3 +if(a00?new Array(q):v.typeUniverse.sEA +for(o=0;o0?new Array(a):v.typeUniverse.sEA}, +at:function at(a,b){var _=this +_.a=a +_.b=b +_.r=_.f=_.d=_.c=null +_.w=0 +_.as=_.Q=_.z=_.y=_.x=null}, +f2:function f2(){this.c=this.b=this.a=null}, +jL:function jL(a){this.a=a}, +f0:function f0(){}, +dr:function dr(a){this.a=a}, +po(){var s,r,q={} +if(self.scheduleImmediate!=null)return A.qR() +if(self.MutationObserver!=null&&self.document!=null){s=self.document.createElement("div") +r=self.document.createElement("span") +q.a=null +new self.MutationObserver(A.bT(new A.is(q),1)).observe(s,{childList:true}) +return new A.ir(q,s,r)}else if(self.setImmediate!=null)return A.qS() +return A.qT()}, +pp(a){self.scheduleImmediate(A.bT(new A.it(t.M.a(a)),0))}, +pq(a){self.setImmediate(A.bT(new A.iu(t.M.a(a)),0))}, +pr(a){A.mm(B.r,t.M.a(a))}, +mm(a,b){var s=B.c.F(a.a,1000) +return A.pH(s<0?0:s,b)}, +pH(a,b){var s=new A.jJ(!0) +s.dK(a,b) +return s}, +l(a){return new A.d8(new A.w($.x,a.h("w<0>")),a.h("d8<0>"))}, +k(a,b){a.$2(0,null) +b.b=!0 +return b.a}, +f(a,b){A.q9(a,b)}, +j(a,b){b.U(a)}, +i(a,b){b.c3(A.L(a),A.ab(a))}, +q9(a,b){var s,r,q=new A.jR(b),p=new A.jS(b) +if(a instanceof A.w)a.cP(q,p,t.z) +else{s=t.z +if(a instanceof A.w)a.bq(q,p,s) +else{r=new A.w($.x,t.e) +r.a=8 +r.c=a +r.cP(q,p,s)}}}, +m(a){var s=function(b,c){return function(d,e){while(true){try{b(d,e) +break}catch(r){e=r +d=c}}}}(a,1) +return $.x.da(new A.k3(s),t.H,t.S,t.z)}, +mJ(a,b,c){return 0}, +kx(a){var s +if(t.Q.b(a)){s=a.gam() +if(s!=null)return s}return B.j}, +on(a,b){var s=new A.w($.x,b.h("w<0>")) +A.pj(B.r,new A.fY(a,s)) +return s}, +oo(a,b){var s,r,q,p,o,n=null +try{n=a.$0()}catch(p){s=A.L(p) +r=A.ab(p) +q=new A.w($.x,b.h("w<0>")) +s=s +r=r +o=A.lk(s,r) +if(o!=null){s=o.a +r=o.b}q.an(s,r) +return q}return b.h("z<0>").b(n)?n:A.mC(n,b)}, +lT(a){var s +a.a(null) +s=new A.w($.x,a.h("w<0>")) +s.bB(null) +return s}, +kz(a,b){var s,r,q,p,o,n,m,l,k,j={},i=null,h=!1,g=b.h("w>"),f=new A.w($.x,g) +j.a=null +j.b=0 +j.c=j.d=null +s=new A.h_(j,i,h,f) +try{for(n=J.W(a),m=t.P;n.m();){r=n.gp() +q=j.b +r.bq(new A.fZ(j,q,f,b,i,h),s,m);++j.b}n=j.b +if(n===0){n=f +n.aI(A.u([],b.h("E<0>"))) +return n}j.a=A.cO(n,null,!1,b.h("0?"))}catch(l){p=A.L(l) +o=A.ab(l) +if(j.b===0||A.b4(h)){k=A.na(p,o) +g=new A.w($.x,g) +g.an(k.a,k.b) +return g}else{j.d=p +j.c=o}}return f}, +lk(a,b){var s,r,q,p=$.x +if(p===B.e)return null +s=p.eH(a,b) +if(s==null)return null +r=s.a +q=s.b +if(t.Q.b(r))A.kJ(r,q) +return s}, +na(a,b){var s +if($.x!==B.e){s=A.lk(a,b) +if(s!=null)return s}if(b==null)if(t.Q.b(a)){b=a.gam() +if(b==null){A.kJ(a,B.j) +b=B.j}}else b=B.j +else if(t.Q.b(a))A.kJ(a,b) +return new A.aN(a,b)}, +mC(a,b){var s=new A.w($.x,b.h("w<0>")) +b.a(a) +s.a=8 +s.c=a +return s}, +l8(a,b){var s,r,q +for(s=t.e;r=a.a,(r&4)!==0;)a=s.a(a.c) +if(a===b){b.an(new A.as(!0,a,null,"Cannot complete a future with itself"),A.mk()) +return}s=r|b.a&1 +a.a=s +if((s&24)!==0){q=b.b5() +b.b0(a) +A.cm(b,q)}else{q=t.d.a(b.c) +b.cJ(a) +a.bV(q)}}, +pz(a,b){var s,r,q,p={},o=p.a=a +for(s=t.e;r=o.a,(r&4)!==0;o=a){a=s.a(o.c) +p.a=a}if(o===b){b.an(new A.as(!0,o,null,"Cannot complete a future with itself"),A.mk()) +return}if((r&24)===0){q=t.d.a(b.c) +b.cJ(o) +p.a.bV(q) +return}if((r&16)===0&&b.c==null){b.b0(o) +return}b.a^=2 +b.b.ak(new A.iM(p,b))}, +cm(a,a0){var s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c={},b=c.a=a +for(s=t.n,r=t.d,q=t.fR;!0;){p={} +o=b.a +n=(o&16)===0 +m=!n +if(a0==null){if(m&&(o&1)===0){l=s.a(b.c) +b.b.d1(l.a,l.b)}return}p.a=a0 +k=a0.a +for(b=a0;k!=null;b=k,k=j){b.a=null +A.cm(c.a,b) +p.a=k +j=k.a}o=c.a +i=o.c +p.b=m +p.c=i +if(n){h=b.c +h=(h&1)!==0||(h&15)===8}else h=!0 +if(h){g=b.b.b +if(m){b=o.b +b=!(b===g||b.gau()===g.gau())}else b=!1 +if(b){b=c.a +l=s.a(b.c) +b.b.d1(l.a,l.b) +return}f=$.x +if(f!==g)$.x=g +else f=null +b=p.a.c +if((b&15)===8)new A.iT(p,c,m).$0() +else if(n){if((b&1)!==0)new A.iS(p,i).$0()}else if((b&2)!==0)new A.iR(c,p).$0() +if(f!=null)$.x=f +b=p.c +if(b instanceof A.w){o=p.a.$ti +o=o.h("z<2>").b(b)||!o.y[1].b(b)}else o=!1 +if(o){q.a(b) +e=p.a.b +if((b.a&24)!==0){d=r.a(e.c) +e.c=null +a0=e.b6(d) +e.a=b.a&30|e.a&1 +e.c=b.c +c.a=b +continue}else A.l8(b,e) +return}}e=p.a.b +d=r.a(e.c) +e.c=null +a0=e.b6(d) +b=p.b +o=p.c +if(!b){e.$ti.c.a(o) +e.a=8 +e.c=o}else{s.a(o) +e.a=e.a&1|16 +e.c=o}c.a=e +b=e}}, +qF(a,b){if(t.U.b(a))return b.da(a,t.z,t.K,t.l) +if(t.v.b(a))return b.dd(a,t.z,t.K) +throw A.c(A.aM(a,"onError",u.c))}, +qD(){var s,r +for(s=$.cr;s!=null;s=$.cr){$.dG=null +r=s.b +$.cr=r +if(r==null)$.dF=null +s.a.$0()}}, +qI(){$.ll=!0 +try{A.qD()}finally{$.dG=null +$.ll=!1 +if($.cr!=null)$.ly().$1(A.nq())}}, +nl(a){var s=new A.eX(a),r=$.dF +if(r==null){$.cr=$.dF=s +if(!$.ll)$.ly().$1(A.nq())}else $.dF=r.b=s}, +qH(a){var s,r,q,p=$.cr +if(p==null){A.nl(a) +$.dG=$.dF +return}s=new A.eX(a) +r=$.dG +if(r==null){s.b=p +$.cr=$.dG=s}else{q=r.b +s.b=q +$.dG=r.b=s +if(q==null)$.dF=s}}, +rj(a){var s,r=null,q=$.x +if(B.e===q){A.k1(r,r,B.e,a) +return}if(B.e===q.gen().a)s=B.e.gau()===q.gau() +else s=!1 +if(s){A.k1(r,r,q,q.dc(a,t.H)) +return}s=$.x +s.ak(s.c2(a))}, +rw(a,b){return new A.fk(A.k6(a,"stream",t.K),b.h("fk<0>"))}, +pj(a,b){var s=$.x +if(s===B.e)return s.cW(a,b) +return s.cW(a,s.c2(b))}, +lm(a,b){A.qH(new A.k0(a,b))}, +nh(a,b,c,d,e){var s,r +t.E.a(a) +t.q.a(b) +t.x.a(c) +e.h("0()").a(d) +r=$.x +if(r===c)return d.$0() +$.x=c +s=r +try{r=d.$0() +return r}finally{$.x=s}}, +ni(a,b,c,d,e,f,g){var s,r +t.E.a(a) +t.q.a(b) +t.x.a(c) +f.h("@<0>").t(g).h("1(2)").a(d) +g.a(e) +r=$.x +if(r===c)return d.$1(e) +$.x=c +s=r +try{r=d.$1(e) +return r}finally{$.x=s}}, +qG(a,b,c,d,e,f,g,h,i){var s,r +t.E.a(a) +t.q.a(b) +t.x.a(c) +g.h("@<0>").t(h).t(i).h("1(2,3)").a(d) +h.a(e) +i.a(f) +r=$.x +if(r===c)return d.$2(e,f) +$.x=c +s=r +try{r=d.$2(e,f) +return r}finally{$.x=s}}, +k1(a,b,c,d){var s,r +t.M.a(d) +if(B.e!==c){s=B.e.gau() +r=c.gau() +d=s!==r?c.c2(d):c.ey(d,t.H)}A.nl(d)}, +is:function is(a){this.a=a}, +ir:function ir(a,b,c){this.a=a +this.b=b +this.c=c}, +it:function it(a){this.a=a}, +iu:function iu(a){this.a=a}, +jJ:function jJ(a){this.a=a +this.b=null +this.c=0}, +jK:function jK(a,b){this.a=a +this.b=b}, +d8:function d8(a,b){this.a=a +this.b=!1 +this.$ti=b}, +jR:function jR(a){this.a=a}, +jS:function jS(a){this.a=a}, +k3:function k3(a){this.a=a}, +dq:function dq(a,b){var _=this +_.a=a +_.e=_.d=_.c=_.b=null +_.$ti=b}, +co:function co(a,b){this.a=a +this.$ti=b}, +aN:function aN(a,b){this.a=a +this.b=b}, +fY:function fY(a,b){this.a=a +this.b=b}, +h_:function h_(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=c +_.d=d}, +fZ:function fZ(a,b,c,d,e,f){var _=this +_.a=a +_.b=b +_.c=c +_.d=d +_.e=e +_.f=f}, +cj:function cj(){}, +bL:function bL(a,b){this.a=a +this.$ti=b}, +Z:function Z(a,b){this.a=a +this.$ti=b}, +b0:function b0(a,b,c,d,e){var _=this +_.a=null +_.b=a +_.c=b +_.d=c +_.e=d +_.$ti=e}, +w:function w(a,b){var _=this +_.a=0 +_.b=a +_.c=null +_.$ti=b}, +iJ:function iJ(a,b){this.a=a +this.b=b}, +iQ:function iQ(a,b){this.a=a +this.b=b}, +iN:function iN(a){this.a=a}, +iO:function iO(a){this.a=a}, +iP:function iP(a,b,c){this.a=a +this.b=b +this.c=c}, +iM:function iM(a,b){this.a=a +this.b=b}, +iL:function iL(a,b){this.a=a +this.b=b}, +iK:function iK(a,b,c){this.a=a +this.b=b +this.c=c}, +iT:function iT(a,b,c){this.a=a +this.b=b +this.c=c}, +iU:function iU(a){this.a=a}, +iS:function iS(a,b){this.a=a +this.b=b}, +iR:function iR(a,b){this.a=a +this.b=b}, +eX:function eX(a){this.a=a +this.b=null}, +eB:function eB(){}, +i7:function i7(a,b){this.a=a +this.b=b}, +i8:function i8(a,b){this.a=a +this.b=b}, +fk:function fk(a,b){var _=this +_.a=null +_.b=a +_.c=!1 +_.$ti=b}, +fq:function fq(a,b,c){this.a=a +this.b=b +this.$ti=c}, +dA:function dA(){}, +k0:function k0(a,b){this.a=a +this.b=b}, +fe:function fe(){}, +jH:function jH(a,b,c){this.a=a +this.b=b +this.c=c}, +jG:function jG(a,b){this.a=a +this.b=b}, +jI:function jI(a,b,c){this.a=a +this.b=b +this.c=c}, +oD(a,b){return new A.aQ(a.h("@<0>").t(b).h("aQ<1,2>"))}, +ah(a,b,c){return b.h("@<0>").t(c).h("m_<1,2>").a(A.r2(a,new A.aQ(b.h("@<0>").t(c).h("aQ<1,2>"))))}, +O(a,b){return new A.aQ(a.h("@<0>").t(b).h("aQ<1,2>"))}, +oE(a){return new A.de(a.h("de<0>"))}, +l9(){var s=Object.create(null) +s[""]=s +delete s[""] +return s}, +mD(a,b,c){var s=new A.bQ(a,b,c.h("bQ<0>")) +s.c=a.e +return s}, +kF(a,b,c){var s=A.oD(b,c) +a.M(0,new A.h6(s,b,c)) +return s}, +h8(a){var s,r={} +if(A.lt(a))return"{...}" +s=new A.a9("") +try{B.b.n($.ar,a) +s.a+="{" +r.a=!0 +a.M(0,new A.h9(r,s)) +s.a+="}"}finally{if(0>=$.ar.length)return A.b($.ar,-1) +$.ar.pop()}r=s.a +return r.charCodeAt(0)==0?r:r}, +de:function de(a){var _=this +_.a=0 +_.f=_.e=_.d=_.c=_.b=null +_.r=0 +_.$ti=a}, +f7:function f7(a){this.a=a +this.c=this.b=null}, +bQ:function bQ(a,b,c){var _=this +_.a=a +_.b=b +_.d=_.c=null +_.$ti=c}, +h6:function h6(a,b,c){this.a=a +this.b=b +this.c=c}, +c9:function c9(a){var _=this +_.b=_.a=0 +_.c=null +_.$ti=a}, +df:function df(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=null +_.d=c +_.e=!1 +_.$ti=d}, +a2:function a2(){}, +r:function r(){}, +D:function D(){}, +h7:function h7(a){this.a=a}, +h9:function h9(a,b){this.a=a +this.b=b}, +ch:function ch(){}, +dg:function dg(a,b){this.a=a +this.$ti=b}, +dh:function dh(a,b,c){var _=this +_.a=a +_.b=b +_.c=null +_.$ti=c}, +dw:function dw(){}, +cd:function cd(){}, +dn:function dn(){}, +q1(a,b,c){var s,r,q,p,o=c-b +if(o<=4096)s=$.nW() +else s=new Uint8Array(o) +for(r=J.ao(a),q=0;q=16)return null +r=r*16+o}n=h-1 +if(!(h>=0&&h=0&&s=16)return null +r=r*16+o}m=n-1 +if(!(n>=0&&n=j)return A.b(i,0) +l=i[0]===0}else l=!1 +if(l)return $.b7() +l=A.au(j,i) +return new A.R(l===0?!1:c,i,l)}, +l7(a,b){var s,r,q,p,o,n +if(a==="")return null +s=$.nS().eO(a) +if(s==null)return null +r=s.b +q=r.length +if(1>=q)return A.b(r,1) +p=r[1]==="-" +if(4>=q)return A.b(r,4) +o=r[4] +n=r[3] +if(5>=q)return A.b(r,5) +if(o!=null)return A.pv(o,p) +if(n!=null)return A.pw(n,2,p) +return null}, +au(a,b){var s,r=b.length +while(!0){if(a>0){s=a-1 +if(!(s=0&&q=0;--s){p=s+c +if(!(s=0&&p=0;--s){q&2&&A.y(d) +if(!(s=0;--s){if(!(s=0&&n>>0 +p=B.c.aD((o&i)>>>0,k)}q&2&&A.y(d) +if(!(l>=0&&l=0;){r&2&&A.y(d) +if(!(q=0&&r=0&&m>>0,k) +q&2&&A.y(d) +if(!(p>>0 +s=B.c.aE(n,l)}q&2&&A.y(d) +if(!(r>=0&&r=0;--s){if(!(s=0&&o=0&&b=0&&o=0;e=l,c=o){o=c+1 +if(!(c=0&&e=0&&e=0&&c=0&&r>>0,a) +if(q>65535)return 65535 +return q}, +kf(a,b){var s=A.kI(a,b) +if(s!=null)return s +throw A.c(A.a1(a,null,null))}, +oi(a,b){a=A.c(a) +if(a==null)a=t.K.a(a) +a.stack=b.j(0) +throw a +throw A.c("unreachable")}, +cO(a,b,c,d){var s,r=c?J.ow(a,d):J.lX(a,d) +if(a!==0&&b!=null)for(s=0;s")) +for(s=J.W(a);s.m();)B.b.n(r,c.a(s.gp())) +if(b)return r +r.$flags=1 +return r}, +m1(a,b,c){var s +if(b)return A.m0(a,c) +s=A.m0(a,c) +s.$flags=1 +return s}, +m0(a,b){var s,r +if(Array.isArray(a))return A.u(a.slice(0),b.h("E<0>")) +s=A.u([],b.h("E<0>")) +for(r=J.W(a);r.m();)B.b.n(s,r.gp()) +return s}, +ef(a,b){var s=A.kG(a,!1,b) +s.$flags=3 +return s}, +ml(a,b,c){var s,r +A.a7(b,"start") +if(c!=null){s=c-b +if(s<0)throw A.c(A.S(c,b,null,"end",null)) +if(s===0)return""}r=A.ph(a,b,c) +return r}, +ph(a,b,c){var s=a.length +if(b>=s)return"" +return A.oQ(a,b,c==null||c>s?s:c)}, +ay(a,b){return new A.cK(a,A.lZ(a,!1,b,!1,!1,!1))}, +kW(a,b,c){var s=J.W(b) +if(!s.m())return a +if(c.length===0){do a+=A.o(s.gp()) +while(s.m())}else{a+=A.o(s.gp()) +for(;s.m();)a=a+c+A.o(s.gp())}return a}, +kZ(){var s,r,q=A.oM() +if(q==null)throw A.c(A.U("'Uri.base' is not supported")) +s=$.mr +if(s!=null&&q===$.mq)return s +r=A.ms(q) +$.mr=r +$.mq=q +return r}, +mk(){return A.ab(new Error())}, +oh(a){var s=Math.abs(a),r=a<0?"-":"" +if(s>=1000)return""+a +if(s>=100)return r+"0"+s +if(s>=10)return r+"00"+s +return r+"000"+s}, +lR(a){if(a>=100)return""+a +if(a>=10)return"0"+a +return"00"+a}, +e1(a){if(a>=10)return""+a +return"0"+a}, +e3(a){if(typeof a=="number"||A.dE(a)||a==null)return J.aC(a) +if(typeof a=="string")return JSON.stringify(a) +return A.mc(a)}, +oj(a,b){A.k6(a,"error",t.K) +A.k6(b,"stackTrace",t.l) +A.oi(a,b)}, +dM(a){return new A.cy(a)}, +a0(a,b){return new A.as(!1,null,b,a)}, +aM(a,b,c){return new A.as(!0,a,b,c)}, +cw(a,b,c){return a}, +md(a,b){return new A.cc(null,null,!0,a,b,"Value not in range")}, +S(a,b,c,d,e){return new A.cc(b,c,!0,a,d,"Invalid value")}, +oS(a,b,c,d){if(ac)throw A.c(A.S(a,b,c,d,null)) +return a}, +bB(a,b,c){if(0>a||a>c)throw A.c(A.S(a,0,c,"start",null)) +if(b!=null){if(a>b||b>c)throw A.c(A.S(b,a,c,"end",null)) +return b}return c}, +a7(a,b){if(a<0)throw A.c(A.S(a,0,null,b,null)) +return a}, +lV(a,b){var s=b.b +return new A.cG(s,!0,a,null,"Index out of range")}, +e8(a,b,c,d,e){return new A.cG(b,!0,a,e,"Index out of range")}, +oq(a,b,c,d,e){if(0>a||a>=b)throw A.c(A.e8(a,b,c,d,e==null?"index":e)) +return a}, +U(a){return new A.d4(a)}, +mo(a){return new A.eE(a)}, +T(a){return new A.bE(a)}, +ag(a){return new A.dX(a)}, +lS(a){return new A.iG(a)}, +a1(a,b,c){return new A.fX(a,b,c)}, +ov(a,b,c){var s,r +if(A.lt(a)){if(b==="("&&c===")")return"(...)" +return b+"..."+c}s=A.u([],t.s) +B.b.n($.ar,a) +try{A.qC(a,s)}finally{if(0>=$.ar.length)return A.b($.ar,-1) +$.ar.pop()}r=A.kW(b,t.hf.a(s),", ")+c +return r.charCodeAt(0)==0?r:r}, +kA(a,b,c){var s,r +if(A.lt(a))return b+"..."+c +s=new A.a9(b) +B.b.n($.ar,a) +try{r=s +r.a=A.kW(r.a,a,", ")}finally{if(0>=$.ar.length)return A.b($.ar,-1) +$.ar.pop()}s.a+=c +r=s.a +return r.charCodeAt(0)==0?r:r}, +qC(a,b){var s,r,q,p,o,n,m,l=a.gu(a),k=0,j=0 +while(!0){if(!(k<80||j<3))break +if(!l.m())return +s=A.o(l.gp()) +B.b.n(b,s) +k+=s.length+2;++j}if(!l.m()){if(j<=5)return +if(0>=b.length)return A.b(b,-1) +r=b.pop() +if(0>=b.length)return A.b(b,-1) +q=b.pop()}else{p=l.gp();++j +if(!l.m()){if(j<=4){B.b.n(b,A.o(p)) +return}r=A.o(p) +if(0>=b.length)return A.b(b,-1) +q=b.pop() +k+=r.length+2}else{o=l.gp();++j +for(;l.m();p=o,o=n){n=l.gp();++j +if(j>100){while(!0){if(!(k>75&&j>3))break +if(0>=b.length)return A.b(b,-1) +k-=b.pop().length+2;--j}B.b.n(b,"...") +return}}q=A.o(p) +r=A.o(o) +k+=r.length+q.length+4}}if(j>b.length+2){k+=5 +m="..."}else m=null +while(!0){if(!(k>80&&b.length>3))break +if(0>=b.length)return A.b(b,-1) +k-=b.pop().length+2 +if(m==null){k+=5 +m="..."}}if(m!=null)B.b.n(b,m) +B.b.n(b,q) +B.b.n(b,r)}, +m3(a,b,c,d){var s +if(B.h===c){s=B.c.gv(a) +b=J.aL(b) +return A.kX(A.bg(A.bg($.kv(),s),b))}if(B.h===d){s=B.c.gv(a) +b=J.aL(b) +c=J.aL(c) +return A.kX(A.bg(A.bg(A.bg($.kv(),s),b),c))}s=B.c.gv(a) +b=J.aL(b) +c=J.aL(c) +d=J.aL(d) +d=A.kX(A.bg(A.bg(A.bg(A.bg($.kv(),s),b),c),d)) +return d}, +aw(a){var s=$.ny +if(s==null)A.nx(a) +else s.$1(a)}, +ms(a5){var s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2,a3=null,a4=a5.length +if(a4>=5){if(4>=a4)return A.b(a5,4) +s=((a5.charCodeAt(4)^58)*3|a5.charCodeAt(0)^100|a5.charCodeAt(1)^97|a5.charCodeAt(2)^116|a5.charCodeAt(3)^97)>>>0 +if(s===0)return A.mp(a4=14)B.b.k(r,7,a4) +q=r[1] +if(q>=0)if(A.nk(a5,0,q,20,r)===20)r[7]=q +p=r[2]+1 +o=r[3] +n=r[4] +m=r[5] +l=r[6] +if(lq+3)){i=o>0 +if(!(i&&o+1===n)){if(!B.a.K(a5,"\\",n))if(p>0)h=B.a.K(a5,"\\",p-1)||B.a.K(a5,"\\",p-2) +else h=!1 +else h=!0 +if(!h){if(!(mn+2&&B.a.K(a5,"/..",m-3) +else h=!0 +if(!h)if(q===4){if(B.a.K(a5,"file",0)){if(p<=0){if(!B.a.K(a5,"/",n)){g="file:///" +s=3}else{g="file://" +s=2}a5=g+B.a.q(a5,n,a4) +m+=s +l+=s +a4=a5.length +p=7 +o=7 +n=7}else if(n===m){++l +f=m+1 +a5=B.a.az(a5,n,m,"/");++a4 +m=f}j="file"}else if(B.a.K(a5,"http",0)){if(i&&o+3===n&&B.a.K(a5,"80",o+1)){l-=3 +e=n-3 +m-=3 +a5=B.a.az(a5,o,n,"") +a4-=3 +n=e}j="http"}}else if(q===5&&B.a.K(a5,"https",0)){if(i&&o+4===n&&B.a.K(a5,"443",o+1)){l-=4 +e=n-4 +m-=4 +a5=B.a.az(a5,o,n,"") +a4-=3 +n=e}j="https"}k=!h}}}}if(k)return new A.fh(a40)j=A.pX(a5,0,q) +else{if(q===0)A.cq(a5,0,"Invalid empty scheme") +j=""}d=a3 +if(p>0){c=q+3 +b=c=0&&r9)j.$2("invalid character",r)}else{if(p===3)j.$2(l,r) +n=A.kf(B.a.q(a,q,r),null) +if(n>255)j.$2(k,q) +m=p+1 +if(!(p<4))return A.b(i,p) +i[p]=n +q=r+1 +p=m}}if(p!==3)j.$2(l,c) +n=A.kf(B.a.q(a,q,c),null) +if(n>255)j.$2(k,q) +if(!(p<4))return A.b(i,p) +i[p]=n +return i}, +mt(a,a0,a1){var s,r,q,p,o,n,m,l,k,j,i,h,g,f,e=null,d=new A.ie(a),c=new A.ig(d,a),b=a.length +if(b<2)d.$2("address is too short",e) +s=A.u([],t.t) +for(r=a0,q=r,p=!1,o=!1;r=0&&r>>0) +B.b.n(s,(l[2]<<8|l[3])>>>0)}if(p){if(s.length>7)d.$2("an address with a wildcard must have less than 7 parts",e)}else if(s.length!==8)d.$2("an address without a wildcard must contain exactly 8 parts",e) +k=new Uint8Array(16) +for(b=s.length,j=9-b,r=0,i=0;r=0&&i<16))return A.b(k,i) +k[i]=0 +f=i+1 +if(!(f<16))return A.b(k,f) +k[f]=0 +i+=2}else{f=B.c.E(h,8) +if(!(i>=0&&i<16))return A.b(k,i) +k[i]=f +f=i+1 +if(!(f<16))return A.b(k,f) +k[f]=h&255 +i+=2}}return k}, +mP(a,b,c,d,e,f,g){return new A.dx(a,b,c,d,e,f,g)}, +mQ(a){if(a==="http")return 80 +if(a==="https")return 443 +return 0}, +cq(a,b,c){throw A.c(A.a1(c,a,b))}, +pU(a,b){var s,r,q +for(s=a.length,r=0;r=0&&b=0&&r=b&&q=b&&s=0&&r>>4 +if(!(m<8))return A.b(B.n,m) +m=(B.n[m]&1<<(o&15))!==0}else m=!1 +if(m){if(p&&65<=o&&90>=o){if(h==null)h=new A.a9("") +if(q=0&&r>>4 +if(!(l<8))return A.b(B.t,l) +l=(B.t[l]&1<<(n&15))!==0}else l=!1 +if(l){if(o&&65<=n&&90>=n){if(p==null)p=new A.a9("") +if(q>>4 +if(!(l<8))return A.b(B.m,l) +l=(B.m[l]&1<<(n&15))!==0}else l=!1 +if(l)A.cq(a,r,"Invalid character") +else{i=1 +if((n&64512)===55296&&r+1>>4 +if(!(o<8))return A.b(B.l,o) +o=(B.l[o]&1<<(p&15))!==0}else o=!1 +if(!o)A.cq(a,r,"Illegal scheme character") +if(65<=p&&p<=90)q=!0}a=B.a.q(a,b,c) +return A.pT(q?a.toLowerCase():a)}, +pT(a){if(a==="http")return"http" +if(a==="file")return"file" +if(a==="https")return"https" +if(a==="package")return"package" +return a}, +mY(a,b,c){if(a==null)return"" +return A.dy(a,b,c,B.O,!1,!1)}, +mV(a,b,c,d,e,f){var s,r=e==="file",q=r||f +if(a==null)return r?"/":"" +else s=A.dy(a,b,c,B.u,!0,!0) +if(s.length===0){if(r)return"/"}else if(q&&!B.a.J(s,"/"))s="/"+s +return A.pY(s,e,f)}, +pY(a,b,c){var s=b.length===0 +if(s&&!c&&!B.a.J(a,"/")&&!B.a.J(a,"\\"))return A.n0(a,!s||c) +return A.n2(a)}, +mX(a,b,c,d){if(a!=null)return A.dy(a,b,c,B.k,!0,!1) +return null}, +mT(a,b,c){if(a==null)return null +return A.dy(a,b,c,B.k,!0,!1)}, +le(a,b,c){var s,r,q,p,o,n,m=b+2,l=a.length +if(m>=l)return"%" +s=b+1 +if(!(s>=0&&s=0))return A.b(a,m) +q=a.charCodeAt(m) +p=A.kb(r) +o=A.kb(q) +if(p<0||o<0)return"%" +n=p*16+o +if(n<127){m=B.c.E(n,4) +if(!(m<8))return A.b(B.n,m) +m=(B.n[m]&1<<(n&15))!==0}else m=!1 +if(m)return A.aU(c&&65<=n&&90>=n?(n|32)>>>0:n) +if(r>=97||q>=97)return B.a.q(a,b,b+3).toUpperCase() +return null}, +ld(a){var s,r,q,p,o,n,m,l,k="0123456789ABCDEF" +if(a<128){s=new Uint8Array(3) +s[0]=37 +r=a>>>4 +if(!(r<16))return A.b(k,r) +s[1]=k.charCodeAt(r) +s[2]=k.charCodeAt(a&15)}else{if(a>2047)if(a>65535){q=240 +p=4}else{q=224 +p=3}else{q=192 +p=2}r=3*p +s=new Uint8Array(r) +for(o=0;--p,p>=0;q=128){n=B.c.eq(a,6*p)&63|q +if(!(o>>4 +if(!(l<16))return A.b(k,l) +if(!(m=0&&q>>4 +if(!(m<8))return A.b(d,m) +m=(d[m]&1<<(n&15))!==0}else m=!1 +if(m)++q +else{l=1 +if(n===37){k=A.le(a,q,!1) +if(k==null){q+=3 +continue}if("%"===k)k="%25" +else l=3}else if(n===92&&f)k="/" +else{m=!1 +if(s)if(n<=93){m=n>>>4 +if(!(m<8))return A.b(B.m,m) +m=(B.m[m]&1<<(n&15))!==0}if(m){A.cq(a,q,"Invalid character") +l=h +k=l}else{if((n&64512)===55296){m=q+1 +if(m=m)return A.b(s,-1) +s.pop() +if(s.length===0)B.b.n(s,"")}p=!0}else{p="."===n +if(!p)B.b.n(s,n)}}if(p)B.b.n(s,"") +return B.b.ah(s,"/")}, +n0(a,b){var s,r,q,p,o,n +if(!A.mZ(a))return!b?A.mR(a):a +s=A.u([],t.s) +for(r=a.split("/"),q=r.length,p=!1,o=0;o=s.length)return A.b(s,-1) +s.pop()}else B.b.n(s,"..")}else{p="."===n +if(!p)B.b.n(s,n)}}r=s.length +if(r!==0)if(r===1){if(0>=r)return A.b(s,0) +r=s[0].length===0}else r=!1 +else r=!0 +if(r)return"./" +if(p||B.b.ga2(s)==="..")B.b.n(s,"") +if(!b){if(0>=s.length)return A.b(s,0) +B.b.k(s,0,A.mR(s[0]))}return B.b.ah(s,"/")}, +mR(a){var s,r,q,p=a.length +if(p>=2&&A.mS(a.charCodeAt(0)))for(s=1;s>>4 +if(!(q<8))return A.b(B.l,q) +q=(B.l[q]&1<<(r&15))===0}else q=!0 +if(q)break}return a}, +pW(a,b){var s,r,q,p,o +for(s=a.length,r=0,q=0;q<2;++q){p=b+q +if(!(p127)throw A.c(A.a0("Illegal percent encoding in URI",null)) +if(r===37){if(n+3>o)throw A.c(A.a0("Truncated URI",null)) +B.b.n(p,A.pW(a,n+1)) +n+=2}else B.b.n(p,r)}}return d.aN(p)}, +mS(a){var s=a|32 +return 97<=s&&s<=122}, +mp(a,b,c){var s,r,q,p,o,n,m,l,k="Invalid MIME type",j=A.u([b-1],t.t) +for(s=a.length,r=b,q=-1,p=null;rb)throw A.c(A.a1(k,a,r)) +for(;p!==44;){B.b.n(j,r);++r +for(o=-1;r=0))return A.b(a,r) +p=a.charCodeAt(r) +if(p===61){if(o<0)o=r}else if(p===59||p===44)break}if(o>=0)B.b.n(j,o) +else{n=B.b.ga2(j) +if(p!==44||r!==n+7||!B.a.K(a,"base64",n+1))throw A.c(A.a1("Expecting '='",a,r)) +break}}B.b.n(j,r) +m=r+1 +if((j.length&1)===1)a=B.A.fe(a,m,s) +else{l=A.n_(a,m,s,B.k,!0,!1) +if(l!=null)a=B.a.az(a,m,s,l)}return new A.ic(a,j,c)}, +qh(){var s,r,q,p,o,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=",m=".",l=":",k="/",j="\\",i="?",h="#",g="/\\",f=J.kC(22,t.p) +for(s=0;s<22;++s)f[s]=new Uint8Array(96) +r=new A.jT(f) +q=new A.jU() +p=new A.jV() +o=r.$2(0,225) +q.$3(o,n,1) +q.$3(o,m,14) +q.$3(o,l,34) +q.$3(o,k,3) +q.$3(o,j,227) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(14,225) +q.$3(o,n,1) +q.$3(o,m,15) +q.$3(o,l,34) +q.$3(o,g,234) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(15,225) +q.$3(o,n,1) +q.$3(o,"%",225) +q.$3(o,l,34) +q.$3(o,k,9) +q.$3(o,j,233) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(1,225) +q.$3(o,n,1) +q.$3(o,l,34) +q.$3(o,k,10) +q.$3(o,j,234) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(2,235) +q.$3(o,n,139) +q.$3(o,k,131) +q.$3(o,j,131) +q.$3(o,m,146) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(3,235) +q.$3(o,n,11) +q.$3(o,k,68) +q.$3(o,j,68) +q.$3(o,m,18) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(4,229) +q.$3(o,n,5) +p.$3(o,"AZ",229) +q.$3(o,l,102) +q.$3(o,"@",68) +q.$3(o,"[",232) +q.$3(o,k,138) +q.$3(o,j,138) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(5,229) +q.$3(o,n,5) +p.$3(o,"AZ",229) +q.$3(o,l,102) +q.$3(o,"@",68) +q.$3(o,k,138) +q.$3(o,j,138) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(6,231) +p.$3(o,"19",7) +q.$3(o,"@",68) +q.$3(o,k,138) +q.$3(o,j,138) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(7,231) +p.$3(o,"09",7) +q.$3(o,"@",68) +q.$3(o,k,138) +q.$3(o,j,138) +q.$3(o,i,172) +q.$3(o,h,205) +q.$3(r.$2(8,8),"]",5) +o=r.$2(9,235) +q.$3(o,n,11) +q.$3(o,m,16) +q.$3(o,g,234) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(16,235) +q.$3(o,n,11) +q.$3(o,m,17) +q.$3(o,g,234) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(17,235) +q.$3(o,n,11) +q.$3(o,k,9) +q.$3(o,j,233) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(10,235) +q.$3(o,n,11) +q.$3(o,m,18) +q.$3(o,k,10) +q.$3(o,j,234) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(18,235) +q.$3(o,n,11) +q.$3(o,m,19) +q.$3(o,g,234) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(19,235) +q.$3(o,n,11) +q.$3(o,g,234) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(11,235) +q.$3(o,n,11) +q.$3(o,k,10) +q.$3(o,j,234) +q.$3(o,i,172) +q.$3(o,h,205) +o=r.$2(12,236) +q.$3(o,n,12) +q.$3(o,i,12) +q.$3(o,h,205) +o=r.$2(13,237) +q.$3(o,n,13) +q.$3(o,i,13) +p.$3(r.$2(20,245),"az",21) +o=r.$2(21,245) +p.$3(o,"az",21) +p.$3(o,"09",21) +q.$3(o,"+-.",21) +return f}, +nk(a,b,c,d,e){var s,r,q,p,o,n=$.o_() +for(s=a.length,r=b;r=0&&d95?31:p] +d=o&31 +B.b.k(e,o>>>5,r)}return d}, +R:function R(a,b,c){this.a=a +this.b=b +this.c=c}, +ix:function ix(){}, +iy:function iy(){}, +f1:function f1(a,b){this.a=a +this.$ti=b}, +bq:function bq(a,b,c){this.a=a +this.b=b +this.c=c}, +bb:function bb(a){this.a=a}, +iD:function iD(){}, +H:function H(){}, +cy:function cy(a){this.a=a}, +aX:function aX(){}, +as:function as(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=c +_.d=d}, +cc:function cc(a,b,c,d,e,f){var _=this +_.e=a +_.f=b +_.a=c +_.b=d +_.c=e +_.d=f}, +cG:function cG(a,b,c,d,e){var _=this +_.f=a +_.a=b +_.b=c +_.c=d +_.d=e}, +d4:function d4(a){this.a=a}, +eE:function eE(a){this.a=a}, +bE:function bE(a){this.a=a}, +dX:function dX(a){this.a=a}, +eo:function eo(){}, +d2:function d2(){}, +iG:function iG(a){this.a=a}, +fX:function fX(a,b,c){this.a=a +this.b=b +this.c=c}, +ea:function ea(){}, +e:function e(){}, +Q:function Q(a,b,c){this.a=a +this.b=b +this.$ti=c}, +F:function F(){}, +p:function p(){}, +fn:function fn(){}, +a9:function a9(a){this.a=a}, +id:function id(a){this.a=a}, +ie:function ie(a){this.a=a}, +ig:function ig(a,b){this.a=a +this.b=b}, +dx:function dx(a,b,c,d,e,f,g){var _=this +_.a=a +_.b=b +_.c=c +_.d=d +_.e=e +_.f=f +_.r=g +_.y=_.x=_.w=$}, +ic:function ic(a,b,c){this.a=a +this.b=b +this.c=c}, +jT:function jT(a){this.a=a}, +jU:function jU(){}, +jV:function jV(){}, +fh:function fh(a,b,c,d,e,f,g,h){var _=this +_.a=a +_.b=b +_.c=c +_.d=d +_.e=e +_.f=f +_.r=g +_.w=h +_.x=null}, +f_:function f_(a,b,c,d,e,f,g){var _=this +_.a=a +_.b=b +_.c=c +_.d=d +_.e=e +_.f=f +_.r=g +_.y=_.x=_.w=$}, +e4:function e4(a,b){this.a=a +this.$ti=b}, +av(a){var s +if(typeof a=="function")throw A.c(A.a0("Attempting to rewrap a JS function.",null)) +s=function(b,c){return function(d){return b(c,d,arguments.length)}}(A.qa,a) +s[$.cu()]=a +return s}, +bm(a){var s +if(typeof a=="function")throw A.c(A.a0("Attempting to rewrap a JS function.",null)) +s=function(b,c){return function(d,e){return b(c,d,e,arguments.length)}}(A.qb,a) +s[$.cu()]=a +return s}, +ft(a){var s +if(typeof a=="function")throw A.c(A.a0("Attempting to rewrap a JS function.",null)) +s=function(b,c){return function(d,e,f){return b(c,d,e,f,arguments.length)}}(A.qc,a) +s[$.cu()]=a +return s}, +jZ(a){var s +if(typeof a=="function")throw A.c(A.a0("Attempting to rewrap a JS function.",null)) +s=function(b,c){return function(d,e,f,g){return b(c,d,e,f,g,arguments.length)}}(A.qd,a) +s[$.cu()]=a +return s}, +li(a){var s +if(typeof a=="function")throw A.c(A.a0("Attempting to rewrap a JS function.",null)) +s=function(b,c){return function(d,e,f,g,h){return b(c,d,e,f,g,h,arguments.length)}}(A.qe,a) +s[$.cu()]=a +return s}, +qa(a,b,c){t.Z.a(a) +if(A.d(c)>=1)return a.$1(b) +return a.$0()}, +qb(a,b,c,d){t.Z.a(a) +A.d(d) +if(d>=2)return a.$2(b,c) +if(d===1)return a.$1(b) +return a.$0()}, +qc(a,b,c,d,e){t.Z.a(a) +A.d(e) +if(e>=3)return a.$3(b,c,d) +if(e===2)return a.$2(b,c) +if(e===1)return a.$1(b) +return a.$0()}, +qd(a,b,c,d,e,f){t.Z.a(a) +A.d(f) +if(f>=4)return a.$4(b,c,d,e) +if(f===3)return a.$3(b,c,d) +if(f===2)return a.$2(b,c) +if(f===1)return a.$1(b) +return a.$0()}, +qe(a,b,c,d,e,f,g){t.Z.a(a) +A.d(g) +if(g>=5)return a.$5(b,c,d,e,f) +if(g===4)return a.$4(b,c,d,e) +if(g===3)return a.$3(b,c,d) +if(g===2)return a.$2(b,c) +if(g===1)return a.$1(b) +return a.$0()}, +fw(a,b,c,d){return d.a(a[b].apply(a,c))}, +lw(a,b){var s=new A.w($.x,b.h("w<0>")),r=new A.bL(s,b.h("bL<0>")) +a.then(A.bT(new A.kp(r,b),1),A.bT(new A.kq(r),1)) +return s}, +kp:function kp(a,b){this.a=a +this.b=b}, +kq:function kq(a){this.a=a}, +ha:function ha(a){this.a=a}, +f6:function f6(a){this.a=a}, +en:function en(){}, +eG:function eG(){}, +qN(a,b){var s,r,q,p,o,n,m,l +for(s=b.length,r=1;r=1;s=q){q=s-1 +if(b[q]!=null)break}p=new A.a9("") +o=""+(a+"(") +p.a=o +n=A.a_(b) +m=n.h("bF<1>") +l=new A.bF(b,0,s,m) +l.dG(b,0,s,n.c) +m=o+new A.a3(l,m.h("h(X.E)").a(new A.k2()),m.h("a3")).ah(0,", ") +p.a=m +p.a=m+("): part "+(r-1)+" was null, but part "+r+" was not.") +throw A.c(A.a0(p.j(0),null))}}, +dY:function dY(a){this.a=a}, +fT:function fT(){}, +k2:function k2(){}, +c5:function c5(){}, +m4(a,b){var s,r,q,p,o,n,m=b.ds(a) +b.av(a) +if(m!=null)a=B.a.Z(a,m.length) +s=t.s +r=A.u([],s) +q=A.u([],s) +s=a.length +if(s!==0){if(0>=s)return A.b(a,0) +p=b.a1(a.charCodeAt(0))}else p=!1 +if(p){if(0>=s)return A.b(a,0) +B.b.n(q,a[0]) +o=1}else{B.b.n(q,"") +o=0}for(n=o;n50)return B.a.q(s,0,50)+"..." +return s}, +qP(a){if(t.p.b(a))return"Blob("+a.length+")" +return A.q3(a)}, +np(a){var s=a.$ti +return"["+new A.a3(a,s.h("h?(r.E)").a(new A.k5()),s.h("a3")).ah(0,", ")+"]"}, +k5:function k5(){}, +e_:function e_(){}, +ew:function ew(){}, +hk:function hk(a){this.a=a}, +hl:function hl(a){this.a=a}, +fW:function fW(){}, +ok(a){var s=a.i(0,"method"),r=a.i(0,"arguments") +if(s!=null)return new A.e5(A.M(s),r) +return null}, +e5:function e5(a,b){this.a=a +this.b=b}, +c2:function c2(a,b){this.a=a +this.b=b}, +ex(a,b,c,d){var s=new A.aW(a,b,b,c) +s.b=d +return s}, +aW:function aW(a,b,c,d){var _=this +_.w=_.r=_.f=null +_.x=a +_.y=b +_.b=null +_.c=c +_.d=null +_.a=d}, +hz:function hz(){}, +hA:function hA(){}, +n8(a){var s=a.j(0) +return A.ex("sqlite_error",null,s,a.c)}, +jY(a,b,c,d){var s,r,q,p +if(a instanceof A.aW){s=a.f +if(s==null)s=a.f=b +r=a.r +if(r==null)r=a.r=c +q=a.w +if(q==null)q=a.w=d +p=s==null +if(!p||r!=null||q!=null)if(a.y==null){r=A.O(t.N,t.X) +if(!p)r.k(0,"database",s.df()) +s=a.r +if(s!=null)r.k(0,"sql",s) +s=a.w +if(s!=null)r.k(0,"arguments",s) +a.seF(r)}return a}else if(a instanceof A.bD)return A.jY(A.n8(a),b,c,d) +else return A.jY(A.ex("error",null,J.aC(a),null),b,c,d)}, +hY(a){return A.pa(a)}, +pa(a){var s=0,r=A.l(t.z),q,p=2,o,n,m,l,k,j,i,h +var $async$hY=A.m(function(b,c){if(b===1){o=c +s=p}while(true)switch(s){case 0:p=4 +s=7 +return A.f(A.a5(a),$async$hY) +case 7:n=c +q=n +s=1 +break +p=2 +s=6 +break +case 4:p=3 +h=o +m=A.L(h) +A.ab(h) +j=A.mh(a) +i=A.bf(a,"sql",t.N) +l=A.jY(m,j,i,A.ey(a)) +throw A.c(l) +s=6 +break +case 3:s=2 +break +case 6:case 1:return A.j(q,r) +case 2:return A.i(o,r)}}) +return A.k($async$hY,r)}, +cZ(a,b){var s=A.hF(a) +return s.aP(A.fr(t.f.a(a.b).i(0,"transactionId")),new A.hE(b,s))}, +bC(a,b){return $.nZ().a0(new A.hD(b),t.z)}, +a5(a){var s=0,r=A.l(t.z),q,p +var $async$a5=A.m(function(b,c){if(b===1)return A.i(c,r) +while(true)switch(s){case 0:p=a.a +case 3:switch(p){case"openDatabase":s=5 +break +case"closeDatabase":s=6 +break +case"query":s=7 +break +case"queryCursorNext":s=8 +break +case"execute":s=9 +break +case"insert":s=10 +break +case"update":s=11 +break +case"batch":s=12 +break +case"getDatabasesPath":s=13 +break +case"deleteDatabase":s=14 +break +case"databaseExists":s=15 +break +case"options":s=16 +break +case"writeDatabaseBytes":s=17 +break +case"readDatabaseBytes":s=18 +break +case"debugMode":s=19 +break +default:s=20 +break}break +case 5:s=21 +return A.f(A.bC(a,A.p2(a)),$async$a5) +case 21:q=c +s=1 +break +case 6:s=22 +return A.f(A.bC(a,A.oX(a)),$async$a5) +case 22:q=c +s=1 +break +case 7:s=23 +return A.f(A.cZ(a,A.p4(a)),$async$a5) +case 23:q=c +s=1 +break +case 8:s=24 +return A.f(A.cZ(a,A.p5(a)),$async$a5) +case 24:q=c +s=1 +break +case 9:s=25 +return A.f(A.cZ(a,A.p_(a)),$async$a5) +case 25:q=c +s=1 +break +case 10:s=26 +return A.f(A.cZ(a,A.p1(a)),$async$a5) +case 26:q=c +s=1 +break +case 11:s=27 +return A.f(A.cZ(a,A.p7(a)),$async$a5) +case 27:q=c +s=1 +break +case 12:s=28 +return A.f(A.cZ(a,A.oW(a)),$async$a5) +case 28:q=c +s=1 +break +case 13:s=29 +return A.f(A.bC(a,A.p0(a)),$async$a5) +case 29:q=c +s=1 +break +case 14:s=30 +return A.f(A.bC(a,A.oZ(a)),$async$a5) +case 30:q=c +s=1 +break +case 15:s=31 +return A.f(A.bC(a,A.oY(a)),$async$a5) +case 31:q=c +s=1 +break +case 16:s=32 +return A.f(A.bC(a,A.p3(a)),$async$a5) +case 32:q=c +s=1 +break +case 17:s=33 +return A.f(A.bC(a,A.p8(a)),$async$a5) +case 33:q=c +s=1 +break +case 18:s=34 +return A.f(A.bC(a,A.p6(a)),$async$a5) +case 34:q=c +s=1 +break +case 19:s=35 +return A.f(A.kO(a),$async$a5) +case 35:q=c +s=1 +break +case 20:throw A.c(A.a0("Invalid method "+p+" "+a.j(0),null)) +case 4:case 1:return A.j(q,r)}}) +return A.k($async$a5,r)}, +p2(a){return new A.hP(a)}, +hZ(a){return A.pb(a)}, +pb(a){var s=0,r=A.l(t.f),q,p=2,o,n,m,l,k,j,i,h,g,f,e,d,c +var $async$hZ=A.m(function(b,a0){if(b===1){o=a0 +s=p}while(true)switch(s){case 0:h=t.f.a(a.b) +g=A.M(h.i(0,"path")) +f=new A.i_() +e=A.dC(h.i(0,"singleInstance")) +d=e===!0 +e=A.dC(h.i(0,"readOnly")) +if(d){l=$.fx.i(0,g) +if(l!=null){if($.kh>=2)l.ai("Reopening existing single database "+l.j(0)) +q=f.$1(l.e) +s=1 +break}}n=null +p=4 +k=$.aa +s=7 +return A.f((k==null?$.aa=A.bV():k).bm(h),$async$hZ) +case 7:n=a0 +p=2 +s=6 +break +case 4:p=3 +c=o +h=A.L(c) +if(h instanceof A.bD){m=h +h=m +f=h.j(0) +throw A.c(A.ex("sqlite_error",null,"open_failed: "+f,h.c))}else throw c +s=6 +break +case 3:s=2 +break +case 6:i=$.nf=$.nf+1 +h=n +k=$.kh +l=new A.am(A.u([],t.bi),A.kH(),i,d,g,e===!0,h,k,A.O(t.S,t.aT),A.kH()) +$.nr.k(0,i,l) +l.ai("Opening database "+l.j(0)) +if(d)$.fx.k(0,g,l) +q=f.$1(i) +s=1 +break +case 1:return A.j(q,r) +case 2:return A.i(o,r)}}) +return A.k($async$hZ,r)}, +oX(a){return new A.hJ(a)}, +kM(a){var s=0,r=A.l(t.z),q +var $async$kM=A.m(function(b,c){if(b===1)return A.i(c,r) +while(true)switch(s){case 0:q=A.hF(a) +if(q.f){$.fx.I(0,q.r) +if($.nn==null)$.nn=new A.fW()}q.aM() +return A.j(null,r)}}) +return A.k($async$kM,r)}, +hF(a){var s=A.mh(a) +if(s==null)throw A.c(A.T("Database "+A.o(A.mi(a))+" not found")) +return s}, +mh(a){var s=A.mi(a) +if(s!=null)return $.nr.i(0,s) +return null}, +mi(a){var s=a.b +if(t.f.b(s))return A.fr(s.i(0,"id")) +return null}, +bf(a,b,c){var s=a.b +if(t.f.b(s))return c.h("0?").a(s.i(0,b)) +return null}, +pc(a){var s="transactionId",r=a.b +if(t.f.b(r))return r.L(s)&&r.i(0,s)==null +return!1}, +hH(a){var s,r,q=A.bf(a,"path",t.N) +if(q!=null&&q!==":memory:"&&$.lC().a.a9(q)<=0){if($.aa==null)$.aa=A.bV() +s=$.lC() +r=A.u(["/",q,null,null,null,null,null,null,null,null,null,null,null,null,null,null],t.d4) +A.qN("join",r) +q=s.f8(new A.d6(r,t.eJ))}return q}, +ey(a){var s,r,q,p=A.bf(a,"arguments",t.j) +if(p!=null)for(s=J.W(p),r=t.p;s.m();){q=s.gp() +if(q!=null)if(typeof q!="number")if(typeof q!="string")if(!r.b(q))if(!(q instanceof A.R))throw A.c(A.a0("Invalid sql argument type '"+J.bW(q).j(0)+"': "+A.o(q),null))}return p==null?null:J.kw(p,t.X)}, +oV(a){var s=A.u([],t.eK),r=t.f +r=J.kw(t.j.a(r.a(a.b).i(0,"operations")),r) +r.M(r,new A.hG(s)) +return s}, +p4(a){return new A.hS(a)}, +kR(a,b){var s=0,r=A.l(t.z),q,p,o +var $async$kR=A.m(function(c,d){if(c===1)return A.i(d,r) +while(true)switch(s){case 0:o=A.bf(a,"sql",t.N) +o.toString +p=A.ey(a) +q=b.eU(A.fr(t.f.a(a.b).i(0,"cursorPageSize")),o,p) +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$kR,r)}, +p5(a){return new A.hR(a)}, +kS(a,b){var s=0,r=A.l(t.z),q,p,o +var $async$kS=A.m(function(c,d){if(c===1)return A.i(d,r) +while(true)switch(s){case 0:b=A.hF(a) +p=t.f.a(a.b) +o=A.d(p.i(0,"cursorId")) +q=b.eV(A.dC(p.i(0,"cancel")),o) +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$kS,r)}, +hC(a,b){var s=0,r=A.l(t.X),q,p +var $async$hC=A.m(function(c,d){if(c===1)return A.i(d,r) +while(true)switch(s){case 0:b=A.hF(a) +p=A.bf(a,"sql",t.N) +p.toString +s=3 +return A.f(b.eS(p,A.ey(a)),$async$hC) +case 3:q=null +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$hC,r)}, +p_(a){return new A.hM(a)}, +hX(a,b){return A.p9(a,b)}, +p9(a,b){var s=0,r=A.l(t.X),q,p=2,o,n,m,l,k +var $async$hX=A.m(function(c,d){if(c===1){o=d +s=p}while(true)switch(s){case 0:m=A.bf(a,"inTransaction",t.y) +l=m===!0&&A.pc(a) +if(A.b4(l))b.b=++b.a +p=4 +s=7 +return A.f(A.hC(a,b),$async$hX) +case 7:p=2 +s=6 +break +case 4:p=3 +k=o +if(A.b4(l))b.b=null +throw k +s=6 +break +case 3:s=2 +break +case 6:if(A.b4(l)){q=A.ah(["transactionId",b.b],t.N,t.X) +s=1 +break}else if(m===!1)b.b=null +q=null +s=1 +break +case 1:return A.j(q,r) +case 2:return A.i(o,r)}}) +return A.k($async$hX,r)}, +p3(a){return new A.hQ(a)}, +i0(a){var s=0,r=A.l(t.z),q,p,o +var $async$i0=A.m(function(b,c){if(b===1)return A.i(c,r) +while(true)switch(s){case 0:o=a.b +s=t.f.b(o)?3:4 +break +case 3:if(o.L("logLevel")){p=A.fr(o.i(0,"logLevel")) +$.kh=p==null?0:p}p=$.aa +s=5 +return A.f((p==null?$.aa=A.bV():p).c7(o),$async$i0) +case 5:case 4:q=null +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$i0,r)}, +kO(a){var s=0,r=A.l(t.z),q +var $async$kO=A.m(function(b,c){if(b===1)return A.i(c,r) +while(true)switch(s){case 0:if(J.V(a.b,!0))$.kh=2 +q=null +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$kO,r)}, +p1(a){return new A.hO(a)}, +kQ(a,b){var s=0,r=A.l(t.I),q,p +var $async$kQ=A.m(function(c,d){if(c===1)return A.i(d,r) +while(true)switch(s){case 0:p=A.bf(a,"sql",t.N) +p.toString +q=b.eT(p,A.ey(a)) +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$kQ,r)}, +p7(a){return new A.hU(a)}, +kT(a,b){var s=0,r=A.l(t.S),q,p +var $async$kT=A.m(function(c,d){if(c===1)return A.i(d,r) +while(true)switch(s){case 0:p=A.bf(a,"sql",t.N) +p.toString +q=b.eX(p,A.ey(a)) +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$kT,r)}, +oW(a){return new A.hI(a)}, +p0(a){return new A.hN(a)}, +kP(a){var s=0,r=A.l(t.z),q +var $async$kP=A.m(function(b,c){if(b===1)return A.i(c,r) +while(true)switch(s){case 0:if($.aa==null)$.aa=A.bV() +q="/" +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$kP,r)}, +oZ(a){return new A.hL(a)}, +hW(a){var s=0,r=A.l(t.H),q=1,p,o,n,m,l,k,j +var $async$hW=A.m(function(b,c){if(b===1){p=c +s=q}while(true)switch(s){case 0:l=A.hH(a) +k=$.fx.i(0,l) +if(k!=null){k.aM() +$.fx.I(0,l)}q=3 +o=$.aa +if(o==null)o=$.aa=A.bV() +n=l +n.toString +s=6 +return A.f(o.bd(n),$async$hW) +case 6:q=1 +s=5 +break +case 3:q=2 +j=p +s=5 +break +case 2:s=1 +break +case 5:return A.j(null,r) +case 1:return A.i(p,r)}}) +return A.k($async$hW,r)}, +oY(a){return new A.hK(a)}, +kN(a){var s=0,r=A.l(t.y),q,p,o +var $async$kN=A.m(function(b,c){if(b===1)return A.i(c,r) +while(true)switch(s){case 0:p=A.hH(a) +o=$.aa +if(o==null)o=$.aa=A.bV() +p.toString +q=o.bg(p) +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$kN,r)}, +p6(a){return new A.hT(a)}, +i1(a){var s=0,r=A.l(t.f),q,p,o,n +var $async$i1=A.m(function(b,c){if(b===1)return A.i(c,r) +while(true)switch(s){case 0:p=A.hH(a) +o=$.aa +if(o==null)o=$.aa=A.bV() +p.toString +n=A +s=3 +return A.f(o.bo(p),$async$i1) +case 3:q=n.ah(["bytes",c],t.N,t.X) +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$i1,r)}, +p8(a){return new A.hV(a)}, +kU(a){var s=0,r=A.l(t.H),q,p,o,n +var $async$kU=A.m(function(b,c){if(b===1)return A.i(c,r) +while(true)switch(s){case 0:p=A.hH(a) +o=A.bf(a,"bytes",t.p) +n=$.aa +if(n==null)n=$.aa=A.bV() +p.toString +o.toString +q=n.br(p,o) +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$kU,r)}, +d_:function d_(){this.c=this.b=this.a=null}, +fi:function fi(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=c +_.d=d +_.e=!1}, +fa:function fa(a,b){this.a=a +this.b=b}, +am:function am(a,b,c,d,e,f,g,h,i,j){var _=this +_.a=0 +_.b=null +_.c=a +_.d=b +_.e=c +_.f=d +_.r=e +_.w=f +_.x=g +_.y=h +_.z=i +_.Q=0 +_.as=j}, +hu:function hu(a,b,c){this.a=a +this.b=b +this.c=c}, +hs:function hs(a){this.a=a}, +hn:function hn(a){this.a=a}, +hv:function hv(a,b,c){this.a=a +this.b=b +this.c=c}, +hy:function hy(a,b,c){this.a=a +this.b=b +this.c=c}, +hx:function hx(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=c +_.d=d}, +hw:function hw(a,b,c){this.a=a +this.b=b +this.c=c}, +ht:function ht(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=c +_.d=d}, +hr:function hr(){}, +hq:function hq(a,b){this.a=a +this.b=b}, +ho:function ho(a,b,c,d,e,f){var _=this +_.a=a +_.b=b +_.c=c +_.d=d +_.e=e +_.f=f}, +hp:function hp(a,b){this.a=a +this.b=b}, +hE:function hE(a,b){this.a=a +this.b=b}, +hD:function hD(a){this.a=a}, +hP:function hP(a){this.a=a}, +i_:function i_(){}, +hJ:function hJ(a){this.a=a}, +hG:function hG(a){this.a=a}, +hS:function hS(a){this.a=a}, +hR:function hR(a){this.a=a}, +hM:function hM(a){this.a=a}, +hQ:function hQ(a){this.a=a}, +hO:function hO(a){this.a=a}, +hU:function hU(a){this.a=a}, +hI:function hI(a){this.a=a}, +hN:function hN(a){this.a=a}, +hL:function hL(a){this.a=a}, +hK:function hK(a){this.a=a}, +hT:function hT(a){this.a=a}, +hV:function hV(a){this.a=a}, +hm:function hm(a){this.a=a}, +hB:function hB(a){var _=this +_.a=a +_.b=$ +_.d=_.c=null}, +fj:function fj(){}, +dD(a8){var s=0,r=A.l(t.H),q=1,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2,a3,a4,a5,a6,a7 +var $async$dD=A.m(function(a9,b0){if(a9===1){p=b0 +s=q}while(true)switch(s){case 0:a4=a8.data +a5=a4==null?null:A.kV(a4) +a4=t.c.a(a8.ports) +o=J.b9(t.k.b(a4)?a4:new A.ac(a4,A.a_(a4).h("ac<1,C>"))) +q=3 +s=typeof a5=="string"?6:8 +break +case 6:o.postMessage(a5) +s=7 +break +case 8:s=t.j.b(a5)?9:11 +break +case 9:n=J.b8(a5,0) +if(J.V(n,"varSet")){m=t.f.a(J.b8(a5,1)) +l=A.M(J.b8(m,"key")) +k=J.b8(m,"value") +A.aw($.dH+" "+A.o(n)+" "+A.o(l)+": "+A.o(k)) +$.nB.k(0,l,k) +o.postMessage(null)}else if(J.V(n,"varGet")){j=t.f.a(J.b8(a5,1)) +i=A.M(J.b8(j,"key")) +h=$.nB.i(0,i) +A.aw($.dH+" "+A.o(n)+" "+A.o(i)+": "+A.o(h)) +a4=t.N +o.postMessage(A.i3(A.ah(["result",A.ah(["key",i,"value",h],a4,t.X)],a4,t.eE)))}else{A.aw($.dH+" "+A.o(n)+" unknown") +o.postMessage(null)}s=10 +break +case 11:s=t.f.b(a5)?12:14 +break +case 12:g=A.ok(a5) +s=g!=null?15:17 +break +case 15:g=new A.e5(g.a,A.lg(g.b)) +s=$.nm==null?18:19 +break +case 18:s=20 +return A.f(A.fy(new A.i2(),!0),$async$dD) +case 20:a4=b0 +$.nm=a4 +a4.toString +$.aa=new A.hB(a4) +case 19:f=new A.k_(o) +q=22 +s=25 +return A.f(A.hY(g),$async$dD) +case 25:e=b0 +e=A.lh(e) +f.$1(new A.c2(e,null)) +q=3 +s=24 +break +case 22:q=21 +a6=p +d=A.L(a6) +c=A.ab(a6) +a4=d +a1=c +a2=new A.c2($,$) +a3=A.O(t.N,t.X) +if(a4 instanceof A.aW){a3.k(0,"code",a4.x) +a3.k(0,"details",a4.y) +a3.k(0,"message",a4.a) +a3.k(0,"resultCode",a4.bx()) +a4=a4.d +a3.k(0,"transactionClosed",a4===!0)}else a3.k(0,"message",J.aC(a4)) +a4=$.ne +if(!(a4==null?$.ne=!0:a4)&&a1!=null)a3.k(0,"stackTrace",a1.j(0)) +a2.b=a3 +a2.a=null +f.$1(a2) +s=24 +break +case 21:s=3 +break +case 24:s=16 +break +case 17:A.aw($.dH+" "+A.o(a5)+" unknown") +o.postMessage(null) +case 16:s=13 +break +case 14:A.aw($.dH+" "+A.o(a5)+" map unknown") +o.postMessage(null) +case 13:case 10:case 7:q=1 +s=5 +break +case 3:q=2 +a7=p +b=A.L(a7) +a=A.ab(a7) +A.aw($.dH+" error caught "+A.o(b)+" "+A.o(a)) +o.postMessage(null) +s=5 +break +case 2:s=1 +break +case 5:return A.j(null,r) +case 1:return A.i(p,r)}}) +return A.k($async$dD,r)}, +rh(a){var s,r,q,p,o,n,m=$.x +try{s=t.m.a(self) +try{r=A.M(s.name)}catch(n){q=A.L(n)}s.onconnect=A.av(new A.km(m))}catch(n){}p=t.m.a(self) +try{p.onmessage=A.av(new A.kn(m))}catch(n){o=A.L(n)}}, +k_:function k_(a){this.a=a}, +km:function km(a){this.a=a}, +kl:function kl(a,b){this.a=a +this.b=b}, +kj:function kj(a){this.a=a}, +ki:function ki(a){this.a=a}, +kn:function kn(a){this.a=a}, +kk:function kk(a){this.a=a}, +nb(a){if(a==null)return!0 +else if(typeof a=="number"||typeof a=="string"||A.dE(a))return!0 +return!1}, +ng(a){var s +if(a.gl(a)===1){s=J.b9(a.gN()) +if(typeof s=="string")return B.a.J(s,"@") +throw A.c(A.aM(s,null,null))}return!1}, +lh(a){var s,r,q,p,o,n,m,l,k={} +if(A.nb(a))return a +a.toString +for(s=$.lB(),r=0;r<1;++r){q=s[r] +p=A.v(q).h("cp.T") +if(p.b(a))return A.ah(["@"+q.a,t.dG.a(p.a(a)).j(0)],t.N,t.X)}if(t.f.b(a)){if(A.ng(a))return A.ah(["@",a],t.N,t.X) +k.a=null +a.M(0,new A.jX(k,a)) +s=k.a +if(s==null)s=a +return s}else if(t.j.b(a)){for(s=J.ao(a),p=t.z,o=null,n=0;n"));q.m();){n=q.c +n=n>=0?new A.bl(o+n,p.gp()):A.J(A.aE()) +m=n.b +l=m==null?null:A.i3(m) +r[n.a]=l}return r}else if(A.dE(a))return a +throw A.c(A.U("Unsupported value: "+A.o(a)+" (type: "+J.bW(a).j(0)+")"))}, +i4:function i4(a){this.a=a}, +i2:function i2(){}, +d0:function d0(){}, +kr(a){var s=0,r=A.l(t.d_),q,p +var $async$kr=A.m(function(b,c){if(b===1)return A.i(c,r) +while(true)switch(s){case 0:p=A +s=3 +return A.f(A.e9("sqflite_databases"),$async$kr) +case 3:q=p.mj(c,a,null) +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$kr,r)}, +fy(a,b){var s=0,r=A.l(t.d_),q,p,o,n,m,l,k,j,i,h +var $async$fy=A.m(function(c,d){if(c===1)return A.i(d,r) +while(true)switch(s){case 0:s=3 +return A.f(A.kr(a),$async$fy) +case 3:h=d +h=h +p=$.nY() +o=t.g2.a(h).b +s=4 +return A.f(A.io(p),$async$fy) +case 4:n=d +m=n.a +m=m.b +l=m.b8(B.f.ar(o.a),1) +k=m.c.e +j=k.a +k.k(0,j,o) +i=A.d(A.q(m.y.call(null,l,j,1))) +if(i===0)A.J(A.T("could not register vfs")) +m=$.nD() +m.$ti.h("1?").a(i) +m.a.set(o,i) +q=A.mj(o,a,n) +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$fy,r)}, +mj(a,b,c){return new A.d1(a,c)}, +d1:function d1(a,b){this.b=a +this.c=b +this.f=$}, +pd(a,b,c,d,e,f,g){return new A.bD(b,c,a,g,f,d,e)}, +bD:function bD(a,b,c,d,e,f,g){var _=this +_.a=a +_.b=b +_.c=c +_.d=d +_.e=e +_.f=f +_.r=g}, +i6:function i6(){}, +es:function es(){}, +ez:function ez(a,b,c){this.a=a +this.b=b +this.$ti=c}, +et:function et(){}, +hh:function hh(){}, +cV:function cV(){}, +hf:function hf(){}, +hg:function hg(){}, +e6:function e6(a,b,c){this.b=a +this.c=b +this.d=c}, +e0:function e0(a,b,c){var _=this +_.a=a +_.b=b +_.c=c +_.r=!1}, +fV:function fV(a,b){this.a=a +this.b=b}, +aO:function aO(){}, +k9:function k9(){}, +i5:function i5(){}, +c3:function c3(a){this.b=a +this.c=!0 +this.d=!1}, +cf:function cf(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=c +_.d=d +_.f=_.e=null}, +eT:function eT(a,b,c){var _=this +_.r=a +_.w=-1 +_.x=$ +_.y=!1 +_.a=b +_.c=c}, +op(a){var s=$.kt() +return new A.e7(A.O(t.N,t.fN),s,"dart-memory")}, +e7:function e7(a,b,c){this.d=a +this.b=b +this.a=c}, +f3:function f3(a,b,c){var _=this +_.a=a +_.b=b +_.c=c +_.d=0}, +c_:function c_(){}, +cH:function cH(){}, +eu:function eu(a,b,c){this.d=a +this.a=b +this.c=c}, +a8:function a8(a,b){this.a=a +this.b=b}, +fb:function fb(a){this.a=a +this.b=-1}, +fc:function fc(){}, +fd:function fd(){}, +ff:function ff(){}, +fg:function fg(){}, +cU:function cU(a){this.b=a}, +dV:function dV(){}, +bw:function bw(a){this.a=a}, +eK(a){return new A.d5(a)}, +lI(a,b){var s,r,q +if(b==null)b=$.kt() +for(s=a.length,r=0;r")),r=new A.Z(s,b.h("Z<0>")),q=t.w,p=t.m +A.bO(a,"success",q.a(new A.fO(r,a,b)),!1,p) +A.bO(a,"error",q.a(new A.fP(r,a)),!1,p) +return s}, +og(a,b){var s=new A.w($.x,b.h("w<0>")),r=new A.Z(s,b.h("Z<0>")),q=t.w,p=t.m +A.bO(a,"success",q.a(new A.fQ(r,a,b)),!1,p) +A.bO(a,"error",q.a(new A.fR(r,a)),!1,p) +A.bO(a,"blocked",q.a(new A.fS(r,a)),!1,p) +return s}, +bN:function bN(a,b){var _=this +_.c=_.b=_.a=null +_.d=a +_.$ti=b}, +iB:function iB(a,b){this.a=a +this.b=b}, +iC:function iC(a,b){this.a=a +this.b=b}, +fO:function fO(a,b,c){this.a=a +this.b=b +this.c=c}, +fP:function fP(a,b){this.a=a +this.b=b}, +fQ:function fQ(a,b,c){this.a=a +this.b=b +this.c=c}, +fR:function fR(a,b){this.a=a +this.b=b}, +fS:function fS(a,b){this.a=a +this.b=b}, +ij(a,b){var s=0,r=A.l(t.g9),q,p,o,n,m,l +var $async$ij=A.m(function(c,d){if(c===1)return A.i(d,r) +while(true)switch(s){case 0:l={} +b.M(0,new A.il(l)) +p=t.m +s=3 +return A.f(A.lw(p.a(self.WebAssembly.instantiateStreaming(a,l)),p),$async$ij) +case 3:o=d +n=p.a(p.a(o.instance).exports) +if("_initialize" in n)t.g.a(n._initialize).call() +m=t.N +m=new A.eO(A.O(m,t.g),A.O(m,p)) +m.dH(p.a(o.instance)) +q=m +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$ij,r)}, +eO:function eO(a,b){this.a=a +this.b=b}, +il:function il(a){this.a=a}, +ik:function ik(a){this.a=a}, +io(a){var s=0,r=A.l(t.ab),q,p,o,n +var $async$io=A.m(function(b,c){if(b===1)return A.i(c,r) +while(true)switch(s){case 0:p=t.m +o=a.gd5()?p.a(new self.URL(a.j(0))):p.a(new self.URL(a.j(0),A.kZ().j(0))) +n=A +s=3 +return A.f(A.lw(p.a(self.fetch(o,null)),p),$async$io) +case 3:q=n.im(c) +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$io,r)}, +im(a){var s=0,r=A.l(t.ab),q,p,o +var $async$im=A.m(function(b,c){if(b===1)return A.i(c,r) +while(true)switch(s){case 0:p=A +o=A +s=3 +return A.f(A.ii(a),$async$im) +case 3:q=new p.eP(new o.eQ(c)) +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$im,r)}, +eP:function eP(a){this.a=a}, +e9(a){var s=0,r=A.l(t.bd),q,p,o,n,m,l +var $async$e9=A.m(function(b,c){if(b===1)return A.i(c,r) +while(true)switch(s){case 0:p=t.N +o=new A.fE(a) +n=A.op(null) +m=$.kt() +l=new A.c4(o,n,new A.c9(t.h),A.oE(p),A.O(p,t.S),m,"indexeddb") +s=3 +return A.f(o.bl(),$async$e9) +case 3:s=4 +return A.f(l.aK(),$async$e9) +case 4:q=l +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$e9,r)}, +fE:function fE(a){this.a=null +this.b=a}, +fI:function fI(a){this.a=a}, +fF:function fF(a){this.a=a}, +fJ:function fJ(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=c +_.d=d}, +fH:function fH(a,b){this.a=a +this.b=b}, +fG:function fG(a,b){this.a=a +this.b=b}, +iH:function iH(a,b,c){this.a=a +this.b=b +this.c=c}, +iI:function iI(a,b){this.a=a +this.b=b}, +f9:function f9(a,b){this.a=a +this.b=b}, +c4:function c4(a,b,c,d,e,f,g){var _=this +_.d=a +_.f=null +_.r=b +_.w=c +_.x=d +_.y=e +_.b=f +_.a=g}, +h0:function h0(a){this.a=a}, +h1:function h1(){}, +f4:function f4(a,b,c){this.a=a +this.b=b +this.c=c}, +iV:function iV(a,b){this.a=a +this.b=b}, +Y:function Y(){}, +cl:function cl(a,b){var _=this +_.w=a +_.d=b +_.c=_.b=_.a=null}, +ck:function ck(a,b,c){var _=this +_.w=a +_.x=b +_.d=c +_.c=_.b=_.a=null}, +bM:function bM(a,b,c){var _=this +_.w=a +_.x=b +_.d=c +_.c=_.b=_.a=null}, +bS:function bS(a,b,c,d,e){var _=this +_.w=a +_.x=b +_.y=c +_.z=d +_.d=e +_.c=_.b=_.a=null}, +ii(c6){var s=0,r=A.l(t.h2),q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,c0,c1,c2,c3,c4,c5 +var $async$ii=A.m(function(c7,c8){if(c7===1)return A.i(c8,r) +while(true)switch(s){case 0:c4=A.pA() +c5=c4.b +c5===$&&A.aK("injectedValues") +s=3 +return A.f(A.ij(c6,c5),$async$ii) +case 3:p=c8 +c5=c4.c +c5===$&&A.aK("memory") +o=p.a +n=o.i(0,"dart_sqlite3_malloc") +n.toString +m=o.i(0,"dart_sqlite3_free") +m.toString +o.i(0,"dart_sqlite3_create_scalar_function").toString +o.i(0,"dart_sqlite3_create_aggregate_function").toString +o.i(0,"dart_sqlite3_create_window_function").toString +o.i(0,"dart_sqlite3_create_collation").toString +l=o.i(0,"dart_sqlite3_register_vfs") +l.toString +o.i(0,"sqlite3_vfs_unregister").toString +k=o.i(0,"dart_sqlite3_updates") +k.toString +o.i(0,"sqlite3_libversion").toString +o.i(0,"sqlite3_sourceid").toString +o.i(0,"sqlite3_libversion_number").toString +j=o.i(0,"sqlite3_open_v2") +j.toString +i=o.i(0,"sqlite3_close_v2") +i.toString +h=o.i(0,"sqlite3_extended_errcode") +h.toString +g=o.i(0,"sqlite3_errmsg") +g.toString +f=o.i(0,"sqlite3_errstr") +f.toString +e=o.i(0,"sqlite3_extended_result_codes") +e.toString +d=o.i(0,"sqlite3_exec") +d.toString +o.i(0,"sqlite3_free").toString +c=o.i(0,"sqlite3_prepare_v3") +c.toString +b=o.i(0,"sqlite3_bind_parameter_count") +b.toString +a=o.i(0,"sqlite3_column_count") +a.toString +a0=o.i(0,"sqlite3_column_name") +a0.toString +a1=o.i(0,"sqlite3_reset") +a1.toString +a2=o.i(0,"sqlite3_step") +a2.toString +a3=o.i(0,"sqlite3_finalize") +a3.toString +a4=o.i(0,"sqlite3_column_type") +a4.toString +a5=o.i(0,"sqlite3_column_int64") +a5.toString +a6=o.i(0,"sqlite3_column_double") +a6.toString +a7=o.i(0,"sqlite3_column_bytes") +a7.toString +a8=o.i(0,"sqlite3_column_blob") +a8.toString +a9=o.i(0,"sqlite3_column_text") +a9.toString +b0=o.i(0,"sqlite3_bind_null") +b0.toString +b1=o.i(0,"sqlite3_bind_int64") +b1.toString +b2=o.i(0,"sqlite3_bind_double") +b2.toString +b3=o.i(0,"sqlite3_bind_text") +b3.toString +b4=o.i(0,"sqlite3_bind_blob64") +b4.toString +b5=o.i(0,"sqlite3_bind_parameter_index") +b5.toString +b6=o.i(0,"sqlite3_changes") +b6.toString +b7=o.i(0,"sqlite3_last_insert_rowid") +b7.toString +b8=o.i(0,"sqlite3_user_data") +b8.toString +o.i(0,"sqlite3_result_null").toString +o.i(0,"sqlite3_result_int64").toString +o.i(0,"sqlite3_result_double").toString +o.i(0,"sqlite3_result_text").toString +o.i(0,"sqlite3_result_blob64").toString +o.i(0,"sqlite3_result_error").toString +o.i(0,"sqlite3_value_type").toString +o.i(0,"sqlite3_value_int64").toString +o.i(0,"sqlite3_value_double").toString +o.i(0,"sqlite3_value_bytes").toString +o.i(0,"sqlite3_value_text").toString +o.i(0,"sqlite3_value_blob").toString +o.i(0,"sqlite3_aggregate_context").toString +b9=o.i(0,"sqlite3_get_autocommit") +b9.toString +o.i(0,"sqlite3_stmt_isexplain").toString +o.i(0,"sqlite3_stmt_readonly").toString +c0=o.i(0,"dart_sqlite3_db_config_int") +c1=o.i(0,"sqlite3_initialize") +c2=o.i(0,"sqlite3_error_offset") +c3=o.i(0,"dart_sqlite3_commits") +o=o.i(0,"dart_sqlite3_rollbacks") +p.b.i(0,"sqlite3_temp_directory").toString +q=c4.a=new A.eM(c5,c4.d,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2,a4,a5,a6,a7,a9,a8,b0,b1,b2,b3,b4,b5,a3,b6,b7,b8,b9,c0,c1,c3,o,c2) +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$ii,r)}, +aj(a){var s,r,q +try{a.$0() +return 0}catch(r){q=A.L(r) +if(q instanceof A.d5){s=q +return s.a}else return 1}}, +l0(a,b){var s=A.aT(t.o.a(a.buffer),b,null),r=s.length,q=0 +while(!0){if(!(q")) +s.es() +return s}, +qO(a,b){var s=$.x +if(s===B.e)return a +return s.cU(a,b)}, +ky:function ky(a,b){this.a=a +this.$ti=b}, +iE:function iE(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=c +_.$ti=d}, +dc:function dc(a,b,c,d,e){var _=this +_.a=0 +_.b=a +_.c=b +_.d=c +_.e=d +_.$ti=e}, +iF:function iF(a){this.a=a}, +nx(a){if(typeof dartPrint=="function"){dartPrint(a) +return}if(typeof console=="object"&&typeof console.log!="undefined"){console.log(a) +return}if(typeof print=="function"){print(a) +return}throw"Unable to print message: "+String(a)}, +oG(a,b){return a}, +kB(a,b){var s,r,q,p,o,n +if(b.length===0)return!1 +s=b.split(".") +r=t.m.a(self) +for(q=s.length,p=t.A,o=0;o=65&&a<=90))s=a>=97&&a<=122 +else s=!0 +return s}, +r_(a,b){var s,r,q=null,p=a.length,o=b+2 +if(p=0&&b=0&&s").t(b).h("ac<1,2>"))}, +n(a,b){A.a_(a).c.a(b) +a.$flags&1&&A.y(a,29) +a.push(b)}, +fl(a,b){var s +a.$flags&1&&A.y(a,"removeAt",1) +s=a.length +if(b>=s)throw A.c(A.md(b,null)) +return a.splice(b,1)[0]}, +eZ(a,b,c){var s,r +A.a_(a).h("e<1>").a(c) +a.$flags&1&&A.y(a,"insertAll",2) +A.oS(b,0,a.length,"index") +if(!t.R.b(c))c=J.o7(c) +s=J.P(c) +a.length=a.length+s +r=b+s +this.D(a,r,a.length,a,b) +this.R(a,b,r,c)}, +I(a,b){var s +a.$flags&1&&A.y(a,"remove",1) +for(s=0;s").a(b) +a.$flags&1&&A.y(a,"addAll",2) +if(Array.isArray(b)){this.dO(a,b) +return}for(s=J.W(b);s.m();)a.push(s.gp())}, +dO(a,b){var s,r +t.b.a(b) +s=b.length +if(s===0)return +if(a===b)throw A.c(A.ag(a)) +for(r=0;r").t(c).h("a3<1,2>"))}, +ah(a,b){var s,r=A.cO(a.length,"",!1,t.N) +for(s=0;s=0&&b0)return a[0] +throw A.c(A.aE())}, +ga2(a){var s=a.length +if(s>0)return a[s-1] +throw A.c(A.aE())}, +D(a,b,c,d,e){var s,r,q,p,o +A.a_(a).h("e<1>").a(d) +a.$flags&2&&A.y(a,5) +A.bB(b,c,a.length) +s=c-b +if(s===0)return +A.a7(e,"skipCount") +if(t.j.b(d)){r=d +q=e}else{r=J.dL(d,e).aB(0,!1) +q=0}p=J.ao(r) +if(q+s>p.gl(r))throw A.c(A.lW()) +if(q=0;--o)a[b+o]=p.i(r,q+o) +else for(o=0;o0){a[0]=q +a[1]=r}return}p=0 +if(n.c.b(null))for(o=0;o0)this.ej(a,p)}, +du(a){return this.dv(a,null)}, +ej(a,b){var s,r=a.length +for(;s=r-1,r>0;r=s)if(a[s]===null){a[s]=void 0;--b +if(b===0)break}}, +f9(a,b){var s,r=a.length,q=r-1 +if(q<0)return-1 +q>=r +for(s=q;s>=0;--s){if(!(s"))}, +gv(a){return A.er(a)}, +gl(a){return a.length}, +i(a,b){if(!(b>=0&&b=0&&b=p){r.scv(null) +return!1}r.scv(q[s]);++r.c +return!0}, +scv(a){this.d=this.$ti.h("1?").a(a)}, +$iB:1} +J.c6.prototype={ +T(a,b){var s +A.q5(b) +if(ab)return 1 +else if(a===b){if(a===0){s=this.gcc(b) +if(this.gcc(a)===s)return 0 +if(this.gcc(a))return-1 +return 1}return 0}else if(isNaN(a)){if(isNaN(b))return 0 +return 1}else return-1}, +gcc(a){return a===0?1/a<0:a<0}, +ez(a){var s,r +if(a>=0){if(a<=2147483647){s=a|0 +return a===s?s:s+1}}else if(a>=-2147483648)return a|0 +r=Math.ceil(a) +if(isFinite(r))return r +throw A.c(A.U(""+a+".ceil()"))}, +j(a){if(a===0&&1/a<0)return"-0.0" +else return""+a}, +gv(a){var s,r,q,p,o=a|0 +if(a===o)return o&536870911 +s=Math.abs(a) +r=Math.log(s)/0.6931471805599453|0 +q=Math.pow(2,r) +p=s<1?s/q:q/s +return((p*9007199254740992|0)+(p*3542243181176521|0))*599197+r*1259&536870911}, +Y(a,b){var s=a%b +if(s===0)return 0 +if(s>0)return s +return s+b}, +dF(a,b){if((a|0)===a)if(b>=1||b<-1)return a/b|0 +return this.cN(a,b)}, +F(a,b){return(a|0)===a?a/b|0:this.cN(a,b)}, +cN(a,b){var s=a/b +if(s>=-2147483648&&s<=2147483647)return s|0 +if(s>0){if(s!==1/0)return Math.floor(s)}else if(s>-1/0)return Math.ceil(s) +throw A.c(A.U("Result of truncating division is "+A.o(s)+": "+A.o(a)+" ~/ "+b))}, +aD(a,b){if(b<0)throw A.c(A.k4(b)) +return b>31?0:a<>>0}, +aE(a,b){var s +if(b<0)throw A.c(A.k4(b)) +if(a>0)s=this.bY(a,b) +else{s=b>31?31:b +s=a>>s>>>0}return s}, +E(a,b){var s +if(a>0)s=this.bY(a,b) +else{s=b>31?31:b +s=a>>s>>>0}return s}, +eq(a,b){if(0>b)throw A.c(A.k4(b)) +return this.bY(a,b)}, +bY(a,b){return b>31?0:a>>>b}, +gB(a){return A.aI(t.di)}, +$ia6:1, +$iA:1, +$iaq:1} +J.cI.prototype={ +gcV(a){var s,r=a<0?-a-1:a,q=r +for(s=32;q>=4294967296;){q=this.F(q,4294967296) +s+=32}return s-Math.clz32(q)}, +gB(a){return A.aI(t.S)}, +$iG:1, +$ia:1} +J.ed.prototype={ +gB(a){return A.aI(t.i)}, +$iG:1} +J.bc.prototype={ +cS(a,b){return new A.fl(b,a,0)}, +cY(a,b){var s=b.length,r=a.length +if(s>r)return!1 +return b===this.Z(a,r-s)}, +az(a,b,c,d){var s=A.bB(b,c,a.length) +return a.substring(0,b)+d+a.substring(s)}, +K(a,b,c){var s +if(c<0||c>a.length)throw A.c(A.S(c,0,a.length,null,null)) +s=c+b.length +if(s>a.length)return!1 +return b===a.substring(c,s)}, +J(a,b){return this.K(a,b,0)}, +q(a,b,c){return a.substring(b,A.bB(b,c,a.length))}, +Z(a,b){return this.q(a,b,null)}, +fs(a){var s,r,q,p=a.trim(),o=p.length +if(o===0)return p +if(0>=o)return A.b(p,0) +if(p.charCodeAt(0)===133){s=J.oA(p,1) +if(s===o)return""}else s=0 +r=o-1 +if(!(r>=0))return A.b(p,r) +q=p.charCodeAt(r)===133?J.oB(p,r):o +if(s===0&&q===o)return p +return p.substring(s,q)}, +aW(a,b){var s,r +if(0>=b)return"" +if(b===1||a.length===0)return a +if(b!==b>>>0)throw A.c(B.J) +for(s=a,r="";!0;){if((b&1)===1)r=s+r +b=b>>>1 +if(b===0)break +s+=s}return r}, +fg(a,b,c){var s=b-a.length +if(s<=0)return a +return this.aW(c,s)+a}, +ag(a,b,c){var s +if(c<0||c>a.length)throw A.c(A.S(c,0,a.length,null,null)) +s=a.indexOf(b,c) +return s}, +c8(a,b){return this.ag(a,b,0)}, +G(a,b){return A.rk(a,b,0)}, +T(a,b){var s +A.M(b) +if(a===b)s=0 +else s=a>6}r=r+((r&67108863)<<3)&536870911 +r^=r>>11 +return r+((r&16383)<<15)&536870911}, +gB(a){return A.aI(t.N)}, +gl(a){return a.length}, +$iG:1, +$ia6:1, +$ihd:1, +$ih:1} +A.bi.prototype={ +gu(a){return new A.cz(J.W(this.ga6()),A.v(this).h("cz<1,2>"))}, +gl(a){return J.P(this.ga6())}, +P(a,b){var s=A.v(this) +return A.dS(J.dL(this.ga6(),b),s.c,s.y[1])}, +C(a,b){return A.v(this).y[1].a(J.dK(this.ga6(),b))}, +gH(a){return A.v(this).y[1].a(J.b9(this.ga6()))}, +G(a,b){return J.lF(this.ga6(),b)}, +j(a){return J.aC(this.ga6())}} +A.cz.prototype={ +m(){return this.a.m()}, +gp(){return this.$ti.y[1].a(this.a.gp())}, +$iB:1} +A.bp.prototype={ +ga6(){return this.a}} +A.db.prototype={$in:1} +A.da.prototype={ +i(a,b){return this.$ti.y[1].a(J.b8(this.a,b))}, +k(a,b,c){var s=this.$ti +J.fD(this.a,b,s.c.a(s.y[1].a(c)))}, +D(a,b,c,d,e){var s=this.$ti +J.o5(this.a,b,c,A.dS(s.h("e<2>").a(d),s.y[1],s.c),e)}, +R(a,b,c,d){return this.D(0,b,c,d,0)}, +$in:1, +$it:1} +A.ac.prototype={ +b9(a,b){return new A.ac(this.a,this.$ti.h("@<1>").t(b).h("ac<1,2>"))}, +ga6(){return this.a}} +A.cA.prototype={ +L(a){return this.a.L(a)}, +i(a,b){return this.$ti.h("4?").a(this.a.i(0,b))}, +M(a,b){this.a.M(0,new A.fN(this,this.$ti.h("~(3,4)").a(b)))}, +gN(){var s=this.$ti +return A.dS(this.a.gN(),s.c,s.y[2])}, +gaa(){var s=this.$ti +return A.dS(this.a.gaa(),s.y[1],s.y[3])}, +gl(a){var s=this.a +return s.gl(s)}, +gaO(){return this.a.gaO().a8(0,new A.fM(this),this.$ti.h("Q<3,4>"))}} +A.fN.prototype={ +$2(a,b){var s=this.a.$ti +s.c.a(a) +s.y[1].a(b) +this.b.$2(s.y[2].a(a),s.y[3].a(b))}, +$S(){return this.a.$ti.h("~(1,2)")}} +A.fM.prototype={ +$1(a){var s=this.a.$ti +s.h("Q<1,2>").a(a) +return new A.Q(s.y[2].a(a.a),s.y[3].a(a.b),s.h("Q<3,4>"))}, +$S(){return this.a.$ti.h("Q<3,4>(Q<1,2>)")}} +A.c8.prototype={ +j(a){return"LateInitializationError: "+this.a}} +A.cB.prototype={ +gl(a){return this.a.length}, +i(a,b){var s=this.a +if(!(b>=0&&b"))}, +gH(a){if(this.gl(this)===0)throw A.c(A.aE()) +return this.C(0,0)}, +G(a,b){var s,r=this,q=r.gl(r) +for(s=0;s").t(c).h("a3<1,2>"))}, +P(a,b){return A.eC(this,b,null,A.v(this).h("X.E"))}} +A.bF.prototype={ +dG(a,b,c,d){var s,r=this.b +A.a7(r,"start") +s=this.c +if(s!=null){A.a7(s,"end") +if(r>s)throw A.c(A.S(r,0,s,"start",null))}}, +ge2(){var s=J.P(this.a),r=this.c +if(r==null||r>s)return s +return r}, +ger(){var s=J.P(this.a),r=this.b +if(r>s)return s +return r}, +gl(a){var s,r=J.P(this.a),q=this.b +if(q>=r)return 0 +s=this.c +if(s==null||s>=r)return r-q +if(typeof s!=="number")return s.aX() +return s-q}, +C(a,b){var s=this,r=s.ger()+b +if(b<0||r>=s.ge2())throw A.c(A.e8(b,s.gl(0),s,null,"index")) +return J.dK(s.a,r)}, +P(a,b){var s,r,q=this +A.a7(b,"count") +s=q.b+b +r=q.c +if(r!=null&&s>=r)return new A.bs(q.$ti.h("bs<1>")) +return A.eC(q.a,s,r,q.$ti.c)}, +aB(a,b){var s,r,q,p=this,o=p.b,n=p.a,m=J.ao(n),l=m.gl(n),k=p.c +if(k!=null&&k=o){r.saG(null) +return!1}r.saG(p.C(q,s));++r.c +return!0}, +saG(a){this.d=this.$ti.h("1?").a(a)}, +$iB:1} +A.aS.prototype={ +gu(a){return new A.cP(J.W(this.a),this.b,A.v(this).h("cP<1,2>"))}, +gl(a){return J.P(this.a)}, +gH(a){return this.b.$1(J.b9(this.a))}, +C(a,b){return this.b.$1(J.dK(this.a,b))}} +A.br.prototype={$in:1} +A.cP.prototype={ +m(){var s=this,r=s.b +if(r.m()){s.saG(s.c.$1(r.gp())) +return!0}s.saG(null) +return!1}, +gp(){var s=this.a +return s==null?this.$ti.y[1].a(s):s}, +saG(a){this.a=this.$ti.h("2?").a(a)}, +$iB:1} +A.a3.prototype={ +gl(a){return J.P(this.a)}, +C(a,b){return this.b.$1(J.dK(this.a,b))}} +A.iq.prototype={ +gu(a){return new A.bJ(J.W(this.a),this.b,this.$ti.h("bJ<1>"))}, +a8(a,b,c){var s=this.$ti +return new A.aS(this,s.t(c).h("1(2)").a(b),s.h("@<1>").t(c).h("aS<1,2>"))}} +A.bJ.prototype={ +m(){var s,r +for(s=this.a,r=this.b;s.m();)if(A.b4(r.$1(s.gp())))return!0 +return!1}, +gp(){return this.a.gp()}, +$iB:1} +A.aV.prototype={ +P(a,b){A.cw(b,"count",t.S) +A.a7(b,"count") +return new A.aV(this.a,this.b+b,A.v(this).h("aV<1>"))}, +gu(a){return new A.cY(J.W(this.a),this.b,A.v(this).h("cY<1>"))}} +A.c1.prototype={ +gl(a){var s=J.P(this.a)-this.b +if(s>=0)return s +return 0}, +P(a,b){A.cw(b,"count",t.S) +A.a7(b,"count") +return new A.c1(this.a,this.b+b,this.$ti)}, +$in:1} +A.cY.prototype={ +m(){var s,r +for(s=this.a,r=0;r"))}, +P(a,b){A.a7(b,"count") +return this}} +A.cE.prototype={ +m(){return!1}, +gp(){throw A.c(A.aE())}, +$iB:1} +A.d6.prototype={ +gu(a){return new A.d7(J.W(this.a),this.$ti.h("d7<1>"))}} +A.d7.prototype={ +m(){var s,r +for(s=this.a,r=this.$ti.c;s.m();)if(r.b(s.gp()))return!0 +return!1}, +gp(){return this.$ti.c.a(this.a.gp())}, +$iB:1} +A.bu.prototype={ +gl(a){return J.P(this.a)}, +gH(a){return new A.bl(this.b,J.b9(this.a))}, +C(a,b){return new A.bl(b+this.b,J.dK(this.a,b))}, +G(a,b){return!1}, +P(a,b){A.cw(b,"count",t.S) +A.a7(b,"count") +return new A.bu(J.dL(this.a,b),b+this.b,A.v(this).h("bu<1>"))}, +gu(a){return new A.bv(J.W(this.a),this.b,A.v(this).h("bv<1>"))}} +A.c0.prototype={ +G(a,b){return!1}, +P(a,b){A.cw(b,"count",t.S) +A.a7(b,"count") +return new A.c0(J.dL(this.a,b),this.b+b,this.$ti)}, +$in:1} +A.bv.prototype={ +m(){if(++this.c>=0&&this.a.m())return!0 +this.c=-2 +return!1}, +gp(){var s=this.c +return s>=0?new A.bl(this.b+s,this.a.gp()):A.J(A.aE())}, +$iB:1} +A.ad.prototype={} +A.bh.prototype={ +k(a,b,c){A.v(this).h("bh.E").a(c) +throw A.c(A.U("Cannot modify an unmodifiable list"))}, +D(a,b,c,d,e){A.v(this).h("e").a(d) +throw A.c(A.U("Cannot modify an unmodifiable list"))}, +R(a,b,c,d){return this.D(0,b,c,d,0)}} +A.cg.prototype={} +A.f8.prototype={ +gl(a){return J.P(this.a)}, +C(a,b){A.oq(b,J.P(this.a),this,null,null) +return b}} +A.cN.prototype={ +i(a,b){return this.L(b)?J.b8(this.a,A.d(b)):null}, +gl(a){return J.P(this.a)}, +gaa(){return A.eC(this.a,0,null,this.$ti.c)}, +gN(){return new A.f8(this.a)}, +L(a){return A.fu(a)&&a>=0&&a>"))}, +eG(){var s=this +return function(){var r=0,q=1,p,o,n,m,l,k +return function $async$gaO(a,b,c){if(b===1){p=c +r=q}while(true)switch(r){case 0:o=s.gN(),o=o.gu(o),n=A.v(s),m=n.y[1],n=n.h("Q<1,2>") +case 2:if(!o.m()){r=3 +break}l=o.gp() +k=s.i(0,l) +r=4 +return a.b=new A.Q(l,k==null?m.a(k):k,n),1 +case 4:r=2 +break +case 3:return 0 +case 1:return a.c=p,3}}}}, +$iI:1} +A.cD.prototype={ +gl(a){return this.b.length}, +gcD(){var s=this.$keys +if(s==null){s=Object.keys(this.a) +this.$keys=s}return s}, +L(a){if(typeof a!="string")return!1 +if("__proto__"===a)return!1 +return this.a.hasOwnProperty(a)}, +i(a,b){if(!this.L(b))return null +return this.b[this.a[b]]}, +M(a,b){var s,r,q,p +this.$ti.h("~(1,2)").a(b) +s=this.gcD() +r=this.b +for(q=s.length,p=0;p"))}, +gaa(){return new A.bP(this.b,this.$ti.h("bP<2>"))}} +A.bP.prototype={ +gl(a){return this.a.length}, +gu(a){var s=this.a +return new A.dd(s,s.length,this.$ti.h("dd<1>"))}} +A.dd.prototype={ +gp(){var s=this.d +return s==null?this.$ti.c.a(s):s}, +m(){var s=this,r=s.c +if(r>=s.b){s.saH(null) +return!1}s.saH(s.a[r]);++s.c +return!0}, +saH(a){this.d=this.$ti.h("1?").a(a)}, +$iB:1} +A.ia.prototype={ +a_(a){var s,r,q=this,p=new RegExp(q.a).exec(a) +if(p==null)return null +s=Object.create(null) +r=q.b +if(r!==-1)s.arguments=p[r+1] +r=q.c +if(r!==-1)s.argumentsExpr=p[r+1] +r=q.d +if(r!==-1)s.expr=p[r+1] +r=q.e +if(r!==-1)s.method=p[r+1] +r=q.f +if(r!==-1)s.receiver=p[r+1] +return s}} +A.cT.prototype={ +j(a){return"Null check operator used on a null value"}} +A.ee.prototype={ +j(a){var s,r=this,q="NoSuchMethodError: method not found: '",p=r.b +if(p==null)return"NoSuchMethodError: "+r.a +s=r.c +if(s==null)return q+p+"' ("+r.a+")" +return q+p+"' on '"+s+"' ("+r.a+")"}} +A.eF.prototype={ +j(a){var s=this.a +return s.length===0?"Error":"Error: "+s}} +A.hb.prototype={ +j(a){return"Throw of null ('"+(this.a===null?"null":"undefined")+"' from JavaScript)"}} +A.cF.prototype={} +A.dp.prototype={ +j(a){var s,r=this.b +if(r!=null)return r +r=this.a +s=r!==null&&typeof r==="object"?r.stack:null +return this.b=s==null?"":s}, +$iaF:1} +A.ba.prototype={ +j(a){var s=this.constructor,r=s==null?null:s.name +return"Closure '"+A.nC(r==null?"unknown":r)+"'"}, +gB(a){var s=A.lp(this) +return A.aI(s==null?A.ap(this):s)}, +$ibt:1, +gfu(){return this}, +$C:"$1", +$R:1, +$D:null} +A.dT.prototype={$C:"$0",$R:0} +A.dU.prototype={$C:"$2",$R:2} +A.eD.prototype={} +A.eA.prototype={ +j(a){var s=this.$static_name +if(s==null)return"Closure of unknown static method" +return"Closure '"+A.nC(s)+"'"}} +A.bY.prototype={ +X(a,b){if(b==null)return!1 +if(this===b)return!0 +if(!(b instanceof A.bY))return!1 +return this.$_target===b.$_target&&this.a===b.a}, +gv(a){return(A.lv(this.a)^A.er(this.$_target))>>>0}, +j(a){return"Closure '"+this.$_name+"' of "+("Instance of '"+A.he(this.a)+"'")}} +A.eZ.prototype={ +j(a){return"Reading static variable '"+this.a+"' during its initialization"}} +A.ev.prototype={ +j(a){return"RuntimeError: "+this.a}} +A.eW.prototype={ +j(a){return"Assertion failed: "+A.e3(this.a)}} +A.aQ.prototype={ +gl(a){return this.a}, +gf6(a){return this.a!==0}, +gN(){return new A.aR(this,A.v(this).h("aR<1>"))}, +gaa(){var s=A.v(this) +return A.m2(new A.aR(this,s.h("aR<1>")),new A.h4(this),s.c,s.y[1])}, +L(a){var s,r +if(typeof a=="string"){s=this.b +if(s==null)return!1 +return s[a]!=null}else if(typeof a=="number"&&(a&0x3fffffff)===a){r=this.c +if(r==null)return!1 +return r[a]!=null}else return this.f2(a)}, +f2(a){var s=this.d +if(s==null)return!1 +return this.bj(s[this.bi(a)],a)>=0}, +c0(a,b){A.v(this).h("I<1,2>").a(b).M(0,new A.h3(this))}, +i(a,b){var s,r,q,p,o=null +if(typeof b=="string"){s=this.b +if(s==null)return o +r=s[b] +q=r==null?o:r.b +return q}else if(typeof b=="number"&&(b&0x3fffffff)===b){p=this.c +if(p==null)return o +r=p[b] +q=r==null?o:r.b +return q}else return this.f3(b)}, +f3(a){var s,r,q=this.d +if(q==null)return null +s=q[this.bi(a)] +r=this.bj(s,a) +if(r<0)return null +return s[r].b}, +k(a,b,c){var s,r,q=this,p=A.v(q) +p.c.a(b) +p.y[1].a(c) +if(typeof b=="string"){s=q.b +q.co(s==null?q.b=q.bT():s,b,c)}else if(typeof b=="number"&&(b&0x3fffffff)===b){r=q.c +q.co(r==null?q.c=q.bT():r,b,c)}else q.f5(b,c)}, +f5(a,b){var s,r,q,p,o=this,n=A.v(o) +n.c.a(a) +n.y[1].a(b) +s=o.d +if(s==null)s=o.d=o.bT() +r=o.bi(a) +q=s[r] +if(q==null)s[r]=[o.bU(a,b)] +else{p=o.bj(q,a) +if(p>=0)q[p].b=b +else q.push(o.bU(a,b))}}, +fj(a,b){var s,r,q=this,p=A.v(q) +p.c.a(a) +p.h("2()").a(b) +if(q.L(a)){s=q.i(0,a) +return s==null?p.y[1].a(s):s}r=b.$0() +q.k(0,a,r) +return r}, +I(a,b){var s=this +if(typeof b=="string")return s.cH(s.b,b) +else if(typeof b=="number"&&(b&0x3fffffff)===b)return s.cH(s.c,b) +else return s.f4(b)}, +f4(a){var s,r,q,p,o=this,n=o.d +if(n==null)return null +s=o.bi(a) +r=n[s] +q=o.bj(r,a) +if(q<0)return null +p=r.splice(q,1)[0] +o.cR(p) +if(r.length===0)delete n[s] +return p.b}, +M(a,b){var s,r,q=this +A.v(q).h("~(1,2)").a(b) +s=q.e +r=q.r +for(;s!=null;){b.$2(s.a,s.b) +if(r!==q.r)throw A.c(A.ag(q)) +s=s.c}}, +co(a,b,c){var s,r=A.v(this) +r.c.a(b) +r.y[1].a(c) +s=a[b] +if(s==null)a[b]=this.bU(b,c) +else s.b=c}, +cH(a,b){var s +if(a==null)return null +s=a[b] +if(s==null)return null +this.cR(s) +delete a[b] +return s.b}, +cF(){this.r=this.r+1&1073741823}, +bU(a,b){var s=this,r=A.v(s),q=new A.h5(r.c.a(a),r.y[1].a(b)) +if(s.e==null)s.e=s.f=q +else{r=s.f +r.toString +q.d=r +s.f=r.c=q}++s.a +s.cF() +return q}, +cR(a){var s=this,r=a.d,q=a.c +if(r==null)s.e=q +else r.c=q +if(q==null)s.f=r +else q.d=r;--s.a +s.cF()}, +bi(a){return J.aL(a)&1073741823}, +bj(a,b){var s,r +if(a==null)return-1 +s=a.length +for(r=0;r"]=s +delete s[""] +return s}, +$im_:1} +A.h4.prototype={ +$1(a){var s=this.a,r=A.v(s) +s=s.i(0,r.c.a(a)) +return s==null?r.y[1].a(s):s}, +$S(){return A.v(this.a).h("2(1)")}} +A.h3.prototype={ +$2(a,b){var s=this.a,r=A.v(s) +s.k(0,r.c.a(a),r.y[1].a(b))}, +$S(){return A.v(this.a).h("~(1,2)")}} +A.h5.prototype={} +A.aR.prototype={ +gl(a){return this.a.a}, +gu(a){var s=this.a,r=new A.cM(s,s.r,this.$ti.h("cM<1>")) +r.c=s.e +return r}, +G(a,b){return this.a.L(b)}} +A.cM.prototype={ +gp(){return this.d}, +m(){var s,r=this,q=r.a +if(r.b!==q.r)throw A.c(A.ag(q)) +s=r.c +if(s==null){r.saH(null) +return!1}else{r.saH(s.a) +r.c=s.c +return!0}}, +saH(a){this.d=this.$ti.h("1?").a(a)}, +$iB:1} +A.kc.prototype={ +$1(a){return this.a(a)}, +$S:68} +A.kd.prototype={ +$2(a,b){return this.a(a,b)}, +$S:31} +A.ke.prototype={ +$1(a){return this.a(A.M(a))}, +$S:27} +A.bk.prototype={ +gB(a){return A.aI(this.cB())}, +cB(){return A.r1(this.$r,this.cz())}, +j(a){return this.cQ(!1)}, +cQ(a){var s,r,q,p,o,n=this.e6(),m=this.cz(),l=(a?""+"Record ":"")+"(" +for(s=n.length,r="",q=0;q0;){--q;--s +B.b.k(j,q,r[s])}}return A.ef(j,k)}} +A.bR.prototype={ +cz(){return[this.a,this.b]}, +X(a,b){if(b==null)return!1 +return b instanceof A.bR&&this.$s===b.$s&&J.V(this.a,b.a)&&J.V(this.b,b.b)}, +gv(a){return A.m3(this.$s,this.a,this.b,B.h)}} +A.cK.prototype={ +j(a){return"RegExp/"+this.a+"/"+this.b.flags}, +gec(){var s=this,r=s.c +if(r!=null)return r +r=s.b +return s.c=A.lZ(s.a,r.multiline,!r.ignoreCase,r.unicode,r.dotAll,!0)}, +eO(a){var s=this.b.exec(a) +if(s==null)return null +return new A.di(s)}, +cS(a,b){return new A.eU(this,b,0)}, +e4(a,b){var s,r=this.gec() +if(r==null)r=t.K.a(r) +r.lastIndex=b +s=r.exec(a) +if(s==null)return null +return new A.di(s)}, +$ihd:1, +$ioT:1} +A.di.prototype={$ica:1,$icW:1} +A.eU.prototype={ +gu(a){return new A.eV(this.a,this.b,this.c)}} +A.eV.prototype={ +gp(){var s=this.d +return s==null?t.cz.a(s):s}, +m(){var s,r,q,p,o,n,m=this,l=m.b +if(l==null)return!1 +s=m.c +r=l.length +if(s<=r){q=m.a +p=q.e4(l,s) +if(p!=null){m.d=p +s=p.b +o=s.index +n=o+s[0].length +if(o===n){s=!1 +if(q.b.unicode){q=m.c +o=q+1 +if(o=0&&q=55296&&q<=56319){if(!(o>=0))return A.b(l,o) +s=l.charCodeAt(o) +s=s>=56320&&s<=57343}}}n=(s?n+1:n)+1}m.c=n +return!0}}m.b=m.d=null +return!1}, +$iB:1} +A.d3.prototype={$ica:1} +A.fl.prototype={ +gu(a){return new A.fm(this.a,this.b,this.c)}, +gH(a){var s=this.b,r=this.a.indexOf(s,this.c) +if(r>=0)return new A.d3(r,s) +throw A.c(A.aE())}} +A.fm.prototype={ +m(){var s,r,q=this,p=q.c,o=q.b,n=o.length,m=q.a,l=m.length +if(p+n>l){q.d=null +return!1}s=m.indexOf(o,p) +if(s<0){q.c=l+1 +q.d=null +return!1}r=s+n +q.d=new A.d3(s,o) +q.c=r===q.c?r+1:r +return!0}, +gp(){var s=this.d +s.toString +return s}, +$iB:1} +A.iz.prototype={ +S(){var s=this.b +if(s===this)throw A.c(A.oC(this.a)) +return s}} +A.cb.prototype={ +gB(a){return B.T}, +cT(a,b,c){A.fs(a,b,c) +return c==null?new Uint8Array(a,b):new Uint8Array(a,b,c)}, +$iG:1, +$icb:1, +$idR:1} +A.cR.prototype={ +gaq(a){if(((a.$flags|0)&2)!==0)return new A.fp(a.buffer) +else return a.buffer}, +eb(a,b,c,d){var s=A.S(b,0,c,d,null) +throw A.c(s)}, +cr(a,b,c,d){if(b>>>0!==b||b>c)this.eb(a,b,c,d)}} +A.fp.prototype={ +cT(a,b,c){var s=A.aT(this.a,b,c) +s.$flags=3 +return s}, +$idR:1} +A.cQ.prototype={ +gB(a){return B.U}, +$iG:1, +$ilO:1} +A.a4.prototype={ +gl(a){return a.length}, +cK(a,b,c,d,e){var s,r,q=a.length +this.cr(a,b,q,"start") +this.cr(a,c,q,"end") +if(b>c)throw A.c(A.S(b,0,c,null,null)) +s=c-b +if(e<0)throw A.c(A.a0(e,null)) +r=d.length +if(r-e").b(a))s.cq(a) +else s.aI(a)}}, +c3(a,b){var s=this.a +if(this.b)s.O(a,b) +else s.an(a,b)}, +$idW:1} +A.jR.prototype={ +$1(a){return this.a.$2(0,a)}, +$S:7} +A.jS.prototype={ +$2(a,b){this.a.$2(1,new A.cF(a,t.l.a(b)))}, +$S:39} +A.k3.prototype={ +$2(a,b){this.a(A.d(a),b)}, +$S:45} +A.dq.prototype={ +gp(){var s=this.b +return s==null?this.$ti.c.a(s):s}, +em(a,b){var s,r,q +a=A.d(a) +b=b +s=this.a +for(;!0;)try{r=s(this,a,b) +return r}catch(q){b=q +a=1}}, +m(){var s,r,q,p,o=this,n=null,m=null,l=0 +for(;!0;){s=o.d +if(s!=null)try{if(s.m()){o.sbA(s.gp()) +return!0}else o.sbS(n)}catch(r){m=r +l=1 +o.sbS(n)}q=o.em(l,m) +if(1===q)return!0 +if(0===q){o.sbA(n) +p=o.e +if(p==null||p.length===0){o.a=A.mJ +return!1}if(0>=p.length)return A.b(p,-1) +o.a=p.pop() +l=0 +m=null +continue}if(2===q){l=0 +m=null +continue}if(3===q){m=o.c +o.c=null +p=o.e +if(p==null||p.length===0){o.sbA(n) +o.a=A.mJ +throw m +return!1}if(0>=p.length)return A.b(p,-1) +o.a=p.pop() +l=1 +continue}throw A.c(A.T("sync*"))}return!1}, +fw(a){var s,r,q=this +if(a instanceof A.co){s=a.a() +r=q.e +if(r==null)r=q.e=[] +B.b.n(r,q.a) +q.a=s +return 2}else{q.sbS(J.W(a)) +return 2}}, +sbA(a){this.b=this.$ti.h("1?").a(a)}, +sbS(a){this.d=this.$ti.h("B<1>?").a(a)}, +$iB:1} +A.co.prototype={ +gu(a){return new A.dq(this.a(),this.$ti.h("dq<1>"))}} +A.aN.prototype={ +j(a){return A.o(this.a)}, +$iH:1, +gam(){return this.b}} +A.fY.prototype={ +$0(){var s,r,q,p,o,n,m=null +try{m=this.a.$0()}catch(q){s=A.L(q) +r=A.ab(q) +p=s +o=r +n=A.lk(p,o) +if(n!=null){p=n.a +o=n.b}this.b.O(p,o) +return}this.b.bH(m)}, +$S:0} +A.h_.prototype={ +$2(a,b){var s,r,q=this +t.K.a(a) +t.l.a(b) +s=q.a +r=--s.b +if(s.a!=null){s.a=null +s.d=a +s.c=b +if(r===0||q.c)q.d.O(a,b)}else if(r===0&&!q.c){r=s.d +r.toString +s=s.c +s.toString +q.d.O(r,s)}}, +$S:58} +A.fZ.prototype={ +$1(a){var s,r,q,p,o,n,m,l,k=this,j=k.d +j.a(a) +o=k.a +s=--o.b +r=o.a +if(r!=null){J.fD(r,k.b,a) +if(J.V(s,0)){q=A.u([],j.h("E<0>")) +for(o=r,n=o.length,m=0;m")) +q=b==null?1:3 +this.aZ(new A.b0(r,q,a,b,p.h("@<1>").t(c).h("b0<1,2>"))) +return r}, +de(a,b){return this.bq(a,null,b)}, +cP(a,b,c){var s,r=this.$ti +r.t(c).h("1/(2)").a(a) +s=new A.w($.x,c.h("w<0>")) +this.aZ(new A.b0(s,19,a,b,r.h("@<1>").t(c).h("b0<1,2>"))) +return s}, +ep(a){this.a=this.a&1|16 +this.c=a}, +b0(a){this.a=a.a&30|this.a&1 +this.c=a.c}, +aZ(a){var s,r=this,q=r.a +if(q<=3){a.a=t.d.a(r.c) +r.c=a}else{if((q&4)!==0){s=t.e.a(r.c) +if((s.a&24)===0){s.aZ(a) +return}r.b0(s)}r.b.ak(new A.iJ(r,a))}}, +bV(a){var s,r,q,p,o,n,m=this,l={} +l.a=a +if(a==null)return +s=m.a +if(s<=3){r=t.d.a(m.c) +m.c=a +if(r!=null){q=a.a +for(p=a;q!=null;p=q,q=o)o=q.a +p.a=r}}else{if((s&4)!==0){n=t.e.a(m.c) +if((n.a&24)===0){n.bV(a) +return}m.b0(n)}l.a=m.b6(a) +m.b.ak(new A.iQ(l,m))}}, +b5(){var s=t.d.a(this.c) +this.c=null +return this.b6(s)}, +b6(a){var s,r,q +for(s=a,r=null;s!=null;r=s,s=q){q=s.a +s.a=r}return r}, +cp(a){var s,r,q,p=this +p.a^=2 +try{a.bq(new A.iN(p),new A.iO(p),t.P)}catch(q){s=A.L(q) +r=A.ab(q) +A.rj(new A.iP(p,s,r))}}, +bH(a){var s,r=this,q=r.$ti +q.h("1/").a(a) +if(q.h("z<1>").b(a))if(q.b(a))A.l8(a,r) +else r.cp(a) +else{s=r.b5() +q.c.a(a) +r.a=8 +r.c=a +A.cm(r,s)}}, +aI(a){var s,r=this +r.$ti.c.a(a) +s=r.b5() +r.a=8 +r.c=a +A.cm(r,s)}, +O(a,b){var s +t.l.a(b) +s=this.b5() +this.ep(new A.aN(a,b)) +A.cm(this,s)}, +bB(a){var s=this.$ti +s.h("1/").a(a) +if(s.h("z<1>").b(a)){this.cq(a) +return}this.dP(a)}, +dP(a){var s=this +s.$ti.c.a(a) +s.a^=2 +s.b.ak(new A.iL(s,a))}, +cq(a){var s=this.$ti +s.h("z<1>").a(a) +if(s.b(a)){A.pz(a,this) +return}this.cp(a)}, +an(a,b){this.a^=2 +this.b.ak(new A.iK(this,a,b))}, +$iz:1} +A.iJ.prototype={ +$0(){A.cm(this.a,this.b)}, +$S:0} +A.iQ.prototype={ +$0(){A.cm(this.b,this.a.a)}, +$S:0} +A.iN.prototype={ +$1(a){var s,r,q,p=this.a +p.a^=2 +try{p.aI(p.$ti.c.a(a))}catch(q){s=A.L(q) +r=A.ab(q) +p.O(s,r)}}, +$S:14} +A.iO.prototype={ +$2(a,b){this.a.O(t.K.a(a),t.l.a(b))}, +$S:70} +A.iP.prototype={ +$0(){this.a.O(this.b,this.c)}, +$S:0} +A.iM.prototype={ +$0(){A.l8(this.a.a,this.b)}, +$S:0} +A.iL.prototype={ +$0(){this.a.aI(this.b)}, +$S:0} +A.iK.prototype={ +$0(){this.a.O(this.b,this.c)}, +$S:0} +A.iT.prototype={ +$0(){var s,r,q,p,o,n,m,l=this,k=null +try{q=l.a.a +k=q.b.b.aS(t.fO.a(q.d),t.z)}catch(p){s=A.L(p) +r=A.ab(p) +if(l.c&&t.n.a(l.b.a.c).a===s){q=l.a +q.c=t.n.a(l.b.a.c)}else{q=s +o=r +if(o==null)o=A.kx(q) +n=l.a +n.c=new A.aN(q,o) +q=n}q.b=!0 +return}if(k instanceof A.w&&(k.a&24)!==0){if((k.a&16)!==0){q=l.a +q.c=t.n.a(k.c) +q.b=!0}return}if(k instanceof A.w){m=l.b.a +q=l.a +q.c=k.de(new A.iU(m),t.z) +q.b=!1}}, +$S:0} +A.iU.prototype={ +$1(a){return this.a}, +$S:28} +A.iS.prototype={ +$0(){var s,r,q,p,o,n,m,l +try{q=this.a +p=q.a +o=p.$ti +n=o.c +m=n.a(this.b) +q.c=p.b.b.cj(o.h("2/(1)").a(p.d),m,o.h("2/"),n)}catch(l){s=A.L(l) +r=A.ab(l) +q=s +p=r +if(p==null)p=A.kx(q) +o=this.a +o.c=new A.aN(q,p) +o.b=!0}}, +$S:0} +A.iR.prototype={ +$0(){var s,r,q,p,o,n,m,l=this +try{s=t.n.a(l.a.a.c) +p=l.b +if(p.a.fb(s)&&p.a.e!=null){p.c=p.a.eR(s) +p.b=!1}}catch(o){r=A.L(o) +q=A.ab(o) +p=t.n.a(l.a.a.c) +if(p.a===r){n=l.b +n.c=p +p=n}else{p=r +n=q +if(n==null)n=A.kx(p) +m=l.b +m.c=new A.aN(p,n) +p=m}p.b=!0}}, +$S:0} +A.eX.prototype={} +A.eB.prototype={ +gl(a){var s,r,q=this,p={},o=new A.w($.x,t.fJ) +p.a=0 +s=q.$ti +r=s.h("~(1)?").a(new A.i7(p,q)) +t.g5.a(new A.i8(p,o)) +A.bO(q.a,q.b,r,!1,s.c) +return o}} +A.i7.prototype={ +$1(a){this.b.$ti.c.a(a);++this.a.a}, +$S(){return this.b.$ti.h("~(1)")}} +A.i8.prototype={ +$0(){this.b.bH(this.a.a)}, +$S:0} +A.fk.prototype={} +A.fq.prototype={} +A.dA.prototype={$ib_:1} +A.k0.prototype={ +$0(){A.oj(this.a,this.b)}, +$S:0} +A.fe.prototype={ +gen(){return B.a6}, +gau(){return this}, +fo(a){var s,r,q +t.M.a(a) +try{if(B.e===$.x){a.$0() +return}A.nh(null,null,this,a,t.H)}catch(q){s=A.L(q) +r=A.ab(q) +A.lm(t.K.a(s),t.l.a(r))}}, +fp(a,b,c){var s,r,q +c.h("~(0)").a(a) +c.a(b) +try{if(B.e===$.x){a.$1(b) +return}A.ni(null,null,this,a,b,t.H,c)}catch(q){s=A.L(q) +r=A.ab(q) +A.lm(t.K.a(s),t.l.a(r))}}, +ey(a,b){return new A.jH(this,b.h("0()").a(a),b)}, +c2(a){return new A.jG(this,t.M.a(a))}, +cU(a,b){return new A.jI(this,b.h("~(0)").a(a),b)}, +d1(a,b){A.lm(a,t.l.a(b))}, +aS(a,b){b.h("0()").a(a) +if($.x===B.e)return a.$0() +return A.nh(null,null,this,a,b)}, +cj(a,b,c,d){c.h("@<0>").t(d).h("1(2)").a(a) +d.a(b) +if($.x===B.e)return a.$1(b) +return A.ni(null,null,this,a,b,c,d)}, +fn(a,b,c,d,e,f){d.h("@<0>").t(e).t(f).h("1(2,3)").a(a) +e.a(b) +f.a(c) +if($.x===B.e)return a.$2(b,c) +return A.qG(null,null,this,a,b,c,d,e,f)}, +dc(a,b){return b.h("0()").a(a)}, +dd(a,b,c){return b.h("@<0>").t(c).h("1(2)").a(a)}, +da(a,b,c,d){return b.h("@<0>").t(c).t(d).h("1(2,3)").a(a)}, +eH(a,b){return null}, +ak(a){A.k1(null,null,this,t.M.a(a))}, +cW(a,b){return A.mm(a,t.M.a(b))}} +A.jH.prototype={ +$0(){return this.a.aS(this.b,this.c)}, +$S(){return this.c.h("0()")}} +A.jG.prototype={ +$0(){return this.a.fo(this.b)}, +$S:0} +A.jI.prototype={ +$1(a){var s=this.c +return this.a.fp(this.b,s.a(a),s)}, +$S(){return this.c.h("~(0)")}} +A.de.prototype={ +gu(a){var s=this,r=new A.bQ(s,s.r,s.$ti.h("bQ<1>")) +r.c=s.e +return r}, +gl(a){return this.a}, +G(a,b){var s,r +if(b!=="__proto__"){s=this.b +if(s==null)return!1 +return t.V.a(s[b])!=null}else{r=this.dX(b) +return r}}, +dX(a){var s=this.d +if(s==null)return!1 +return this.bN(s[B.a.gv(a)&1073741823],a)>=0}, +gH(a){var s=this.e +if(s==null)throw A.c(A.T("No elements")) +return this.$ti.c.a(s.a)}, +n(a,b){var s,r,q=this +q.$ti.c.a(b) +if(typeof b=="string"&&b!=="__proto__"){s=q.b +return q.cs(s==null?q.b=A.l9():s,b)}else if(typeof b=="number"&&(b&1073741823)===b){r=q.c +return q.cs(r==null?q.c=A.l9():r,b)}else return q.dN(b)}, +dN(a){var s,r,q,p=this +p.$ti.c.a(a) +s=p.d +if(s==null)s=p.d=A.l9() +r=J.aL(a)&1073741823 +q=s[r] +if(q==null)s[r]=[p.bF(a)] +else{if(p.bN(q,a)>=0)return!1 +q.push(p.bF(a))}return!0}, +I(a,b){var s +if(b!=="__proto__")return this.dU(this.b,b) +else{s=this.ei(b) +return s}}, +ei(a){var s,r,q,p,o=this.d +if(o==null)return!1 +s=B.a.gv(a)&1073741823 +r=o[s] +q=this.bN(r,a) +if(q<0)return!1 +p=r.splice(q,1)[0] +if(0===r.length)delete o[s] +this.cu(p) +return!0}, +cs(a,b){this.$ti.c.a(b) +if(t.V.a(a[b])!=null)return!1 +a[b]=this.bF(b) +return!0}, +dU(a,b){var s +if(a==null)return!1 +s=t.V.a(a[b]) +if(s==null)return!1 +this.cu(s) +delete a[b] +return!0}, +ct(){this.r=this.r+1&1073741823}, +bF(a){var s,r=this,q=new A.f7(r.$ti.c.a(a)) +if(r.e==null)r.e=r.f=q +else{s=r.f +s.toString +q.c=s +r.f=s.b=q}++r.a +r.ct() +return q}, +cu(a){var s=this,r=a.c,q=a.b +if(r==null)s.e=q +else r.b=q +if(q==null)s.f=r +else q.c=r;--s.a +s.ct()}, +bN(a,b){var s,r +if(a==null)return-1 +s=a.length +for(r=0;r"))}, +gl(a){return this.b}, +gH(a){var s +if(this.b===0)throw A.c(A.T("No such element")) +s=this.c +s.toString +return s}, +ga2(a){var s +if(this.b===0)throw A.c(A.T("No such element")) +s=this.c.c +s.toString +return s}, +gW(a){return this.b===0}, +bR(a,b,c){var s=this,r=s.$ti +r.h("1?").a(a) +r.c.a(b) +if(b.a!=null)throw A.c(A.T("LinkedListEntry is already in a LinkedList"));++s.a +b.scE(s) +if(s.b===0){b.sad(b) +b.saJ(b) +s.sbO(b);++s.b +return}r=a.c +r.toString +b.saJ(r) +b.sad(a) +r.sad(b) +a.saJ(b);++s.b}, +bZ(a){var s,r,q=this,p=null +q.$ti.c.a(a);++q.a +a.b.saJ(a.c) +s=a.c +r=a.b +s.sad(r);--q.b +a.saJ(p) +a.sad(p) +a.scE(p) +if(q.b===0)q.sbO(p) +else if(a===q.c)q.sbO(r)}, +sbO(a){this.c=this.$ti.h("1?").a(a)}} +A.df.prototype={ +gp(){var s=this.c +return s==null?this.$ti.c.a(s):s}, +m(){var s=this,r=s.a +if(s.b!==r.a)throw A.c(A.ag(s)) +if(r.b!==0)r=s.e&&s.d===r.gH(0) +else r=!0 +if(r){s.sa4(null) +return!1}s.e=!0 +s.sa4(s.d) +s.sad(s.d.b) +return!0}, +sa4(a){this.c=this.$ti.h("1?").a(a)}, +sad(a){this.d=this.$ti.h("1?").a(a)}, +$iB:1} +A.a2.prototype={ +gaR(){var s=this.a +if(s==null||this===s.gH(0))return null +return this.c}, +scE(a){this.a=A.v(this).h("c9?").a(a)}, +sad(a){this.b=A.v(this).h("a2.E?").a(a)}, +saJ(a){this.c=A.v(this).h("a2.E?").a(a)}} +A.r.prototype={ +gu(a){return new A.bx(a,this.gl(a),A.ap(a).h("bx"))}, +C(a,b){return this.i(a,b)}, +M(a,b){var s,r +A.ap(a).h("~(r.E)").a(b) +s=this.gl(a) +for(r=0;r").t(c).h("a3<1,2>"))}, +P(a,b){return A.eC(a,b,null,A.ap(a).h("r.E"))}, +b9(a,b){return new A.ac(a,A.ap(a).h("@").t(b).h("ac<1,2>"))}, +c6(a,b,c,d){var s +A.ap(a).h("r.E?").a(d) +A.bB(b,c,this.gl(a)) +for(s=b;s").a(d) +A.bB(b,c,this.gl(a)) +s=c-b +if(s===0)return +A.a7(e,"skipCount") +if(o.h("t").b(d)){r=e +q=d}else{q=J.dL(d,e).aB(0,!1) +r=0}o=J.ao(q) +if(r+s>o.gl(q))throw A.c(A.lW()) +if(r=0;--p)this.k(a,b+p,o.i(q,r+p)) +else for(p=0;p").a(c) +if(t.j.b(c))this.R(a,b,b+c.length,c) +else for(s=J.W(c);s.m();b=r){r=b+1 +this.k(a,b,s.gp())}}, +j(a){return A.kA(a,"[","]")}, +$in:1, +$ie:1, +$it:1} +A.D.prototype={ +M(a,b){var s,r,q,p=A.v(this) +p.h("~(D.K,D.V)").a(b) +for(s=J.W(this.gN()),p=p.h("D.V");s.m();){r=s.gp() +q=this.i(0,r) +b.$2(r,q==null?p.a(q):q)}}, +gaO(){return J.lG(this.gN(),new A.h7(this),A.v(this).h("Q"))}, +fa(a,b,c,d){var s,r,q,p,o,n=A.v(this) +n.t(c).t(d).h("Q<1,2>(D.K,D.V)").a(b) +s=A.O(c,d) +for(r=J.W(this.gN()),n=n.h("D.V");r.m();){q=r.gp() +p=this.i(0,q) +o=b.$2(q,p==null?n.a(p):p) +s.k(0,o.a,o.b)}return s}, +L(a){return J.lF(this.gN(),a)}, +gl(a){return J.P(this.gN())}, +gaa(){return new A.dg(this,A.v(this).h("dg"))}, +j(a){return A.h8(this)}, +$iI:1} +A.h7.prototype={ +$1(a){var s=this.a,r=A.v(s) +r.h("D.K").a(a) +s=s.i(0,a) +if(s==null)s=r.h("D.V").a(s) +return new A.Q(a,s,r.h("Q"))}, +$S(){return A.v(this.a).h("Q(D.K)")}} +A.h9.prototype={ +$2(a,b){var s,r=this.a +if(!r.a)this.b.a+=", " +r.a=!1 +r=this.b +s=A.o(a) +s=r.a+=s +r.a=s+": " +s=A.o(b) +r.a+=s}, +$S:32} +A.ch.prototype={} +A.dg.prototype={ +gl(a){var s=this.a +return s.gl(s)}, +gH(a){var s=this.a +s=s.i(0,J.b9(s.gN())) +return s==null?this.$ti.y[1].a(s):s}, +gu(a){var s=this.a +return new A.dh(J.W(s.gN()),s,this.$ti.h("dh<1,2>"))}} +A.dh.prototype={ +m(){var s=this,r=s.a +if(r.m()){s.sa4(s.b.i(0,r.gp())) +return!0}s.sa4(null) +return!1}, +gp(){var s=this.c +return s==null?this.$ti.y[1].a(s):s}, +sa4(a){this.c=this.$ti.h("2?").a(a)}, +$iB:1} +A.dw.prototype={} +A.cd.prototype={ +a8(a,b,c){var s=this.$ti +return new A.br(this,s.t(c).h("1(2)").a(b),s.h("@<1>").t(c).h("br<1,2>"))}, +j(a){return A.kA(this,"{","}")}, +P(a,b){return A.mg(this,b,this.$ti.c)}, +gH(a){var s,r=A.mD(this,this.r,this.$ti.c) +if(!r.m())throw A.c(A.aE()) +s=r.d +return s==null?r.$ti.c.a(s):s}, +C(a,b){var s,r,q,p=this +A.a7(b,"index") +s=A.mD(p,p.r,p.$ti.c) +for(r=b;s.m();){if(r===0){q=s.d +return q==null?s.$ti.c.a(q):q}--r}throw A.c(A.e8(b,b-r,p,null,"index"))}, +$in:1, +$ie:1, +$ikL:1} +A.dn.prototype={} +A.jN.prototype={ +$0(){var s,r +try{s=new TextDecoder("utf-8",{fatal:true}) +return s}catch(r){}return null}, +$S:16} +A.jM.prototype={ +$0(){var s,r +try{s=new TextDecoder("utf-8",{fatal:false}) +return s}catch(r){}return null}, +$S:16} +A.dN.prototype={ +fe(a3,a4,a5){var s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a1="Invalid base64 encoding length ",a2=a3.length +a5=A.bB(a4,a5,a2) +s=$.nR() +for(r=s.length,q=a4,p=q,o=null,n=-1,m=-1,l=0;q=0&&e=0){if(!(d<64))return A.b(a0,d) +e=a0.charCodeAt(d) +if(e===j)continue +j=e}else{if(d===-1){if(n<0){g=o==null?null:o.a.length +if(g==null)g=0 +n=g+(q-p) +m=q}++l +if(j===61)continue}j=e}if(d!==-2){if(o==null){o=new A.a9("") +g=o}else g=o +g.a+=B.a.q(a3,p,q) +c=A.aU(j) +g.a+=c +p=k +continue}}throw A.c(A.a1("Invalid base64 data",a3,q))}if(o!=null){a2=B.a.q(a3,p,a5) +a2=o.a+=a2 +r=a2.length +if(n>=0)A.lH(a3,m,a5,n,l,r) +else{b=B.c.Y(r-1,4)+1 +if(b===1)throw A.c(A.a1(a1,a3,a5)) +for(;b<4;){a2+="=" +o.a=a2;++b}}a2=o.a +return B.a.az(a3,a4,a5,a2.charCodeAt(0)==0?a2:a2)}a=a5-a4 +if(n>=0)A.lH(a3,m,a5,n,l,a) +else{b=B.c.Y(a,4) +if(b===1)throw A.c(A.a1(a1,a3,a5)) +if(b>1)a3=B.a.az(a3,a5,a5,b===2?"==":"=")}return a3}} +A.fK.prototype={} +A.bZ.prototype={} +A.dZ.prototype={} +A.e2.prototype={} +A.eJ.prototype={ +aN(a){t.L.a(a) +return new A.dz(!1).bI(a,0,null,!0)}} +A.ih.prototype={ +ar(a){var s,r,q,p,o=a.length,n=A.bB(0,null,o) +if(n===0)return new Uint8Array(0) +s=n*3 +r=new Uint8Array(s) +q=new A.jO(r) +if(q.e7(a,0,n)!==n){p=n-1 +if(!(p>=0&&p>>18|240 +q=n.b=p+1 +if(!(p>>12&63|128 +p=n.b=q+1 +if(!(q>>6&63|128 +n.b=p+1 +if(!(p=0&&s=q)break +k.b=m+1 +r&2&&A.y(s) +s[m]=n}else{m=n&64512 +if(m===55296){if(k.b+4>q)break +m=o+1 +if(!(mq)break +k.c_()}else if(n<=2047){m=k.b +l=m+1 +if(l>=q)break +k.b=l +r&2&&A.y(s) +if(!(m>>6|192 +k.b=l+1 +s[l]=n&63|128}else{m=k.b +if(m+2>=q)break +l=k.b=m+1 +r&2&&A.y(s) +if(!(m>>12|224 +m=k.b=l+1 +if(!(l>>6&63|128 +k.b=m+1 +if(!(m=15){o=l.a +n=A.q0(o,q,b,s) +if(n!=null){if(!o)return n +if(n.indexOf("\ufffd")<0)return n}}n=l.bJ(q,b,s,!0) +o=l.b +if((o&1)!==0){m=A.q2(o) +l.b=0 +throw A.c(A.a1(m,a,p+l.c))}return n}, +bJ(a,b,c,d){var s,r,q=this +if(c-b>1000){s=B.c.F(b+c,2) +r=q.bJ(a,b,s,!1) +if((q.b&1)!==0)return r +return r+q.bJ(a,s,c,d)}return q.eD(a,b,c,d)}, +eD(a,b,a0,a1){var s,r,q,p,o,n,m,l,k=this,j="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFFFFFFFFFFFFFGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHIHHHJEEBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBKCCCCCCCCCCCCDCLONNNMEEEEEEEEEEE",i=" \x000:XECCCCCN:lDb \x000:XECCCCCNvlDb \x000:XECCCCCN:lDb AAAAA\x00\x00\x00\x00\x00AAAAA00000AAAAA:::::AAAAAGG000AAAAA00KKKAAAAAG::::AAAAA:IIIIAAAAA000\x800AAAAA\x00\x00\x00\x00 AAAAA",h=65533,g=k.b,f=k.c,e=new A.a9(""),d=b+1,c=a.length +if(!(b>=0&&b=0&&s<256))return A.b(j,s) +q=j.charCodeAt(s)&31 +f=g<=32?s&61694>>>q:(s&63|f<<6)>>>0 +p=g+q +if(!(p>=0&&p<144))return A.b(i,p) +g=i.charCodeAt(p) +if(g===0){p=A.aU(f) +e.a+=p +if(d===a0)break $label0$0 +break}else if((g&1)!==0){if(r)switch(g){case 69:case 67:p=A.aU(h) +e.a+=p +break +case 65:p=A.aU(h) +e.a+=p;--d +break +default:p=A.aU(h) +p=e.a+=p +e.a=p+A.aU(h) +break}else{k.b=g +k.c=d-1 +return""}g=0}if(d===a0)break $label0$0 +o=d+1 +if(!(d>=0&&d=0&&d=0&&o=128){n=m-1 +o=m +break}o=m}if(n-d<20)for(l=d;l32)if(r){c=A.aU(h) +e.a+=c}else{k.b=77 +k.c=a0 +return""}k.b=g +k.c=f +c=e.a +return c.charCodeAt(0)==0?c:c}} +A.R.prototype={ +a3(a){var s,r,q=this,p=q.c +if(p===0)return q +s=!q.a +r=q.b +p=A.au(p,r) +return new A.R(p===0?!1:s,r,p)}, +e1(a){var s,r,q,p,o,n,m,l,k=this,j=k.c +if(j===0)return $.b7() +s=j-a +if(s<=0)return k.a?$.lA():$.b7() +r=k.b +q=new Uint16Array(s) +for(p=r.length,o=a;o=0&&o=0&&r>>0!==0)return l.aX(0,$.fB()) +for(k=0;k=0)return q.aY(b,r) +return b.aY(q,!r)}, +aX(a,b){var s,r,q=this,p=q.c +if(p===0)return b.a3(0) +s=b.c +if(s===0)return q +r=q.a +if(r!==b.a)return q.bz(b,r) +if(A.iw(q.b,p,b.b,s)>=0)return q.aY(b,r) +return b.aY(q,!r)}, +aW(a,b){var s,r,q,p,o,n,m,l=this.c,k=b.c +if(l===0||k===0)return $.b7() +s=l+k +r=this.b +q=b.b +p=new Uint16Array(s) +for(o=q.length,n=0;n0?p.a3(0):p}, +eh(a){var s,r,q,p=this +if(p.c0)q=q.aE(0,$.l4.S()) +return p.a&&q.c>0?q.a3(0):q}, +cw(a){var s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c=this,b=c.c +if(b===$.mx&&a.c===$.mz&&c.b===$.mw&&a.b===$.my)return +s=a.b +r=a.c +q=r-1 +if(!(q>=0&&q0){o=new Uint16Array(r+5) +n=A.mv(s,r,p,o) +m=new Uint16Array(b+5) +l=A.mv(c.b,b,p,m)}else{m=A.l5(c.b,0,b,b+2) +n=r +o=s +l=b}q=n-1 +if(!(q>=0&&q=0){q&2&&A.y(m) +if(!(l>=0&&l=0&&l=0&&n0;){d=A.pt(k,m,e);--j +A.mA(d,f,0,m,j,n) +if(!(e>=0&&e=m.length)return A.b(m,0) +return B.c.j(-m[0])}m=n.b +if(0>=m.length)return A.b(m,0) +return B.c.j(m[0])}s=A.u([],t.s) +m=n.a +r=m?n.a3(0):n +for(;r.c>1;){q=$.lz() +if(q.c===0)A.J(B.C) +p=r.eh(q).j(0) +B.b.n(s,p) +o=p.length +if(o===1)B.b.n(s,"000") +if(o===2)B.b.n(s,"00") +if(o===3)B.b.n(s,"0") +r=r.e0(q)}q=r.b +if(0>=q.length)return A.b(q,0) +B.b.n(s,B.c.j(q[0])) +if(m)B.b.n(s,"-") +return new A.cX(s,t.bJ).f7(0)}, +$ibX:1, +$ia6:1} +A.ix.prototype={ +$2(a,b){a=a+b&536870911 +a=a+((a&524287)<<10)&536870911 +return a^a>>>6}, +$S:1} +A.iy.prototype={ +$1(a){a=a+((a&67108863)<<3)&536870911 +a^=a>>>11 +return a+((a&16383)<<15)&536870911}, +$S:11} +A.f1.prototype={ +cX(a){var s=this.a +if(s!=null)s.unregister(a)}} +A.bq.prototype={ +X(a,b){var s +if(b==null)return!1 +s=!1 +if(b instanceof A.bq)if(this.a===b.a)s=this.b===b.b +return s}, +gv(a){return A.m3(this.a,this.b,B.h,B.h)}, +T(a,b){var s +t.dy.a(b) +s=B.c.T(this.a,b.a) +if(s!==0)return s +return B.c.T(this.b,b.b)}, +j(a){var s=this,r=A.oh(A.mb(s)),q=A.e1(A.m9(s)),p=A.e1(A.m6(s)),o=A.e1(A.m7(s)),n=A.e1(A.m8(s)),m=A.e1(A.ma(s)),l=A.lR(A.oO(s)),k=s.b,j=k===0?"":A.lR(k) +return r+"-"+q+"-"+p+" "+o+":"+n+":"+m+"."+l+j}, +$ia6:1} +A.bb.prototype={ +X(a,b){if(b==null)return!1 +return b instanceof A.bb&&this.a===b.a}, +gv(a){return B.c.gv(this.a)}, +T(a,b){return B.c.T(this.a,t.fu.a(b).a)}, +j(a){var s,r,q,p,o,n=this.a,m=B.c.F(n,36e8),l=n%36e8 +if(n<0){m=0-m +n=0-l +s="-"}else{n=l +s=""}r=B.c.F(n,6e7) +n%=6e7 +q=r<10?"0":"" +p=B.c.F(n,1e6) +o=p<10?"0":"" +return s+m+":"+q+r+":"+o+p+"."+B.a.fg(B.c.j(n%1e6),6,"0")}, +$ia6:1} +A.iD.prototype={ +j(a){return this.e3()}} +A.H.prototype={ +gam(){return A.oN(this)}} +A.cy.prototype={ +j(a){var s=this.a +if(s!=null)return"Assertion failed: "+A.e3(s) +return"Assertion failed"}} +A.aX.prototype={} +A.as.prototype={ +gbL(){return"Invalid argument"+(!this.a?"(s)":"")}, +gbK(){return""}, +j(a){var s=this,r=s.c,q=r==null?"":" ("+r+")",p=s.d,o=p==null?"":": "+A.o(p),n=s.gbL()+q+o +if(!s.a)return n +return n+s.gbK()+": "+A.e3(s.gcb())}, +gcb(){return this.b}} +A.cc.prototype={ +gcb(){return A.q6(this.b)}, +gbL(){return"RangeError"}, +gbK(){var s,r=this.e,q=this.f +if(r==null)s=q!=null?": Not less than or equal to "+A.o(q):"" +else if(q==null)s=": Not greater than or equal to "+A.o(r) +else if(q>r)s=": Not in inclusive range "+A.o(r)+".."+A.o(q) +else s=qe.length +else s=!1 +if(s)f=null +if(f==null){if(e.length>78)e=B.a.q(e,0,75)+"..." +return g+"\n"+e}for(r=e.length,q=1,p=0,o=!1,n=0;n1?g+(" (at line "+q+", character "+(f-p+1)+")\n"):g+(" (at character "+(f+1)+")\n") +for(n=f;n=0))return A.b(e,n) +m=e.charCodeAt(n) +if(m===10||m===13){r=n +break}}l="" +if(r-p>78){k="..." +if(f-p<75){j=p+75 +i=p}else{if(r-f<75){i=r-75 +j=r +k=""}else{i=f-36 +j=f+36}l="..."}}else{j=r +i=p +k=""}return g+l+B.a.q(e,i,j)+k+"\n"+B.a.aW(" ",f-i+l.length)+"^\n"}else return f!=null?g+(" (at offset "+A.o(f)+")"):g}} +A.ea.prototype={ +gam(){return null}, +j(a){return"IntegerDivisionByZeroException"}, +$iH:1} +A.e.prototype={ +b9(a,b){return A.dS(this,A.v(this).h("e.E"),b)}, +a8(a,b,c){var s=A.v(this) +return A.m2(this,s.t(c).h("1(e.E)").a(b),s.h("e.E"),c)}, +G(a,b){var s +for(s=this.gu(this);s.m();)if(J.V(s.gp(),b))return!0 +return!1}, +aB(a,b){return A.m1(this,b,A.v(this).h("e.E"))}, +dg(a){return this.aB(0,!0)}, +gl(a){var s,r=this.gu(this) +for(s=0;r.m();)++s +return s}, +gW(a){return!this.gu(this).m()}, +P(a,b){return A.mg(this,b,A.v(this).h("e.E"))}, +gH(a){var s=this.gu(this) +if(!s.m())throw A.c(A.aE()) +return s.gp()}, +C(a,b){var s,r +A.a7(b,"index") +s=this.gu(this) +for(r=b;s.m();){if(r===0)return s.gp();--r}throw A.c(A.e8(b,b-r,this,null,"index"))}, +j(a){return A.ov(this,"(",")")}} +A.Q.prototype={ +j(a){return"MapEntry("+A.o(this.a)+": "+A.o(this.b)+")"}} +A.F.prototype={ +gv(a){return A.p.prototype.gv.call(this,0)}, +j(a){return"null"}} +A.p.prototype={$ip:1, +X(a,b){return this===b}, +gv(a){return A.er(this)}, +j(a){return"Instance of '"+A.he(this)+"'"}, +gB(a){return A.ns(this)}, +toString(){return this.j(this)}} +A.fn.prototype={ +j(a){return""}, +$iaF:1} +A.a9.prototype={ +gl(a){return this.a.length}, +j(a){var s=this.a +return s.charCodeAt(0)==0?s:s}, +$ipg:1} +A.id.prototype={ +$2(a,b){throw A.c(A.a1("Illegal IPv4 address, "+a,this.a,b))}, +$S:49} +A.ie.prototype={ +$2(a,b){throw A.c(A.a1("Illegal IPv6 address, "+a,this.a,b))}, +$S:56} +A.ig.prototype={ +$2(a,b){var s +if(b-a>4)this.a.$2("an IPv6 part can only contain a maximum of 4 hex digits",a) +s=A.kf(B.a.q(this.b,a,b),16) +if(s<0||s>65535)this.a.$2("each part must be in the range of `0x0..0xFFFF`",a) +return s}, +$S:1} +A.dx.prototype={ +gcO(){var s,r,q,p,o=this,n=o.w +if(n===$){s=o.a +r=s.length!==0?""+s+":":"" +q=o.c +p=q==null +if(!p||s==="file"){s=r+"//" +r=o.b +if(r.length!==0)s=s+r+"@" +if(!p)s+=q +r=o.d +if(r!=null)s=s+":"+A.o(r)}else s=r +s+=o.e +r=o.f +if(r!=null)s=s+"?"+r +r=o.r +if(r!=null)s=s+"#"+r +n!==$&&A.fz("_text") +n=o.w=s.charCodeAt(0)==0?s:s}return n}, +gfi(){var s,r,q,p=this,o=p.x +if(o===$){s=p.e +r=s.length +if(r!==0){if(0>=r)return A.b(s,0) +r=s.charCodeAt(0)===47}else r=!1 +if(r)s=B.a.Z(s,1) +q=s.length===0?B.P:A.ef(new A.a3(A.u(s.split("/"),t.s),t.dO.a(A.qX()),t.do),t.N) +p.x!==$&&A.fz("pathSegments") +p.sdM(q) +o=q}return o}, +gv(a){var s,r=this,q=r.y +if(q===$){s=B.a.gv(r.gcO()) +r.y!==$&&A.fz("hashCode") +r.y=s +q=s}return q}, +gdi(){return this.b}, +gbh(){var s=this.c +if(s==null)return"" +if(B.a.J(s,"["))return B.a.q(s,1,s.length-1) +return s}, +gcg(){var s=this.d +return s==null?A.mQ(this.a):s}, +gd9(){var s=this.f +return s==null?"":s}, +gd0(){var s=this.r +return s==null?"":s}, +gd5(){if(this.a!==""){var s=this.r +s=(s==null?"":s)===""}else s=!1 +return s}, +gd2(){return this.c!=null}, +gd4(){return this.f!=null}, +gd3(){return this.r!=null}, +fq(){var s,r=this,q=r.a +if(q!==""&&q!=="file")throw A.c(A.U("Cannot extract a file path from a "+q+" URI")) +q=r.f +if((q==null?"":q)!=="")throw A.c(A.U("Cannot extract a file path from a URI with a query component")) +q=r.r +if((q==null?"":q)!=="")throw A.c(A.U("Cannot extract a file path from a URI with a fragment component")) +if(r.c!=null&&r.gbh()!=="")A.J(A.U("Cannot extract a non-Windows file path from a file URI with an authority")) +s=r.gfi() +A.pU(s,!1) +q=A.kW(B.a.J(r.e,"/")?""+"/":"",s,"/") +q=q.charCodeAt(0)==0?q:q +return q}, +j(a){return this.gcO()}, +X(a,b){var s,r,q,p=this +if(b==null)return!1 +if(p===b)return!0 +s=!1 +if(t.dD.b(b))if(p.a===b.gby())if(p.c!=null===b.gd2())if(p.b===b.gdi())if(p.gbh()===b.gbh())if(p.gcg()===b.gcg())if(p.e===b.gcf()){r=p.f +q=r==null +if(!q===b.gd4()){if(q)r="" +if(r===b.gd9()){r=p.r +q=r==null +if(!q===b.gd3()){s=q?"":r +s=s===b.gd0()}}}}return s}, +sdM(a){this.x=t.a.a(a)}, +$ieH:1, +gby(){return this.a}, +gcf(){return this.e}} +A.ic.prototype={ +gdh(){var s,r,q,p,o=this,n=null,m=o.c +if(m==null){m=o.b +if(0>=m.length)return A.b(m,0) +s=o.a +m=m[0]+1 +r=B.a.ag(s,"?",m) +q=s.length +if(r>=0){p=A.dy(s,r+1,q,B.k,!1,!1) +q=r}else p=n +m=o.c=new A.f_("data","",n,n,A.dy(s,m,q,B.u,!1,!1),p,n)}return m}, +j(a){var s,r=this.b +if(0>=r.length)return A.b(r,0) +s=this.a +return r[0]===-1?"data:"+s:s}} +A.jT.prototype={ +$2(a,b){var s=this.a +if(!(a=p)return A.b(b,0) +s=b.charCodeAt(0) +if(1>=p)return A.b(b,1) +r=b.charCodeAt(1) +p=a.$flags|0 +for(;s<=r;++s){q=(s^96)>>>0 +p&2&&A.y(a) +if(!(q<96))return A.b(a,q) +a[q]=c}}, +$S:17} +A.fh.prototype={ +gd2(){return this.c>0}, +geY(){return this.c>0&&this.d+10&&this.r>=this.a.length}, +gby(){var s=this.w +return s==null?this.w=this.dW():s}, +dW(){var s,r=this,q=r.b +if(q<=0)return"" +s=q===4 +if(s&&B.a.J(r.a,"http"))return"http" +if(q===5&&B.a.J(r.a,"https"))return"https" +if(s&&B.a.J(r.a,"file"))return"file" +if(q===7&&B.a.J(r.a,"package"))return"package" +return B.a.q(r.a,0,q)}, +gdi(){var s=this.c,r=this.b+3 +return s>r?B.a.q(this.a,r,s-1):""}, +gbh(){var s=this.c +return s>0?B.a.q(this.a,s,this.d):""}, +gcg(){var s,r=this +if(r.geY())return A.kf(B.a.q(r.a,r.d+1,r.e),null) +s=r.b +if(s===4&&B.a.J(r.a,"http"))return 80 +if(s===5&&B.a.J(r.a,"https"))return 443 +return 0}, +gcf(){return B.a.q(this.a,this.e,this.f)}, +gd9(){var s=this.f,r=this.r +return s4294967296)throw A.c(new A.cc(k,k,!1,k,k,"max must be in range 0 < max \u2264 2^32, was "+a)) +if(a>255)if(a>65535)s=a>16777215?4:3 +else s=2 +else s=1 +r=this.a +r.$flags&2&&A.y(r,11) +r.setUint32(0,0,!1) +q=4-s +p=A.d(Math.pow(256,s)) +for(o=a-1,n=(a&o)===0;!0;){crypto.getRandomValues(J.cv(B.Q.gaq(r),q,s)) +m=r.getUint32(0,!1) +if(n)return(m&o)>>>0 +l=m%a +if(m-l+a")),r=this.a,p=!1,o=!1,n="";s.m();){m=q.gp() +if(r.av(m)&&o){l=A.m4(m,r) +k=n.charCodeAt(0)==0?n:n +n=B.a.q(k,0,r.aA(k,!0)) +l.b=n +if(r.aQ(n))B.b.k(l.e,0,r.gaC()) +n=""+l.j(0)}else if(r.a9(m)>0){o=!r.av(m) +n=""+m}else{j=m.length +if(j!==0){if(0>=j)return A.b(m,0) +j=r.c4(m[0])}else j=!1 +if(!j)if(p)n+=r.gaC() +n+=m}p=r.aQ(m)}return n.charCodeAt(0)==0?n:n}, +d7(a){var s +if(!this.ed(a))return a +s=A.m4(a,this.a) +s.fd() +return s.j(0)}, +ed(a){var s,r,q,p,o,n,m,l,k=this.a,j=k.a9(a) +if(j!==0){if(k===$.fA())for(s=a.length,r=0;r=0))return A.b(s,r) +m=s.charCodeAt(r) +if(k.a1(m)){if(k===$.fA()&&m===47)return!0 +if(p!=null&&k.a1(p))return!0 +if(p===46)l=n==null||n===46||k.a1(n) +else l=!1 +if(l)return!0}}if(p==null)return!0 +if(k.a1(p))return!0 +if(p===46)k=n==null||k.a1(n)||n===46 +else k=!1 +if(k)return!0 +return!1}} +A.fT.prototype={ +$1(a){return A.M(a)!==""}, +$S:61} +A.k2.prototype={ +$1(a){A.lf(a) +return a==null?"null":'"'+a+'"'}, +$S:63} +A.c5.prototype={ +ds(a){var s,r=this.a9(a) +if(r>0)return B.a.q(a,0,r) +if(this.av(a)){if(0>=a.length)return A.b(a,0) +s=a[0]}else s=null +return s}} +A.hc.prototype={ +fm(){var s,r,q=this +while(!0){s=q.d +if(!(s.length!==0&&J.V(B.b.ga2(s),"")))break +s=q.d +if(0>=s.length)return A.b(s,-1) +s.pop() +s=q.e +if(0>=s.length)return A.b(s,-1) +s.pop()}s=q.e +r=s.length +if(r!==0)B.b.k(s,r-1,"")}, +fd(){var s,r,q,p,o,n,m=this,l=A.u([],t.s) +for(s=m.d,r=s.length,q=0,p=0;p=n)return A.b(l,-1) +l.pop()}else ++q}else B.b.n(l,o)}if(m.b==null)B.b.eZ(l,0,A.cO(q,"..",!1,t.N)) +if(l.length===0&&m.b==null)B.b.n(l,".") +m.sfh(l) +s=m.a +m.sdt(A.cO(l.length+1,s.gaC(),!0,t.N)) +r=m.b +if(r==null||l.length===0||!s.aQ(r))B.b.k(m.e,0,"") +r=m.b +if(r!=null&&s===$.fA()){r.toString +m.b=A.rl(r,"/","\\")}m.fm()}, +j(a){var s,r,q,p,o,n=this.b +n=n!=null?""+n:"" +for(s=this.d,r=s.length,q=this.e,p=q.length,o=0;o=0))return A.b(a,s) +s=a.charCodeAt(s)!==47 +r=s}else r=!1 +return r}, +aA(a,b){var s=a.length +if(s!==0){if(0>=s)return A.b(a,0) +s=a.charCodeAt(0)===47}else s=!1 +if(s)return 1 +return 0}, +a9(a){return this.aA(a,!1)}, +av(a){return!1}, +gce(){return"posix"}, +gaC(){return"/"}} +A.eI.prototype={ +c4(a){return B.a.G(a,"/")}, +a1(a){return a===47}, +aQ(a){var s,r=a.length +if(r===0)return!1 +s=r-1 +if(!(s>=0))return A.b(a,s) +if(a.charCodeAt(s)!==47)return!0 +return B.a.cY(a,"://")&&this.a9(a)===r}, +aA(a,b){var s,r,q,p=a.length +if(p===0)return 0 +if(0>=p)return A.b(a,0) +if(a.charCodeAt(0)===47)return 1 +for(s=0;s=s)return A.b(a,0) +s=a.charCodeAt(0)===47}else s=!1 +return s}, +gce(){return"url"}, +gaC(){return"/"}} +A.eS.prototype={ +c4(a){return B.a.G(a,"/")}, +a1(a){return a===47||a===92}, +aQ(a){var s,r=a.length +if(r===0)return!1 +s=r-1 +if(!(s>=0))return A.b(a,s) +s=a.charCodeAt(s) +return!(s===47||s===92)}, +aA(a,b){var s,r,q=a.length +if(q===0)return 0 +if(0>=q)return A.b(a,0) +if(a.charCodeAt(0)===47)return 1 +if(a.charCodeAt(0)===92){if(q>=2){if(1>=q)return A.b(a,1) +s=a.charCodeAt(1)!==92}else s=!0 +if(s)return 1 +r=B.a.ag(a,"\\",2) +if(r>0){r=B.a.ag(a,"\\",r+1) +if(r>0)return r}return q}if(q<3)return 0 +if(!A.nv(a.charCodeAt(0)))return 0 +if(a.charCodeAt(1)!==58)return 0 +q=a.charCodeAt(2) +if(!(q===47||q===92))return 0 +return 3}, +a9(a){return this.aA(a,!1)}, +av(a){return this.a9(a)===1}, +gce(){return"windows"}, +gaC(){return"\\"}} +A.k5.prototype={ +$1(a){return A.qP(a)}, +$S:24} +A.e_.prototype={ +j(a){return"DatabaseException("+this.a+")"}} +A.ew.prototype={ +j(a){return this.dB(0)}, +bx(){var s=this.b +if(s==null){s=new A.hk(this).$0() +this.sek(s)}return s}, +sek(a){this.b=A.fr(a)}} +A.hk.prototype={ +$0(){var s=new A.hl(this.a.a.toLowerCase()),r=s.$1("(sqlite code ") +if(r!=null)return r +r=s.$1("(code ") +if(r!=null)return r +r=s.$1("code=") +if(r!=null)return r +return null}, +$S:25} +A.hl.prototype={ +$1(a){var s,r,q,p,o,n=this.a,m=B.a.c8(n,a) +if(!J.V(m,-1))try{p=m +if(typeof p!=="number")return p.cl() +p=B.a.fs(B.a.Z(n,p+a.length)).split(" ") +if(0>=p.length)return A.b(p,0) +s=p[0] +r=J.o4(s,")") +if(!J.V(r,-1))s=J.o6(s,0,r) +q=A.kI(s,null) +if(q!=null)return q}catch(o){}return null}, +$S:26} +A.fW.prototype={} +A.e5.prototype={ +j(a){return A.ns(this).j(0)+"("+this.a+", "+A.o(this.b)+")"}} +A.c2.prototype={} +A.aW.prototype={ +j(a){var s=this,r=t.N,q=t.X,p=A.O(r,q),o=s.y +if(o!=null){r=A.kF(o,r,q) +q=A.v(r) +o=q.h("p?") +o.a(r.I(0,"arguments")) +o.a(r.I(0,"sql")) +if(r.gf6(0))p.k(0,"details",new A.cA(r,q.h("cA")))}r=s.bx()==null?"":": "+A.o(s.bx())+", " +r=""+("SqfliteFfiException("+s.x+r+", "+s.a+"})") +q=s.r +if(q!=null){r+=" sql "+q +q=s.w +q=q==null?null:!q.gW(q) +if(q===!0){q=s.w +q.toString +q=r+(" args "+A.np(q)) +r=q}}else r+=" "+s.dD(0) +if(p.a!==0)r+=" "+p.j(0) +return r.charCodeAt(0)==0?r:r}, +seF(a){this.y=t.fn.a(a)}} +A.hz.prototype={} +A.hA.prototype={} +A.d_.prototype={ +j(a){var s=this.a,r=this.b,q=this.c,p=q==null?null:!q.gW(q) +if(p===!0){q.toString +q=" "+A.np(q)}else q="" +return A.o(s)+" "+(A.o(r)+q)}, +sdw(a){this.c=t.gq.a(a)}} +A.fi.prototype={} +A.fa.prototype={ +A(){var s=0,r=A.l(t.H),q=1,p,o=this,n,m,l,k +var $async$A=A.m(function(a,b){if(a===1){p=b +s=q}while(true)switch(s){case 0:q=3 +s=6 +return A.f(o.a.$0(),$async$A) +case 6:n=b +o.b.U(n) +q=1 +s=5 +break +case 3:q=2 +k=p +m=A.L(k) +o.b.a7(m) +s=5 +break +case 2:s=1 +break +case 5:return A.j(null,r) +case 1:return A.i(p,r)}}) +return A.k($async$A,r)}} +A.am.prototype={ +df(){var s=this +return A.ah(["path",s.r,"id",s.e,"readOnly",s.w,"singleInstance",s.f],t.N,t.X)}, +cA(){var s,r,q,p=this +if(p.cC()===0)return null +s=p.x.b +r=t.C.a(s.a.x2.call(null,s.b)) +q=A.d(A.q(self.Number(r))) +if(p.y>=1)A.aw("[sqflite-"+p.e+"] Inserted "+q) +return q}, +j(a){return A.h8(this.df())}, +aM(){var s=this +s.b_() +s.ai("Closing database "+s.j(0)) +s.x.V()}, +bM(a){var s=a==null?null:new A.ac(a.a,a.$ti.h("ac<1,p?>")) +return s==null?B.v:s}, +eS(a,b){return this.d.a0(new A.hu(this,a,b),t.H)}, +a5(a,b){return this.e9(a,b)}, +e9(a,b){var s=0,r=A.l(t.H),q,p=[],o=this,n,m,l,k +var $async$a5=A.m(function(c,d){if(c===1)return A.i(d,r) +while(true)switch(s){case 0:o.cd(a,b) +if(B.a.J(a,"PRAGMA sqflite -- ")){if(a==="PRAGMA sqflite -- db_config_defensive_off"){m=o.x +l=m.b +k=l.a.dz(l.b,1010,0) +if(k!==0)A.dJ(m,k,null,null,null)}}else{m=b==null?null:!b.gW(b) +l=o.x +if(m===!0){n=l.ci(a) +try{n.cZ(new A.bw(o.bM(b))) +s=1 +break}finally{n.V()}}else l.eI(a)}case 1:return A.j(q,r)}}) +return A.k($async$a5,r)}, +ai(a){if(a!=null&&this.y>=1)A.aw("[sqflite-"+this.e+"] "+A.o(a))}, +cd(a,b){var s +if(this.y>=1){s=b==null?null:!b.gW(b) +s=s===!0?" "+A.o(b):"" +A.aw("[sqflite-"+this.e+"] "+a+s) +this.ai(null)}}, +b7(){var s=0,r=A.l(t.H),q=this +var $async$b7=A.m(function(a,b){if(a===1)return A.i(b,r) +while(true)switch(s){case 0:s=q.c.length!==0?2:3 +break +case 2:s=4 +return A.f(q.as.a0(new A.hs(q),t.P),$async$b7) +case 4:case 3:return A.j(null,r)}}) +return A.k($async$b7,r)}, +b_(){var s=0,r=A.l(t.H),q=this +var $async$b_=A.m(function(a,b){if(a===1)return A.i(b,r) +while(true)switch(s){case 0:s=q.c.length!==0?2:3 +break +case 2:s=4 +return A.f(q.as.a0(new A.hn(q),t.P),$async$b_) +case 4:case 3:return A.j(null,r)}}) +return A.k($async$b_,r)}, +aP(a,b){return this.eW(a,t.gJ.a(b))}, +eW(a,b){var s=0,r=A.l(t.z),q,p=2,o,n=[],m=this,l,k,j,i,h,g,f +var $async$aP=A.m(function(c,d){if(c===1){o=d +s=p}while(true)switch(s){case 0:g=m.b +s=g==null?3:5 +break +case 3:s=6 +return A.f(b.$0(),$async$aP) +case 6:q=d +s=1 +break +s=4 +break +case 5:s=a===g||a===-1?7:9 +break +case 7:p=11 +s=14 +return A.f(b.$0(),$async$aP) +case 14:g=d +q=g +n=[1] +s=12 +break +n.push(13) +s=12 +break +case 11:p=10 +f=o +g=A.L(f) +if(g instanceof A.bD){l=g +k=!1 +try{if(m.b!=null){g=m.x.b +i=A.d(A.q(g.a.d_.call(null,g.b)))!==0}else i=!1 +k=i}catch(e){}if(A.b4(k)){m.b=null +g=A.n8(l) +g.d=!0 +throw A.c(g)}else throw f}else throw f +n.push(13) +s=12 +break +case 10:n=[2] +case 12:p=2 +if(m.b==null)m.b7() +s=n.pop() +break +case 13:s=8 +break +case 9:g=new A.w($.x,t.D) +B.b.n(m.c,new A.fa(b,new A.bL(g,t.ez))) +q=g +s=1 +break +case 8:case 4:case 1:return A.j(q,r) +case 2:return A.i(o,r)}}) +return A.k($async$aP,r)}, +eT(a,b){return this.d.a0(new A.hv(this,a,b),t.I)}, +b2(a,b){var s=0,r=A.l(t.I),q,p=this,o +var $async$b2=A.m(function(c,d){if(c===1)return A.i(d,r) +while(true)switch(s){case 0:if(p.w)A.J(A.ex("sqlite_error",null,"Database readonly",null)) +s=3 +return A.f(p.a5(a,b),$async$b2) +case 3:o=p.cA() +if(p.y>=1)A.aw("[sqflite-"+p.e+"] Inserted id "+A.o(o)) +q=o +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$b2,r)}, +eX(a,b){return this.d.a0(new A.hy(this,a,b),t.S)}, +b4(a,b){var s=0,r=A.l(t.S),q,p=this +var $async$b4=A.m(function(c,d){if(c===1)return A.i(d,r) +while(true)switch(s){case 0:if(p.w)A.J(A.ex("sqlite_error",null,"Database readonly",null)) +s=3 +return A.f(p.a5(a,b),$async$b4) +case 3:q=p.cC() +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$b4,r)}, +eU(a,b,c){return this.d.a0(new A.hx(this,a,c,b),t.z)}, +b3(a,b){return this.ea(a,b)}, +ea(a,b){var s=0,r=A.l(t.z),q,p=[],o=this,n,m,l,k +var $async$b3=A.m(function(c,d){if(c===1)return A.i(d,r) +while(true)switch(s){case 0:k=o.x.ci(a) +try{o.cd(a,b) +m=k +l=o.bM(b) +if(m.c.d)A.J(A.T(u.f)) +m.ap() +m.bC(new A.bw(l)) +n=m.eo() +o.ai("Found "+n.d.length+" rows") +m=n +m=A.ah(["columns",m.a,"rows",m.d],t.N,t.X) +q=m +s=1 +break}finally{k.V()}case 1:return A.j(q,r)}}) +return A.k($async$b3,r)}, +cI(a){var s,r,q,p,o,n,m,l,k=a.a,j=k +try{s=a.d +r=s.a +q=A.u([],t.G) +for(n=a.c;!0;){if(s.m()){m=s.x +m===$&&A.aK("current") +p=m +J.lE(q,p.b)}else{a.e=!0 +break}if(J.P(q)>=n)break}o=A.ah(["columns",r,"rows",q],t.N,t.X) +if(!a.e)J.fD(o,"cursorId",k) +return o}catch(l){this.bE(j) +throw l}finally{if(a.e)this.bE(j)}}, +bP(a,b,c){var s=0,r=A.l(t.X),q,p=this,o,n,m,l,k +var $async$bP=A.m(function(d,e){if(d===1)return A.i(e,r) +while(true)switch(s){case 0:k=p.x.ci(b) +p.cd(b,c) +o=p.bM(c) +n=k.c +if(n.d)A.J(A.T(u.f)) +k.ap() +k.bC(new A.bw(o)) +o=k.gbG() +k.gcM() +m=new A.eT(k,o,B.w) +m.bD() +n.c=!1 +k.f=m +n=++p.Q +l=new A.fi(n,k,a,m) +p.z.k(0,n,l) +q=p.cI(l) +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$bP,r)}, +eV(a,b){return this.d.a0(new A.hw(this,b,a),t.z)}, +bQ(a,b){var s=0,r=A.l(t.X),q,p=this,o,n +var $async$bQ=A.m(function(c,d){if(c===1)return A.i(d,r) +while(true)switch(s){case 0:if(p.y>=2){o=a===!0?" (cancel)":"" +p.ai("queryCursorNext "+b+o)}n=p.z.i(0,b) +if(a===!0){p.bE(b) +q=null +s=1 +break}if(n==null)throw A.c(A.T("Cursor "+b+" not found")) +q=p.cI(n) +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$bQ,r)}, +bE(a){var s=this.z.I(0,a) +if(s!=null){if(this.y>=2)this.ai("Closing cursor "+a) +s.b.V()}}, +cC(){var s=this.x.b,r=A.d(A.q(s.a.x1.call(null,s.b))) +if(this.y>=1)A.aw("[sqflite-"+this.e+"] Modified "+r+" rows") +return r}, +eQ(a,b,c){return this.d.a0(new A.ht(this,t.B.a(c),b,a),t.z)}, +ac(a,b,c){return this.e8(a,b,t.B.a(c))}, +e8(b3,b4,b5){var s=0,r=A.l(t.z),q,p=2,o,n=this,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,b0,b1,b2 +var $async$ac=A.m(function(b6,b7){if(b6===1){o=b7 +s=p}while(true)switch(s){case 0:a8={} +a8.a=null +d=!b4 +if(d)a8.a=A.u([],t.aX) +c=b5.length,b=n.y>=1,a=n.x.b,a0=a.b,a=a.a.x1,a1="[sqflite-"+n.e+"] Modified ",a2=0 +case 3:if(!(a2")),0) +q.onmessage=A.av(new A.kj(this.b))}, +$S:4} +A.kj.prototype={ +$1(a){this.a.aS(new A.ki(t.m.a(a)),t.P)}, +$S:9} +A.ki.prototype={ +$0(){A.dD(this.a)}, +$S:4} +A.kn.prototype={ +$1(a){this.a.aS(new A.kk(t.m.a(a)),t.P)}, +$S:9} +A.kk.prototype={ +$0(){A.dD(this.a)}, +$S:4} +A.cp.prototype={} +A.aA.prototype={ +aN(a){if(typeof a=="string")return A.l7(a,null) +throw A.c(A.U("invalid encoding for bigInt "+A.o(a)))}} +A.jQ.prototype={ +$2(a,b){A.d(a) +t.J.a(b) +return new A.Q(b.a,b,t.dA)}, +$S:59} +A.jX.prototype={ +$2(a,b){var s,r,q +if(typeof a!="string")throw A.c(A.aM(a,null,null)) +s=A.lh(b) +if(s==null?b!=null:s!==b){r=this.a +q=r.a;(q==null?r.a=A.kF(this.b,t.N,t.X):q).k(0,a,s)}}, +$S:8} +A.jW.prototype={ +$2(a,b){var s,r,q=A.lg(b) +if(q==null?b!=null:q!==b){s=this.a +r=s.a +s=r==null?s.a=A.kF(this.b,t.N,t.X):r +s.k(0,J.aC(a),q)}}, +$S:8} +A.i4.prototype={ +$2(a,b){var s +A.M(a) +s=b==null?null:A.i3(b) +this.a[a]=s}, +$S:8} +A.i2.prototype={ +j(a){return"SqfliteFfiWebOptions(inMemory: null, sqlite3WasmUri: null, indexedDbName: null, sharedWorkerUri: null, forceAsBasicWorker: null)"}} +A.d0.prototype={} +A.d1.prototype={} +A.bD.prototype={ +j(a){var s,r,q=this,p=q.e +p=p==null?"":"while "+p+", " +p="SqliteException("+q.c+"): "+p+q.a +s=q.b +if(s!=null)p=p+", "+s +s=q.f +if(s!=null){r=q.d +r=r!=null?" (at position "+A.o(r)+"): ":": " +s=p+"\n Causing statement"+r+s +p=q.r +p=p!=null?s+(", parameters: "+J.lG(p,new A.i6(),t.N).ah(0,", ")):s}return p.charCodeAt(0)==0?p:p}} +A.i6.prototype={ +$1(a){if(t.p.b(a))return"blob ("+a.length+" bytes)" +else return J.aC(a)}, +$S:47} +A.es.prototype={} +A.ez.prototype={} +A.et.prototype={} +A.hh.prototype={} +A.cV.prototype={} +A.hf.prototype={} +A.hg.prototype={} +A.e6.prototype={ +V(){var s,r,q,p,o,n,m +for(s=this.d,r=s.length,q=0;q0)A.J(A.lS("BigInt value exceeds the range of 64 bits")) +n=a.j(0) +A.d(A.q(r.c.p4.call(null,r.b,b,t.C.a(self.BigInt(n))))) +break $label0$0}if(A.dE(a)){r=n.a +n=a?1:0 +A.d(A.q(r.c.p4.call(null,r.b,b,t.C.a(self.BigInt(n))))) +break $label0$0}if(typeof a=="number"){r=n.a +A.d(A.q(r.c.R8.call(null,r.b,b,a))) +break $label0$0}if(typeof a=="string"){r=n.a +q=B.f.ar(a) +p=r.c +o=p.c1(q) +B.b.n(r.d,o) +A.d(A.fw(p.RG,"call",[null,r.b,b,o,q.length,0],t.i)) +break $label0$0}r=t.L +if(r.b(a)){p=n.a +r.a(a) +r=p.c +o=r.c1(a) +B.b.n(p.d,o) +n=J.P(a) +A.d(A.fw(r.rx,"call",[null,p.b,b,o,t.C.a(self.BigInt(n)),0],t.i)) +break $label0$0}s=A.J(A.aM(a,"params["+b+"]","Allowed parameters must either be null or bool, int, num, String or List."))}return s}, +bC(a){$label0$0:{this.dQ(a.a) +break $label0$0}}, +V(){var s,r=this.c +if(!r.d){$.fC().cX(this) +r.V() +s=this.b +if(!s.r)B.b.I(s.c.d,r)}}, +cZ(a){var s=this +if(s.c.d)A.J(A.T(u.f)) +s.ap() +s.bC(a) +s.e5()}} +A.eT.prototype={ +gp(){var s=this.x +s===$&&A.aK("current") +return s}, +m(){var s,r,q,p,o,n=this,m=n.r +if(m.c.d||m.f!==n)return!1 +s=m.a +r=s.c +q=s.b +p=A.d(A.q(r.k1.call(null,q))) +if(p===100){if(!n.y){n.w=A.d(A.q(r.fy.call(null,q))) +n.sel(t.a.a(m.gbG())) +n.bD() +n.y=!0}s=[] +for(o=0;o=2?1:0}, +bt(){if(this.c)this.a.d.I(0,this.b)}, +bu(){return this.a.d.i(0,this.b).b}, +dm(a){this.d=a}, +dq(a){}, +bw(a){var s=this.a.d,r=this.b,q=s.i(0,r) +if(q==null){s.k(0,r,new A.aG(new Uint8Array(0),0)) +s.i(0,r).sl(0,a)}else q.sl(0,a)}, +dr(a){this.d=a}, +aV(a,b){var s,r=this.a.d,q=this.b,p=r.i(0,q) +if(p==null){p=new A.aG(new Uint8Array(0),0) +r.k(0,q,p)}s=b+a.length +if(s>p.b)p.sl(0,s) +p.R(0,b,s,a)}} +A.c_.prototype={ +bD(){var s,r,q,p,o=A.O(t.N,t.S) +for(s=this.a,r=s.length,q=0;q=0&&b>>0!==b||b>=s.length)return A.b(s,b) +return s[b]}return null}r=this.a.c.i(0,b) +if(r==null)return null +s=this.b +if(r>>>0!==r||r>=s.length)return A.b(s,r) +return s[r]}, +gN(){return this.a.a}, +gaa(){return this.b}, +$iI:1} +A.fb.prototype={ +gp(){var s=this.a,r=s.d,q=this.b +if(!(q>=0&&q=g.length){q=A.b(g,1) +s=1 +break}f=A.d(A.q(g[1])) +B.b.n(j,A.oo(new A.fJ(h,k,f,Math.min(4096,A.d(l.length)-f)),e)) +s=4 +break +case 5:s=7 +return A.f(A.kz(j,e),$async$aw) +case 7:q=k +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$aw,r)}, +ae(a,b){var s=0,r=A.l(t.H),q=this,p,o,n,m,l,k,j,i +var $async$ae=A.m(function(c,d){if(c===1)return A.i(d,r) +while(true)switch(s){case 0:i=q.a +i.toString +p=t.m +o=p.a(i.transaction($.ks(),"readwrite")) +n=p.a(o.objectStore("blocks")) +s=2 +return A.f(q.bX(o,a),$async$ae) +case 2:m=d +i=b.b +l=A.v(i).h("aR<1>") +k=A.m1(new A.aR(i,l),!0,l.h("e.E")) +B.b.du(k) +l=A.a_(k) +s=3 +return A.f(A.kz(new A.a3(k,l.h("z<~>(1)").a(new A.fG(new A.fH(n,a),b)),l.h("a3<1,z<~>>")),t.H),$async$ae) +case 3:s=b.c!==A.d(m.length)?4:5 +break +case 4:j=new A.bN(p.a(p.a(o.objectStore("files")).openCursor(a)),t.O) +s=6 +return A.f(j.m(),$async$ae) +case 6:s=7 +return A.f(A.aD(p.a(j.gp().update({name:A.M(m.name),length:b.c})),t.X),$async$ae) +case 7:case 5:return A.j(null,r)}}) +return A.k($async$ae,r)}, +aj(a,b,c){var s=0,r=A.l(t.H),q=this,p,o,n,m,l,k,j +var $async$aj=A.m(function(d,e){if(d===1)return A.i(e,r) +while(true)switch(s){case 0:j=q.a +j.toString +p=t.m +o=p.a(j.transaction($.ks(),"readwrite")) +n=p.a(o.objectStore("files")) +m=p.a(o.objectStore("blocks")) +s=2 +return A.f(q.bX(o,b),$async$aj) +case 2:l=e +s=A.d(l.length)>c?3:4 +break +case 3:s=5 +return A.f(A.aD(p.a(m.delete(q.eg(b,B.c.F(c,4096)*4096+1))),t.X),$async$aj) +case 5:case 4:k=new A.bN(p.a(n.openCursor(b)),t.O) +s=6 +return A.f(k.m(),$async$aj) +case 6:s=7 +return A.f(A.aD(p.a(k.gp().update({name:A.M(l.name),length:c})),t.X),$async$aj) +case 7:return A.j(null,r)}}) +return A.k($async$aj,r)}, +be(a){var s=0,r=A.l(t.H),q=this,p,o,n,m +var $async$be=A.m(function(b,c){if(b===1)return A.i(c,r) +while(true)switch(s){case 0:m=q.a +m.toString +p=t.m +o=p.a(m.transaction(A.u(["files","blocks"],t.s),"readwrite")) +n=q.bW(a,9007199254740992,0) +m=t.X +s=2 +return A.f(A.kz(A.u([A.aD(p.a(p.a(o.objectStore("blocks")).delete(n)),m),A.aD(p.a(p.a(o.objectStore("files")).delete(a)),m)],t.W),t.H),$async$be) +case 2:return A.j(null,r)}}) +return A.k($async$be,r)}, +se_(a){this.a=t.A.a(a)}} +A.fI.prototype={ +$1(a){var s,r=t.m +r.a(a) +s=r.a(this.a.result) +if(A.d(a.oldVersion)===0){r.a(r.a(s.createObjectStore("files",{autoIncrement:!0})).createIndex("fileName","name",{unique:!0})) +r.a(s.createObjectStore("blocks"))}}, +$S:9} +A.fF.prototype={ +$1(a){t.A.a(a) +if(a==null)throw A.c(A.aM(this.a,"fileId","File not found in database")) +else return a}, +$S:52} +A.fJ.prototype={ +$0(){var s=0,r=A.l(t.H),q=this,p,o +var $async$$0=A.m(function(a,b){if(a===1)return A.i(b,r) +while(true)switch(s){case 0:p=q.a +s=A.kB(p.value,"Blob")?2:4 +break +case 2:s=5 +return A.f(A.hi(t.m.a(p.value)),$async$$0) +case 5:s=3 +break +case 4:b=t.o.a(p.value) +case 3:o=b +B.d.al(q.b,q.c,J.cv(o,0,q.d)) +return A.j(null,r)}}) +return A.k($async$$0,r)}, +$S:2} +A.fH.prototype={ +$2(a,b){var s=0,r=A.l(t.H),q=this,p,o,n,m,l,k,j +var $async$$2=A.m(function(c,d){if(c===1)return A.i(d,r) +while(true)switch(s){case 0:p=q.a +o=q.b +n=t.u +m=t.m +s=2 +return A.f(A.aD(m.a(p.openCursor(m.a(self.IDBKeyRange.only(A.u([o,a],n))))),t.A),$async$$2) +case 2:l=d +k=t.o.a(B.d.gaq(b)) +j=t.X +s=l==null?3:5 +break +case 3:s=6 +return A.f(A.aD(m.a(p.put(k,A.u([o,a],n))),j),$async$$2) +case 6:s=4 +break +case 5:s=7 +return A.f(A.aD(m.a(l.update(k)),j),$async$$2) +case 7:case 4:return A.j(null,r)}}) +return A.k($async$$2,r)}, +$S:53} +A.fG.prototype={ +$1(a){var s +A.d(a) +s=this.b.b.i(0,a) +s.toString +return this.a.$2(a,s)}, +$S:54} +A.iH.prototype={ +ev(a,b,c){B.d.al(this.b.fj(a,new A.iI(this,a)),b,c)}, +ex(a,b){var s,r,q,p,o,n,m,l +for(s=b.length,r=0;rp)B.d.al(s,0,J.cv(B.d.gaq(r),r.byteOffset+p,Math.min(4096,q-p))) +return s}, +$S:55} +A.f9.prototype={} +A.c4.prototype={ +aL(a){var s=this.d.a +if(s==null)A.J(A.eK(10)) +if(a.ca(this.w)){this.cL() +return a.d.a}else return A.lT(t.H)}, +cL(){var s,r,q,p,o,n,m=this +if(m.f==null&&!m.w.gW(0)){s=m.w +r=m.f=s.gH(0) +s.I(0,r) +s=A.on(r.gbp(),t.H) +q=t.fO.a(new A.h0(m)) +p=s.$ti +o=$.x +n=new A.w(o,p) +if(o!==B.e)q=o.dc(q,t.z) +s.aZ(new A.b0(n,8,q,null,p.h("b0<1,1>"))) +r.d.U(n)}}, +ao(a){var s=0,r=A.l(t.S),q,p=this,o,n +var $async$ao=A.m(function(b,c){if(b===1)return A.i(c,r) +while(true)switch(s){case 0:n=p.y +s=n.L(a)?3:5 +break +case 3:n=n.i(0,a) +n.toString +q=n +s=1 +break +s=4 +break +case 5:s=6 +return A.f(p.d.bf(a),$async$ao) +case 6:o=c +o.toString +n.k(0,a,o) +q=o +s=1 +break +case 4:case 1:return A.j(q,r)}}) +return A.k($async$ao,r)}, +aK(){var s=0,r=A.l(t.H),q=this,p,o,n,m,l,k,j,i,h,g,f +var $async$aK=A.m(function(a,b){if(a===1)return A.i(b,r) +while(true)switch(s){case 0:g=q.d +s=2 +return A.f(g.bk(),$async$aK) +case 2:f=b +q.y.c0(0,f) +p=f.gaO(),p=p.gu(p),o=q.r.d,n=t.fQ.h("e") +case 3:if(!p.m()){s=4 +break}m=p.gp() +l=m.a +k=m.b +j=new A.aG(new Uint8Array(0),0) +s=5 +return A.f(g.aw(k),$async$aK) +case 5:i=b +m=i.length +j.sl(0,m) +n.a(i) +h=j.b +if(m>h)A.J(A.S(m,0,h,null,null)) +B.d.D(j.a,0,m,i,0) +o.k(0,l,j) +s=3 +break +case 4:return A.j(null,r)}}) +return A.k($async$aK,r)}, +eP(){return this.aL(new A.cl(t.M.a(new A.h1()),new A.Z(new A.w($.x,t.D),t.F)))}, +bs(a,b){return this.r.d.L(a)?1:0}, +ck(a,b){var s=this +s.r.d.I(0,a) +if(!s.x.I(0,a))s.aL(new A.ck(s,a,new A.Z(new A.w($.x,t.D),t.F)))}, +dl(a){return $.lD().d7("/"+a)}, +aU(a,b){var s,r,q,p=this,o=a.a +if(o==null)o=A.lU(p.b,"/") +s=p.r +r=s.d.L(o)?1:0 +q=s.aU(new A.ce(o),b) +if(r===0)if((b&8)!==0)p.x.n(0,o) +else p.aL(new A.bM(p,o,new A.Z(new A.w($.x,t.D),t.F))) +return new A.cn(new A.f4(p,q.a,o),0)}, +dn(a){}} +A.h0.prototype={ +$0(){var s=this.a +s.f=null +s.cL()}, +$S:4} +A.h1.prototype={ +$0(){}, +$S:4} +A.f4.prototype={ +bv(a,b){this.b.bv(a,b)}, +gdk(){return 0}, +dj(){return this.b.d>=2?1:0}, +bt(){}, +bu(){return this.b.bu()}, +dm(a){this.b.d=a +return null}, +dq(a){}, +bw(a){var s=this,r=s.a,q=r.d.a +if(q==null)A.J(A.eK(10)) +s.b.bw(a) +if(!r.x.G(0,s.c))r.aL(new A.cl(t.M.a(new A.iV(s,a)),new A.Z(new A.w($.x,t.D),t.F)))}, +dr(a){this.b.d=a +return null}, +aV(a,b){var s,r,q,p,o,n=this,m=n.a,l=m.d.a +if(l==null)A.J(A.eK(10)) +l=n.c +if(m.x.G(0,l)){n.b.aV(a,b) +return}s=m.r.d.i(0,l) +if(s==null)s=new A.aG(new Uint8Array(0),0) +r=J.cv(B.d.gaq(s.a),0,s.b) +n.b.aV(a,b) +q=new Uint8Array(a.length) +B.d.al(q,0,a) +p=A.u([],t.gQ) +o=$.x +B.b.n(p,new A.f9(b,q)) +m.aL(new A.bS(m,l,r,p,new A.Z(new A.w(o,t.D),t.F)))}, +$ieL:1} +A.iV.prototype={ +$0(){var s=0,r=A.l(t.H),q,p=this,o,n,m +var $async$$0=A.m(function(a,b){if(a===1)return A.i(b,r) +while(true)switch(s){case 0:o=p.a +n=o.a +m=n.d +s=3 +return A.f(n.ao(o.c),$async$$0) +case 3:q=m.aj(0,b,p.b) +s=1 +break +case 1:return A.j(q,r)}}) +return A.k($async$$0,r)}, +$S:2} +A.Y.prototype={ +ca(a){t.h.a(a) +a.$ti.c.a(this) +a.bR(a.c,this,!1) +return!0}} +A.cl.prototype={ +A(){return this.w.$0()}} +A.ck.prototype={ +ca(a){var s,r,q,p +t.h.a(a) +if(!a.gW(0)){s=a.ga2(0) +for(r=this.x;s!=null;)if(s instanceof A.ck)if(s.x===r)return!1 +else s=s.gaR() +else if(s instanceof A.bS){q=s.gaR() +if(s.x===r){p=s.a +p.toString +p.bZ(A.v(s).h("a2.E").a(s))}s=q}else if(s instanceof A.bM){if(s.x===r){r=s.a +r.toString +r.bZ(A.v(s).h("a2.E").a(s)) +return!1}s=s.gaR()}else break}a.$ti.c.a(this) +a.bR(a.c,this,!1) +return!0}, +A(){var s=0,r=A.l(t.H),q=this,p,o,n +var $async$A=A.m(function(a,b){if(a===1)return A.i(b,r) +while(true)switch(s){case 0:p=q.w +o=q.x +s=2 +return A.f(p.ao(o),$async$A) +case 2:n=b +p.y.I(0,o) +s=3 +return A.f(p.d.be(n),$async$A) +case 3:return A.j(null,r)}}) +return A.k($async$A,r)}} +A.bM.prototype={ +A(){var s=0,r=A.l(t.H),q=this,p,o,n,m +var $async$A=A.m(function(a,b){if(a===1)return A.i(b,r) +while(true)switch(s){case 0:p=q.w +o=q.x +n=p.y +m=o +s=2 +return A.f(p.d.ba(o),$async$A) +case 2:n.k(0,m,b) +return A.j(null,r)}}) +return A.k($async$A,r)}} +A.bS.prototype={ +ca(a){var s,r +t.h.a(a) +s=a.b===0?null:a.ga2(0) +for(r=this.x;s!=null;)if(s instanceof A.bS)if(s.x===r){B.b.c0(s.z,this.z) +return!1}else s=s.gaR() +else if(s instanceof A.bM){if(s.x===r)break +s=s.gaR()}else break +a.$ti.c.a(this) +a.bR(a.c,this,!1) +return!0}, +A(){var s=0,r=A.l(t.H),q=this,p,o,n,m,l,k +var $async$A=A.m(function(a,b){if(a===1)return A.i(b,r) +while(true)switch(s){case 0:m=q.y +l=new A.iH(m,A.O(t.S,t.p),m.length) +for(m=q.z,p=m.length,o=0;oq.c)throw A.c(A.eK(14)) +s=A.aT(t.o.a(q.d.buffer),0,null) +r=q.e +B.d.al(s,r,p) +o=r+o +s.$flags&2&&A.y(s) +if(!(o>=0&&o864e13)A.J(A.S(s,-864e13,864e13,"millisecondsSinceEpoch",null)) +A.k6(!1,"isUtc",t.y) +r=new A.bq(s,0,!1) +q=A.oJ(t.o.a(this.a.buffer),b,8) +q.$flags&2&&A.y(q) +p=q.length +if(0>=p)return A.b(q,0) +q[0]=A.ma(r) +if(1>=p)return A.b(q,1) +q[1]=A.m8(r) +if(2>=p)return A.b(q,2) +q[2]=A.m7(r) +if(3>=p)return A.b(q,3) +q[3]=A.m6(r) +if(4>=p)return A.b(q,4) +q[4]=A.m9(r)-1 +if(5>=p)return A.b(q,5) +q[5]=A.mb(r)-1900 +o=B.c.Y(A.oP(r),7) +if(6>=p)return A.b(q,6) +q[6]=o}, +$S:66} +A.fU.prototype={ +sf1(a){this.r=t.aY.a(a)}, +sf_(a){this.w=t.g_.a(a)}, +sf0(a){this.x=t.g5.a(a)}} +A.dQ.prototype={ +aF(a,b,c){return this.dE(c.h("0/()").a(a),b,c,c)}, +a0(a,b){return this.aF(a,null,b)}, +dE(a,b,c,d){var s=0,r=A.l(d),q,p=2,o,n=[],m=this,l,k,j,i,h +var $async$aF=A.m(function(e,f){if(e===1){o=f +s=p}while(true)switch(s){case 0:i=m.a +h=new A.Z(new A.w($.x,t.D),t.F) +m.a=h.a +p=3 +s=i!=null?6:7 +break +case 6:s=8 +return A.f(i,$async$aF) +case 8:case 7:l=a.$0() +s=l instanceof A.w?9:11 +break +case 9:j=l +s=12 +return A.f(c.h("z<0>").b(j)?j:A.mC(c.a(j),c),$async$aF) +case 12:j=f +q=j +n=[1] +s=4 +break +s=10 +break +case 11:q=l +n=[1] +s=4 +break +case 10:n.push(5) +s=4 +break +case 3:n=[2] +case 4:p=2 +k=new A.fL(m,h) +k.$0() +s=n.pop() +break +case 5:case 1:return A.j(q,r) +case 2:return A.i(o,r)}}) +return A.k($async$aF,r)}, +j(a){return"Lock["+A.lv(this)+"]"}, +$ioH:1} +A.fL.prototype={ +$0(){var s=this.a,r=this.b +if(s.a===r.a)s.a=null +r.eB()}, +$S:0} +A.an.prototype={ +gl(a){return this.b}, +i(a,b){var s +if(b>=this.b)throw A.c(A.lV(b,this)) +s=this.a +if(!(b>=0&&b=s.b)throw A.c(A.lV(b,s)) +B.d.k(s.a,b,c)}, +sl(a,b){var s,r,q,p,o=this,n=o.b +if(b=0&&qn){if(n===0)p=new Uint8Array(b) +else p=o.dY(b) +B.d.R(p,0,o.b,o.a) +o.sdS(p)}}o.b=b}, +dY(a){var s=this.a.length*2 +if(a!=null&&s").a(d) +s=this.b +if(c>s)throw A.c(A.S(c,0,s,null,null)) +s=this.a +if(r.h("an").b(d))B.d.D(s,b,c,d.a,e) +else B.d.D(s,b,c,d,e)}, +R(a,b,c,d){return this.D(0,b,c,d,0)}, +sdS(a){this.a=A.v(this).h("K").a(a)}} +A.f5.prototype={} +A.aG.prototype={} +A.ky.prototype={} +A.iE.prototype={} +A.dc.prototype={ +af(){var s=this,r=A.lT(t.H) +if(s.b==null)return r +s.eu() +s.d=s.b=null +return r}, +es(){var s=this,r=s.d +if(r!=null&&s.a<=0)s.b.addEventListener(s.c,r,!1)}, +eu(){var s=this.d +if(s!=null)this.b.removeEventListener(this.c,s,!1)}, +$ipf:1} +A.iF.prototype={ +$1(a){return this.a.$1(t.m.a(a))}, +$S:3};(function aliases(){var s=J.bd.prototype +s.dC=s.j +s=A.r.prototype +s.cn=s.D +s=A.e_.prototype +s.dB=s.j +s=A.ew.prototype +s.dD=s.j})();(function installTearOffs(){var s=hunkHelpers._static_2,r=hunkHelpers._static_1,q=hunkHelpers._static_0,p=hunkHelpers.installStaticTearOff,o=hunkHelpers._instance_0u +s(J,"qr","oy",67) +r(A,"qR","pp",10) +r(A,"qS","pq",10) +r(A,"qT","pr",10) +q(A,"nq","qI",0) +p(A,"qU",4,null,["$4"],["k1"],69,0) +r(A,"qX","pn",46) +o(A.cl.prototype,"gbp","A",0) +o(A.ck.prototype,"gbp","A",2) +o(A.bM.prototype,"gbp","A",2) +o(A.bS.prototype,"gbp","A",2)})();(function inheritance(){var s=hunkHelpers.mixin,r=hunkHelpers.inherit,q=hunkHelpers.inheritMany +r(A.p,null) +q(A.p,[A.kD,J.eb,J.cx,A.e,A.cz,A.D,A.ba,A.H,A.r,A.hj,A.bx,A.cP,A.bJ,A.cY,A.cE,A.d7,A.bv,A.ad,A.bh,A.bk,A.cC,A.dd,A.ia,A.hb,A.cF,A.dp,A.h5,A.cM,A.cK,A.di,A.eV,A.d3,A.fm,A.iz,A.fp,A.at,A.f2,A.jL,A.jJ,A.d8,A.dq,A.aN,A.cj,A.b0,A.w,A.eX,A.eB,A.fk,A.fq,A.dA,A.cd,A.f7,A.bQ,A.df,A.a2,A.dh,A.dw,A.bZ,A.dZ,A.jO,A.dz,A.R,A.f1,A.bq,A.bb,A.iD,A.eo,A.d2,A.iG,A.fX,A.ea,A.Q,A.F,A.fn,A.a9,A.dx,A.ic,A.fh,A.e4,A.ha,A.f6,A.en,A.eG,A.dY,A.i9,A.hc,A.e_,A.fW,A.e5,A.c2,A.hz,A.hA,A.d_,A.fi,A.fa,A.am,A.hm,A.cp,A.i2,A.d0,A.bD,A.es,A.ez,A.et,A.hh,A.cV,A.hf,A.hg,A.aO,A.e0,A.i5,A.dV,A.c_,A.bH,A.dO,A.ff,A.fb,A.bw,A.d5,A.ce,A.bN,A.eO,A.fE,A.iH,A.f9,A.f4,A.eM,A.iW,A.fU,A.dQ,A.ky,A.dc]) +q(J.eb,[J.ec,J.cJ,J.cL,J.ae,J.c7,J.c6,J.bc]) +q(J.cL,[J.bd,J.E,A.cb,A.cR]) +q(J.bd,[J.ep,J.bG,J.aP]) +r(J.h2,J.E) +q(J.c6,[J.cI,J.ed]) +q(A.e,[A.bi,A.n,A.aS,A.iq,A.aV,A.d6,A.bu,A.bP,A.eU,A.fl,A.co,A.c9]) +q(A.bi,[A.bp,A.dB]) +r(A.db,A.bp) +r(A.da,A.dB) +r(A.ac,A.da) +q(A.D,[A.cA,A.ch,A.aQ]) +q(A.ba,[A.dU,A.fM,A.dT,A.eD,A.h4,A.kc,A.ke,A.is,A.ir,A.jR,A.fZ,A.iN,A.iU,A.i7,A.jI,A.h7,A.iy,A.jU,A.jV,A.kp,A.kq,A.fT,A.k2,A.k5,A.hl,A.hr,A.hq,A.ho,A.hp,A.i_,A.hG,A.hS,A.hR,A.hM,A.hO,A.hU,A.hI,A.k_,A.km,A.kj,A.kn,A.i6,A.k9,A.iB,A.iC,A.fO,A.fP,A.fQ,A.fR,A.fS,A.fI,A.fF,A.fG,A.jb,A.jc,A.jd,A.jo,A.jx,A.jy,A.jB,A.jC,A.jD,A.je,A.jl,A.jm,A.jn,A.jp,A.jq,A.jr,A.js,A.jt,A.ju,A.jv,A.iF]) +q(A.dU,[A.fN,A.h3,A.kd,A.jS,A.k3,A.h_,A.iO,A.h6,A.h9,A.ix,A.id,A.ie,A.ig,A.jT,A.jQ,A.jX,A.jW,A.i4,A.il,A.ik,A.fH,A.jz,A.jA,A.jf,A.jg,A.jh,A.ji,A.jj,A.jk,A.jw]) +q(A.H,[A.c8,A.aX,A.ee,A.eF,A.eZ,A.ev,A.cy,A.f0,A.as,A.d4,A.eE,A.bE,A.dX]) +q(A.r,[A.cg,A.ci,A.an]) +r(A.cB,A.cg) +q(A.n,[A.X,A.bs,A.aR,A.dg]) +q(A.X,[A.bF,A.a3,A.f8,A.cX]) +r(A.br,A.aS) +r(A.c1,A.aV) +r(A.c0,A.bu) +r(A.cN,A.ch) +r(A.bR,A.bk) +q(A.bR,[A.bl,A.cn]) +r(A.cD,A.cC) +r(A.cT,A.aX) +q(A.eD,[A.eA,A.bY]) +r(A.eW,A.cy) +q(A.cR,[A.cQ,A.a4]) +q(A.a4,[A.dj,A.dl]) +r(A.dk,A.dj) +r(A.be,A.dk) +r(A.dm,A.dl) +r(A.al,A.dm) +q(A.be,[A.eg,A.eh]) +q(A.al,[A.ei,A.ej,A.ek,A.el,A.em,A.cS,A.bz]) +r(A.dr,A.f0) +q(A.dT,[A.it,A.iu,A.jK,A.fY,A.iJ,A.iQ,A.iP,A.iM,A.iL,A.iK,A.iT,A.iS,A.iR,A.i8,A.k0,A.jH,A.jG,A.jN,A.jM,A.hk,A.hu,A.hs,A.hn,A.hv,A.hy,A.hx,A.hw,A.ht,A.hE,A.hD,A.hP,A.hJ,A.hQ,A.hN,A.hL,A.hK,A.hT,A.hV,A.kl,A.ki,A.kk,A.fV,A.fJ,A.iI,A.h0,A.h1,A.iV,A.j2,A.j1,A.j0,A.j_,A.ja,A.j9,A.j8,A.j7,A.j6,A.j5,A.j4,A.j3,A.iZ,A.iY,A.iX,A.fL]) +q(A.cj,[A.bL,A.Z]) +r(A.fe,A.dA) +r(A.dn,A.cd) +r(A.de,A.dn) +q(A.bZ,[A.dN,A.e2]) +q(A.dZ,[A.fK,A.ih]) +r(A.eJ,A.e2) +q(A.as,[A.cc,A.cG]) +r(A.f_,A.dx) +r(A.c5,A.i9) +q(A.c5,[A.eq,A.eI,A.eS]) +r(A.ew,A.e_) +r(A.aW,A.ew) +r(A.fj,A.hz) +r(A.hB,A.fj) +r(A.aA,A.cp) +r(A.d1,A.d0) +q(A.aO,[A.e6,A.c3]) +r(A.cf,A.dV) +q(A.c_,[A.cH,A.fc]) +r(A.eT,A.cH) +r(A.dP,A.bH) +q(A.dP,[A.e7,A.c4]) +r(A.f3,A.dO) +r(A.fd,A.fc) +r(A.eu,A.fd) +r(A.fg,A.ff) +r(A.a8,A.fg) +r(A.cU,A.iD) +r(A.eQ,A.es) +r(A.eN,A.et) +r(A.ip,A.hh) +r(A.eR,A.cV) +r(A.bI,A.hf) +r(A.aZ,A.hg) +r(A.eP,A.i5) +r(A.Y,A.a2) +q(A.Y,[A.cl,A.ck,A.bM,A.bS]) +r(A.f5,A.an) +r(A.aG,A.f5) +r(A.iE,A.eB) +s(A.cg,A.bh) +s(A.dB,A.r) +s(A.dj,A.r) +s(A.dk,A.ad) +s(A.dl,A.r) +s(A.dm,A.ad) +s(A.ch,A.dw) +s(A.fj,A.hA) +s(A.fc,A.r) +s(A.fd,A.en) +s(A.ff,A.eG) +s(A.fg,A.D)})() +var v={typeUniverse:{eC:new Map(),tR:{},eT:{},tPV:{},sEA:[]},mangledGlobalNames:{a:"int",A:"double",aq:"num",h:"String",aH:"bool",F:"Null",t:"List",p:"Object",I:"Map"},mangledNames:{},types:["~()","a(a,a)","z<~>()","~(C)","F()","z<@>()","F(a)","~(@)","~(@,@)","F(C)","~(~())","a(a)","z<@>(am)","F(a,a,a)","F(@)","a(a,a,a,a)","@()","~(az,h,a)","z()","z()","z>()","a(a,a,a,a,a)","a(a,a,a)","a(a,a,a,ae)","h?(p?)","a?()","a?(h)","@(h)","w<@>(@)","z()","z()","@(@,h)","~(p?,p?)","I(aW)","~(@[@])","aW(@)","F(~())","I<@,@>(a)","~(I<@,@>)","F(@,aF)","z(am)","z(am)","z(am)","z()","~(c2)","~(a,@)","h(h)","h(p?)","~(aO)","~(h,a)","~(h,I)","~(h,p?)","C(C?)","z<~>(a,az)","z<~>(a)","az()","~(h,a?)","az(@,@)","~(p,aF)","Q(a,aA)","F(a,a)","aH(h)","a(a,ae)","h(h?)","F(a,a,a,a,ae)","a?(a)","F(ae,a)","a(@,@)","@(@)","~(b_?,l1?,b_,~())","F(p,aF)"],interceptorsByTag:null,leafTags:null,arrayRti:Symbol("$ti"),rttc:{"2;":(a,b)=>c=>c instanceof A.bl&&a.b(c.a)&&b.b(c.b),"2;file,outFlags":(a,b)=>c=>c instanceof A.cn&&a.b(c.a)&&b.b(c.b)}} +A.pQ(v.typeUniverse,JSON.parse('{"aP":"bd","ep":"bd","bG":"bd","E":{"t":["1"],"n":["1"],"C":[],"e":["1"]},"ec":{"aH":[],"G":[]},"cJ":{"F":[],"G":[]},"cL":{"C":[]},"bd":{"C":[]},"h2":{"E":["1"],"t":["1"],"n":["1"],"C":[],"e":["1"]},"cx":{"B":["1"]},"c6":{"A":[],"aq":[],"a6":["aq"]},"cI":{"A":[],"a":[],"aq":[],"a6":["aq"],"G":[]},"ed":{"A":[],"aq":[],"a6":["aq"],"G":[]},"bc":{"h":[],"a6":["h"],"hd":[],"G":[]},"bi":{"e":["2"]},"cz":{"B":["2"]},"bp":{"bi":["1","2"],"e":["2"],"e.E":"2"},"db":{"bp":["1","2"],"bi":["1","2"],"n":["2"],"e":["2"],"e.E":"2"},"da":{"r":["2"],"t":["2"],"bi":["1","2"],"n":["2"],"e":["2"]},"ac":{"da":["1","2"],"r":["2"],"t":["2"],"bi":["1","2"],"n":["2"],"e":["2"],"r.E":"2","e.E":"2"},"cA":{"D":["3","4"],"I":["3","4"],"D.K":"3","D.V":"4"},"c8":{"H":[]},"cB":{"r":["a"],"bh":["a"],"t":["a"],"n":["a"],"e":["a"],"r.E":"a","bh.E":"a"},"n":{"e":["1"]},"X":{"n":["1"],"e":["1"]},"bF":{"X":["1"],"n":["1"],"e":["1"],"X.E":"1","e.E":"1"},"bx":{"B":["1"]},"aS":{"e":["2"],"e.E":"2"},"br":{"aS":["1","2"],"n":["2"],"e":["2"],"e.E":"2"},"cP":{"B":["2"]},"a3":{"X":["2"],"n":["2"],"e":["2"],"X.E":"2","e.E":"2"},"iq":{"e":["1"],"e.E":"1"},"bJ":{"B":["1"]},"aV":{"e":["1"],"e.E":"1"},"c1":{"aV":["1"],"n":["1"],"e":["1"],"e.E":"1"},"cY":{"B":["1"]},"bs":{"n":["1"],"e":["1"],"e.E":"1"},"cE":{"B":["1"]},"d6":{"e":["1"],"e.E":"1"},"d7":{"B":["1"]},"bu":{"e":["+(a,1)"],"e.E":"+(a,1)"},"c0":{"bu":["1"],"n":["+(a,1)"],"e":["+(a,1)"],"e.E":"+(a,1)"},"bv":{"B":["+(a,1)"]},"cg":{"r":["1"],"bh":["1"],"t":["1"],"n":["1"],"e":["1"]},"f8":{"X":["a"],"n":["a"],"e":["a"],"X.E":"a","e.E":"a"},"cN":{"D":["a","1"],"dw":["a","1"],"I":["a","1"],"D.K":"a","D.V":"1"},"cX":{"X":["1"],"n":["1"],"e":["1"],"X.E":"1","e.E":"1"},"bl":{"bR":[],"bk":[]},"cn":{"bR":[],"bk":[]},"cC":{"I":["1","2"]},"cD":{"cC":["1","2"],"I":["1","2"]},"bP":{"e":["1"],"e.E":"1"},"dd":{"B":["1"]},"cT":{"aX":[],"H":[]},"ee":{"H":[]},"eF":{"H":[]},"dp":{"aF":[]},"ba":{"bt":[]},"dT":{"bt":[]},"dU":{"bt":[]},"eD":{"bt":[]},"eA":{"bt":[]},"bY":{"bt":[]},"eZ":{"H":[]},"ev":{"H":[]},"eW":{"H":[]},"aQ":{"D":["1","2"],"m_":["1","2"],"I":["1","2"],"D.K":"1","D.V":"2"},"aR":{"n":["1"],"e":["1"],"e.E":"1"},"cM":{"B":["1"]},"bR":{"bk":[]},"cK":{"oT":[],"hd":[]},"di":{"cW":[],"ca":[]},"eU":{"e":["cW"],"e.E":"cW"},"eV":{"B":["cW"]},"d3":{"ca":[]},"fl":{"e":["ca"],"e.E":"ca"},"fm":{"B":["ca"]},"cb":{"C":[],"dR":[],"G":[]},"cR":{"C":[]},"fp":{"dR":[]},"cQ":{"lO":[],"C":[],"G":[]},"a4":{"ak":["1"],"C":[]},"be":{"r":["A"],"a4":["A"],"t":["A"],"ak":["A"],"n":["A"],"C":[],"e":["A"],"ad":["A"]},"al":{"r":["a"],"a4":["a"],"t":["a"],"ak":["a"],"n":["a"],"C":[],"e":["a"],"ad":["a"]},"eg":{"be":[],"r":["A"],"K":["A"],"a4":["A"],"t":["A"],"ak":["A"],"n":["A"],"C":[],"e":["A"],"ad":["A"],"G":[],"r.E":"A"},"eh":{"be":[],"r":["A"],"K":["A"],"a4":["A"],"t":["A"],"ak":["A"],"n":["A"],"C":[],"e":["A"],"ad":["A"],"G":[],"r.E":"A"},"ei":{"al":[],"r":["a"],"K":["a"],"a4":["a"],"t":["a"],"ak":["a"],"n":["a"],"C":[],"e":["a"],"ad":["a"],"G":[],"r.E":"a"},"ej":{"al":[],"r":["a"],"K":["a"],"a4":["a"],"t":["a"],"ak":["a"],"n":["a"],"C":[],"e":["a"],"ad":["a"],"G":[],"r.E":"a"},"ek":{"al":[],"r":["a"],"K":["a"],"a4":["a"],"t":["a"],"ak":["a"],"n":["a"],"C":[],"e":["a"],"ad":["a"],"G":[],"r.E":"a"},"el":{"al":[],"kY":[],"r":["a"],"K":["a"],"a4":["a"],"t":["a"],"ak":["a"],"n":["a"],"C":[],"e":["a"],"ad":["a"],"G":[],"r.E":"a"},"em":{"al":[],"r":["a"],"K":["a"],"a4":["a"],"t":["a"],"ak":["a"],"n":["a"],"C":[],"e":["a"],"ad":["a"],"G":[],"r.E":"a"},"cS":{"al":[],"r":["a"],"K":["a"],"a4":["a"],"t":["a"],"ak":["a"],"n":["a"],"C":[],"e":["a"],"ad":["a"],"G":[],"r.E":"a"},"bz":{"al":[],"az":[],"r":["a"],"K":["a"],"a4":["a"],"t":["a"],"ak":["a"],"n":["a"],"C":[],"e":["a"],"ad":["a"],"G":[],"r.E":"a"},"f0":{"H":[]},"dr":{"aX":[],"H":[]},"w":{"z":["1"]},"d8":{"dW":["1"]},"dq":{"B":["1"]},"co":{"e":["1"],"e.E":"1"},"aN":{"H":[]},"cj":{"dW":["1"]},"bL":{"cj":["1"],"dW":["1"]},"Z":{"cj":["1"],"dW":["1"]},"dA":{"b_":[]},"fe":{"dA":[],"b_":[]},"de":{"cd":["1"],"kL":["1"],"n":["1"],"e":["1"]},"bQ":{"B":["1"]},"c9":{"e":["1"],"e.E":"1"},"df":{"B":["1"]},"r":{"t":["1"],"n":["1"],"e":["1"]},"D":{"I":["1","2"]},"ch":{"D":["1","2"],"dw":["1","2"],"I":["1","2"]},"dg":{"n":["2"],"e":["2"],"e.E":"2"},"dh":{"B":["2"]},"cd":{"kL":["1"],"n":["1"],"e":["1"]},"dn":{"cd":["1"],"kL":["1"],"n":["1"],"e":["1"]},"dN":{"bZ":["t","h"]},"e2":{"bZ":["h","t"]},"eJ":{"bZ":["h","t"]},"bX":{"a6":["bX"]},"bq":{"a6":["bq"]},"A":{"aq":[],"a6":["aq"]},"bb":{"a6":["bb"]},"a":{"aq":[],"a6":["aq"]},"t":{"n":["1"],"e":["1"]},"aq":{"a6":["aq"]},"cW":{"ca":[]},"h":{"a6":["h"],"hd":[]},"R":{"bX":[],"a6":["bX"]},"cy":{"H":[]},"aX":{"H":[]},"as":{"H":[]},"cc":{"H":[]},"cG":{"H":[]},"d4":{"H":[]},"eE":{"H":[]},"bE":{"H":[]},"dX":{"H":[]},"eo":{"H":[]},"d2":{"H":[]},"ea":{"H":[]},"fn":{"aF":[]},"a9":{"pg":[]},"dx":{"eH":[]},"fh":{"eH":[]},"f_":{"eH":[]},"f6":{"oR":[]},"eq":{"c5":[]},"eI":{"c5":[]},"eS":{"c5":[]},"aA":{"cp":["bX"],"cp.T":"bX"},"d1":{"d0":[]},"e6":{"aO":[]},"e0":{"lQ":[]},"c3":{"aO":[]},"cf":{"dV":[]},"eT":{"cH":[],"c_":[],"B":["a8"]},"e7":{"bH":[]},"f3":{"eL":[]},"a8":{"eG":["h","@"],"D":["h","@"],"I":["h","@"],"D.K":"h","D.V":"@"},"cH":{"c_":[],"B":["a8"]},"eu":{"r":["a8"],"en":["a8"],"t":["a8"],"n":["a8"],"c_":[],"e":["a8"],"r.E":"a8"},"fb":{"B":["a8"]},"bw":{"pe":[]},"dP":{"bH":[]},"dO":{"eL":[]},"eQ":{"es":[]},"eN":{"et":[]},"eR":{"cV":[]},"ci":{"r":["aZ"],"t":["aZ"],"n":["aZ"],"e":["aZ"],"r.E":"aZ"},"c4":{"bH":[]},"Y":{"a2":["Y"]},"f4":{"eL":[]},"cl":{"Y":[],"a2":["Y"],"a2.E":"Y"},"ck":{"Y":[],"a2":["Y"],"a2.E":"Y"},"bM":{"Y":[],"a2":["Y"],"a2.E":"Y"},"bS":{"Y":[],"a2":["Y"],"a2.E":"Y"},"dQ":{"oH":[]},"aG":{"an":["a"],"r":["a"],"t":["a"],"n":["a"],"e":["a"],"r.E":"a","an.E":"a"},"an":{"r":["1"],"t":["1"],"n":["1"],"e":["1"]},"f5":{"an":["a"],"r":["a"],"t":["a"],"n":["a"],"e":["a"]},"iE":{"eB":["1"]},"dc":{"pf":["1"]},"ou":{"K":["a"],"t":["a"],"n":["a"],"e":["a"]},"az":{"K":["a"],"t":["a"],"n":["a"],"e":["a"]},"pl":{"K":["a"],"t":["a"],"n":["a"],"e":["a"]},"os":{"K":["a"],"t":["a"],"n":["a"],"e":["a"]},"kY":{"K":["a"],"t":["a"],"n":["a"],"e":["a"]},"ot":{"K":["a"],"t":["a"],"n":["a"],"e":["a"]},"pk":{"K":["a"],"t":["a"],"n":["a"],"e":["a"]},"ol":{"K":["A"],"t":["A"],"n":["A"],"e":["A"]},"om":{"K":["A"],"t":["A"],"n":["A"],"e":["A"]}}')) +A.pP(v.typeUniverse,JSON.parse('{"cg":1,"dB":2,"a4":1,"ch":2,"dn":1,"dZ":2,"o8":1}')) +var u={c:"Error handler must accept one Object or one Object and a StackTrace as arguments, and return a value of the returned future's type",f:"Tried to operate on a released prepared statement"} +var t=(function rtii(){var s=A.aB +return{b9:s("o8"),n:s("aN"),dG:s("bX"),dI:s("dR"),gs:s("lQ"),e8:s("a6<@>"),dy:s("bq"),fu:s("bb"),R:s("n<@>"),Q:s("H"),r:s("aO"),Z:s("bt"),fR:s("z<@>"),gJ:s("z<@>()"),bd:s("c4"),cs:s("e"),bM:s("e"),hf:s("e<@>"),hb:s("e"),eV:s("E"),W:s("E>"),G:s("E>"),aX:s("E>"),eK:s("E"),bb:s("E"),s:s("E"),gQ:s("E"),bi:s("E"),u:s("E"),b:s("E<@>"),t:s("E"),c:s("E"),d4:s("E"),T:s("cJ"),m:s("C"),C:s("ae"),g:s("aP"),aU:s("ak<@>"),h:s("c9"),k:s("t"),B:s("t"),a:s("t"),j:s("t<@>"),L:s("t"),ee:s("t"),dA:s("Q"),dY:s("I"),Y:s("I"),f:s("I<@,@>"),f6:s("I>"),eE:s("I"),do:s("a3"),o:s("cb"),aS:s("be"),eB:s("al"),bm:s("bz"),P:s("F"),K:s("p"),gT:s("ru"),bQ:s("+()"),cz:s("cW"),gy:s("rv"),bJ:s("cX"),fI:s("a8"),d_:s("d0"),g2:s("d1"),gR:s("ez"),l:s("aF"),N:s("h"),dm:s("G"),bV:s("aX"),fQ:s("aG"),p:s("az"),ak:s("bG"),dD:s("eH"),fL:s("bH"),cG:s("eL"),h2:s("eM"),g9:s("eO"),ab:s("eP"),gV:s("aZ"),eJ:s("d6"),x:s("b_"),ez:s("bL<~>"),J:s("aA"),cl:s("R"),O:s("bN"),et:s("w"),ek:s("w"),e:s("w<@>"),fJ:s("w"),D:s("w<~>"),aT:s("fi"),eC:s("Z"),fa:s("Z"),F:s("Z<~>"),y:s("aH"),al:s("aH(p)"),i:s("A"),z:s("@"),fO:s("@()"),v:s("@(p)"),U:s("@(p,aF)"),dO:s("@(h)"),S:s("a"),aw:s("0&*"),_:s("p*"),eH:s("z?"),A:s("C?"),bE:s("t<@>?"),gq:s("t?"),fn:s("I?"),X:s("p?"),fN:s("aG?"),E:s("b_?"),q:s("l1?"),d:s("b0<@,@>?"),V:s("f7?"),I:s("a?"),g_:s("a()?"),g5:s("~()?"),w:s("~(C)?"),aY:s("~(a,h,a)?"),di:s("aq"),H:s("~"),M:s("~()")}})();(function constants(){var s=hunkHelpers.makeConstList +B.K=J.eb.prototype +B.b=J.E.prototype +B.c=J.cI.prototype +B.L=J.c6.prototype +B.a=J.bc.prototype +B.M=J.aP.prototype +B.N=J.cL.prototype +B.Q=A.cQ.prototype +B.d=A.bz.prototype +B.z=J.ep.prototype +B.o=J.bG.prototype +B.a7=new A.fK() +B.A=new A.dN() +B.B=new A.cE(A.aB("cE<0&>")) +B.C=new A.ea() +B.p=function getTagFallback(o) { + var s = Object.prototype.toString.call(o); + return s.substring(8, s.length - 1); +} +B.D=function() { + var toStringFunction = Object.prototype.toString; + function getTag(o) { + var s = toStringFunction.call(o); + return s.substring(8, s.length - 1); + } + function getUnknownTag(object, tag) { + if (/^HTML[A-Z].*Element$/.test(tag)) { + var name = toStringFunction.call(object); + if (name == "[object Object]") return null; + return "HTMLElement"; + } + } + function getUnknownTagGenericBrowser(object, tag) { + if (object instanceof HTMLElement) return "HTMLElement"; + return getUnknownTag(object, tag); + } + function prototypeForTag(tag) { + if (typeof window == "undefined") return null; + if (typeof window[tag] == "undefined") return null; + var constructor = window[tag]; + if (typeof constructor != "function") return null; + return constructor.prototype; + } + function discriminator(tag) { return null; } + var isBrowser = typeof HTMLElement == "function"; + return { + getTag: getTag, + getUnknownTag: isBrowser ? getUnknownTagGenericBrowser : getUnknownTag, + prototypeForTag: prototypeForTag, + discriminator: discriminator }; +} +B.I=function(getTagFallback) { + return function(hooks) { + if (typeof navigator != "object") return hooks; + var userAgent = navigator.userAgent; + if (typeof userAgent != "string") return hooks; + if (userAgent.indexOf("DumpRenderTree") >= 0) return hooks; + if (userAgent.indexOf("Chrome") >= 0) { + function confirm(p) { + return typeof window == "object" && window[p] && window[p].name == p; + } + if (confirm("Window") && confirm("HTMLElement")) return hooks; + } + hooks.getTag = getTagFallback; + }; +} +B.E=function(hooks) { + if (typeof dartExperimentalFixupGetTag != "function") return hooks; + hooks.getTag = dartExperimentalFixupGetTag(hooks.getTag); +} +B.H=function(hooks) { + if (typeof navigator != "object") return hooks; + var userAgent = navigator.userAgent; + if (typeof userAgent != "string") return hooks; + if (userAgent.indexOf("Firefox") == -1) return hooks; + var getTag = hooks.getTag; + var quickMap = { + "BeforeUnloadEvent": "Event", + "DataTransfer": "Clipboard", + "GeoGeolocation": "Geolocation", + "Location": "!Location", + "WorkerMessageEvent": "MessageEvent", + "XMLDocument": "!Document"}; + function getTagFirefox(o) { + var tag = getTag(o); + return quickMap[tag] || tag; + } + hooks.getTag = getTagFirefox; +} +B.G=function(hooks) { + if (typeof navigator != "object") return hooks; + var userAgent = navigator.userAgent; + if (typeof userAgent != "string") return hooks; + if (userAgent.indexOf("Trident/") == -1) return hooks; + var getTag = hooks.getTag; + var quickMap = { + "BeforeUnloadEvent": "Event", + "DataTransfer": "Clipboard", + "HTMLDDElement": "HTMLElement", + "HTMLDTElement": "HTMLElement", + "HTMLPhraseElement": "HTMLElement", + "Position": "Geoposition" + }; + function getTagIE(o) { + var tag = getTag(o); + var newTag = quickMap[tag]; + if (newTag) return newTag; + if (tag == "Object") { + if (window.DataView && (o instanceof window.DataView)) return "DataView"; + } + return tag; + } + function prototypeForTagIE(tag) { + var constructor = window[tag]; + if (constructor == null) return null; + return constructor.prototype; + } + hooks.getTag = getTagIE; + hooks.prototypeForTag = prototypeForTagIE; +} +B.F=function(hooks) { + var getTag = hooks.getTag; + var prototypeForTag = hooks.prototypeForTag; + function getTagFixed(o) { + var tag = getTag(o); + if (tag == "Document") { + if (!!o.xmlVersion) return "!Document"; + return "!HTMLDocument"; + } + return tag; + } + function prototypeForTagFixed(tag) { + if (tag == "Document") return null; + return prototypeForTag(tag); + } + hooks.getTag = getTagFixed; + hooks.prototypeForTag = prototypeForTagFixed; +} +B.q=function(hooks) { return hooks; } + +B.J=new A.eo() +B.h=new A.hj() +B.i=new A.eJ() +B.f=new A.ih() +B.e=new A.fe() +B.j=new A.fn() +B.r=new A.bb(0) +B.O=A.u(s([0,0,32722,12287,65534,34815,65534,18431]),t.t) +B.k=A.u(s([0,0,65490,45055,65535,34815,65534,18431]),t.t) +B.t=A.u(s([0,0,32754,11263,65534,34815,65534,18431]),t.t) +B.l=A.u(s([0,0,26624,1023,65534,2047,65534,2047]),t.t) +B.u=A.u(s([0,0,65490,12287,65535,34815,65534,18431]),t.t) +B.m=A.u(s([0,0,32776,33792,1,10240,0,0]),t.t) +B.P=A.u(s([]),t.s) +B.v=A.u(s([]),t.c) +B.n=A.u(s([0,0,24576,1023,65534,34815,65534,18431]),t.t) +B.R={} +B.w=new A.cD(B.R,[],A.aB("cD")) +B.x=new A.cU("readOnly") +B.S=new A.cU("readWrite") +B.y=new A.cU("readWriteCreate") +B.T=A.ax("dR") +B.U=A.ax("lO") +B.V=A.ax("ol") +B.W=A.ax("om") +B.X=A.ax("os") +B.Y=A.ax("ot") +B.Z=A.ax("ou") +B.a_=A.ax("C") +B.a0=A.ax("p") +B.a1=A.ax("kY") +B.a2=A.ax("pk") +B.a3=A.ax("pl") +B.a4=A.ax("az") +B.a5=new A.d5(522) +B.a6=new A.fq(B.e,A.qU(),A.aB("fq<~(b_,l1,b_,~())>"))})();(function staticFields(){$.jE=null +$.ar=A.u([],A.aB("E

")) +$.ny=null +$.m5=null +$.lM=null +$.lL=null +$.nt=null +$.no=null +$.nz=null +$.k8=null +$.kg=null +$.ls=null +$.jF=A.u([],A.aB("E?>")) +$.cr=null +$.dF=null +$.dG=null +$.ll=!1 +$.x=B.e +$.mw=null +$.mx=null +$.my=null +$.mz=null +$.l2=A.iA("_lastQuoRemDigits") +$.l3=A.iA("_lastQuoRemUsed") +$.d9=A.iA("_lastRemUsed") +$.l4=A.iA("_lastRem_nsh") +$.mq="" +$.mr=null +$.nn=null +$.ne=null +$.nr=A.O(t.S,A.aB("am")) +$.fx=A.O(A.aB("h?"),A.aB("am")) +$.nf=0 +$.kh=0 +$.aa=null +$.nB=A.O(t.N,t.X) +$.nm=null +$.dH="/shw2"})();(function lazyInitializers(){var s=hunkHelpers.lazyFinal,r=hunkHelpers.lazy +s($,"rr","cu",()=>A.r5("_$dart_dartClosure")) +s($,"rB","nH",()=>A.aY(A.ib({ +toString:function(){return"$receiver$"}}))) +s($,"rC","nI",()=>A.aY(A.ib({$method$:null, +toString:function(){return"$receiver$"}}))) +s($,"rD","nJ",()=>A.aY(A.ib(null))) +s($,"rE","nK",()=>A.aY(function(){var $argumentsExpr$="$arguments$" +try{null.$method$($argumentsExpr$)}catch(q){return q.message}}())) +s($,"rH","nN",()=>A.aY(A.ib(void 0))) +s($,"rI","nO",()=>A.aY(function(){var $argumentsExpr$="$arguments$" +try{(void 0).$method$($argumentsExpr$)}catch(q){return q.message}}())) +s($,"rG","nM",()=>A.aY(A.mn(null))) +s($,"rF","nL",()=>A.aY(function(){try{null.$method$}catch(q){return q.message}}())) +s($,"rK","nQ",()=>A.aY(A.mn(void 0))) +s($,"rJ","nP",()=>A.aY(function(){try{(void 0).$method$}catch(q){return q.message}}())) +s($,"rL","ly",()=>A.po()) +s($,"rV","nW",()=>A.oK(4096)) +s($,"rT","nU",()=>new A.jN().$0()) +s($,"rU","nV",()=>new A.jM().$0()) +s($,"rM","nR",()=>new Int8Array(A.qj(A.u([-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-1,-2,-2,-2,-2,-2,62,-2,62,-2,63,52,53,54,55,56,57,58,59,60,61,-2,-2,-2,-1,-2,-2,-2,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-2,-2,-2,-2,63,-2,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-2,-2,-2,-2,-2],t.t)))) +s($,"rR","b7",()=>A.iv(0)) +s($,"rQ","fB",()=>A.iv(1)) +s($,"rO","lA",()=>$.fB().a3(0)) +s($,"rN","lz",()=>A.iv(1e4)) +r($,"rP","nS",()=>A.ay("^\\s*([+-]?)((0x[a-f0-9]+)|(\\d+)|([a-z0-9]+))\\s*$",!1)) +s($,"rS","nT",()=>typeof FinalizationRegistry=="function"?FinalizationRegistry:null) +s($,"t5","kv",()=>A.lv(B.a0)) +s($,"t6","o_",()=>A.qh()) +s($,"rt","nE",()=>{var q=new A.f6(new DataView(new ArrayBuffer(A.qf(8)))) +q.dJ() +return q}) +s($,"td","lD",()=>{var q=$.ku() +return new A.dY(q)}) +s($,"t9","lC",()=>new A.dY($.nF())) +s($,"ry","nG",()=>new A.eq(A.ay("/",!0),A.ay("[^/]$",!0),A.ay("^/",!0))) +s($,"rA","fA",()=>new A.eS(A.ay("[/\\\\]",!0),A.ay("[^/\\\\]$",!0),A.ay("^(\\\\\\\\[^\\\\]+\\\\[^\\\\/]+|[a-zA-Z]:[/\\\\])",!0),A.ay("^[/\\\\](?![/\\\\])",!0))) +s($,"rz","ku",()=>new A.eI(A.ay("/",!0),A.ay("(^[a-zA-Z][-+.a-zA-Z\\d]*://|[^/])$",!0),A.ay("[a-zA-Z][-+.a-zA-Z\\d]*://[^/]*",!0),A.ay("^/",!0))) +s($,"rx","nF",()=>A.pi()) +s($,"t4","nZ",()=>A.kH()) +r($,"rW","lB",()=>A.u([new A.aA("BigInt")],A.aB("E"))) +r($,"rX","nX",()=>{var q=$.lB() +return A.oF(q,A.a_(q).c).fa(0,new A.jQ(),t.N,t.J)}) +r($,"t3","nY",()=>A.ms("sqlite3.wasm")) +s($,"t8","o1",()=>A.lJ("-9223372036854775808")) +s($,"t7","o0",()=>A.lJ("9223372036854775807")) +s($,"tb","fC",()=>{var q=$.nT() +q=q==null?null:new q(A.bT(A.ro(new A.k9(),t.r),1)) +return new A.f1(q,A.aB("f1"))}) +s($,"rq","kt",()=>$.nE()) +s($,"rp","ks",()=>A.oG(A.u(["files","blocks"],t.s),t.N)) +s($,"rs","nD",()=>new A.e4(new WeakMap(),A.aB("e4")))})();(function nativeSupport(){!function(){var s=function(a){var m={} +m[a]=1 +return Object.keys(hunkHelpers.convertToFastObject(m))[0]} +v.getIsolateTag=function(a){return s("___dart_"+a+v.isolateTag)} +var r="___dart_isolate_tags_" +var q=Object[r]||(Object[r]=Object.create(null)) +var p="_ZxYxX" +for(var o=0;;o++){var n=s(p+"_"+o+"_") +if(!(n in q)){q[n]=1 +v.isolateTag=n +break}}v.dispatchPropertyName=v.getIsolateTag("dispatch_record")}() +hunkHelpers.setOrUpdateInterceptorsByTag({ArrayBuffer:A.cb,ArrayBufferView:A.cR,DataView:A.cQ,Float32Array:A.eg,Float64Array:A.eh,Int16Array:A.ei,Int32Array:A.ej,Int8Array:A.ek,Uint16Array:A.el,Uint32Array:A.em,Uint8ClampedArray:A.cS,CanvasPixelArray:A.cS,Uint8Array:A.bz}) +hunkHelpers.setOrUpdateLeafTags({ArrayBuffer:true,ArrayBufferView:false,DataView:true,Float32Array:true,Float64Array:true,Int16Array:true,Int32Array:true,Int8Array:true,Uint16Array:true,Uint32Array:true,Uint8ClampedArray:true,CanvasPixelArray:true,Uint8Array:false}) +A.a4.$nativeSuperclassTag="ArrayBufferView" +A.dj.$nativeSuperclassTag="ArrayBufferView" +A.dk.$nativeSuperclassTag="ArrayBufferView" +A.be.$nativeSuperclassTag="ArrayBufferView" +A.dl.$nativeSuperclassTag="ArrayBufferView" +A.dm.$nativeSuperclassTag="ArrayBufferView" +A.al.$nativeSuperclassTag="ArrayBufferView"})() +Function.prototype.$0=function(){return this()} +Function.prototype.$1=function(a){return this(a)} +Function.prototype.$2=function(a,b){return this(a,b)} +Function.prototype.$1$1=function(a){return this(a)} +Function.prototype.$3$1=function(a){return this(a)} +Function.prototype.$2$1=function(a){return this(a)} +Function.prototype.$3=function(a,b,c){return this(a,b,c)} +Function.prototype.$4=function(a,b,c,d){return this(a,b,c,d)} +Function.prototype.$3$3=function(a,b,c){return this(a,b,c)} +Function.prototype.$2$2=function(a,b){return this(a,b)} +Function.prototype.$1$0=function(){return this()} +Function.prototype.$5=function(a,b,c,d,e){return this(a,b,c,d,e)} +convertAllToFastObject(w) +convertToFastObject($);(function(a){if(typeof document==="undefined"){a(null) +return}if(typeof document.currentScript!="undefined"){a(document.currentScript) +return}var s=document.scripts +function onLoad(b){for(var q=0;q #include +#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { @@ -15,6 +16,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("AppLinksPluginCApi")); ConnectivityPlusWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); + FileSelectorWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FileSelectorWindows")); UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 64c0dfb..d1bae2b 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -5,6 +5,7 @@ list(APPEND FLUTTER_PLUGIN_LIST app_links connectivity_plus + file_selector_windows url_launcher_windows )