commit 3b3f80fe2094bc28deeb022e73c7ef7422c42e5c Author: anitak Date: Wed Apr 22 10:41:00 2026 +0530 first commit diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..187894b --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: '@react-native', +}; diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e93acff --- /dev/null +++ b/.gitignore @@ -0,0 +1,76 @@ +# OSX +# +.DS_Store + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +**/.xcode.env.local + +# Android/IntelliJ +# +build/ +.idea +.gradle +local.properties +*.iml +*.hprof +.cxx/ +*.keystore +!debug.keystore +.kotlin/ + +# node.js +# +/node_modules/ +npm-debug.log +yarn-error.log + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/ + +**/fastlane/report.xml +**/fastlane/Preview.html +**/fastlane/screenshots +**/fastlane/test_output + +# Bundle artifact +*.jsbundle + +# Ruby / CocoaPods +**/Pods/ +/vendor/bundle/ + +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* + +# testing +/coverage + + +# Yarn +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..06860c8 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,5 @@ +module.exports = { + arrowParens: 'avoid', + singleQuote: true, + trailingComma: 'all', +}; diff --git a/.watchmanconfig b/.watchmanconfig new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/.watchmanconfig @@ -0,0 +1 @@ +{} diff --git a/App.tsx b/App.tsx new file mode 100644 index 0000000..5e963b1 --- /dev/null +++ b/App.tsx @@ -0,0 +1,45 @@ +/** + * Sample React Native App + * https://github.com/facebook/react-native + * + * @format + */ + +import { NewAppScreen } from '@react-native/new-app-screen'; +import { StatusBar, StyleSheet, useColorScheme, View } from 'react-native'; +import { + SafeAreaProvider, + useSafeAreaInsets, +} from 'react-native-safe-area-context'; + +function App() { + const isDarkMode = useColorScheme() === 'dark'; + + return ( + + + + + ); +} + +function AppContent() { + const safeAreaInsets = useSafeAreaInsets(); + + return ( + + + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + }, +}); + +export default App; diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..6a4c5f1 --- /dev/null +++ b/Gemfile @@ -0,0 +1,16 @@ +source 'https://rubygems.org' + +# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version +ruby ">= 2.6.10" + +# Exclude problematic versions of cocoapods and activesupport that causes build failures. +gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' +gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' +gem 'xcodeproj', '< 1.26.0' +gem 'concurrent-ruby', '< 1.3.4' + +# Ruby 3.4.0 has removed some libraries from the standard library. +gem 'bigdecimal' +gem 'logger' +gem 'benchmark' +gem 'mutex_m' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..5733b1a --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,120 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.8) + activesupport (7.2.3) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + atomos (0.1.3) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (3.3.1) + claide (1.1.0) + cocoapods (1.15.2) + addressable (~> 2.8) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.15.2) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 2.1, < 3.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.8.0) + nap (~> 1.0) + ruby-macho (>= 2.3.0, < 3.0) + xcodeproj (>= 1.23.0, < 2.0) + cocoapods-core (1.15.2) + activesupport (>= 5.0, < 8) + addressable (~> 2.8) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + public_suffix (~> 4.0) + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (2.1) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.2.0) + colored2 (3.1.2) + concurrent-ruby (1.3.3) + connection_pool (2.5.5) + drb (2.2.3) + escape (0.0.4) + ethon (0.15.0) + ffi (>= 1.15.0) + ffi (1.17.2) + fourflusher (2.3.1) + fuzzy_match (2.0.4) + gh_inspector (1.1.3) + httpclient (2.9.0) + mutex_m + i18n (1.14.7) + concurrent-ruby (~> 1.0) + json (2.16.0) + logger (1.7.0) + minitest (5.26.2) + molinillo (0.8.0) + mutex_m (0.3.0) + nanaimo (0.3.0) + nap (1.1.0) + netrc (0.11.0) + public_suffix (4.0.7) + rexml (3.4.4) + ruby-macho (2.5.1) + securerandom (0.4.1) + typhoeus (1.5.0) + ethon (>= 0.9.0, < 0.16.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + xcodeproj (1.25.1) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.3.0) + rexml (>= 3.3.6, < 4.0) + +PLATFORMS + ruby + +DEPENDENCIES + activesupport (>= 6.1.7.5, != 7.1.0) + benchmark + bigdecimal + cocoapods (>= 1.13, != 1.15.1, != 1.15.0) + concurrent-ruby (< 1.3.4) + logger + mutex_m + xcodeproj (< 1.26.0) + +RUBY VERSION + ruby 3.2.9p265 + +BUNDLED WITH + 2.7.1 diff --git a/README.md b/README.md new file mode 100644 index 0000000..3e2c3f8 --- /dev/null +++ b/README.md @@ -0,0 +1,97 @@ +This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli). + +# Getting Started + +> **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding. + +## Step 1: Start Metro + +First, you will need to run **Metro**, the JavaScript build tool for React Native. + +To start the Metro dev server, run the following command from the root of your React Native project: + +```sh +# Using npm +npm start + +# OR using Yarn +yarn start +``` + +## Step 2: Build and run your app + +With Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app: + +### Android + +```sh +# Using npm +npm run android + +# OR using Yarn +yarn android +``` + +### iOS + +For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps). + +The first time you create a new project, run the Ruby bundler to install CocoaPods itself: + +```sh +bundle install +``` + +Then, and every time you update your native dependencies, run: + +```sh +bundle exec pod install +``` + +For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html). + +```sh +# Using npm +npm run ios + +# OR using Yarn +yarn ios +``` + +If everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device. + +This is one way to run your app — you can also build it directly from Android Studio or Xcode. + +## Step 3: Modify your app + +Now that you have successfully run the app, let's make changes! + +Open `App.tsx` in your text editor of choice and make some changes. When you save, your app will automatically update and reflect these changes — this is powered by [Fast Refresh](https://reactnative.dev/docs/fast-refresh). + +When you want to forcefully reload, for example to reset the state of your app, you can perform a full reload: + +- **Android**: Press the R key twice or select **"Reload"** from the **Dev Menu**, accessed via Ctrl + M (Windows/Linux) or Cmd ⌘ + M (macOS). +- **iOS**: Press R in iOS Simulator. + +## Congratulations! :tada: + +You've successfully run and modified your React Native App. :partying_face: + +### Now what? + +- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps). +- If you're curious to learn more about React Native, check out the [docs](https://reactnative.dev/docs/getting-started). + +# Troubleshooting + +If you're having issues getting the above steps to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page. + +# Learn More + +To learn more about React Native, take a look at the following resources: + +- [React Native Website](https://reactnative.dev) - learn more about React Native. +- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment. +- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**. +- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts. +- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native. diff --git a/__tests__/App.test.tsx b/__tests__/App.test.tsx new file mode 100644 index 0000000..e532f70 --- /dev/null +++ b/__tests__/App.test.tsx @@ -0,0 +1,13 @@ +/** + * @format + */ + +import React from 'react'; +import ReactTestRenderer from 'react-test-renderer'; +import App from '../App'; + +test('renders correctly', async () => { + await ReactTestRenderer.act(() => { + ReactTestRenderer.create(); + }); +}); diff --git a/adb b/adb new file mode 100644 index 0000000..e69de29 diff --git a/android/app/build.gradle b/android/app/build.gradle new file mode 100644 index 0000000..b889210 --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,138 @@ +apply plugin: "com.android.application" +apply plugin: "org.jetbrains.kotlin.android" +apply plugin: "com.facebook.react" +apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" + +/** + * This is the configuration block to customize your React Native Android app. + * By default you don't need to apply any configuration, just uncomment the lines you need. + */ +react { + /* Folders */ + // The root of your project, i.e. where "package.json" lives. Default is '../..' + // root = file("../../") + // The folder where the react-native NPM package is. Default is ../../node_modules/react-native + // reactNativeDir = file("../../node_modules/react-native") + // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen + // codegenDir = file("../../node_modules/@react-native/codegen") + // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js + // cliFile = file("../../node_modules/react-native/cli.js") + + /* Variants */ + // The list of variants to that are debuggable. For those we're going to + // skip the bundling of the JS bundle and the assets. By default is just 'debug'. + // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. + // debuggableVariants = ["liteDebug", "prodDebug"] + + /* Bundling */ + // A list containing the node command and its flags. Default is just 'node'. + // nodeExecutableAndArgs = ["node"] + // + // The command to run when bundling. By default is 'bundle' + // bundleCommand = "ram-bundle" + // + // The path to the CLI configuration file. Default is empty. + // bundleConfig = file(../rn-cli.config.js) + // + // The name of the generated asset file containing your JS bundle + // bundleAssetName = "MyApplication.android.bundle" + // + // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' + // entryFile = file("../js/MyApplication.android.js") + // + // A list of extra flags to pass to the 'bundle' commands. + // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle + // extraPackagerArgs = [] + + /* Hermes Commands */ + // The hermes compiler command to run. By default it is 'hermesc' + // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" + // + // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" + // hermesFlags = ["-O", "-output-source-map"] + + /* Autolinking */ + autolinkLibrariesWithApp() +} + +/** + * Set this to true to Run Proguard on Release builds to minify the Java bytecode. + */ +def enableProguardInReleaseBuilds = true + +/** + * The preferred build flavor of JavaScriptCore (JSC) + * + * For example, to use the international variant, you can use: + * `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+` + * + * The international variant includes ICU i18n library and necessary data + * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that + * give correct results when using with locales other than en-US. Note that + * this variant is about 6MiB larger per architecture than default. + */ +def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+' + +android { + ndkVersion rootProject.ext.ndkVersion + // buildToolsVersion rootProject.ext.buildToolsVersion + compileSdk rootProject.ext.compileSdkVersion + + namespace "com.performicsmanager" + defaultConfig { + applicationId "com.performicsmanager" + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion + versionCode 36 + versionName "2.6" + ndk { + abiFilters "armeabi-v7a", "arm64-v8a" +} + } + signingConfigs { + debug { + storeFile file('debug.keystore') + storePassword 'android' + keyAlias 'androiddebugkey' + keyPassword 'android' + } + } + buildTypes { + debug { + signingConfig signingConfigs.debug + } + release { + // Caution! In production, you need to generate your own keystore file. + // see https://reactnative.dev/docs/signed-apk-android. + signingConfig signingConfigs.debug + minifyEnabled enableProguardInReleaseBuilds + proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + } + } + +} + +dependencies { + // The version of react-native is set by the React Native Gradle Plugin + implementation("com.facebook.react:react-android") + implementation project(':react-native-vector-icons') + + if (hermesEnabled.toBoolean()) { + implementation("com.facebook.react:hermes-android") + } else { + implementation jscFlavor + } + + configurations.all { + exclude group: "com.android.support", module: "support-v4" + exclude group: "com.android.support", module: "support-compat" + exclude group: "com.android.support", module: "support-media-compat" + } + + + + + +} + + diff --git a/android/app/debug.keystore b/android/app/debug.keystore new file mode 100644 index 0000000..364e105 Binary files /dev/null and b/android/app/debug.keystore differ diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro new file mode 100644 index 0000000..11b0257 --- /dev/null +++ b/android/app/proguard-rules.pro @@ -0,0 +1,10 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3269983 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/java/com/performicsmanager/MainActivity.kt b/android/app/src/main/java/com/performicsmanager/MainActivity.kt new file mode 100644 index 0000000..cc4531b --- /dev/null +++ b/android/app/src/main/java/com/performicsmanager/MainActivity.kt @@ -0,0 +1,27 @@ +package com.performicsmanager +import android.os.Bundle +import org.devio.rn.splashscreen.SplashScreen +import com.facebook.react.ReactActivity +import com.facebook.react.ReactActivityDelegate +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled +import com.facebook.react.defaults.DefaultReactActivityDelegate + +class MainActivity : ReactActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + SplashScreen.show(this) + super.onCreate(savedInstanceState) + } + /** + * Returns the name of the main component registered from JavaScript. This is used to schedule + * rendering of the component. + */ + override fun getMainComponentName(): String = "PerformicsManager" + + /** + * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] + * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] + */ + override fun createReactActivityDelegate(): ReactActivityDelegate = + DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) +} diff --git a/android/app/src/main/java/com/performicsmanager/MainApplication.kt b/android/app/src/main/java/com/performicsmanager/MainApplication.kt new file mode 100644 index 0000000..db5abe9 --- /dev/null +++ b/android/app/src/main/java/com/performicsmanager/MainApplication.kt @@ -0,0 +1,27 @@ +package com.performicsmanager + +import android.app.Application +import com.facebook.react.PackageList +import com.facebook.react.ReactApplication +import com.facebook.react.ReactHost +import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative +import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost + +class MainApplication : Application(), ReactApplication { + + override val reactHost: ReactHost by lazy { + getDefaultReactHost( + context = applicationContext, + packageList = + PackageList(this).packages.apply { + // Packages that cannot be autolinked yet can be added manually here, for example: + // add(MyReactNativePackage()) + }, + ) + } + + override fun onCreate() { + super.onCreate() + loadReactNative(this) + } +} diff --git a/android/app/src/main/res/drawable/logo.png b/android/app/src/main/res/drawable/logo.png new file mode 100644 index 0000000..11a738a Binary files /dev/null and b/android/app/src/main/res/drawable/logo.png differ diff --git a/android/app/src/main/res/drawable/parinaam_tag_line.png b/android/app/src/main/res/drawable/parinaam_tag_line.png new file mode 100644 index 0000000..1d072e2 Binary files /dev/null and b/android/app/src/main/res/drawable/parinaam_tag_line.png differ diff --git a/android/app/src/main/res/drawable/rn_edit_text_material.xml b/android/app/src/main/res/drawable/rn_edit_text_material.xml new file mode 100644 index 0000000..5c25e72 --- /dev/null +++ b/android/app/src/main/res/drawable/rn_edit_text_material.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/android/app/src/main/res/layout/launch_screen.xml b/android/app/src/main/res/layout/launch_screen.xml new file mode 100644 index 0000000..406cf8e --- /dev/null +++ b/android/app/src/main/res/layout/launch_screen.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..9e14167 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..9e14167 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..094d02d Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..094d02d Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..2febffa Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..2febffa Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..ea08cef Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..ea08cef Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..0f511ec Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..0f511ec Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..fa39bce --- /dev/null +++ b/android/app/src/main/res/values/colors.xml @@ -0,0 +1,47 @@ + + + #000000 + #6B84F6 + + + #294D8C + #383386 + #87CEFA + #294D8C + #FFFFFF + #fe8bd0 + #000000 + #FFF176 + #f9f93d + #e21c22 + #00000000 + #4CAF50 + #294D8C + #009688 + #388E3C + #00796B + #66BB6A + #D3D3D3 + #FAFAFA + #00bfff + #1E88E5 + #FFA07A + #87CEFA + #DCDCDC + #FFDAB9 + #1a7be0 + #c8c3c3 + #888 + #bada55 + #787878 + #bada55 + #D1D1D1 + #A9A9A9 + #F7F7F7 + #E1E2E2 + @android:color/transparent + + #E6F8FF + #5a5a5a + @color/colorPrimary + \ No newline at end of file diff --git a/android/app/src/main/res/values/dimens.xml b/android/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..6474b8b --- /dev/null +++ b/android/app/src/main/res/values/dimens.xml @@ -0,0 +1,34 @@ + + + 16dp + 16dp + 5dp + 160dp + 16dp + 15sp + 16sp + 18sp + 15sp + 12sp + 14sp + 13sp + 8dp + 5dp + 11dp + 1dp + + 30dp + 25sp + + 15dp + 16sp + 2dp + 3dp + 10dp + 8dp + + 35dp + 40dp + + + diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..789c51b --- /dev/null +++ b/android/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + Performics Manager + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..7ba83a2 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000..dab957c --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,44 @@ +buildscript { + ext { + buildToolsVersion = "34.0.0" + minSdkVersion = 26 + compileSdkVersion = 36 + targetSdkVersion = 36 + ndkVersion = "27.1.12297006" + kotlinVersion = "1.9.24" // Fixed: Compatible with RN 0.82.1 + googlePlayServicesVersion = "21.0.1" + googlePlayServicesMapsVersion = "18.2.0" + } + repositories { + google() + mavenCentral() + } + dependencies { + classpath("com.android.tools.build:gradle:8.3.2") // Added version + classpath("com.facebook.react:react-native-gradle-plugin") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") + } +} + +apply plugin: "com.facebook.react.rootproject" + +subprojects { + project.configurations.all { + exclude group: "com.android.support" + resolutionStrategy { + force "com.facebook.react:hermes-engine:0.82.1" // Force Hermes version + } + } +} + +subprojects { + configurations.all { + resolutionStrategy.eachDependency { details -> + if (details.requested.group == 'com.google.android.gms') { + if (details.requested.name == 'play-services-location') { + details.useVersion "21.0.1" + } + } + } + } +} \ No newline at end of file diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..256d563 --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,56 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m + +org.gradle.jvmargs=-Xmx4096m -XX:+UseParallelGC +org.gradle.caching=true +org.gradle.parallel=true +org.gradle.configureondemand=true + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true + +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true + +android.enableJetifier=false + +# Use this property to specify which architecture you want to build. +# You can also override it from the CLI using +# ./gradlew -PreactNativeArchitectures=x86_64 +# reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 + +# Use this property to enable support to the new architecture. +# This will allow you to use TurboModules and the Fabric render in +# your application. You should enable this flag either if you want +# to write custom TurboModules/Fabric components OR use libraries that +# are providing them. +newArchEnabled=true + +# Use this property to enable or disable the Hermes JS engine. +# If set to false, you will be using JSC instead. +hermesEnabled=true + +# Use this property to enable edge-to-edge display support. +# This allows your app to draw behind system bars for an immersive UI. +# Note: Only works with ReactActivity and should not be used with custom Activity. +edgeToEdgeEnabled=false + +reactNativeArchitectures=armeabi-v7a,arm64-v8a + + + diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..8bdaf60 Binary files /dev/null and b/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..2a84e18 --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/android/gradlew b/android/gradlew new file mode 100644 index 0000000..ef07e01 --- /dev/null +++ b/android/gradlew @@ -0,0 +1,251 @@ +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH="\\\"\\\"" + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/android/gradlew.bat b/android/gradlew.bat new file mode 100644 index 0000000..dd2b8ee --- /dev/null +++ b/android/gradlew.bat @@ -0,0 +1,99 @@ +@REM Copyright (c) Meta Platforms, Inc. and affiliates. +@REM +@REM This source code is licensed under the MIT license found in the +@REM LICENSE file in the root directory of this source tree. + +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH= + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/android/settings.gradle b/android/settings.gradle new file mode 100644 index 0000000..eee63a2 --- /dev/null +++ b/android/settings.gradle @@ -0,0 +1,6 @@ +pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") } +plugins { id("com.facebook.react.settings") } +extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } +rootProject.name = 'PerformicsManager' +include ':app' +includeBuild('../node_modules/@react-native/gradle-plugin') diff --git a/app.json b/app.json new file mode 100644 index 0000000..116851e --- /dev/null +++ b/app.json @@ -0,0 +1,4 @@ +{ + "name": "PerformicsManager", + "displayName": "PerformicsManager" +} diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..a606b1c --- /dev/null +++ b/babel.config.js @@ -0,0 +1,20 @@ +module.exports = { + presets: ['module:@react-native/babel-preset'], + plugins: [ + ["react-native-worklets-core/plugin"], + [ + 'react-native-reanimated/plugin', + { + globals: ['__scanCodes', '_setGlobalConsole'], + } + ], + [ + "babel-plugin-inline-import", + { + "extensions": [".svg"], + "resolvePath": (path) => path + } + ], + ] +}; + diff --git a/index.js b/index.js new file mode 100644 index 0000000..7067641 --- /dev/null +++ b/index.js @@ -0,0 +1,9 @@ +/** + * @format + */ + +import { AppRegistry } from 'react-native'; +import App from './src/screens/App'; +import { name as appName } from './app.json'; + +AppRegistry.registerComponent(appName, () => App); diff --git a/ios/.xcode.env b/ios/.xcode.env new file mode 100644 index 0000000..3d5782c --- /dev/null +++ b/ios/.xcode.env @@ -0,0 +1,11 @@ +# This `.xcode.env` file is versioned and is used to source the environment +# used when running script phases inside Xcode. +# To customize your local environment, you can create an `.xcode.env.local` +# file that is not versioned. + +# NODE_BINARY variable contains the PATH to the node executable. +# +# Customize the NODE_BINARY variable here. +# For example, to use nvm with brew, add the following line +# . "$(brew --prefix nvm)/nvm.sh" --no-use +export NODE_BINARY=$(command -v node) diff --git a/ios/PerformicsLogo.png b/ios/PerformicsLogo.png new file mode 100644 index 0000000..1d072e2 Binary files /dev/null and b/ios/PerformicsLogo.png differ diff --git a/ios/PerformicsManager.xcodeproj/project.pbxproj b/ios/PerformicsManager.xcodeproj/project.pbxproj new file mode 100644 index 0000000..2bb8bb4 --- /dev/null +++ b/ios/PerformicsManager.xcodeproj/project.pbxproj @@ -0,0 +1,480 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 0C80B921A6F3F58F76C31292 /* libPods-PerformicsManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-PerformicsManager.a */; }; + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; + 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; }; + 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; + DB748B468423950FE254B658 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 13B07F961A680F5B00A75B9A /* PerformicsManager.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PerformicsManager.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = PerformicsManager/Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = PerformicsManager/Info.plist; sourceTree = ""; }; + 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = PerformicsManager/PrivacyInfo.xcprivacy; sourceTree = ""; }; + 3B4392A12AC88292D35C810B /* Pods-PerformicsManager.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PerformicsManager.debug.xcconfig"; path = "Target Support Files/Pods-PerformicsManager/Pods-PerformicsManager.debug.xcconfig"; sourceTree = ""; }; + 5709B34CF0A7D63546082F79 /* Pods-PerformicsManager.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PerformicsManager.release.xcconfig"; path = "Target Support Files/Pods-PerformicsManager/Pods-PerformicsManager.release.xcconfig"; sourceTree = ""; }; + 5DCACB8F33CDC322A6C60F78 /* libPods-PerformicsManager.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PerformicsManager.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = PerformicsManager/AppDelegate.swift; sourceTree = ""; }; + 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = PerformicsManager/LaunchScreen.storyboard; sourceTree = ""; }; + ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0C80B921A6F3F58F76C31292 /* libPods-PerformicsManager.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 13B07FAE1A68108700A75B9A /* PerformicsManager */ = { + isa = PBXGroup; + children = ( + 13B07FB51A68108700A75B9A /* Images.xcassets */, + 761780EC2CA45674006654EE /* AppDelegate.swift */, + 13B07FB61A68108700A75B9A /* Info.plist */, + 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, + 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */, + ); + name = PerformicsManager; + sourceTree = ""; + }; + 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { + isa = PBXGroup; + children = ( + ED297162215061F000B7C4FE /* JavaScriptCore.framework */, + 5DCACB8F33CDC322A6C60F78 /* libPods-PerformicsManager.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 832341AE1AAA6A7D00B99B32 /* Libraries */ = { + isa = PBXGroup; + children = ( + ); + name = Libraries; + sourceTree = ""; + }; + 83CBB9F61A601CBA00E9B192 = { + isa = PBXGroup; + children = ( + 13B07FAE1A68108700A75B9A /* PerformicsManager */, + 832341AE1AAA6A7D00B99B32 /* Libraries */, + 83CBBA001A601CBA00E9B192 /* Products */, + 2D16E6871FA4F8E400B85C8A /* Frameworks */, + BBD78D7AC51CEA395F1C20DB /* Pods */, + ); + indentWidth = 2; + sourceTree = ""; + tabWidth = 2; + usesTabs = 0; + }; + 83CBBA001A601CBA00E9B192 /* Products */ = { + isa = PBXGroup; + children = ( + 13B07F961A680F5B00A75B9A /* PerformicsManager.app */, + ); + name = Products; + sourceTree = ""; + }; + BBD78D7AC51CEA395F1C20DB /* Pods */ = { + isa = PBXGroup; + children = ( + 3B4392A12AC88292D35C810B /* Pods-PerformicsManager.debug.xcconfig */, + 5709B34CF0A7D63546082F79 /* Pods-PerformicsManager.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 13B07F861A680F5B00A75B9A /* PerformicsManager */ = { + isa = PBXNativeTarget; + buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "PerformicsManager" */; + buildPhases = ( + C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, + 13B07F871A680F5B00A75B9A /* Sources */, + 13B07F8C1A680F5B00A75B9A /* Frameworks */, + 13B07F8E1A680F5B00A75B9A /* Resources */, + 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, + 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, + E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PerformicsManager; + productName = PerformicsManager; + productReference = 13B07F961A680F5B00A75B9A /* PerformicsManager.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 83CBB9F71A601CBA00E9B192 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1210; + TargetAttributes = { + 13B07F861A680F5B00A75B9A = { + LastSwiftMigration = 1120; + }; + }; + }; + buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "PerformicsManager" */; + compatibilityVersion = "Xcode 12.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 83CBB9F61A601CBA00E9B192; + productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 13B07F861A680F5B00A75B9A /* PerformicsManager */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 13B07F8E1A680F5B00A75B9A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, + DB748B468423950FE254B658 /* PrivacyInfo.xcprivacy in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/.xcode.env.local", + "$(SRCROOT)/.xcode.env", + ); + name = "Bundle React Native code and images"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; + }; + 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-PerformicsManager/Pods-PerformicsManager-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-PerformicsManager/Pods-PerformicsManager-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PerformicsManager/Pods-PerformicsManager-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-PerformicsManager-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-PerformicsManager/Pods-PerformicsManager-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-PerformicsManager/Pods-PerformicsManager-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PerformicsManager/Pods-PerformicsManager-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 13B07F871A680F5B00A75B9A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 13B07F941A680F5B00A75B9A /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-PerformicsManager.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = 3; + DEVELOPMENT_TEAM = JGDHGNH9XY; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = PerformicsManager/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.1.1; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.cpmindiait.PerformicsManager; + PRODUCT_NAME = PerformicsManager; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 13B07F951A680F5B00A75B9A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-PerformicsManager.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = 3; + DEVELOPMENT_TEAM = JGDHGNH9XY; + INFOPLIST_FILE = PerformicsManager/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.1.1; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.cpmindiait.PerformicsManager; + PRODUCT_NAME = PerformicsManager; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; + 83CBBA201A601CBA00E9B192 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; + 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; + 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_SYMBOLS_PRIVATE_EXTERN = NO; + 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 = 15.1; + LD_RUNPATH_SEARCH_PATHS = ( + /usr/lib/swift, + "$(inherited)", + ); + LIBRARY_SEARCH_PATHS = ( + "\"$(SDKROOT)/usr/lib/swift\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + OTHER_CPLUSPLUSFLAGS = ( + "$(OTHER_CFLAGS)", + "-DFOLLY_NO_CONFIG", + "-DFOLLY_MOBILE=1", + "-DFOLLY_USE_LIBCPP=1", + "-DFOLLY_CFG_NO_COROUTINES=1", + "-DFOLLY_HAVE_CLOCK_GETTIME=1", + ); + REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; + USE_HERMES = true; + }; + name = Debug; + }; + 83CBBA211A601CBA00E9B192 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; + 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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 = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; + 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 = 15.1; + LD_RUNPATH_SEARCH_PATHS = ( + /usr/lib/swift, + "$(inherited)", + ); + LIBRARY_SEARCH_PATHS = ( + "\"$(SDKROOT)/usr/lib/swift\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_CPLUSPLUSFLAGS = ( + "$(OTHER_CFLAGS)", + "-DFOLLY_NO_CONFIG", + "-DFOLLY_MOBILE=1", + "-DFOLLY_USE_LIBCPP=1", + "-DFOLLY_CFG_NO_COROUTINES=1", + "-DFOLLY_HAVE_CLOCK_GETTIME=1", + ); + REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; + SDKROOT = iphoneos; + USE_HERMES = true; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "PerformicsManager" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 13B07F941A680F5B00A75B9A /* Debug */, + 13B07F951A680F5B00A75B9A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "PerformicsManager" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 83CBBA201A601CBA00E9B192 /* Debug */, + 83CBBA211A601CBA00E9B192 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; +} diff --git a/ios/PerformicsManager.xcodeproj/xcshareddata/xcschemes/PerformicsManager.xcscheme b/ios/PerformicsManager.xcodeproj/xcshareddata/xcschemes/PerformicsManager.xcscheme new file mode 100644 index 0000000..a44d989 --- /dev/null +++ b/ios/PerformicsManager.xcodeproj/xcshareddata/xcschemes/PerformicsManager.xcscheme @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/PerformicsManager.xcworkspace/contents.xcworkspacedata b/ios/PerformicsManager.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..f014da9 --- /dev/null +++ b/ios/PerformicsManager.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/ios/PerformicsManager/AppDelegate.swift b/ios/PerformicsManager/AppDelegate.swift new file mode 100644 index 0000000..312c4ee --- /dev/null +++ b/ios/PerformicsManager/AppDelegate.swift @@ -0,0 +1,48 @@ +import UIKit +import React +import React_RCTAppDelegate +import ReactAppDependencyProvider + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + var window: UIWindow? + + var reactNativeDelegate: ReactNativeDelegate? + var reactNativeFactory: RCTReactNativeFactory? + + func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil + ) -> Bool { + let delegate = ReactNativeDelegate() + let factory = RCTReactNativeFactory(delegate: delegate) + delegate.dependencyProvider = RCTAppDependencyProvider() + + reactNativeDelegate = delegate + reactNativeFactory = factory + + window = UIWindow(frame: UIScreen.main.bounds) + + factory.startReactNative( + withModuleName: "PerformicsManager", + in: window, + launchOptions: launchOptions + ) + + return true + } +} + +class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate { + override func sourceURL(for bridge: RCTBridge) -> URL? { + self.bundleURL() + } + + override func bundleURL() -> URL? { +#if DEBUG + RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") +#else + Bundle.main.url(forResource: "main", withExtension: "jsbundle") +#endif + } +} diff --git a/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/1024.png b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/1024.png new file mode 100644 index 0000000..ede1791 Binary files /dev/null and b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/1024.png differ diff --git a/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/120 1.png b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/120 1.png new file mode 100644 index 0000000..70b3c53 Binary files /dev/null and b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/120 1.png differ diff --git a/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/120.png b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/120.png new file mode 100644 index 0000000..70b3c53 Binary files /dev/null and b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/120.png differ diff --git a/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/180.png b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/180.png new file mode 100644 index 0000000..74d443f Binary files /dev/null and b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/180.png differ diff --git a/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/40.png b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/40.png new file mode 100644 index 0000000..3f103b6 Binary files /dev/null and b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/40.png differ diff --git a/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/58.png b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/58.png new file mode 100644 index 0000000..26404b1 Binary files /dev/null and b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/58.png differ diff --git a/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/60.png b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/60.png new file mode 100644 index 0000000..6b470d6 Binary files /dev/null and b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/60.png differ diff --git a/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/80.png b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/80.png new file mode 100644 index 0000000..759b2f2 Binary files /dev/null and b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/80.png differ diff --git a/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/87.png b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/87.png new file mode 100644 index 0000000..d122e7a Binary files /dev/null and b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/87.png differ diff --git a/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/Contents.json b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..ad54b31 --- /dev/null +++ b/ios/PerformicsManager/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,62 @@ +{ + "images" : [ + { + "filename" : "40.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "60.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "filename" : "58.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "87.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "80.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "120.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "filename" : "120 1.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "filename" : "180.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "filename" : "1024.png", + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/PerformicsManager/Images.xcassets/Contents.json b/ios/PerformicsManager/Images.xcassets/Contents.json new file mode 100644 index 0000000..2d92bd5 --- /dev/null +++ b/ios/PerformicsManager/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/PerformicsManager/Info.plist b/ios/PerformicsManager/Info.plist new file mode 100644 index 0000000..489f10b --- /dev/null +++ b/ios/PerformicsManager/Info.plist @@ -0,0 +1,135 @@ + + + + + CADisableMinimumFrameDurationOnPhone + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + PerformicsManager + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(MARKETING_VERSION) + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + LSRequiresIPhoneOS + + LSSupportsOpeningDocumentsInPlace + + NSAllowsLocalNetworking + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSAllowsLocalNetworking + + NSExceptionDomains + + https://cpminternal.parinaam.in + + NSExceptionAllowsInsecureHTTPLoads + + NSIncludesSubdomains + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + localhost + + NSExceptionAllowsInsecureHTTPLoads + + + + + NSAppleMusicUsageDescription + This app needs to access media library to get the audio files recorded by user, that can be shown in reports and share with your team. Only the app's data would be shared with your team. + NSCalendarsUsageDescription + This app needs access to calendars. Some functionalities are dependent on the calendar. Give Calendar permission to Performics to make app work perfectly + NSCameraUsageDescription + This app needs access to the camera to take photos. Performics will only use images captured through this app. No other images we will use. + NSDocumentsFolderUsageDescription + This app needs to access documents folder. Performics will store some app data files in documents folder and need to access it. Give document folder permission to Performics to make app work perfectly + NSFileProviderDomainUsageDescription + This app needs access to files. Performics will only use the file stored through this app. No other file will be accessed + NSLocationAlwaysAndWhenInUseUsageDescription + This app needs access to the location. Give location permission to Performics. Your location would only be shared with your team. + NSLocationWhenInUseUsageDescription + This app needs access to the location. Give location permission to Performics. Your location would only be shared with your team. + NSMicrophoneUsageDescription + This app needs to access microphone to record audio with user permission. Recorder will be used to record user's voice or for other smilar tasks . Give Performics permission to use your microphone. Your recordings would only be shared with your team. + NSPhotoLibraryAddUsageDescription + This app needs access to photos captured and stored using Performic's camera, so that it can be shown in reports generated. Your photos would only be shared with your team's head. + NSPhotoLibraryUsageDescription + This app needs access to photos captured using Performic's camera, so that it can be shown in reports generated. Your photos would only be shared with your team's head. + NSUbiquitousContainersUsageDescription + This app needs access to your iCloud Drive to import and manage files. + NSUbiquitousDocumentsUsageDescription + This app uses iCloud Drive to open and save your documents. + RCTNewArchEnabled + + UIAppFonts + + OpenSans-Bold.ttf + OpenSans-Regular.ttf + OpenSans-SemiBold.ttf + Roboto-Regular.ttf + Zocial.ttf + SimpleLineIcons.ttf + Octicons.ttf + MaterialIcons.ttf + MaterialCommunityIcons.ttf + Ionicons.ttf + Foundation.ttf + Fontisto.ttf + FontAwesome5_Solid.ttf + FontAwesome5_Regular.ttf + FontAwesome5_Brands.ttf + FontAwesome.ttf + Feather.ttf + EvilIcons.ttf + Entypo.ttf + AntDesign.ttf + + UIBackgroundModes + + remote-notification + fetch + + UIFileSharingEnabled + + UILaunchScreen + + UIImageName + LaunchImage + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + WKJavaScriptEnabled + + + diff --git a/ios/PerformicsManager/LaunchScreen.storyboard b/ios/PerformicsManager/LaunchScreen.storyboard new file mode 100644 index 0000000..b287e11 --- /dev/null +++ b/ios/PerformicsManager/LaunchScreen.storyboard @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ios/PerformicsManager/PrivacyInfo.xcprivacy b/ios/PerformicsManager/PrivacyInfo.xcprivacy new file mode 100644 index 0000000..0b556fa --- /dev/null +++ b/ios/PerformicsManager/PrivacyInfo.xcprivacy @@ -0,0 +1,49 @@ + + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + CA92.1 + C56D.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + C617.1 + 0A2A.1 + 3B52.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategorySystemBootTime + NSPrivacyAccessedAPITypeReasons + + 35F9.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryDiskSpace + NSPrivacyAccessedAPITypeReasons + + 85F4.1 + E174.1 + + + + NSPrivacyCollectedDataTypes + + NSPrivacyTracking + + + diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..02c0ffe --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,42 @@ +# Resolve react_native_pods.rb with node to allow for hoisting +require Pod::Executable.execute_command('node', ['-p', + 'require.resolve( + "react-native/scripts/react_native_pods.rb", + {paths: [process.argv[1]]}, + )', __dir__]).strip + +platform :ios, '18' +prepare_react_native_project! + +begin + permissions_path = Pod::Executable.execute_command('node', ['-p', 'require.resolve("react-native-permissions/scripts/setup.rb", {paths: [process.argv[1]]})', __dir__]).strip + require permissions_path + setup_permissions(['Calendars', 'Camera', 'LocationAccuracy', 'LocationAlways', 'LocationWhenInUse', 'MediaLibrary', 'Microphone', 'PhotoLibrary', 'PhotoLibraryAddOnly']) +rescue => e + Pod::UI.warn "react-native-permissions setup failed: #{e.message}" +end + +linkage = ENV['USE_FRAMEWORKS'] +if linkage != nil + Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green + use_frameworks! :linkage => linkage.to_sym +end + +target 'PerformicsManager' do + config = use_native_modules! + + use_react_native!( + :path => config[:reactNativePath], + # An absolute path to your application root. + :app_path => "#{Pod::Config.instance.installation_root}/.." + ) + + post_install do |installer| + react_native_post_install( + installer, + config[:reactNativePath], + :mac_catalyst_enabled => false, + # :ccache_enabled => true + ) + end +end diff --git a/ios/Podfile.lock b/ios/Podfile.lock new file mode 100644 index 0000000..78861fb --- /dev/null +++ b/ios/Podfile.lock @@ -0,0 +1,3828 @@ +PODS: + - BEMCheckBox (1.4.1) + - boost (1.84.0) + - BVLinearGradient (2.8.3): + - React-Core + - DoubleConversion (1.1.6) + - fast_float (8.0.0) + - FBLazyVector (0.82.1) + - fmt (11.0.2) + - glog (0.3.5) + - GoogleDataTransport (10.1.0): + - nanopb (~> 3.30910.0) + - PromisesObjC (~> 2.4) + - GoogleMLKit/FaceDetection (8.0.0): + - GoogleMLKit/MLKitCore + - MLKitFaceDetection (~> 7.0.0) + - GoogleMLKit/MLKitCore (8.0.0): + - MLKitCommon (~> 13.0.0) + - GoogleToolboxForMac/Defines (4.2.1) + - GoogleToolboxForMac/Logger (4.2.1): + - GoogleToolboxForMac/Defines (= 4.2.1) + - "GoogleToolboxForMac/NSData+zlib (4.2.1)": + - GoogleToolboxForMac/Defines (= 4.2.1) + - GoogleUtilities/Environment (8.1.0): + - GoogleUtilities/Privacy + - GoogleUtilities/Logger (8.1.0): + - GoogleUtilities/Environment + - GoogleUtilities/Privacy + - GoogleUtilities/Privacy (8.1.0) + - GoogleUtilities/UserDefaults (8.1.0): + - GoogleUtilities/Logger + - GoogleUtilities/Privacy + - GTMSessionFetcher/Core (3.5.0) + - hermes-engine (0.82.1): + - hermes-engine/Pre-built (= 0.82.1) + - hermes-engine/Pre-built (0.82.1) + - MLImage (1.0.0-beta7) + - MLKitCommon (13.0.0): + - GoogleDataTransport (~> 10.0) + - GoogleToolboxForMac/Logger (< 5.0, >= 4.2.1) + - "GoogleToolboxForMac/NSData+zlib (< 5.0, >= 4.2.1)" + - GoogleUtilities/Logger (~> 8.0) + - GoogleUtilities/UserDefaults (~> 8.0) + - GTMSessionFetcher/Core (< 4.0, >= 3.3.2) + - MLKitFaceDetection (7.0.0): + - MLKitCommon (~> 13.0) + - MLKitVision (~> 9.0) + - MLKitVision (9.0.0): + - GoogleToolboxForMac/Logger (< 5.0, >= 4.2.1) + - "GoogleToolboxForMac/NSData+zlib (< 5.0, >= 4.2.1)" + - GTMSessionFetcher/Core (< 4.0, >= 3.3.2) + - MLImage (= 1.0.0-beta7) + - MLKitCommon (~> 13.0) + - nanopb (3.30910.0): + - nanopb/decode (= 3.30910.0) + - nanopb/encode (= 3.30910.0) + - nanopb/decode (3.30910.0) + - nanopb/encode (3.30910.0) + - PromisesObjC (2.4.0) + - RCT-Folly (2024.11.18.00): + - boost + - DoubleConversion + - fast_float (= 8.0.0) + - fmt (= 11.0.2) + - glog + - RCT-Folly/Default (= 2024.11.18.00) + - RCT-Folly/Default (2024.11.18.00): + - boost + - DoubleConversion + - fast_float (= 8.0.0) + - fmt (= 11.0.2) + - glog + - RCT-Folly/Fabric (2024.11.18.00): + - boost + - DoubleConversion + - fast_float (= 8.0.0) + - fmt (= 11.0.2) + - glog + - RCTDeprecation (0.82.1) + - RCTRequired (0.82.1) + - RCTTypeSafety (0.82.1): + - FBLazyVector (= 0.82.1) + - RCTRequired (= 0.82.1) + - React-Core (= 0.82.1) + - React (0.82.1): + - React-Core (= 0.82.1) + - React-Core/DevSupport (= 0.82.1) + - React-Core/RCTWebSocket (= 0.82.1) + - React-RCTActionSheet (= 0.82.1) + - React-RCTAnimation (= 0.82.1) + - React-RCTBlob (= 0.82.1) + - React-RCTImage (= 0.82.1) + - React-RCTLinking (= 0.82.1) + - React-RCTNetwork (= 0.82.1) + - React-RCTSettings (= 0.82.1) + - React-RCTText (= 0.82.1) + - React-RCTVibration (= 0.82.1) + - React-callinvoker (0.82.1) + - React-Codegen (0.1.0) + - React-Core (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default (= 0.82.1) + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/CoreModulesHeaders (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/Default (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/DevSupport (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default (= 0.82.1) + - React-Core/RCTWebSocket (= 0.82.1) + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTActionSheetHeaders (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTAnimationHeaders (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTBlobHeaders (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTImageHeaders (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTLinkingHeaders (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTNetworkHeaders (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTSettingsHeaders (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTTextHeaders (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTVibrationHeaders (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTWebSocket (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default (= 0.82.1) + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-CoreModules (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - RCTTypeSafety (= 0.82.1) + - React-Core/CoreModulesHeaders (= 0.82.1) + - React-debug + - React-jsi (= 0.82.1) + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-NativeModulesApple + - React-RCTBlob + - React-RCTFBReactNativeSpec + - React-RCTImage (= 0.82.1) + - React-runtimeexecutor + - ReactCommon + - SocketRocket + - React-cxxreact (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-callinvoker (= 0.82.1) + - React-debug (= 0.82.1) + - React-jsi (= 0.82.1) + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-logger (= 0.82.1) + - React-perflogger (= 0.82.1) + - React-runtimeexecutor + - React-timing (= 0.82.1) + - SocketRocket + - React-debug (0.82.1) + - React-defaultsnativemodule (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-domnativemodule + - React-featureflagsnativemodule + - React-idlecallbacksnativemodule + - React-jsi + - React-jsiexecutor + - React-microtasksnativemodule + - React-RCTFBReactNativeSpec + - React-webperformancenativemodule + - SocketRocket + - React-domnativemodule (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-Fabric + - React-Fabric/bridging + - React-FabricComponents + - React-graphics + - React-jsi + - React-jsiexecutor + - React-RCTFBReactNativeSpec + - React-runtimeexecutor + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-Fabric (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric/animations (= 0.82.1) + - React-Fabric/attributedstring (= 0.82.1) + - React-Fabric/bridging (= 0.82.1) + - React-Fabric/componentregistry (= 0.82.1) + - React-Fabric/componentregistrynative (= 0.82.1) + - React-Fabric/components (= 0.82.1) + - React-Fabric/consistency (= 0.82.1) + - React-Fabric/core (= 0.82.1) + - React-Fabric/dom (= 0.82.1) + - React-Fabric/imagemanager (= 0.82.1) + - React-Fabric/leakchecker (= 0.82.1) + - React-Fabric/mounting (= 0.82.1) + - React-Fabric/observers (= 0.82.1) + - React-Fabric/scheduler (= 0.82.1) + - React-Fabric/telemetry (= 0.82.1) + - React-Fabric/templateprocessor (= 0.82.1) + - React-Fabric/uimanager (= 0.82.1) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/animations (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/attributedstring (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/bridging (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/componentregistry (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/componentregistrynative (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/components (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric/components/legacyviewmanagerinterop (= 0.82.1) + - React-Fabric/components/root (= 0.82.1) + - React-Fabric/components/scrollview (= 0.82.1) + - React-Fabric/components/view (= 0.82.1) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/components/legacyviewmanagerinterop (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/components/root (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/components/scrollview (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/components/view (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-renderercss + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-Fabric/consistency (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/core (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/dom (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/imagemanager (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/leakchecker (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/mounting (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/observers (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric/observers/events (= 0.82.1) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/observers/events (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/scheduler (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric/observers/events + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-performancecdpmetrics + - React-performancetimeline + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/telemetry (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/templateprocessor (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/uimanager (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric/uimanager/consistency (= 0.82.1) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererconsistency + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/uimanager/consistency (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererconsistency + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-FabricComponents (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-FabricComponents/components (= 0.82.1) + - React-FabricComponents/textlayoutmanager (= 0.82.1) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-FabricComponents/components/inputaccessory (= 0.82.1) + - React-FabricComponents/components/iostextinput (= 0.82.1) + - React-FabricComponents/components/modal (= 0.82.1) + - React-FabricComponents/components/rncore (= 0.82.1) + - React-FabricComponents/components/safeareaview (= 0.82.1) + - React-FabricComponents/components/scrollview (= 0.82.1) + - React-FabricComponents/components/switch (= 0.82.1) + - React-FabricComponents/components/text (= 0.82.1) + - React-FabricComponents/components/textinput (= 0.82.1) + - React-FabricComponents/components/unimplementedview (= 0.82.1) + - React-FabricComponents/components/virtualview (= 0.82.1) + - React-FabricComponents/components/virtualviewexperimental (= 0.82.1) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/inputaccessory (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/iostextinput (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/modal (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/rncore (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/safeareaview (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/scrollview (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/switch (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/text (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/textinput (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/unimplementedview (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/virtualview (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/virtualviewexperimental (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/textlayoutmanager (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricImage (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired (= 0.82.1) + - RCTTypeSafety (= 0.82.1) + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-jsiexecutor (= 0.82.1) + - React-logger + - React-rendererdebug + - React-utils + - ReactCommon + - SocketRocket + - Yoga + - React-featureflags (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - SocketRocket + - React-featureflagsnativemodule (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-featureflags + - React-jsi + - React-jsiexecutor + - React-RCTFBReactNativeSpec + - ReactCommon/turbomodule/core + - SocketRocket + - React-graphics (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-jsi + - React-jsiexecutor + - React-utils + - SocketRocket + - React-hermes (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-cxxreact (= 0.82.1) + - React-jsi + - React-jsiexecutor (= 0.82.1) + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-oscompat + - React-perflogger (= 0.82.1) + - React-runtimeexecutor + - SocketRocket + - React-idlecallbacksnativemodule (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-jsi + - React-jsiexecutor + - React-RCTFBReactNativeSpec + - React-runtimeexecutor + - React-runtimescheduler + - ReactCommon/turbomodule/core + - SocketRocket + - React-ImageManager (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-Core/Default + - React-debug + - React-Fabric + - React-graphics + - React-rendererdebug + - React-utils + - SocketRocket + - React-jserrorhandler (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-cxxreact + - React-debug + - React-featureflags + - React-jsi + - ReactCommon/turbomodule/bridging + - SocketRocket + - React-jsi (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - SocketRocket + - React-jsiexecutor (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-cxxreact + - React-debug + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-perflogger + - React-runtimeexecutor + - SocketRocket + - React-jsinspector (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-featureflags + - React-jsi + - React-jsinspectorcdp + - React-jsinspectornetwork + - React-jsinspectortracing + - React-oscompat + - React-perflogger (= 0.82.1) + - React-runtimeexecutor + - SocketRocket + - React-jsinspectorcdp (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - SocketRocket + - React-jsinspectornetwork (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-featureflags + - React-jsinspectorcdp + - React-performancetimeline + - React-timing + - SocketRocket + - React-jsinspectortracing (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-oscompat + - React-timing + - SocketRocket + - React-jsitooling (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-cxxreact (= 0.82.1) + - React-debug + - React-jsi (= 0.82.1) + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-runtimeexecutor + - SocketRocket + - React-jsitracing (0.82.1): + - React-jsi + - React-logger (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - SocketRocket + - React-Mapbuffer (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-debug + - SocketRocket + - React-microtasksnativemodule (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-jsi + - React-jsiexecutor + - React-RCTFBReactNativeSpec + - ReactCommon/turbomodule/core + - SocketRocket + - react-native-blob-util (0.22.2): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - react-native-document-picker (11.0.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - react-native-geolocation (3.4.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - react-native-geolocation-service (5.3.1): + - React + - react-native-image-marker (1.2.9): + - RCT-Folly + - RCTRequired + - RCTTypeSafety + - React-Codegen + - React-Core + - ReactCommon/turbomodule/core + - react-native-image-picker (8.2.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - react-native-image-resizer (1.4.5): + - React-Core + - react-native-maps (1.26.18): + - react-native-maps/Maps (= 1.26.18) + - react-native-maps/Generated (1.26.18): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - react-native-maps/Maps (1.26.18): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - react-native-maps/Generated + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - react-native-netinfo (11.4.1): + - React-Core + - react-native-orientation-locker (1.7.0): + - React-Core + - react-native-safe-area-context (5.6.2): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - react-native-safe-area-context/common (= 5.6.2) + - react-native-safe-area-context/fabric (= 5.6.2) + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - react-native-safe-area-context/common (5.6.2): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - react-native-safe-area-context/fabric (5.6.2): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - react-native-safe-area-context/common + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - react-native-splash-screen (3.3.0): + - React-Core + - react-native-sqlite-2 (3.6.2): + - React-Core + - react-native-version-check (3.5.0): + - React-Core + - react-native-video (6.18.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - react-native-video/Video (= 6.18.0) + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - react-native-video/Fabric (6.18.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - react-native-video/Video (6.18.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - react-native-video/Fabric + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - react-native-view-shot (4.0.3): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - react-native-webview (13.16.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - react-native-worklets-core (1.6.2): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-NativeModulesApple (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-callinvoker + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-runtimeexecutor + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - React-oscompat (0.82.1) + - React-perflogger (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - SocketRocket + - React-performancecdpmetrics (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-jsi + - React-performancetimeline + - React-runtimeexecutor + - React-timing + - SocketRocket + - React-performancetimeline (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-featureflags + - React-jsinspectortracing + - React-perflogger + - React-timing + - SocketRocket + - React-RCTActionSheet (0.82.1): + - React-Core/RCTActionSheetHeaders (= 0.82.1) + - React-RCTAnimation (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - RCTTypeSafety + - React-Core/RCTAnimationHeaders + - React-featureflags + - React-jsi + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - ReactCommon + - SocketRocket + - React-RCTAppDelegate (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-CoreModules + - React-debug + - React-defaultsnativemodule + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-jsitooling + - React-NativeModulesApple + - React-RCTFabric + - React-RCTFBReactNativeSpec + - React-RCTImage + - React-RCTNetwork + - React-RCTRuntime + - React-rendererdebug + - React-RuntimeApple + - React-RuntimeCore + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon + - SocketRocket + - React-RCTBlob (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-Core/RCTBlobHeaders + - React-Core/RCTWebSocket + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - React-RCTNetwork + - ReactCommon + - SocketRocket + - React-RCTFabric (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-Core + - React-debug + - React-Fabric + - React-FabricComponents + - React-FabricImage + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectornetwork + - React-jsinspectortracing + - React-performancecdpmetrics + - React-performancetimeline + - React-RCTAnimation + - React-RCTFBReactNativeSpec + - React-RCTImage + - React-RCTText + - React-rendererconsistency + - React-renderercss + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-RCTFBReactNativeSpec (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-jsi + - React-NativeModulesApple + - React-RCTFBReactNativeSpec/components (= 0.82.1) + - ReactCommon + - SocketRocket + - React-RCTFBReactNativeSpec/components (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-NativeModulesApple + - React-rendererdebug + - React-utils + - ReactCommon + - SocketRocket + - Yoga + - React-RCTImage (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - RCTTypeSafety + - React-Core/RCTImageHeaders + - React-jsi + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - React-RCTNetwork + - ReactCommon + - SocketRocket + - React-RCTLinking (0.82.1): + - React-Core/RCTLinkingHeaders (= 0.82.1) + - React-jsi (= 0.82.1) + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - ReactCommon + - ReactCommon/turbomodule/core (= 0.82.1) + - React-RCTNetwork (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - RCTTypeSafety + - React-Core/RCTNetworkHeaders + - React-debug + - React-featureflags + - React-jsi + - React-jsinspectorcdp + - React-jsinspectornetwork + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - ReactCommon + - SocketRocket + - React-RCTRuntime (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-Core + - React-debug + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-jsitooling + - React-RuntimeApple + - React-RuntimeCore + - React-runtimeexecutor + - React-RuntimeHermes + - SocketRocket + - React-RCTSettings (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - RCTTypeSafety + - React-Core/RCTSettingsHeaders + - React-jsi + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - ReactCommon + - SocketRocket + - React-RCTText (0.82.1): + - React-Core/RCTTextHeaders (= 0.82.1) + - Yoga + - React-RCTVibration (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-Core/RCTVibrationHeaders + - React-jsi + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - ReactCommon + - SocketRocket + - React-rendererconsistency (0.82.1) + - React-renderercss (0.82.1): + - React-debug + - React-utils + - React-rendererdebug (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-debug + - SocketRocket + - React-RuntimeApple (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-callinvoker + - React-Core/Default + - React-CoreModules + - React-cxxreact + - React-featureflags + - React-jserrorhandler + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsitooling + - React-Mapbuffer + - React-NativeModulesApple + - React-RCTFabric + - React-RCTFBReactNativeSpec + - React-RuntimeCore + - React-runtimeexecutor + - React-RuntimeHermes + - React-runtimescheduler + - React-utils + - SocketRocket + - React-RuntimeCore (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-cxxreact + - React-Fabric + - React-featureflags + - React-jserrorhandler + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsitooling + - React-performancetimeline + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - React-runtimeexecutor (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-debug + - React-featureflags + - React-jsi (= 0.82.1) + - React-utils + - SocketRocket + - React-RuntimeHermes (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-featureflags + - React-hermes + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-jsitooling + - React-jsitracing + - React-RuntimeCore + - React-runtimeexecutor + - React-utils + - SocketRocket + - React-runtimescheduler (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-callinvoker + - React-cxxreact + - React-debug + - React-featureflags + - React-jsi + - React-jsinspectortracing + - React-performancetimeline + - React-rendererconsistency + - React-rendererdebug + - React-runtimeexecutor + - React-timing + - React-utils + - SocketRocket + - React-timing (0.82.1): + - React-debug + - React-utils (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-debug + - React-jsi (= 0.82.1) + - SocketRocket + - React-webperformancenativemodule (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-jsi + - React-jsiexecutor + - React-performancetimeline + - React-RCTFBReactNativeSpec + - React-runtimeexecutor + - ReactCommon/turbomodule/core + - SocketRocket + - ReactAppDependencyProvider (0.82.1): + - ReactCodegen + - ReactCodegen (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-FabricImage + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-NativeModulesApple + - React-RCTAppDelegate + - React-rendererdebug + - React-utils + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - ReactCommon (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - ReactCommon/turbomodule (= 0.82.1) + - SocketRocket + - ReactCommon/turbomodule (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-callinvoker (= 0.82.1) + - React-cxxreact (= 0.82.1) + - React-jsi (= 0.82.1) + - React-logger (= 0.82.1) + - React-perflogger (= 0.82.1) + - ReactCommon/turbomodule/bridging (= 0.82.1) + - ReactCommon/turbomodule/core (= 0.82.1) + - SocketRocket + - ReactCommon/turbomodule/bridging (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-callinvoker (= 0.82.1) + - React-cxxreact (= 0.82.1) + - React-jsi (= 0.82.1) + - React-logger (= 0.82.1) + - React-perflogger (= 0.82.1) + - SocketRocket + - ReactCommon/turbomodule/core (0.82.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-callinvoker (= 0.82.1) + - React-cxxreact (= 0.82.1) + - React-debug (= 0.82.1) + - React-featureflags (= 0.82.1) + - React-jsi (= 0.82.1) + - React-logger (= 0.82.1) + - React-perflogger (= 0.82.1) + - React-utils (= 0.82.1) + - SocketRocket + - RNCAsyncStorage (2.2.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - RNCCheckbox (0.5.20): + - BEMCheckBox (~> 1.4) + - React-Core + - RNCClipboard (1.16.3): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - RNDateTimePicker (8.5.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - RNDeviceInfo (15.0.1): + - React-Core + - RNFileViewer (2.1.5): + - React-Core + - RNFS (2.20.0): + - React-Core + - RNGestureHandler (2.29.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - RNKeychain (9.2.3): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - RNPermissions (5.4.4): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - RNReanimated (4.1.5): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - RNReanimated/reanimated (= 4.1.5) + - RNWorklets + - SocketRocket + - Yoga + - RNReanimated/reanimated (4.1.5): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - RNReanimated/reanimated/apple (= 4.1.5) + - RNWorklets + - SocketRocket + - Yoga + - RNReanimated/reanimated/apple (4.1.5): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - RNWorklets + - SocketRocket + - Yoga + - RNScreens (4.18.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-RCTImage + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - RNScreens/common (= 4.18.0) + - SocketRocket + - Yoga + - RNScreens/common (4.18.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-RCTImage + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - RNSnackbar (2.9.0): + - React-Core + - RNSVG (15.15.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - RNSVG/common (= 15.15.0) + - SocketRocket + - Yoga + - RNSVG/common (15.15.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - RNVectorIcons (10.3.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - RNWorklets (0.6.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - RNWorklets/worklets (= 0.6.1) + - SocketRocket + - Yoga + - RNWorklets/worklets (0.6.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - RNWorklets/worklets/apple (= 0.6.1) + - SocketRocket + - Yoga + - RNWorklets/worklets/apple (0.6.1): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - SocketRocket (0.7.1) + - VisionCamera (4.7.3): + - VisionCamera/Core (= 4.7.3) + - VisionCamera/FrameProcessors (= 4.7.3) + - VisionCamera/React (= 4.7.3) + - VisionCamera/Core (4.7.3) + - VisionCamera/FrameProcessors (4.7.3): + - React + - React-callinvoker + - react-native-worklets-core + - VisionCamera/React (4.7.3): + - React-Core + - VisionCamera/FrameProcessors + - VisionCameraFaceDetector (1.9.1): + - GoogleMLKit/FaceDetection (= 8.0.0) + - React-Core + - VisionCamera + - Yoga (0.0.0) + +DEPENDENCIES: + - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) + - BVLinearGradient (from `../node_modules/react-native-linear-gradient`) + - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) + - fast_float (from `../node_modules/react-native/third-party-podspecs/fast_float.podspec`) + - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) + - fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`) + - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) + - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) + - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) + - RCTDeprecation (from `../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation`) + - RCTRequired (from `../node_modules/react-native/Libraries/Required`) + - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) + - React (from `../node_modules/react-native/`) + - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) + - React-Core (from `../node_modules/react-native/`) + - React-Core/RCTWebSocket (from `../node_modules/react-native/`) + - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) + - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) + - React-debug (from `../node_modules/react-native/ReactCommon/react/debug`) + - React-defaultsnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/defaults`) + - React-domnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/dom`) + - React-Fabric (from `../node_modules/react-native/ReactCommon`) + - React-FabricComponents (from `../node_modules/react-native/ReactCommon`) + - React-FabricImage (from `../node_modules/react-native/ReactCommon`) + - React-featureflags (from `../node_modules/react-native/ReactCommon/react/featureflags`) + - React-featureflagsnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/featureflags`) + - React-graphics (from `../node_modules/react-native/ReactCommon/react/renderer/graphics`) + - React-hermes (from `../node_modules/react-native/ReactCommon/hermes`) + - React-idlecallbacksnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/idlecallbacks`) + - React-ImageManager (from `../node_modules/react-native/ReactCommon/react/renderer/imagemanager/platform/ios`) + - React-jserrorhandler (from `../node_modules/react-native/ReactCommon/jserrorhandler`) + - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) + - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) + - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector-modern`) + - React-jsinspectorcdp (from `../node_modules/react-native/ReactCommon/jsinspector-modern/cdp`) + - React-jsinspectornetwork (from `../node_modules/react-native/ReactCommon/jsinspector-modern/network`) + - React-jsinspectortracing (from `../node_modules/react-native/ReactCommon/jsinspector-modern/tracing`) + - React-jsitooling (from `../node_modules/react-native/ReactCommon/jsitooling`) + - React-jsitracing (from `../node_modules/react-native/ReactCommon/hermes/executor/`) + - React-logger (from `../node_modules/react-native/ReactCommon/logger`) + - React-Mapbuffer (from `../node_modules/react-native/ReactCommon`) + - React-microtasksnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`) + - react-native-blob-util (from `../node_modules/react-native-blob-util`) + - "react-native-document-picker (from `../node_modules/@react-native-documents/picker`)" + - "react-native-geolocation (from `../node_modules/@react-native-community/geolocation`)" + - react-native-geolocation-service (from `../node_modules/react-native-geolocation-service`) + - react-native-image-marker (from `../node_modules/react-native-image-marker`) + - react-native-image-picker (from `../node_modules/react-native-image-picker`) + - react-native-image-resizer (from `../node_modules/react-native-image-resizer`) + - react-native-maps (from `../node_modules/react-native-maps`) + - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)" + - react-native-orientation-locker (from `../node_modules/react-native-orientation-locker`) + - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) + - react-native-splash-screen (from `../node_modules/react-native-splash-screen`) + - react-native-sqlite-2 (from `../node_modules/react-native-sqlite-2`) + - react-native-version-check (from `../node_modules/react-native-version-check`) + - react-native-video (from `../node_modules/react-native-video`) + - react-native-view-shot (from `../node_modules/react-native-view-shot`) + - react-native-webview (from `../node_modules/react-native-webview`) + - react-native-worklets-core (from `../node_modules/react-native-worklets-core`) + - React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`) + - React-oscompat (from `../node_modules/react-native/ReactCommon/oscompat`) + - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) + - React-performancecdpmetrics (from `../node_modules/react-native/ReactCommon/react/performance/cdpmetrics`) + - React-performancetimeline (from `../node_modules/react-native/ReactCommon/react/performance/timeline`) + - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) + - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) + - React-RCTAppDelegate (from `../node_modules/react-native/Libraries/AppDelegate`) + - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) + - React-RCTFabric (from `../node_modules/react-native/React`) + - React-RCTFBReactNativeSpec (from `../node_modules/react-native/React`) + - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) + - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) + - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) + - React-RCTRuntime (from `../node_modules/react-native/React/Runtime`) + - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) + - React-RCTText (from `../node_modules/react-native/Libraries/Text`) + - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) + - React-rendererconsistency (from `../node_modules/react-native/ReactCommon/react/renderer/consistency`) + - React-renderercss (from `../node_modules/react-native/ReactCommon/react/renderer/css`) + - React-rendererdebug (from `../node_modules/react-native/ReactCommon/react/renderer/debug`) + - React-RuntimeApple (from `../node_modules/react-native/ReactCommon/react/runtime/platform/ios`) + - React-RuntimeCore (from `../node_modules/react-native/ReactCommon/react/runtime`) + - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) + - React-RuntimeHermes (from `../node_modules/react-native/ReactCommon/react/runtime`) + - React-runtimescheduler (from `../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`) + - React-timing (from `../node_modules/react-native/ReactCommon/react/timing`) + - React-utils (from `../node_modules/react-native/ReactCommon/react/utils`) + - React-webperformancenativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/webperformance`) + - ReactAppDependencyProvider (from `build/generated/ios`) + - ReactCodegen (from `build/generated/ios`) + - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) + - "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)" + - "RNCCheckbox (from `../node_modules/@react-native-community/checkbox`)" + - "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)" + - "RNDateTimePicker (from `../node_modules/@react-native-community/datetimepicker`)" + - RNDeviceInfo (from `../node_modules/react-native-device-info`) + - RNFileViewer (from `../node_modules/react-native-file-viewer`) + - RNFS (from `../node_modules/react-native-fs`) + - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) + - RNKeychain (from `../node_modules/react-native-keychain`) + - RNPermissions (from `../node_modules/react-native-permissions`) + - RNReanimated (from `../node_modules/react-native-reanimated`) + - RNScreens (from `../node_modules/react-native-screens`) + - RNSnackbar (from `../node_modules/react-native-snackbar`) + - RNSVG (from `../node_modules/react-native-svg`) + - RNVectorIcons (from `../node_modules/react-native-vector-icons`) + - RNWorklets (from `../node_modules/react-native-worklets`) + - SocketRocket (~> 0.7.1) + - VisionCamera (from `../node_modules/react-native-vision-camera`) + - VisionCameraFaceDetector (from `../node_modules/react-native-vision-camera-face-detector`) + - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) + +SPEC REPOS: + trunk: + - BEMCheckBox + - GoogleDataTransport + - GoogleMLKit + - GoogleToolboxForMac + - GoogleUtilities + - GTMSessionFetcher + - MLImage + - MLKitCommon + - MLKitFaceDetection + - MLKitVision + - nanopb + - PromisesObjC + - React-Codegen + - SocketRocket + +EXTERNAL SOURCES: + boost: + :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec" + BVLinearGradient: + :path: "../node_modules/react-native-linear-gradient" + DoubleConversion: + :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" + fast_float: + :podspec: "../node_modules/react-native/third-party-podspecs/fast_float.podspec" + FBLazyVector: + :path: "../node_modules/react-native/Libraries/FBLazyVector" + fmt: + :podspec: "../node_modules/react-native/third-party-podspecs/fmt.podspec" + glog: + :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" + hermes-engine: + :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" + :tag: hermes-2025-09-01-RNv0.82.0-265ef62ff3eb7289d17e366664ac0da82303e101 + RCT-Folly: + :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" + RCTDeprecation: + :path: "../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation" + RCTRequired: + :path: "../node_modules/react-native/Libraries/Required" + RCTTypeSafety: + :path: "../node_modules/react-native/Libraries/TypeSafety" + React: + :path: "../node_modules/react-native/" + React-callinvoker: + :path: "../node_modules/react-native/ReactCommon/callinvoker" + React-Core: + :path: "../node_modules/react-native/" + React-CoreModules: + :path: "../node_modules/react-native/React/CoreModules" + React-cxxreact: + :path: "../node_modules/react-native/ReactCommon/cxxreact" + React-debug: + :path: "../node_modules/react-native/ReactCommon/react/debug" + React-defaultsnativemodule: + :path: "../node_modules/react-native/ReactCommon/react/nativemodule/defaults" + React-domnativemodule: + :path: "../node_modules/react-native/ReactCommon/react/nativemodule/dom" + React-Fabric: + :path: "../node_modules/react-native/ReactCommon" + React-FabricComponents: + :path: "../node_modules/react-native/ReactCommon" + React-FabricImage: + :path: "../node_modules/react-native/ReactCommon" + React-featureflags: + :path: "../node_modules/react-native/ReactCommon/react/featureflags" + React-featureflagsnativemodule: + :path: "../node_modules/react-native/ReactCommon/react/nativemodule/featureflags" + React-graphics: + :path: "../node_modules/react-native/ReactCommon/react/renderer/graphics" + React-hermes: + :path: "../node_modules/react-native/ReactCommon/hermes" + React-idlecallbacksnativemodule: + :path: "../node_modules/react-native/ReactCommon/react/nativemodule/idlecallbacks" + React-ImageManager: + :path: "../node_modules/react-native/ReactCommon/react/renderer/imagemanager/platform/ios" + React-jserrorhandler: + :path: "../node_modules/react-native/ReactCommon/jserrorhandler" + React-jsi: + :path: "../node_modules/react-native/ReactCommon/jsi" + React-jsiexecutor: + :path: "../node_modules/react-native/ReactCommon/jsiexecutor" + React-jsinspector: + :path: "../node_modules/react-native/ReactCommon/jsinspector-modern" + React-jsinspectorcdp: + :path: "../node_modules/react-native/ReactCommon/jsinspector-modern/cdp" + React-jsinspectornetwork: + :path: "../node_modules/react-native/ReactCommon/jsinspector-modern/network" + React-jsinspectortracing: + :path: "../node_modules/react-native/ReactCommon/jsinspector-modern/tracing" + React-jsitooling: + :path: "../node_modules/react-native/ReactCommon/jsitooling" + React-jsitracing: + :path: "../node_modules/react-native/ReactCommon/hermes/executor/" + React-logger: + :path: "../node_modules/react-native/ReactCommon/logger" + React-Mapbuffer: + :path: "../node_modules/react-native/ReactCommon" + React-microtasksnativemodule: + :path: "../node_modules/react-native/ReactCommon/react/nativemodule/microtasks" + react-native-blob-util: + :path: "../node_modules/react-native-blob-util" + react-native-document-picker: + :path: "../node_modules/@react-native-documents/picker" + react-native-geolocation: + :path: "../node_modules/@react-native-community/geolocation" + react-native-geolocation-service: + :path: "../node_modules/react-native-geolocation-service" + react-native-image-marker: + :path: "../node_modules/react-native-image-marker" + react-native-image-picker: + :path: "../node_modules/react-native-image-picker" + react-native-image-resizer: + :path: "../node_modules/react-native-image-resizer" + react-native-maps: + :path: "../node_modules/react-native-maps" + react-native-netinfo: + :path: "../node_modules/@react-native-community/netinfo" + react-native-orientation-locker: + :path: "../node_modules/react-native-orientation-locker" + react-native-safe-area-context: + :path: "../node_modules/react-native-safe-area-context" + react-native-splash-screen: + :path: "../node_modules/react-native-splash-screen" + react-native-sqlite-2: + :path: "../node_modules/react-native-sqlite-2" + react-native-version-check: + :path: "../node_modules/react-native-version-check" + react-native-video: + :path: "../node_modules/react-native-video" + react-native-view-shot: + :path: "../node_modules/react-native-view-shot" + react-native-webview: + :path: "../node_modules/react-native-webview" + react-native-worklets-core: + :path: "../node_modules/react-native-worklets-core" + React-NativeModulesApple: + :path: "../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios" + React-oscompat: + :path: "../node_modules/react-native/ReactCommon/oscompat" + React-perflogger: + :path: "../node_modules/react-native/ReactCommon/reactperflogger" + React-performancecdpmetrics: + :path: "../node_modules/react-native/ReactCommon/react/performance/cdpmetrics" + React-performancetimeline: + :path: "../node_modules/react-native/ReactCommon/react/performance/timeline" + React-RCTActionSheet: + :path: "../node_modules/react-native/Libraries/ActionSheetIOS" + React-RCTAnimation: + :path: "../node_modules/react-native/Libraries/NativeAnimation" + React-RCTAppDelegate: + :path: "../node_modules/react-native/Libraries/AppDelegate" + React-RCTBlob: + :path: "../node_modules/react-native/Libraries/Blob" + React-RCTFabric: + :path: "../node_modules/react-native/React" + React-RCTFBReactNativeSpec: + :path: "../node_modules/react-native/React" + React-RCTImage: + :path: "../node_modules/react-native/Libraries/Image" + React-RCTLinking: + :path: "../node_modules/react-native/Libraries/LinkingIOS" + React-RCTNetwork: + :path: "../node_modules/react-native/Libraries/Network" + React-RCTRuntime: + :path: "../node_modules/react-native/React/Runtime" + React-RCTSettings: + :path: "../node_modules/react-native/Libraries/Settings" + React-RCTText: + :path: "../node_modules/react-native/Libraries/Text" + React-RCTVibration: + :path: "../node_modules/react-native/Libraries/Vibration" + React-rendererconsistency: + :path: "../node_modules/react-native/ReactCommon/react/renderer/consistency" + React-renderercss: + :path: "../node_modules/react-native/ReactCommon/react/renderer/css" + React-rendererdebug: + :path: "../node_modules/react-native/ReactCommon/react/renderer/debug" + React-RuntimeApple: + :path: "../node_modules/react-native/ReactCommon/react/runtime/platform/ios" + React-RuntimeCore: + :path: "../node_modules/react-native/ReactCommon/react/runtime" + React-runtimeexecutor: + :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" + React-RuntimeHermes: + :path: "../node_modules/react-native/ReactCommon/react/runtime" + React-runtimescheduler: + :path: "../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler" + React-timing: + :path: "../node_modules/react-native/ReactCommon/react/timing" + React-utils: + :path: "../node_modules/react-native/ReactCommon/react/utils" + React-webperformancenativemodule: + :path: "../node_modules/react-native/ReactCommon/react/nativemodule/webperformance" + ReactAppDependencyProvider: + :path: build/generated/ios + ReactCodegen: + :path: build/generated/ios + ReactCommon: + :path: "../node_modules/react-native/ReactCommon" + RNCAsyncStorage: + :path: "../node_modules/@react-native-async-storage/async-storage" + RNCCheckbox: + :path: "../node_modules/@react-native-community/checkbox" + RNCClipboard: + :path: "../node_modules/@react-native-clipboard/clipboard" + RNDateTimePicker: + :path: "../node_modules/@react-native-community/datetimepicker" + RNDeviceInfo: + :path: "../node_modules/react-native-device-info" + RNFileViewer: + :path: "../node_modules/react-native-file-viewer" + RNFS: + :path: "../node_modules/react-native-fs" + RNGestureHandler: + :path: "../node_modules/react-native-gesture-handler" + RNKeychain: + :path: "../node_modules/react-native-keychain" + RNPermissions: + :path: "../node_modules/react-native-permissions" + RNReanimated: + :path: "../node_modules/react-native-reanimated" + RNScreens: + :path: "../node_modules/react-native-screens" + RNSnackbar: + :path: "../node_modules/react-native-snackbar" + RNSVG: + :path: "../node_modules/react-native-svg" + RNVectorIcons: + :path: "../node_modules/react-native-vector-icons" + RNWorklets: + :path: "../node_modules/react-native-worklets" + VisionCamera: + :path: "../node_modules/react-native-vision-camera" + VisionCameraFaceDetector: + :path: "../node_modules/react-native-vision-camera-face-detector" + Yoga: + :path: "../node_modules/react-native/ReactCommon/yoga" + +SPEC CHECKSUMS: + BEMCheckBox: 5ba6e37ade3d3657b36caecc35c8b75c6c2b1a4e + boost: 7e761d76ca2ce687f7cc98e698152abd03a18f90 + BVLinearGradient: cb006ba232a1f3e4f341bb62c42d1098c284da70 + DoubleConversion: cb417026b2400c8f53ae97020b2be961b59470cb + fast_float: b32c788ed9c6a8c584d114d0047beda9664e7cc6 + FBLazyVector: 0aa6183b9afe3c31fc65b5d1eeef1f3c19b63bfa + fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd + glog: 5683914934d5b6e4240e497e0f4a3b42d1854183 + GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7 + GoogleMLKit: ddd51d7dff36ff28defa69afedd9cdce684fd857 + GoogleToolboxForMac: d1a2cbf009c453f4d6ded37c105e2f67a32206d8 + GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1 + GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 + hermes-engine: 273e30e7fb618279934b0b95ffab60ecedb7acf5 + MLImage: 2ab9c968e75f57911c16f4c9d9e8a8e9604a86a1 + MLKitCommon: 26b779f072a182c1603d4c88a101c350cac837b1 + MLKitFaceDetection: d50aff1a44aa9a4e95f7e208298a3ce40b68f9f8 + MLKitVision: fa8dea9012ac59497c79ddbe9ebf32051047ac4c + nanopb: fad817b59e0457d11a5dfbde799381cd727c1275 + PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 + RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669 + RCTDeprecation: f17e2ebc07876ca9ab8eb6e4b0a4e4647497ae3a + RCTRequired: e2c574c1b45231f7efb0834936bd609d75072b63 + RCTTypeSafety: c693294e3993056955c3010eb1ebc574f1fcded6 + React: aeece948ccf155182ea86a2395786ed31cf21c61 + React-callinvoker: 05ad789505922d68c06cde1c8060e734df9fe182 + React-Codegen: 4b8b4817cea7a54b83851d4c1f91f79aa73de30a + React-Core: 956ac86b4d9b0c0fd9a14b9cc533aa297bb501c0 + React-CoreModules: 3a8d39778cf9eeca40e419814e875da1a8e29855 + React-cxxreact: db275765e1eb08f038599fb44114cf57ee0d18cd + React-debug: 1dfa1d1cbd93bdaffa3b140190829f9fd9e27985 + React-defaultsnativemodule: 35f353ba06901fb5e374bc56e750fde05cbb05b9 + React-domnativemodule: cf9e1b1b520ce0e66396c2744b3eb6d419711c13 + React-Fabric: c0b0c1ad70476d354b3da9fef96094f7b37804da + React-FabricComponents: 8c6861c5233cf0d5685cee301a979313090e2f57 + React-FabricImage: cef8883d2fb6c892003fefcad261d2898adbe926 + React-featureflags: 0e2b969019c2b118de64a6d4c55ef7c05f2b0f1d + React-featureflagsnativemodule: e1ef619d14fe0a68d4783b32293309dbb13ef2a5 + React-graphics: 0fc6b7acaff7161bda05bf8bffceacc2b0b4e38d + React-hermes: b454b9352bc26e638704d103009f659a125b86d3 + React-idlecallbacksnativemodule: 35ab292f8404c469744db5a5dd5f0f27f95e5ebf + React-ImageManager: 3312c550ebcf6b7d911d9993082adcb3e1407ce8 + React-jserrorhandler: 2a7f2d94566f05f8cb82288afd46bc0fd8b2ffc7 + React-jsi: 7aa265cf8372d8385ccc7935729e76d27e694dfe + React-jsiexecutor: 8dd53bebfb3bc12f0541282aa4c858a433914e37 + React-jsinspector: f89b9ae62a4e2f6035b452442ef20a7f98f9cb27 + React-jsinspectorcdp: 44e46c1473a8deecf7b188389ed409be83fb3cc7 + React-jsinspectornetwork: dc9524f6e3d7694b1b6f4bd22dedad8ccc2c0a80 + React-jsinspectortracing: 0166ebbdfb125936a5d231895de3c11a19521dfc + React-jsitooling: 34692514ec8d8735938eda3677808a58f41c925b + React-jsitracing: a598dae84a87f8013635d09c5e7884023bda8501 + React-logger: 500f2fa5697d224e63c33d913c8a4765319e19bf + React-Mapbuffer: 06d59c448da7e34eb05b3fb2189e12f6a30fec57 + React-microtasksnativemodule: d1ee999dc9052e23f6488b730fa2d383a4ea40e5 + react-native-blob-util: e2162ce4757849682559754bca954b65dc7eeb2f + react-native-document-picker: b49fc10a23d1f89ae7d8c09c2312fb6bec98f8cd + react-native-geolocation: 95e48fe2687e5a8280103085372fa62c2297c5d6 + react-native-geolocation-service: 32b2c2a3b91e70ce2a8d0c684801aaeb0a07e0ec + react-native-image-marker: 8e0fa61e722cd010f5c78ef3d2a2b11feb9cf251 + react-native-image-picker: 0314366753615115fa55c3cc937ac44cb7e75702 + react-native-image-resizer: 17b2d73c030975b6543395c7e7368bc8774c5efa + react-native-maps: 92f417ffa2c6598b783f133df25e60ce62aede0f + react-native-netinfo: cec9c4e86083cb5b6aba0e0711f563e2fbbff187 + react-native-orientation-locker: cc6f357b289a2e0dd2210fea0c52cb8e0727fdaa + react-native-safe-area-context: c00143b4823773bba23f2f19f85663ae89ceb460 + react-native-splash-screen: 95994222cc95c236bd3cdc59fe45ed5f27969594 + react-native-sqlite-2: 1356d7be6e51712e5de9fdc0be2be140162b563d + react-native-version-check: 842a3b0e7221798cbe8c6abaf24aab3ed0b485ce + react-native-video: 7b821291837d8ba7b9d7574bfeb0cd651e910141 + react-native-view-shot: 6c008e58f4720de58370848201c5d4a082c6d4ca + react-native-webview: 654f794a7686b47491cf43aa67f7f428bea00eed + react-native-worklets-core: 28a6e2121dcf62543b703e81bc4860e9a0150cee + React-NativeModulesApple: 46690a0fe94ec28fc6fc686ec797b911d251ded0 + React-oscompat: 95875e81f5d4b3c7b2c888d5bd2c9d83450d8bdb + React-perflogger: 2e229bf33e42c094fd64516d89ec1187a2b79b5b + React-performancecdpmetrics: 05ba4bd83f36acf192071bb5d9c8f45faf04d140 + React-performancetimeline: bfc96fcd2b79f7489dd54e3df4cba186dd8dd141 + React-RCTActionSheet: 2399bb6cc8adaef2e5850878102fea2ad1788a0e + React-RCTAnimation: d1deb6946e83e22a795a7d0148b94faad8851644 + React-RCTAppDelegate: 10b35d5cec3f8653f6de843ae800b3ba8050b801 + React-RCTBlob: 85150378edc42862d7c13ff2502693f32b174f91 + React-RCTFabric: 736f9da3ad57e2cef5fa4c132999933a89bb8378 + React-RCTFBReactNativeSpec: 705ec584758966950a31fa235539b57523059837 + React-RCTImage: bb6cbdc22698b3afc8eb8d81ef03ee840d24c6f6 + React-RCTLinking: e8b006d101c45651925de3e82189f03449eedfe7 + React-RCTNetwork: 7999731af05ec8f591cbc6ad4e29d79e209c581a + React-RCTRuntime: 99d8a2a17747866fb972561cdb205afe9b26d369 + React-RCTSettings: 839f334abb92e917bc24322036081ffe15c84086 + React-RCTText: 272f60e9a5dbfd14c348c85881ee7d5c7749a67c + React-RCTVibration: 1ffa30a21e2227be3afe28d657ac8e6616c91bae + React-rendererconsistency: 3c3e198aba0255524ed7126aa812d22ce750d217 + React-renderercss: 6b3ce3dfadf991937ae3229112be843ef1438c32 + React-rendererdebug: baf9e1daa07ac7f9aca379555126d29f963ba38b + React-RuntimeApple: 4136aee89257894955ef09e9f9ef74f0c27596be + React-RuntimeCore: e9a743d7de4bbd741b16e10b26078d815d6513ab + React-runtimeexecutor: 781e292362066af82fa2478d95c6b0e374421844 + React-RuntimeHermes: 6ab3c2847516769fc860d711814f1735859cad74 + React-runtimescheduler: 824c83a5fd68b35396de6d4f2f9ae995daac861b + React-timing: 1ebc7102dd52a3edcc63534686bb156e12648411 + React-utils: abf37b162f560cd0e3e5d037af30bb796512246d + React-webperformancenativemodule: 50a57c713a90d27ae3ab947a6c9c8859bcb49709 + ReactAppDependencyProvider: a45ef34bb22dc1c9b2ac1f74167d9a28af961176 + ReactCodegen: 878add6c7d8ff8cea87697c44d29c03b79b6f2d9 + ReactCommon: 804dc80944fa90b86800b43c871742ec005ca424 + RNCAsyncStorage: 29f0230e1a25f36c20b05f65e2eb8958d6526e82 + RNCCheckbox: 33b44487ca8008394ce658cc32b26eab04f426ef + RNCClipboard: 4b58c780f63676367640f23c8e114e9bd0cf86ac + RNDateTimePicker: 243cc82889368422dab234d73dec63d6cdb1e70f + RNDeviceInfo: 36d7f232bfe7c9b5c494cb7793230424ed32c388 + RNFileViewer: 4b5d83358214347e4ab2d4ca8d5c1c90d869e251 + RNFS: 89de7d7f4c0f6bafa05343c578f61118c8282ed8 + RNGestureHandler: e1cf8ef3f11045536eed6bd4f132b003ef5f9a5f + RNKeychain: 483402cf2b90647eb0cf569cebbc069d32addea4 + RNPermissions: ff947b6fd956f3d188c1950dfc18ebd830bf00e3 + RNReanimated: ac06da53579693ab451941ef89f5a55afeab0dd9 + RNScreens: d821082c6dd1cb397cc0c98b026eeafaa68be479 + RNSnackbar: c1b235eb606b03938c693ce769ed3059c31dff9b + RNSVG: 005860704c95493cd23a417dfbeb76dcd8bb7042 + RNVectorIcons: 791f13226ec4a3fd13062eda9e892159f0981fae + RNWorklets: ab618bf7d1c7fd2cb793b9f0f39c3e29274b3ebf + SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 + VisionCamera: 0044a94f7489f19e19d5938e97dfc36f4784af3c + VisionCameraFaceDetector: 1aac3e7353161c7c822cf1c616760bd44a2758c4 + Yoga: 689c8e04277f3ad631e60fe2a08e41d411daf8eb + +PODFILE CHECKSUM: f3322fb1054de4530f6e0bade2e0da8c6e77c5be + +COCOAPODS: 1.16.2 diff --git a/ios/cpm_logo.png b/ios/cpm_logo.png new file mode 100644 index 0000000..e4d9ae6 Binary files /dev/null and b/ios/cpm_logo.png differ diff --git a/ios/logo.png b/ios/logo.png new file mode 100644 index 0000000..11a738a Binary files /dev/null and b/ios/logo.png differ diff --git a/ios/parinaam_tag_line.png b/ios/parinaam_tag_line.png new file mode 100644 index 0000000..1d072e2 Binary files /dev/null and b/ios/parinaam_tag_line.png differ diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..8eb675e --- /dev/null +++ b/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + preset: 'react-native', +}; diff --git a/metro.config.js b/metro.config.js new file mode 100644 index 0000000..2a0a21c --- /dev/null +++ b/metro.config.js @@ -0,0 +1,11 @@ +const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config'); + +/** + * Metro configuration + * https://reactnative.dev/docs/metro + * + * @type {import('@react-native/metro-config').MetroConfig} + */ +const config = {}; + +module.exports = mergeConfig(getDefaultConfig(__dirname), config); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..dfbdd2b --- /dev/null +++ b/package-lock.json @@ -0,0 +1,15001 @@ +{ + "name": "PerformicsManager", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "PerformicsManager", + "version": "0.0.1", + "hasInstallScript": true, + "dependencies": { + "@dominicvonk/react-native-apk-installer": "^2.2.2", + "@react-native-async-storage/async-storage": "^2.2.0", + "@react-native-clipboard/clipboard": "^1.16.2", + "@react-native-community/checkbox": "^0.5.20", + "@react-native-community/datetimepicker": "^8.4.1", + "@react-native-community/netinfo": "^11.4.1", + "@react-native-documents/picker": "^11.0.0", + "@react-native/new-app-screen": "0.82.1", + "@react-navigation/drawer": "^7.5.8", + "@react-navigation/native": "^7.1.18", + "@react-navigation/stack": "^7.4.8", + "base-64": "^1.0.0", + "deprecated-react-native-prop-types": "^2.3.0", + "mime": "^4.0.7", + "moment": "^2.30.1", + "prop-types": "^15.8.1", + "react": "19.1.1", + "react-native": "0.82.1", + "react-native-animated-splash-screen": "^2.0.5", + "react-native-blob-util": "^0.22.2", + "react-native-chart-kit": "^6.12.0", + "react-native-collapsible": "^1.6.2", + "react-native-device-info": "^15.0.1", + "react-native-draggable-flatlist": "^4.0.3", + "react-native-element-dropdown": "^2.12.4", + "react-native-file-viewer": "^2.1.5", + "react-native-fs": "^2.20.0", + "react-native-geolocation-service": "^5.3.1", + "react-native-gesture-handler": "^2.25.0", + "react-native-google-maps": "^1.0.0", + "react-native-image-marker": "^1.2.9", + "react-native-image-pan-zoom": "^2.1.12", + "react-native-image-picker": "^8.2.1", + "react-native-image-resizer": "^1.4.5", + "react-native-image-zoom-viewer": "^3.0.1", + "react-native-keychain": "^9.2.3", + "react-native-linear-gradient": "^2.8.3", + "react-native-maps": "^1.24.1", + "react-native-modal": "^14.0.0-rc.1", + "react-native-modal-datetime-picker": "^18.0.0", + "react-native-modal-selector": "^2.1.2", + "react-native-multiple-select": "^0.5.12", + "react-native-orientation-locker": "^1.7.0", + "react-native-otp-inputs": "^7.4.0", + "react-native-paper": "^5.14.5", + "react-native-permissions": "^5.4.1", + "react-native-reanimated": "^4.1.5", + "react-native-responsive-screen": "^1.4.2", + "react-native-safe-area-context": "^5.5.2", + "react-native-screens": "^4.11.1", + "react-native-snackbar": "^2.9.0", + "react-native-snap-carousel": "^3.9.1", + "react-native-splash-screen": "^3.3.0", + "react-native-sqlite-2": "^3.6.2", + "react-native-svg": "^15.12.0", + "react-native-vector-icons": "^10.2.0", + "react-native-version-check": "^3.5.0", + "react-native-video": "^6.14.1", + "react-native-video-controls": "^2.8.1", + "react-native-view-shot": "^4.0.3", + "react-native-vision-camera": "^4.7.3", + "react-native-vision-camera-face-detector": "^1.9.1", + "react-native-webview": "^13.15.0", + "react-native-worklets": "^0.6.1", + "react-native-worklets-core": "^1.6.2", + "react-redux": "^9.2.0", + "redux": "^5.0.1", + "utf8": "^3.0.0" + }, + "devDependencies": { + "@babel/core": "^7.25.2", + "@babel/preset-env": "^7.25.3", + "@babel/runtime": "^7.25.0", + "@react-native-community/cli": "20.0.0", + "@react-native-community/cli-platform-android": "20.0.0", + "@react-native-community/cli-platform-ios": "20.0.0", + "@react-native/babel-preset": "0.82.1", + "@react-native/eslint-config": "0.82.1", + "@react-native/metro-config": "0.82.1", + "@react-native/typescript-config": "0.82.1", + "@types/jest": "^29.5.13", + "@types/react": "^19.1.1", + "@types/react-test-renderer": "^19.1.0", + "babel-plugin-inline-import": "^3.0.0", + "eslint": "^8.19.0", + "jest": "^29.6.3", + "prettier": "2.8.8", + "react-test-renderer": "19.1.1", + "typescript": "^5.8.3" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.5.tgz", + "integrity": "sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz", + "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-module-transforms": "^7.28.3", + "@babel/helpers": "^7.28.4", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/traverse": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/eslint-parser": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.28.5.tgz", + "integrity": "sha512-fcdRcWahONYo+JRnJg1/AekOacGvKx12Gu0qXJXFi2WBqQA1i7+O5PaxRB7kxE/Op94dExnCiiar6T09pvdHpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", + "eslint-visitor-keys": "^2.1.0", + "semver": "^6.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || >=14.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.11.0", + "eslint": "^7.5.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/@babel/generator": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.5.tgz", + "integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.27.3.tgz", + "integrity": "sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.27.3" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", + "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.27.2", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.28.5.tgz", + "integrity": "sha512-q3WC4JfdODypvxArsJQROfupPBq9+lMwjKq7C33GhbFYJsufD0yd/ziwD+hJucLeWsnFPWZjsU2DNFqBPE7jwQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.3", + "@babel/helper-member-expression-to-functions": "^7.28.5", + "@babel/helper-optimise-call-expression": "^7.27.1", + "@babel/helper-replace-supers": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1", + "@babel/traverse": "^7.28.5", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.28.5.tgz", + "integrity": "sha512-N1EhvLtHzOvj7QQOUCCS3NrPJP8c5W6ZXCHDn7Yialuy1iu4r5EmIYkXlKNqT99Ciw+W0mDqWoR6HWMZlFP3hw==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.3", + "regexpu-core": "^6.3.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-define-polyfill-provider": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.5.tgz", + "integrity": "sha512-uJnGFcPsWQK8fvjgGP5LZUZZsYGIoPeRjSF5PGwrelYgq7Q15/Ft9NGFp1zglwgIv//W0uG4BevRuSJRyylZPg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-plugin-utils": "^7.27.1", + "debug": "^4.4.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.22.10" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.28.5.tgz", + "integrity": "sha512-cwM7SBRZcPCLgl8a7cY0soT1SptSzAlMH39vwiRpOQkJlh53r5hdHwLSCZpQdVLT39sZt+CRpNwYG4Y2v77atg==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.28.5", + "@babel/types": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", + "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz", + "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.28.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.27.1.tgz", + "integrity": "sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", + "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.27.1.tgz", + "integrity": "sha512-7fiA521aVw8lSPeI4ZOD3vRFkoqkJcS+z4hFo82bFSH/2tNd6eJ5qCVMS5OzDmZh/kaHQeBaeyxK6wljcPtveA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.1", + "@babel/helper-wrap-function": "^7.27.1", + "@babel/traverse": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.27.1.tgz", + "integrity": "sha512-7EHz6qDZc8RYS5ElPoShMheWvEgERonFCs7IAonWLLUTXW59DP14bCZt89/GKyreYn8g3S83m21FelHKbeDCKA==", + "license": "MIT", + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.27.1", + "@babel/helper-optimise-call-expression": "^7.27.1", + "@babel/traverse": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.27.1.tgz", + "integrity": "sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-wrap-function": { + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.28.3.tgz", + "integrity": "sha512-zdf983tNfLZFletc0RRXYrHrucBEg95NIFMkn6K9dbeMYnsgHaSBGcQqdsCSStG2PYwRre0Qc2NNSCXbG+xc6g==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.27.2", + "@babel/traverse": "^7.28.3", + "@babel/types": "^7.28.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz", + "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==", + "license": "MIT", + "dependencies": { + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.5" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.28.5.tgz", + "integrity": "sha512-87GDMS3tsmMSi/3bWOte1UblL+YUTFMV8SZPZ2eSEL17s74Cw/l63rR6NmGVKMYW2GYi85nE+/d6Hw5N0bEk2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/traverse": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.27.1.tgz", + "integrity": "sha512-qNeq3bCKnGgLkEXUuFry6dPlGfCdQNZbn7yUAPCInwAJHMU7THJfrBSozkcWq5sNM6RcF3S8XyQL2A52KNR9IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.27.1.tgz", + "integrity": "sha512-g4L7OYun04N1WyqMNjldFwlfPCLVkgB54A/YCXICZYBsvJJE3kByKv9c9+R/nAfmIfjl2rKYLNyMHboYbZaWaA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.27.1.tgz", + "integrity": "sha512-oO02gcONcD5O1iTLi/6frMJBIwWEHceWGSGqrpCmEL8nogiS6J9PBlE48CaK20/Jx1LuRml9aDftLgdjXT8+Cw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1", + "@babel/plugin-transform-optional-chaining": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.13.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.28.3.tgz", + "integrity": "sha512-b6YTX108evsvE4YgWyQ921ZAFFQm3Bn+CA3+ZXlNVnPhx+UfsVURoPjfGAPCjBgrqo30yX/C2nZGX96DxvR9Iw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/traverse": "^7.28.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-proposal-export-default-from": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.27.1.tgz", + "integrity": "sha512-hjlsMBl1aJc5lp8MoCDEZCiYzlgdRAShOjAfRw6X+GlpLpUPU7c3XNLsKFZbQk/1cRzBlJ7CXg3xJAJMrFa1Uw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-export-default-from": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.27.1.tgz", + "integrity": "sha512-eBC/3KSekshx19+N40MzjWqJd7KTEdOoLesAfa4IDFI8eRz5a47i5Oszus6zG/cwIXN63YhgLOMSSNJx49sENg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-flow": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.27.1.tgz", + "integrity": "sha512-p9OkPbZ5G7UT1MofwYFigGebnrzGJacoBSQM0/6bi/PUMVE+qlWDD/OalvQKbwgQzU6dl0xAv6r4X7Jme0RYxA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-assertions": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.27.1.tgz", + "integrity": "sha512-UT/Jrhw57xg4ILHLFnzFpPDlMbcdEicaAtjPQpbj9wa8T4r5KVWCimHcL/460g8Ht0DMxDyjsLgiWSkVjnwPFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.27.1.tgz", + "integrity": "sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.27.1.tgz", + "integrity": "sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.27.1.tgz", + "integrity": "sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", + "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.27.1.tgz", + "integrity": "sha512-8Z4TGic6xW70FKThA5HYEKKyBpOOsucTOD1DjU3fZxDg+K3zBJcXMFnt/4yQiZnf5+MiOMSXQ9PaEK/Ilh1DeA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-generator-functions": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.28.0.tgz", + "integrity": "sha512-BEOdvX4+M765icNPZeidyADIvQ1m1gmunXufXxvRESy/jNNyfovIqUyE7MVgGBjWktCoJlzvFA1To2O4ymIO3Q==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-remap-async-to-generator": "^7.27.1", + "@babel/traverse": "^7.28.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.27.1.tgz", + "integrity": "sha512-NREkZsZVJS4xmTr8qzE5y8AfIPqsdQfRuUiLRTEzb7Qii8iFWCyDKaUV2c0rCuh4ljDZ98ALHP/PetiBV2nddA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-remap-async-to-generator": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.27.1.tgz", + "integrity": "sha512-cnqkuOtZLapWYZUYM5rVIdv1nXYuFVIltZ6ZJ7nIj585QsjKM5dhL2Fu/lICXZ1OyIAFc7Qy+bvDAtTXqGrlhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.28.5.tgz", + "integrity": "sha512-45DmULpySVvmq9Pj3X9B+62Xe+DJGov27QravQJU1LLcapR6/10i+gYVAucGGJpHBp5mYxIMK4nDAT/QDLr47g==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.27.1.tgz", + "integrity": "sha512-D0VcalChDMtuRvJIu3U/fwWjf8ZMykz5iZsg77Nuj821vCKI3zCyRLwRdWbsuJ/uRwZhZ002QtCqIkwC/ZkvbA==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-static-block": { + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.28.3.tgz", + "integrity": "sha512-LtPXlBbRoc4Njl/oh1CeD/3jC+atytbnf/UqLoqTDcEYGUPj022+rvfkbDYieUrSj3CaV4yHDByPE+T2HwfsJg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.28.3", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" + } + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.28.4.tgz", + "integrity": "sha512-cFOlhIYPBv/iBoc+KS3M6et2XPtbT2HiCRfBXWtfpc9OAyostldxIf9YAYB6ypURBBbx+Qv6nyrLzASfJe+hBA==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.3", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-globals": "^7.28.0", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-replace-supers": "^7.27.1", + "@babel/traverse": "^7.28.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.27.1.tgz", + "integrity": "sha512-lj9PGWvMTVksbWiDT2tW68zGS/cyo4AkZ/QTp0sQT0mjPopCmrSkzxeXkznjqBxzDI6TclZhOJbBmbBLjuOZUw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/template": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.28.5.tgz", + "integrity": "sha512-Kl9Bc6D0zTUcFUvkNuQh4eGXPKKNDOJQXVyyM4ZAQPMveniJdxi8XMJwLo+xSoW3MIq81bD33lcUe9kZpl0MCw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/traverse": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.27.1.tgz", + "integrity": "sha512-gEbkDVGRvjj7+T1ivxrfgygpT7GUd4vmODtYpbs0gZATdkX8/iSnOtZSxiZnsgm1YjTgjI6VKBGSJJevkrclzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.27.1.tgz", + "integrity": "sha512-MTyJk98sHvSs+cvZ4nOauwTTG1JeonDjSGvGGUNHreGQns+Mpt6WX/dVzWBHgg+dYZhkC4X+zTDfkTU+Vy9y7Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.27.1.tgz", + "integrity": "sha512-hkGcueTEzuhB30B3eJCbCYeCaaEQOmQR0AdvzpD4LoN0GXMWzzGSuRrxR2xTnCrvNbVwK9N6/jQ92GSLfiZWoQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-dynamic-import": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.27.1.tgz", + "integrity": "sha512-MHzkWQcEmjzzVW9j2q8LGjwGWpG2mjwaaB0BNQwst3FIjqsg8Ct/mIZlvSPJvfi9y2AC8mi/ktxbFVL9pZ1I4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-explicit-resource-management": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-explicit-resource-management/-/plugin-transform-explicit-resource-management-7.28.0.tgz", + "integrity": "sha512-K8nhUcn3f6iB+P3gwCv/no7OdzOZQcKchW6N389V6PD8NUWKZHzndOd9sPDVbMoBsbmjMqlB4L9fm+fEFNVlwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/plugin-transform-destructuring": "^7.28.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.28.5.tgz", + "integrity": "sha512-D4WIMaFtwa2NizOp+dnoFjRez/ClKiC2BqqImwKd1X28nqBtZEyCYJ2ozQrrzlxAFrcrjxo39S6khe9RNDlGzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-export-namespace-from": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.27.1.tgz", + "integrity": "sha512-tQvHWSZ3/jH2xuq/vZDy0jNn+ZdXJeM8gHvX4lnJmsc3+50yPlWdZXIc5ay+umX+2/tJIqHqiEqcJvxlmIvRvQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-flow-strip-types": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.27.1.tgz", + "integrity": "sha512-G5eDKsu50udECw7DL2AcsysXiQyB7Nfg521t2OAJ4tbfTJ27doHLeF/vlI1NZGlLdbb/v+ibvtL1YBQqYOwJGg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/plugin-syntax-flow": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.27.1.tgz", + "integrity": "sha512-BfbWFFEJFQzLCQ5N8VocnCtA8J1CLkNTe2Ms2wocj75dd6VpiqS5Z5quTYcUoo4Yq+DN0rtikODccuv7RU81sw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-function-name": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.27.1.tgz", + "integrity": "sha512-1bQeydJF9Nr1eBCMMbC+hdwmRlsv5XYOMu03YSWFwNs0HsAmtSxxF1fyuYPqemVldVyFmlCU7w8UE14LupUSZQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/traverse": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-json-strings": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.27.1.tgz", + "integrity": "sha512-6WVLVJiTjqcQauBhn1LkICsR2H+zm62I3h9faTDKt1qP4jn2o72tSvqMwtGFKGTpojce0gJs+76eZ2uCHRZh0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-literals": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.27.1.tgz", + "integrity": "sha512-0HCFSepIpLTkLcsi86GG3mTUzxV5jpmbv97hTETW3yzrAij8aqlD36toB1D0daVFJM8NK6GvKO0gslVQmm+zZA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-logical-assignment-operators": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.28.5.tgz", + "integrity": "sha512-axUuqnUTBuXyHGcJEVVh9pORaN6wC5bYfE7FGzPiaWa3syib9m7g+/IT/4VgCOe2Upef43PHzeAvcrVek6QuuA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-member-expression-literals": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.27.1.tgz", + "integrity": "sha512-hqoBX4dcZ1I33jCSWcXrP+1Ku7kdqXf1oeah7ooKOIiAdKQ+uqftgCFNOSzA5AMS2XIHEYeGFg4cKRCdpxzVOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.27.1.tgz", + "integrity": "sha512-iCsytMg/N9/oFq6n+gFTvUYDZQOMK5kEdeYxmxt91fcJGycfxVP9CnrxoliM0oumFERba2i8ZtwRUCMhvP1LnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.27.1.tgz", + "integrity": "sha512-OJguuwlTYlN0gBZFRPqwOGNWssZjfIUdS7HMYtN8c1KmwpwHFBwTeFZrg9XZa+DFTitWOW5iTAG7tyCUPsCCyw==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.28.5.tgz", + "integrity": "sha512-vn5Jma98LCOeBy/KpeQhXcV2WZgaRUtjwQmjoBuLNlOmkg0fB5pdvYVeWRYI69wWKwK2cD1QbMiUQnoujWvrew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.28.3", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5", + "@babel/traverse": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.27.1.tgz", + "integrity": "sha512-iQBE/xC5BV1OxJbp6WG7jq9IWiD+xxlZhLrdwpPkTX3ydmXdvoCpyfJN7acaIBZaOqTfr76pgzqBJflNbeRK+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.27.1.tgz", + "integrity": "sha512-SstR5JYy8ddZvD6MhV0tM/j16Qds4mIpJTOd1Yu9J9pJjH93bxHECF7pgtc28XvkzTD6Pxcm/0Z73Hvk7kb3Ng==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-new-target": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.27.1.tgz", + "integrity": "sha512-f6PiYeqXQ05lYq3TIfIDu/MtliKUbNwkGApPUvyo6+tc7uaR4cPjPe7DFPr15Uyycg2lZU6btZ575CuQoYh7MQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.27.1.tgz", + "integrity": "sha512-aGZh6xMo6q9vq1JGcw58lZ1Z0+i0xB2x0XaauNIUXd6O1xXc3RwoWEBlsTQrY4KQ9Jf0s5rgD6SiNkaUdJegTA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-numeric-separator": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.27.1.tgz", + "integrity": "sha512-fdPKAcujuvEChxDBJ5c+0BTaS6revLV7CJL08e4m3de8qJfNIuCc2nc7XJYOjBoTMJeqSmwXJ0ypE14RCjLwaw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-rest-spread": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.28.4.tgz", + "integrity": "sha512-373KA2HQzKhQCYiRVIRr+3MjpCObqzDlyrM6u4I201wL8Mp2wHf7uB8GhDwis03k2ti8Zr65Zyyqs1xOxUF/Ew==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/plugin-transform-destructuring": "^7.28.0", + "@babel/plugin-transform-parameters": "^7.27.7", + "@babel/traverse": "^7.28.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-super": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.27.1.tgz", + "integrity": "sha512-SFy8S9plRPbIcxlJ8A6mT/CxFdJx/c04JEctz4jf8YZaVS2px34j7NXRrlGlHkN/M2gnpL37ZpGRGVFLd3l8Ng==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-replace-supers": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-catch-binding": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.27.1.tgz", + "integrity": "sha512-txEAEKzYrHEX4xSZN4kJ+OfKXFVSWKB2ZxM9dpcE3wT7smwkNmXo5ORRlVzMVdJbD+Q8ILTgSD7959uj+3Dm3Q==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.28.5.tgz", + "integrity": "sha512-N6fut9IZlPnjPwgiQkXNhb+cT8wQKFlJNqcZkWlcTqkcqx6/kU4ynGmLFoa4LViBSirn05YAwk+sQBbPfxtYzQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-parameters": { + "version": "7.27.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.27.7.tgz", + "integrity": "sha512-qBkYTYCb76RRxUM6CcZA5KRu8K4SM8ajzVeUgVdMVO9NN9uI/GaVmBg/WKJJGnNokV9SY8FxNOVWGXzqzUidBg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.27.1.tgz", + "integrity": "sha512-10FVt+X55AjRAYI9BrdISN9/AQWHqldOeZDUoLyif1Kn05a56xVBXb8ZouL8pZ9jem8QpXaOt8TS7RHUIS+GPA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-property-in-object": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.27.1.tgz", + "integrity": "sha512-5J+IhqTi1XPa0DXF83jYOaARrX+41gOewWbkPyjMNRDqgOCqdffGh8L3f/Ek5utaEBZExjSAzcyjmV9SSAWObQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.1", + "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-property-literals": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.27.1.tgz", + "integrity": "sha512-oThy3BCuCha8kDZ8ZkgOg2exvPYUlprMukKQXI1r1pJ47NCvxfkEy8vK+r/hT9nF0Aa4H1WUPZZjHTFtAhGfmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-display-name": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.28.0.tgz", + "integrity": "sha512-D6Eujc2zMxKjfa4Zxl4GHMsmhKKZ9VpcqIchJLvwTxad9zWIYulwYItBovpDOoNLISpcZSXoDJ5gaGbQUDqViA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.27.1.tgz", + "integrity": "sha512-2KH4LWGSrJIkVf5tSiBFYuXDAoWRq2MMwgivCf+93dd0GQi8RXLjKA/0EvRnVV5G0hrHczsquXuD01L8s6dmBw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.1", + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/plugin-syntax-jsx": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz", + "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz", + "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regenerator": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.28.4.tgz", + "integrity": "sha512-+ZEdQlBoRg9m2NnzvEeLgtvBMO4tkFBw5SQIUgLICgTrumLoU7lr+Oghi6km2PFj+dbUt2u1oby2w3BDO9YQnA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regexp-modifiers": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.27.1.tgz", + "integrity": "sha512-TtEciroaiODtXvLZv4rmfMhkCv8jx3wgKpL68PuiPh2M4fvz5jhsA7697N1gMvkvr/JTF13DrFYyEbY9U7cVPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-reserved-words": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.27.1.tgz", + "integrity": "sha512-V2ABPHIJX4kC7HegLkYoDpfg9PVmuWy/i6vUM5eGK22bx4YVFD3M5F0QQnWQoDs6AGsUWTVOopBiMFQgHaSkVw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-runtime": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.28.5.tgz", + "integrity": "sha512-20NUVgOrinudkIBzQ2bNxP08YpKprUkRTiRSd2/Z5GOdPImJGkoN4Z7IQe1T5AdyKI1i5L6RBmluqdSzvaq9/w==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", + "babel-plugin-polyfill-corejs2": "^0.4.14", + "babel-plugin-polyfill-corejs3": "^0.13.0", + "babel-plugin-polyfill-regenerator": "^0.6.5", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-shorthand-properties": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.27.1.tgz", + "integrity": "sha512-N/wH1vcn4oYawbJ13Y/FxcQrWk63jhfNa7jef0ih7PHSIHX2LB7GWE1rkPrOnka9kwMxb6hMl19p7lidA+EHmQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-spread": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.27.1.tgz", + "integrity": "sha512-kpb3HUqaILBJcRFVhFUs6Trdd4mkrzcGXss+6/mxUd273PfbWqSDHRzMT2234gIg2QYfAjvXLSquP1xECSg09Q==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-sticky-regex": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.27.1.tgz", + "integrity": "sha512-lhInBO5bi/Kowe2/aLdBAawijx+q1pQzicSgnkB6dUPc1+RC8QmJHKf2OjvU+NZWitguJHEaEmbV6VWEouT58g==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-template-literals": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.27.1.tgz", + "integrity": "sha512-fBJKiV7F2DxZUkg5EtHKXQdbsbURW3DZKQUWphDum0uRP6eHGGa/He9mc0mypL680pb+e/lDIthRohlv8NCHkg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typeof-symbol": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.27.1.tgz", + "integrity": "sha512-RiSILC+nRJM7FY5srIyc4/fGIwUhyDuuBSdWn4y6yT6gm652DpCHZjIipgn6B7MQ1ITOUnAKWixEUjQRIBIcLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typescript": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.28.5.tgz", + "integrity": "sha512-x2Qa+v/CuEoX7Dr31iAfr0IhInrVOWZU/2vJMJ00FOR/2nM0BcBEclpaf9sWCDc+v5e9dMrhSH8/atq/kX7+bA==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.3", + "@babel/helper-create-class-features-plugin": "^7.28.5", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1", + "@babel/plugin-syntax-typescript": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-escapes": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.27.1.tgz", + "integrity": "sha512-Ysg4v6AmF26k9vpfFuTZg8HRfVWzsh1kVfowA23y9j/Gu6dOuahdUVhkLqpObp3JIv27MLSii6noRnuKN8H0Mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-property-regex": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.27.1.tgz", + "integrity": "sha512-uW20S39PnaTImxp39O5qFlHLS9LJEmANjMG7SxIhap8rCHqu0Ik+tLEPX5DKmHn6CsWQ7j3lix2tFOa5YtL12Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.27.1.tgz", + "integrity": "sha512-xvINq24TRojDuyt6JGtHmkVkrfVV3FPT16uytxImLeBZqW3/H52yN+kM1MGuyPkIQxrzKwPHs5U/MP3qKyzkGw==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-sets-regex": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.27.1.tgz", + "integrity": "sha512-EtkOujbc4cgvb0mlpQefi4NTPBzhSIevblFevACNLUspmrALgmEBdL/XfnyyITfd8fKBZrZys92zOWcik7j9Tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/preset-env": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.28.5.tgz", + "integrity": "sha512-S36mOoi1Sb6Fz98fBfE+UZSpYw5mJm0NUHtIKrOuNcqeFauy1J6dIvXm2KRVKobOSaGq4t/hBXdN4HGU3wL9Wg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.28.5", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-validator-option": "^7.27.1", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.28.5", + "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.27.1", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.27.1", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.27.1", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.28.3", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", + "@babel/plugin-syntax-import-assertions": "^7.27.1", + "@babel/plugin-syntax-import-attributes": "^7.27.1", + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.27.1", + "@babel/plugin-transform-async-generator-functions": "^7.28.0", + "@babel/plugin-transform-async-to-generator": "^7.27.1", + "@babel/plugin-transform-block-scoped-functions": "^7.27.1", + "@babel/plugin-transform-block-scoping": "^7.28.5", + "@babel/plugin-transform-class-properties": "^7.27.1", + "@babel/plugin-transform-class-static-block": "^7.28.3", + "@babel/plugin-transform-classes": "^7.28.4", + "@babel/plugin-transform-computed-properties": "^7.27.1", + "@babel/plugin-transform-destructuring": "^7.28.5", + "@babel/plugin-transform-dotall-regex": "^7.27.1", + "@babel/plugin-transform-duplicate-keys": "^7.27.1", + "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.27.1", + "@babel/plugin-transform-dynamic-import": "^7.27.1", + "@babel/plugin-transform-explicit-resource-management": "^7.28.0", + "@babel/plugin-transform-exponentiation-operator": "^7.28.5", + "@babel/plugin-transform-export-namespace-from": "^7.27.1", + "@babel/plugin-transform-for-of": "^7.27.1", + "@babel/plugin-transform-function-name": "^7.27.1", + "@babel/plugin-transform-json-strings": "^7.27.1", + "@babel/plugin-transform-literals": "^7.27.1", + "@babel/plugin-transform-logical-assignment-operators": "^7.28.5", + "@babel/plugin-transform-member-expression-literals": "^7.27.1", + "@babel/plugin-transform-modules-amd": "^7.27.1", + "@babel/plugin-transform-modules-commonjs": "^7.27.1", + "@babel/plugin-transform-modules-systemjs": "^7.28.5", + "@babel/plugin-transform-modules-umd": "^7.27.1", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.27.1", + "@babel/plugin-transform-new-target": "^7.27.1", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.27.1", + "@babel/plugin-transform-numeric-separator": "^7.27.1", + "@babel/plugin-transform-object-rest-spread": "^7.28.4", + "@babel/plugin-transform-object-super": "^7.27.1", + "@babel/plugin-transform-optional-catch-binding": "^7.27.1", + "@babel/plugin-transform-optional-chaining": "^7.28.5", + "@babel/plugin-transform-parameters": "^7.27.7", + "@babel/plugin-transform-private-methods": "^7.27.1", + "@babel/plugin-transform-private-property-in-object": "^7.27.1", + "@babel/plugin-transform-property-literals": "^7.27.1", + "@babel/plugin-transform-regenerator": "^7.28.4", + "@babel/plugin-transform-regexp-modifiers": "^7.27.1", + "@babel/plugin-transform-reserved-words": "^7.27.1", + "@babel/plugin-transform-shorthand-properties": "^7.27.1", + "@babel/plugin-transform-spread": "^7.27.1", + "@babel/plugin-transform-sticky-regex": "^7.27.1", + "@babel/plugin-transform-template-literals": "^7.27.1", + "@babel/plugin-transform-typeof-symbol": "^7.27.1", + "@babel/plugin-transform-unicode-escapes": "^7.27.1", + "@babel/plugin-transform-unicode-property-regex": "^7.27.1", + "@babel/plugin-transform-unicode-regex": "^7.27.1", + "@babel/plugin-transform-unicode-sets-regex": "^7.27.1", + "@babel/preset-modules": "0.1.6-no-external-plugins", + "babel-plugin-polyfill-corejs2": "^0.4.14", + "babel-plugin-polyfill-corejs3": "^0.13.0", + "babel-plugin-polyfill-regenerator": "^0.6.5", + "core-js-compat": "^3.43.0", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-modules": { + "version": "0.1.6-no-external-plugins", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", + "integrity": "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/@babel/preset-typescript": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.28.5.tgz", + "integrity": "sha512-+bQy5WOI2V6LJZpPVxY+yp66XdZ2yifu0Mc1aP5CQKgjn4QM5IN2i5fAZ4xKop47pr8rpVhiAeu+nDQa12C8+g==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-validator-option": "^7.27.1", + "@babel/plugin-syntax-jsx": "^7.27.1", + "@babel/plugin-transform-modules-commonjs": "^7.27.1", + "@babel/plugin-transform-typescript": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", + "integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz", + "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.5", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse--for-generate-function-map": { + "name": "@babel/traverse", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz", + "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.5", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", + "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@callstack/react-theme-provider": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@callstack/react-theme-provider/-/react-theme-provider-3.0.9.tgz", + "integrity": "sha512-tTQ0uDSCL0ypeMa8T/E9wAZRGKWj8kXP7+6RYgPTfOPs9N07C9xM8P02GJ3feETap4Ux5S69D9nteq9mEj86NA==", + "license": "MIT", + "dependencies": { + "deepmerge": "^3.2.0", + "hoist-non-react-statics": "^3.3.0" + }, + "peerDependencies": { + "react": ">=16.3.0" + } + }, + "node_modules/@callstack/react-theme-provider/node_modules/deepmerge": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-3.3.0.tgz", + "integrity": "sha512-GRQOafGHwMHpjPx9iCvTgpu9NojZ49q794EEL94JVEw6VaeA8XTUyBKvAkOOjBX9oJNiV6G3P+T+tihFjo2TqA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@dominicvonk/react-native-apk-installer": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@dominicvonk/react-native-apk-installer/-/react-native-apk-installer-2.2.2.tgz", + "integrity": "sha512-1JIqdVaER7P7tL//z2fEvbATcNPFgMzM88MncDZB6cr9CQl9RegbIwYiInlTDNkv+3lmAOvJ+LnCsvsYWyoX7w==", + "license": "MIT", + "peerDependencies": { + "react": "*", + "react-native": ">=0.60.0-rc.0 <1.0.x" + } + }, + "node_modules/@egjs/hammerjs": { + "version": "2.0.17", + "resolved": "https://registry.npmjs.org/@egjs/hammerjs/-/hammerjs-2.0.17.tgz", + "integrity": "sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A==", + "license": "MIT", + "dependencies": { + "@types/hammerjs": "^2.0.36" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "license": "MIT", + "optional": true + }, + "node_modules/@hapi/hoek": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", + "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", + "devOptional": true, + "license": "BSD-3-Clause" + }, + "node_modules/@hapi/topo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", + "devOptional": true, + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/ttlcache": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@isaacs/ttlcache/-/ttlcache-1.4.1.tgz", + "integrity": "sha512-RQgQ4uQ+pLbqXfOmieB91ejmLwvSgv9nLx6sT6sD83s7umBypgg+OIBOBbEUiJXrfpnp9j0mRhYYdzp9uqq3lA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "license": "ISC", + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/create-cache-key-function": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/create-cache-key-function/-/create-cache-key-function-29.7.0.tgz", + "integrity": "sha512-4QqS3LY5PBmTRHj9sAg1HLoPzqAI0uOX6wI/TRqHIcOxlFidy6YEmCQJk6FSZjNLGCeubDMfmkWL+qaLKhSGQA==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { + "version": "5.1.1-v1", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", + "integrity": "sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-scope": "5.1.1" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + } + }, + "node_modules/@npmcli/fs/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "deprecated": "This functionality has been moved to @npmcli/fs", + "license": "MIT", + "optional": true, + "dependencies": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@react-native-async-storage/async-storage": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-2.2.0.tgz", + "integrity": "sha512-gvRvjR5JAaUZF8tv2Kcq/Gbt3JHwbKFYfmb445rhOj6NUMx3qPLixmDx5pZAyb9at1bYvJ4/eTUipU5aki45xw==", + "license": "MIT", + "dependencies": { + "merge-options": "^3.0.4" + }, + "peerDependencies": { + "react-native": "^0.0.0-0 || >=0.65 <1.0" + } + }, + "node_modules/@react-native-clipboard/clipboard": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/@react-native-clipboard/clipboard/-/clipboard-1.16.3.tgz", + "integrity": "sha512-cMIcvoZKIrShzJHEaHbTAp458R9WOv0fB6UyC7Ek4Qk561Ow/DrzmmJmH/rAZg21Z6ixJ4YSdFDC14crqIBmCQ==", + "license": "MIT", + "workspaces": [ + "example" + ], + "peerDependencies": { + "react": ">= 16.9.0", + "react-native": ">= 0.61.5", + "react-native-macos": ">= 0.61.0", + "react-native-windows": ">= 0.61.0" + }, + "peerDependenciesMeta": { + "react-native-macos": { + "optional": true + }, + "react-native-windows": { + "optional": true + } + } + }, + "node_modules/@react-native-community/checkbox": { + "version": "0.5.20", + "resolved": "https://registry.npmjs.org/@react-native-community/checkbox/-/checkbox-0.5.20.tgz", + "integrity": "sha512-NuTAOFmttPEX7cwDbVr5Rf0HR86zCzX2FllebMayxca//dFH6X5DLySftra/PC2K9kt42yashWK7T2Tucm5JTQ==", + "license": "MIT", + "peerDependencies": { + "react": "*", + "react-native": ">= 0.62", + "react-native-windows": ">=0.62" + }, + "peerDependenciesMeta": { + "react-native-windows": { + "optional": true + } + } + }, + "node_modules/@react-native-community/cli": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@react-native-community/cli/-/cli-20.0.0.tgz", + "integrity": "sha512-/cMnGl5V1rqnbElY1Fvga1vfw0d3bnqiJLx2+2oh7l9ulnXfVRWb5tU2kgBqiMxuDOKA+DQoifC9q/tvkj5K2w==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@react-native-community/cli-clean": "20.0.0", + "@react-native-community/cli-config": "20.0.0", + "@react-native-community/cli-doctor": "20.0.0", + "@react-native-community/cli-server-api": "20.0.0", + "@react-native-community/cli-tools": "20.0.0", + "@react-native-community/cli-types": "20.0.0", + "chalk": "^4.1.2", + "commander": "^9.4.1", + "deepmerge": "^4.3.0", + "execa": "^5.0.0", + "find-up": "^5.0.0", + "fs-extra": "^8.1.0", + "graceful-fs": "^4.1.3", + "prompts": "^2.4.2", + "semver": "^7.5.2" + }, + "bin": { + "rnc-cli": "build/bin.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@react-native-community/cli-clean": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-clean/-/cli-clean-20.0.0.tgz", + "integrity": "sha512-YmdNRcT+Dp8lC7CfxSDIfPMbVPEXVFzBH62VZNbYGxjyakqAvoQUFTYPgM2AyFusAr4wDFbDOsEv88gCDwR3ig==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@react-native-community/cli-tools": "20.0.0", + "chalk": "^4.1.2", + "execa": "^5.0.0", + "fast-glob": "^3.3.2" + } + }, + "node_modules/@react-native-community/cli-config": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-config/-/cli-config-20.0.0.tgz", + "integrity": "sha512-5Ky9ceYuDqG62VIIpbOmkg8Lybj2fUjf/5wK4UO107uRqejBgNgKsbGnIZgEhREcaSEOkujWrroJ9gweueLfBg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@react-native-community/cli-tools": "20.0.0", + "chalk": "^4.1.2", + "cosmiconfig": "^9.0.0", + "deepmerge": "^4.3.0", + "fast-glob": "^3.3.2", + "joi": "^17.2.1" + } + }, + "node_modules/@react-native-community/cli-config-android": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-config-android/-/cli-config-android-20.0.0.tgz", + "integrity": "sha512-asv60qYCnL1v0QFWcG9r1zckeFlKG+14GGNyPXY72Eea7RX5Cxdx8Pb6fIPKroWH1HEWjYH9KKHksMSnf9FMKw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@react-native-community/cli-tools": "20.0.0", + "chalk": "^4.1.2", + "fast-glob": "^3.3.2", + "fast-xml-parser": "^4.4.1" + } + }, + "node_modules/@react-native-community/cli-config-apple": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-config-apple/-/cli-config-apple-20.0.0.tgz", + "integrity": "sha512-PS1gNOdpeQ6w7dVu1zi++E+ix2D0ZkGC2SQP6Y/Qp002wG4se56esLXItYiiLrJkhH21P28fXdmYvTEkjSm9/Q==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@react-native-community/cli-tools": "20.0.0", + "chalk": "^4.1.2", + "execa": "^5.0.0", + "fast-glob": "^3.3.2" + } + }, + "node_modules/@react-native-community/cli-doctor": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-doctor/-/cli-doctor-20.0.0.tgz", + "integrity": "sha512-cPHspi59+Fy41FDVxt62ZWoicCZ1o34k8LAl64NVSY0lwPl+CEi78jipXJhtfkVqSTetloA8zexa/vSAcJy57Q==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@react-native-community/cli-config": "20.0.0", + "@react-native-community/cli-platform-android": "20.0.0", + "@react-native-community/cli-platform-apple": "20.0.0", + "@react-native-community/cli-platform-ios": "20.0.0", + "@react-native-community/cli-tools": "20.0.0", + "chalk": "^4.1.2", + "command-exists": "^1.2.8", + "deepmerge": "^4.3.0", + "envinfo": "^7.13.0", + "execa": "^5.0.0", + "node-stream-zip": "^1.9.1", + "ora": "^5.4.1", + "semver": "^7.5.2", + "wcwidth": "^1.0.1", + "yaml": "^2.2.1" + } + }, + "node_modules/@react-native-community/cli-doctor/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "devOptional": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@react-native-community/cli-platform-android": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-android/-/cli-platform-android-20.0.0.tgz", + "integrity": "sha512-th3ji1GRcV6ACelgC0wJtt9daDZ+63/52KTwL39xXGoqczFjml4qERK90/ppcXU0Ilgq55ANF8Pr+UotQ2AB/A==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@react-native-community/cli-config-android": "20.0.0", + "@react-native-community/cli-tools": "20.0.0", + "chalk": "^4.1.2", + "execa": "^5.0.0", + "logkitty": "^0.7.1" + } + }, + "node_modules/@react-native-community/cli-platform-apple": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-apple/-/cli-platform-apple-20.0.0.tgz", + "integrity": "sha512-rZZCnAjUHN1XBgiWTAMwEKpbVTO4IHBSecdd1VxJFeTZ7WjmstqA6L/HXcnueBgxrzTCRqvkRIyEQXxC1OfhGw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@react-native-community/cli-config-apple": "20.0.0", + "@react-native-community/cli-tools": "20.0.0", + "chalk": "^4.1.2", + "execa": "^5.0.0", + "fast-xml-parser": "^4.4.1" + } + }, + "node_modules/@react-native-community/cli-platform-ios": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-ios/-/cli-platform-ios-20.0.0.tgz", + "integrity": "sha512-Z35M+4gUJgtS4WqgpKU9/XYur70nmj3Q65c9USyTq6v/7YJ4VmBkmhC9BticPs6wuQ9Jcv0NyVCY0Wmh6kMMYw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@react-native-community/cli-platform-apple": "20.0.0" + } + }, + "node_modules/@react-native-community/cli-server-api": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-server-api/-/cli-server-api-20.0.0.tgz", + "integrity": "sha512-Ves21bXtjUK3tQbtqw/NdzpMW1vR2HvYCkUQ/MXKrJcPjgJnXQpSnTqHXz6ZdBlMbbwLJXOhSPiYzxb5/v4CDg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@react-native-community/cli-tools": "20.0.0", + "body-parser": "^1.20.3", + "compression": "^1.7.1", + "connect": "^3.6.5", + "errorhandler": "^1.5.1", + "nocache": "^3.0.1", + "open": "^6.2.0", + "pretty-format": "^29.7.0", + "serve-static": "^1.13.1", + "ws": "^6.2.3" + } + }, + "node_modules/@react-native-community/cli-tools": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-tools/-/cli-tools-20.0.0.tgz", + "integrity": "sha512-akSZGxr1IajJ8n0YCwQoA3DI0HttJ0WB7M3nVpb0lOM+rJpsBN7WG5Ft+8ozb6HyIPX+O+lLeYazxn5VNG/Xhw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@vscode/sudo-prompt": "^9.0.0", + "appdirsjs": "^1.2.4", + "chalk": "^4.1.2", + "execa": "^5.0.0", + "find-up": "^5.0.0", + "launch-editor": "^2.9.1", + "mime": "^2.4.1", + "ora": "^5.4.1", + "prompts": "^2.4.2", + "semver": "^7.5.2" + } + }, + "node_modules/@react-native-community/cli-tools/node_modules/mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "devOptional": true, + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/@react-native-community/cli-tools/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "devOptional": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@react-native-community/cli-types": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-types/-/cli-types-20.0.0.tgz", + "integrity": "sha512-7J4hzGWOPTBV1d30Pf2NidV+bfCWpjfCOiGO3HUhz1fH4MvBM0FbbBmE9LE5NnMz7M8XSRSi68ZGYQXgLBB2Qw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "joi": "^17.2.1" + } + }, + "node_modules/@react-native-community/cli/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "devOptional": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@react-native-community/datetimepicker": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/@react-native-community/datetimepicker/-/datetimepicker-8.5.1.tgz", + "integrity": "sha512-TuwM1ORbxCjOp1GOtONj0QnpDpVfq0F4UlfKZYPxL/vmriaLHt2Kgvw63Bv0Bpep4eOkslVVSS1IRfRI6d392g==", + "license": "MIT", + "dependencies": { + "invariant": "^2.2.4" + }, + "peerDependencies": { + "expo": ">=52.0.0", + "react": "*", + "react-native": "*", + "react-native-windows": "*" + }, + "peerDependenciesMeta": { + "expo": { + "optional": true + }, + "react-native-windows": { + "optional": true + } + } + }, + "node_modules/@react-native-community/netinfo": { + "version": "11.4.1", + "resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-11.4.1.tgz", + "integrity": "sha512-B0BYAkghz3Q2V09BF88RA601XursIEA111tnc2JOaN7axJWmNefmfjZqw/KdSxKZp7CZUuPpjBmz/WCR9uaHYg==", + "license": "MIT", + "peerDependencies": { + "react-native": ">=0.59" + } + }, + "node_modules/@react-native-documents/picker": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@react-native-documents/picker/-/picker-11.0.0.tgz", + "integrity": "sha512-SyP4j88HyyHOUA/N5UGsuf5Ij7BURHSPbZ7F12yjCNVwjXkeFJcFzyxkOGbgNQs9U5b88TgoQDTyjvmYNXYjJg==", + "license": "MIT", + "peerDependencies": { + "react": "*", + "react-native": ">=0.79.0" + } + }, + "node_modules/@react-native/assets-registry": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/assets-registry/-/assets-registry-0.82.1.tgz", + "integrity": "sha512-B1SRwpntaAcckiatxbjzylvNK562Ayza05gdJCjDQHTiDafa1OABmyB5LHt7qWDOpNkaluD+w11vHF7pBmTpzQ==", + "license": "MIT", + "engines": { + "node": ">= 20.19.4" + } + }, + "node_modules/@react-native/babel-plugin-codegen": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.82.1.tgz", + "integrity": "sha512-wzmEz/RlR4SekqmaqeQjdMVh4LsnL9e62mrOikOOkHDQ3QN0nrKLuUDzXyYptVbxQ0IRua4pTm3efJLymDBoEg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.3", + "@react-native/codegen": "0.82.1" + }, + "engines": { + "node": ">= 20.19.4" + } + }, + "node_modules/@react-native/babel-preset": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/babel-preset/-/babel-preset-0.82.1.tgz", + "integrity": "sha512-Olj7p4XIsUWLKjlW46CqijaXt45PZT9Lbvv/Hz698FXTenPKk4k7sy6RGRGZPWO2TCBBfcb73dus1iNHRFSq7g==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/plugin-proposal-export-default-from": "^7.24.7", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-default-from": "^7.24.7", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-transform-arrow-functions": "^7.24.7", + "@babel/plugin-transform-async-generator-functions": "^7.25.4", + "@babel/plugin-transform-async-to-generator": "^7.24.7", + "@babel/plugin-transform-block-scoping": "^7.25.0", + "@babel/plugin-transform-class-properties": "^7.25.4", + "@babel/plugin-transform-classes": "^7.25.4", + "@babel/plugin-transform-computed-properties": "^7.24.7", + "@babel/plugin-transform-destructuring": "^7.24.8", + "@babel/plugin-transform-flow-strip-types": "^7.25.2", + "@babel/plugin-transform-for-of": "^7.24.7", + "@babel/plugin-transform-function-name": "^7.25.1", + "@babel/plugin-transform-literals": "^7.25.2", + "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", + "@babel/plugin-transform-modules-commonjs": "^7.24.8", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", + "@babel/plugin-transform-numeric-separator": "^7.24.7", + "@babel/plugin-transform-object-rest-spread": "^7.24.7", + "@babel/plugin-transform-optional-catch-binding": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.8", + "@babel/plugin-transform-parameters": "^7.24.7", + "@babel/plugin-transform-private-methods": "^7.24.7", + "@babel/plugin-transform-private-property-in-object": "^7.24.7", + "@babel/plugin-transform-react-display-name": "^7.24.7", + "@babel/plugin-transform-react-jsx": "^7.25.2", + "@babel/plugin-transform-react-jsx-self": "^7.24.7", + "@babel/plugin-transform-react-jsx-source": "^7.24.7", + "@babel/plugin-transform-regenerator": "^7.24.7", + "@babel/plugin-transform-runtime": "^7.24.7", + "@babel/plugin-transform-shorthand-properties": "^7.24.7", + "@babel/plugin-transform-spread": "^7.24.7", + "@babel/plugin-transform-sticky-regex": "^7.24.7", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/plugin-transform-unicode-regex": "^7.24.7", + "@babel/template": "^7.25.0", + "@react-native/babel-plugin-codegen": "0.82.1", + "babel-plugin-syntax-hermes-parser": "0.32.0", + "babel-plugin-transform-flow-enums": "^0.0.2", + "react-refresh": "^0.14.0" + }, + "engines": { + "node": ">= 20.19.4" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "node_modules/@react-native/codegen": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.82.1.tgz", + "integrity": "sha512-ezXTN70ygVm9l2m0i+pAlct0RntoV4afftWMGUIeAWLgaca9qItQ54uOt32I/9dBJvzBibT33luIR/pBG0dQvg==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/parser": "^7.25.3", + "glob": "^7.1.1", + "hermes-parser": "0.32.0", + "invariant": "^2.2.4", + "nullthrows": "^1.1.1", + "yargs": "^17.6.2" + }, + "engines": { + "node": ">= 20.19.4" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "node_modules/@react-native/community-cli-plugin": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/community-cli-plugin/-/community-cli-plugin-0.82.1.tgz", + "integrity": "sha512-H/eMdtOy9nEeX7YVeEG1N2vyCoifw3dr9OV8++xfUElNYV7LtSmJ6AqxZUUfxGJRDFPQvaU/8enmJlM/l11VxQ==", + "license": "MIT", + "dependencies": { + "@react-native/dev-middleware": "0.82.1", + "debug": "^4.4.0", + "invariant": "^2.2.4", + "metro": "^0.83.1", + "metro-config": "^0.83.1", + "metro-core": "^0.83.1", + "semver": "^7.1.3" + }, + "engines": { + "node": ">= 20.19.4" + }, + "peerDependencies": { + "@react-native-community/cli": "*", + "@react-native/metro-config": "*" + }, + "peerDependenciesMeta": { + "@react-native-community/cli": { + "optional": true + }, + "@react-native/metro-config": { + "optional": true + } + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@react-native/debugger-frontend": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/debugger-frontend/-/debugger-frontend-0.82.1.tgz", + "integrity": "sha512-a2O6M7/OZ2V9rdavOHyCQ+10z54JX8+B+apYKCQ6a9zoEChGTxUMG2YzzJ8zZJVvYf1ByWSNxv9Se0dca1hO9A==", + "license": "BSD-3-Clause", + "engines": { + "node": ">= 20.19.4" + } + }, + "node_modules/@react-native/debugger-shell": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/debugger-shell/-/debugger-shell-0.82.1.tgz", + "integrity": "sha512-fdRHAeqqPT93bSrxfX+JHPpCXHApfDUdrXMXhoxlPgSzgXQXJDykIViKhtpu0M6slX6xU/+duq+AtP/qWJRpBw==", + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.6", + "fb-dotslash": "0.5.8" + }, + "engines": { + "node": ">= 20.19.4" + } + }, + "node_modules/@react-native/dev-middleware": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/dev-middleware/-/dev-middleware-0.82.1.tgz", + "integrity": "sha512-wuOIzms/Qg5raBV6Ctf2LmgzEOCqdP3p1AYN4zdhMT110c39TVMbunpBaJxm0Kbt2HQ762MQViF9naxk7SBo4w==", + "license": "MIT", + "dependencies": { + "@isaacs/ttlcache": "^1.4.1", + "@react-native/debugger-frontend": "0.82.1", + "@react-native/debugger-shell": "0.82.1", + "chrome-launcher": "^0.15.2", + "chromium-edge-launcher": "^0.2.0", + "connect": "^3.6.5", + "debug": "^4.4.0", + "invariant": "^2.2.4", + "nullthrows": "^1.1.1", + "open": "^7.0.3", + "serve-static": "^1.16.2", + "ws": "^6.2.3" + }, + "engines": { + "node": ">= 20.19.4" + } + }, + "node_modules/@react-native/dev-middleware/node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@react-native/dev-middleware/node_modules/open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@react-native/eslint-config": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/eslint-config/-/eslint-config-0.82.1.tgz", + "integrity": "sha512-K3xCTEAg8WDd7WpDhQ1hsKbuY3OXaQtqpokeOdgyJag100ZvUX84YIaqDqsVaAZqjA53zCA5PbxerWs6mPA+PQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/eslint-parser": "^7.25.1", + "@react-native/eslint-plugin": "0.82.1", + "@typescript-eslint/eslint-plugin": "^8.36.0", + "@typescript-eslint/parser": "^8.36.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-ft-flow": "^2.0.1", + "eslint-plugin-jest": "^29.0.1", + "eslint-plugin-react": "^7.30.1", + "eslint-plugin-react-hooks": "^5.2.0", + "eslint-plugin-react-native": "^4.0.0" + }, + "engines": { + "node": ">= 20.19.4" + }, + "peerDependencies": { + "eslint": ">=8", + "prettier": ">=2" + } + }, + "node_modules/@react-native/eslint-plugin": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/eslint-plugin/-/eslint-plugin-0.82.1.tgz", + "integrity": "sha512-PU0ho8pNp24pdegIpYRAwppfO8z7werpoTts2CJ/wXYQ+ryZKa2M31DHW+kl+K3wwwqVqFKAzLh4t3sP/mOqMQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20.19.4" + } + }, + "node_modules/@react-native/gradle-plugin": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/gradle-plugin/-/gradle-plugin-0.82.1.tgz", + "integrity": "sha512-KkF/2T1NSn6EJ5ALNT/gx0MHlrntFHv8YdooH9OOGl9HQn5NM0ZmQSr86o5utJsGc7ME3R6p3SaQuzlsFDrn8Q==", + "license": "MIT", + "engines": { + "node": ">= 20.19.4" + } + }, + "node_modules/@react-native/js-polyfills": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/js-polyfills/-/js-polyfills-0.82.1.tgz", + "integrity": "sha512-tf70X7pUodslOBdLN37J57JmDPB/yiZcNDzS2m+4bbQzo8fhx3eG9QEBv5n4fmzqfGAgSB4BWRHgDMXmmlDSVA==", + "license": "MIT", + "engines": { + "node": ">= 20.19.4" + } + }, + "node_modules/@react-native/metro-babel-transformer": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.82.1.tgz", + "integrity": "sha512-kVQyYxYe1Da7cr7uGK9c44O6vTzM8YY3KW9CSLhhV1CGw7jmohU1HfLaUxDEmYfFZMc4Kj3JsIEbdUlaHMtprQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@react-native/babel-preset": "0.82.1", + "hermes-parser": "0.32.0", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">= 20.19.4" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "node_modules/@react-native/metro-config": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/metro-config/-/metro-config-0.82.1.tgz", + "integrity": "sha512-mAY6R3xnDMlmDOrUCAtLTjIkli26DZt4LNVuAjDEdnlv5sHANOr5x4qpMn7ea1p9Q/tpfHLalPQUQeJ8CZH4gA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@react-native/js-polyfills": "0.82.1", + "@react-native/metro-babel-transformer": "0.82.1", + "metro-config": "^0.83.1", + "metro-runtime": "^0.83.1" + }, + "engines": { + "node": ">= 20.19.4" + } + }, + "node_modules/@react-native/new-app-screen": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/new-app-screen/-/new-app-screen-0.82.1.tgz", + "integrity": "sha512-cViiTco2ukQVd683tGk+7bwf8WMS6A9hg5HUB3LjFli4pzOinuDlC5jzym6RiROhS5B3NmQ3CTccJmWgsJQL1w==", + "license": "MIT", + "engines": { + "node": ">= 20.19.4" + }, + "peerDependencies": { + "@types/react": "^19.1.0", + "react": "*", + "react-native": "*" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@react-native/normalize-color": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@react-native/normalize-color/-/normalize-color-2.1.0.tgz", + "integrity": "sha512-Z1jQI2NpdFJCVgpY+8Dq/Bt3d+YUi1928Q+/CZm/oh66fzM0RUl54vvuXlPJKybH4pdCZey1eDTPaLHkMPNgWA==", + "license": "MIT" + }, + "node_modules/@react-native/normalize-colors": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.82.1.tgz", + "integrity": "sha512-CCfTR1uX+Z7zJTdt3DNX9LUXr2zWXsNOyLbwupW2wmRzrxlHRYfmLgTABzRL/cKhh0Ubuwn15o72MQChvCRaHw==", + "license": "MIT" + }, + "node_modules/@react-native/typescript-config": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/typescript-config/-/typescript-config-0.82.1.tgz", + "integrity": "sha512-kCTjmBg44p0kqU4xEMg7l6SNJyHWTHuTqiT9MpHasEYcnVpBWyEQsSQAiVKONHwcUWcAktrGVLE1dYGfBmPJ3Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@react-native/virtualized-lists": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/@react-native/virtualized-lists/-/virtualized-lists-0.82.1.tgz", + "integrity": "sha512-f5zpJg9gzh7JtCbsIwV+4kP3eI0QBuA93JGmwFRd4onQ3DnCjV2J5pYqdWtM95sjSKK1dyik59Gj01lLeKqs1Q==", + "license": "MIT", + "dependencies": { + "invariant": "^2.2.4", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">= 20.19.4" + }, + "peerDependencies": { + "@types/react": "^19.1.1", + "react": "*", + "react-native": "*" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@react-navigation/core": { + "version": "7.13.2", + "resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-7.13.2.tgz", + "integrity": "sha512-A0pFeZlKp+FJob2lVr7otDt3M4rsSJrnAfXWoWR9JVeFtfEXsH/C0s7xtpDCMRUO58kzSBoTF1GYzoMC5DLD4g==", + "license": "MIT", + "dependencies": { + "@react-navigation/routers": "^7.5.2", + "escape-string-regexp": "^4.0.0", + "fast-deep-equal": "^3.1.3", + "nanoid": "^3.3.11", + "query-string": "^7.1.3", + "react-is": "^19.1.0", + "use-latest-callback": "^0.2.4", + "use-sync-external-store": "^1.5.0" + }, + "peerDependencies": { + "react": ">= 18.2.0" + } + }, + "node_modules/@react-navigation/core/node_modules/react-is": { + "version": "19.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.0.tgz", + "integrity": "sha512-x3Ax3kNSMIIkyVYhWPyO09bu0uttcAIoecO/um/rKGQ4EltYWVYtyiGkS/3xMynrbVQdS69Jhlv8FXUEZehlzA==", + "license": "MIT" + }, + "node_modules/@react-navigation/drawer": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@react-navigation/drawer/-/drawer-7.7.4.tgz", + "integrity": "sha512-53/X1ySui/uOc21lJEN5j+RsY1O+uF+yzqnj0xjtJRSCwuKvqFpaSjRkkXn6/2Zt9V2kf19VtniehuzNpGcdkg==", + "license": "MIT", + "dependencies": { + "@react-navigation/elements": "^2.8.3", + "color": "^4.2.3", + "react-native-drawer-layout": "^4.2.0", + "use-latest-callback": "^0.2.4" + }, + "peerDependencies": { + "@react-navigation/native": "^7.1.21", + "react": ">= 18.2.0", + "react-native": "*", + "react-native-gesture-handler": ">= 2.0.0", + "react-native-reanimated": ">= 2.0.0", + "react-native-safe-area-context": ">= 4.0.0", + "react-native-screens": ">= 4.0.0" + } + }, + "node_modules/@react-navigation/elements": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/@react-navigation/elements/-/elements-2.8.3.tgz", + "integrity": "sha512-0c5nSDPP3bUFujgkSVqqMShaAup3XIxNe1KTK9LSmwKgWEneyo6OPIjIdiEwPlZvJZKi7ag5hDjacQLGwO0LGA==", + "license": "MIT", + "dependencies": { + "color": "^4.2.3", + "use-latest-callback": "^0.2.4", + "use-sync-external-store": "^1.5.0" + }, + "peerDependencies": { + "@react-native-masked-view/masked-view": ">= 0.2.0", + "@react-navigation/native": "^7.1.21", + "react": ">= 18.2.0", + "react-native": "*", + "react-native-safe-area-context": ">= 4.0.0" + }, + "peerDependenciesMeta": { + "@react-native-masked-view/masked-view": { + "optional": true + } + } + }, + "node_modules/@react-navigation/native": { + "version": "7.1.21", + "resolved": "https://registry.npmjs.org/@react-navigation/native/-/native-7.1.21.tgz", + "integrity": "sha512-mhpAewdivBL01ibErr91FUW9bvKhfAF6Xv/yr6UOJtDhv0jU6iUASUcA3i3T8VJCOB/vxmoke7VDp8M+wBFs/Q==", + "license": "MIT", + "dependencies": { + "@react-navigation/core": "^7.13.2", + "escape-string-regexp": "^4.0.0", + "fast-deep-equal": "^3.1.3", + "nanoid": "^3.3.11", + "use-latest-callback": "^0.2.4" + }, + "peerDependencies": { + "react": ">= 18.2.0", + "react-native": "*" + } + }, + "node_modules/@react-navigation/routers": { + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/@react-navigation/routers/-/routers-7.5.2.tgz", + "integrity": "sha512-kymreY5aeTz843E+iPAukrsOtc7nabAH6novtAPREmmGu77dQpfxPB2ZWpKb5nRErIRowp1kYRoN2Ckl+S6JYw==", + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11" + } + }, + "node_modules/@react-navigation/stack": { + "version": "7.6.7", + "resolved": "https://registry.npmjs.org/@react-navigation/stack/-/stack-7.6.7.tgz", + "integrity": "sha512-8NZWKTBYRVl8oSvhLKs26C6Dw5a3OhyfRc8ITS9A0kRSYaaX/KcZpObbAxp8kCJfTaJ7ZmghyX2NCGwnKw6V7A==", + "license": "MIT", + "dependencies": { + "@react-navigation/elements": "^2.8.3", + "color": "^4.2.3", + "use-latest-callback": "^0.2.4" + }, + "peerDependencies": { + "@react-navigation/native": "^7.1.21", + "react": ">= 18.2.0", + "react-native": "*", + "react-native-gesture-handler": ">= 2.0.0", + "react-native-safe-area-context": ">= 4.0.0", + "react-native-screens": ">= 4.0.0" + } + }, + "node_modules/@sideway/address": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", + "integrity": "sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==", + "devOptional": true, + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "node_modules/@sideway/formula": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==", + "devOptional": true, + "license": "BSD-3-Clause" + }, + "node_modules/@sideway/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", + "devOptional": true, + "license": "BSD-3-Clause" + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "license": "MIT" + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/geojson": { + "version": "7946.0.16", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", + "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", + "license": "MIT" + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/hammerjs": { + "version": "2.0.46", + "resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.46.tgz", + "integrity": "sha512-ynRvcq6wvqexJ9brDMS4BnBLzmr0e14d6ZJTEShTBWKymQiHwlAyGu0ZPEFI2Fh1U53F7tN9ufClWM5KvqkKOw==", + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jest": { + "version": "29.5.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", + "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/@types/react": { + "version": "19.2.7", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.7.tgz", + "integrity": "sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-test-renderer": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/@types/react-test-renderer/-/react-test-renderer-19.1.0.tgz", + "integrity": "sha512-XD0WZrHqjNrxA/MaR9O22w/RNidWR9YZmBdRGI7wcnWGrv/3dA8wKCJ8m63Sn+tLJhcjmuhOi629N66W6kgWzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", + "license": "MIT" + }, + "node_modules/@types/use-sync-external-store": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz", + "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==", + "license": "MIT" + }, + "node_modules/@types/yargs": { + "version": "17.0.35", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", + "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.48.0.tgz", + "integrity": "sha512-XxXP5tL1txl13YFtrECECQYeZjBZad4fyd3cFV4a19LkAY/bIp9fev3US4S5fDVV2JaYFiKAZ/GRTOLer+mbyQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.48.0", + "@typescript-eslint/type-utils": "8.48.0", + "@typescript-eslint/utils": "8.48.0", + "@typescript-eslint/visitor-keys": "8.48.0", + "graphemer": "^1.4.0", + "ignore": "^7.0.0", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.48.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.48.0.tgz", + "integrity": "sha512-jCzKdm/QK0Kg4V4IK/oMlRZlY+QOcdjv89U2NgKHZk1CYTj82/RVSx1mV/0gqCVMJ/DA+Zf/S4NBWNF8GQ+eqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.48.0", + "@typescript-eslint/types": "8.48.0", + "@typescript-eslint/typescript-estree": "8.48.0", + "@typescript-eslint/visitor-keys": "8.48.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.48.0.tgz", + "integrity": "sha512-Ne4CTZyRh1BecBf84siv42wv5vQvVmgtk8AuiEffKTUo3DrBaGYZueJSxxBZ8fjk/N3DrgChH4TOdIOwOwiqqw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.48.0", + "@typescript-eslint/types": "^8.48.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.48.0.tgz", + "integrity": "sha512-uGSSsbrtJrLduti0Q1Q9+BF1/iFKaxGoQwjWOIVNJv0o6omrdyR8ct37m4xIl5Zzpkp69Kkmvom7QFTtue89YQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.48.0", + "@typescript-eslint/visitor-keys": "8.48.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.48.0.tgz", + "integrity": "sha512-WNebjBdFdyu10sR1M4OXTt2OkMd5KWIL+LLfeH9KhgP+jzfDV/LI3eXzwJ1s9+Yc0Kzo2fQCdY/OpdusCMmh6w==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.48.0.tgz", + "integrity": "sha512-zbeVaVqeXhhab6QNEKfK96Xyc7UQuoFWERhEnj3mLVnUWrQnv15cJNseUni7f3g557gm0e46LZ6IJ4NJVOgOpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.48.0", + "@typescript-eslint/typescript-estree": "8.48.0", + "@typescript-eslint/utils": "8.48.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.48.0.tgz", + "integrity": "sha512-cQMcGQQH7kwKoVswD1xdOytxQR60MWKM1di26xSUtxehaDs/32Zpqsu5WJlXTtTTqyAVK8R7hvsUnIXRS+bjvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.48.0.tgz", + "integrity": "sha512-ljHab1CSO4rGrQIAyizUS6UGHHCiAYhbfcIZ1zVJr5nMryxlXMVWS3duFPSKvSUbFPwkXMFk1k0EMIjub4sRRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.48.0", + "@typescript-eslint/tsconfig-utils": "8.48.0", + "@typescript-eslint/types": "8.48.0", + "@typescript-eslint/visitor-keys": "8.48.0", + "debug": "^4.3.4", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.48.0.tgz", + "integrity": "sha512-yTJO1XuGxCsSfIVt1+1UrLHtue8xz16V8apzPYI06W0HbEbEWHxHXgZaAgavIkoh+GeV6hKKd5jm0sS6OYxWXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.48.0", + "@typescript-eslint/types": "8.48.0", + "@typescript-eslint/typescript-estree": "8.48.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.48.0.tgz", + "integrity": "sha512-T0XJMaRPOH3+LBbAfzR2jalckP1MSG/L9eUtY0DEzUyVaXJ/t6zN0nR7co5kz0Jko/nkSYCBRkz1djvjajVTTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.48.0", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "dev": true, + "license": "ISC" + }, + "node_modules/@vscode/sudo-prompt": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/@vscode/sudo-prompt/-/sudo-prompt-9.3.1.tgz", + "integrity": "sha512-9ORTwwS74VaTn38tNbQhsA5U44zkJfcb0BdTSyyG6frP4e8KMtHuTXYmwefe5dpL8XB1aGSIVTaLjD3BbWb5iA==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "license": "BSD-2-Clause" + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "license": "ISC", + "optional": true + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "license": "MIT", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/accepts/node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/agentkeepalive": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", + "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "license": "MIT", + "optional": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/anser": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/anser/-/anser-1.4.10.tgz", + "integrity": "sha512-hCv9AqTQ8ycjpSd3upOJd7vFwW1JaoYQ7tpham03GJ1ca8/65rqn0RpaWpItOAd6ylW9wAw6luXYPJIyPFVOww==", + "license": "MIT" + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-fragments": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ansi-fragments/-/ansi-fragments-0.2.1.tgz", + "integrity": "sha512-DykbNHxuXQwUDRv5ibc2b0x7uw7wmwOGLBUd5RmaQ5z8Lhx19vwvKV+FAsM5rEA6dEcHxX+/Ad5s9eF2k2bB+w==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "colorette": "^1.0.7", + "slice-ansi": "^2.0.0", + "strip-ansi": "^5.0.0" + } + }, + "node_modules/ansi-fragments/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-fragments/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/appdirsjs": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/appdirsjs/-/appdirsjs-1.2.7.tgz", + "integrity": "sha512-Quji6+8kLBC3NnBeo14nPDq0+2jUs5s3/xEye+udFHumHhRk4M7aAMXp/PBJqkKYGuuyR9M/6Dq7d2AViiGmhw==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/aproba": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.1.0.tgz", + "integrity": "sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew==", + "license": "ISC", + "optional": true + }, + "node_modules/are-we-there-yet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "devOptional": true, + "license": "Python-2.0" + }, + "node_modules/argsarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/argsarray/-/argsarray-0.0.1.tgz", + "integrity": "sha512-u96dg2GcAKtpTrBdDoFIM7PjcBA+6rSP0OR94MOReNRyUECL6MtQt5XXmRr4qrftYaef9+l5hcpO5te7sML1Cg==", + "license": "WTFPL" + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz", + "integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.24.0", + "es-object-atoms": "^1.1.1", + "get-intrinsic": "^1.3.0", + "is-string": "^1.1.1", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", + "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", + "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "license": "MIT" + }, + "node_modules/astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "license": "MIT" + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "license": "MIT", + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-plugin-inline-import": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/babel-plugin-inline-import/-/babel-plugin-inline-import-3.0.0.tgz", + "integrity": "sha512-thnykl4FMb8QjMjVCuZoUmAM7r2mnTn5qJwrryCvDv6rugbJlTHZMctdjDtEgD0WBAXJOLJSGXN3loooEwx7UQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "require-resolve": "0.0.2" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "license": "BSD-3-Clause", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "license": "MIT", + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-plugin-polyfill-corejs2": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.14.tgz", + "integrity": "sha512-Co2Y9wX854ts6U8gAAPXfn0GmAyctHuK8n0Yhfjd6t30g7yvKjspvvOo9yG+z52PZRgFErt7Ka2pYnXCjLKEpg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.27.7", + "@babel/helper-define-polyfill-provider": "^0.6.5", + "semver": "^6.3.1" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.13.0.tgz", + "integrity": "sha512-U+GNwMdSFgzVmfhNm8GJUX88AadB3uo9KpJqS3FaqNIPKgySuvMb+bHPsOmmuWyIcuqZj/pzt1RUIUZns4y2+A==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.5", + "core-js-compat": "^3.43.0" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-regenerator": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.5.tgz", + "integrity": "sha512-ISqQ2frbiNU9vIJkzg7dlPpznPZ4jOiUQ1uSmB0fEHeowtN3COYRsXr/xexn64NpU13P06jc/L5TgiJXOgrbEg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.5" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-syntax-hermes-parser": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.32.0.tgz", + "integrity": "sha512-m5HthL++AbyeEA2FcdwOLfVFvWYECOBObLHNqdR8ceY4TsEdn4LdX2oTvbB2QJSSElE2AWA/b2MXZ/PF/CqLZg==", + "license": "MIT", + "dependencies": { + "hermes-parser": "0.32.0" + } + }, + "node_modules/babel-plugin-transform-flow-enums": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-enums/-/babel-plugin-transform-flow-enums-0.0.2.tgz", + "integrity": "sha512-g4aaCrDDOsWjbm0PUUeVnkcVd6AKJsVc/MbnPhEotEpkeJQP6b8nzewohQi7+QS8UyPehOhGWn0nOwjvWpmMvQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/plugin-syntax-flow": "^7.12.1" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz", + "integrity": "sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==", + "license": "MIT", + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" + }, + "peerDependencies": { + "@babel/core": "^7.0.0 || ^8.0.0-0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "license": "MIT", + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, + "node_modules/base-64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz", + "integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==", + "license": "MIT" + }, + "node_modules/base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.8.31", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.31.tgz", + "integrity": "sha512-a28v2eWrrRWPpJSzxc+mKwm0ZtVx/G8SepdQZDArnXYU/XS+IF6mp8aB/4E+hH1tyGCoDo3KlUCdlSxGDsRkAw==", + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "license": "ISC" + }, + "node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.0.tgz", + "integrity": "sha512-tbydkR/CxfMwelN0vwdP/pLkDwyAASZ+VfWm4EOwlB6SWhx1sYnWLqo8N5j0rAzPfzfRaxt0mM/4wPU/Su84RQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.8.25", + "caniuse-lite": "^1.0.30001754", + "electron-to-chromium": "^1.5.249", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.1.4" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "license": "Apache-2.0", + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "devOptional": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/cacache/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cacache/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC", + "optional": true + }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001757", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001757.tgz", + "integrity": "sha512-r0nnL/I28Zi/yjk1el6ilj27tKcdjLsNqAOZr0yVjWPrSQyHgKI2INaEWw21bAQSv2LXRt1XuCS/GomNpWOxsQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", + "optional": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/chrome-launcher": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/chrome-launcher/-/chrome-launcher-0.15.2.tgz", + "integrity": "sha512-zdLEwNo3aUVzIhKhTtXfxhdvZhUghrnmkvcAq2NoDd+LeOHKf03H5jwZ8T/STsAlzyALkBVK552iaG1fGf1xVQ==", + "license": "Apache-2.0", + "dependencies": { + "@types/node": "*", + "escape-string-regexp": "^4.0.0", + "is-wsl": "^2.2.0", + "lighthouse-logger": "^1.0.0" + }, + "bin": { + "print-chrome-path": "bin/print-chrome-path.js" + }, + "engines": { + "node": ">=12.13.0" + } + }, + "node_modules/chrome-launcher/node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chromium-edge-launcher": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/chromium-edge-launcher/-/chromium-edge-launcher-0.2.0.tgz", + "integrity": "sha512-JfJjUnq25y9yg4FABRRVPmBGWPZZi+AQXT4mxupb67766/0UlhG8PAZCz6xzEMXTbW3CsSoE8PcCWA49n35mKg==", + "license": "Apache-2.0", + "dependencies": { + "@types/node": "*", + "escape-string-regexp": "^4.0.0", + "is-wsl": "^2.2.0", + "lighthouse-logger": "^1.0.0", + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + } + }, + "node_modules/chromium-edge-launcher/node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", + "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz", + "integrity": "sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==", + "dev": true, + "license": "MIT" + }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "license": "MIT", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", + "optional": true, + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/colorette": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/command-exists": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "mime-db": ">= 1.43.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/compression": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.8.1.tgz", + "integrity": "sha512-9mAqGPHLakhCLeNyxPkK4xVo746zQ/czLH1Ky+vkitMnWfWZps8r0qXuwhwizagCRttsL4lfG4pIOvaWLpAP0w==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "compressible": "~2.0.18", + "debug": "2.6.9", + "negotiator": "~0.6.4", + "on-headers": "~1.1.0", + "safe-buffer": "5.2.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/compression/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/compression/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT" + }, + "node_modules/connect": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", + "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "finalhandler": "1.1.2", + "parseurl": "~1.3.3", + "utils-merge": "1.0.1" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/connect/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/connect/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC", + "optional": true + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "license": "MIT" + }, + "node_modules/core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha512-ZiPp9pZlgxpWRu0M+YWbm6+aQ84XEfH1JRXvfOc/fILWI0VKhLC2LX13X1NYq4fULzLMq7Hfh43CSo2/aIaUPA==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "license": "MIT" + }, + "node_modules/core-js-compat": { + "version": "3.47.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.47.0.tgz", + "integrity": "sha512-IGfuznZ/n7Kp9+nypamBhvwdwLsW6KC8IOaURw2doAK5e98AG3acVLdh0woOnEqCfUtS+Vu882JE4k/DAm3ItQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.28.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/cosmiconfig": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.1", + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-line-break": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz", + "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==", + "license": "MIT", + "dependencies": { + "utrie": "^1.0.2" + } + }, + "node_modules/css-select": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz", + "integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==", + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-tree": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", + "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "license": "MIT", + "dependencies": { + "mdn-data": "2.0.14", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/css-what": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz", + "integrity": "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dayjs": { + "version": "1.11.19", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz", + "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decode-uri-component": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/dedent": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.0.tgz", + "integrity": "sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT", + "optional": true + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/deprecated-react-native-prop-types": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/deprecated-react-native-prop-types/-/deprecated-react-native-prop-types-2.3.0.tgz", + "integrity": "sha512-pWD0voFtNYxrVqvBMYf5gq3NA2GCpfodS1yNynTPc93AYA/KEMGeWDqqeUB6R2Z9ZofVhks2aeJXiuQqKNpesA==", + "license": "MIT", + "dependencies": { + "@react-native/normalize-color": "*", + "invariant": "*", + "prop-types": "*" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "license": "MIT", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "BSD-2-Clause" + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "license": "BSD-2-Clause", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", + "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "license": "BSD-2-Clause", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "license": "MIT" + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.260", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.260.tgz", + "integrity": "sha512-ov8rBoOBhVawpzdre+Cmz4FB+y66Eqrk6Gwqd8NGxuhv99GQ8XqMAr351KEkOt7gukXWDg6gJWEMKgL2RLMPtA==", + "license": "ISC" + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "license": "MIT", + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "optional": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/envinfo": { + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.20.0.tgz", + "integrity": "sha512-+zUomDcLXsVkQ37vUqWBvQwLaLlj8eZPSi61llaEFAVBY5mhcXdaSw1pSJVl4yTYD5g/gEfpNl28YYk4IPvrrg==", + "devOptional": true, + "license": "MIT", + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "license": "MIT", + "optional": true + }, + "node_modules/error-ex": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", + "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/error-stack-parser": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", + "license": "MIT", + "dependencies": { + "stackframe": "^1.3.4" + } + }, + "node_modules/errorhandler": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/errorhandler/-/errorhandler-1.5.1.tgz", + "integrity": "sha512-rcOwbfvP1WTViVoUjcfZicVzjhjTuhSMntHh6mW3IrEiyE6mJyXvsToJUJGlGlw/2xU9P5whlWNGlIDVeCiT4A==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "accepts": "~1.3.7", + "escape-html": "~1.0.3" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-abstract": { + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz", + "integrity": "sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.3.0", + "get-proto": "^1.0.1", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.2.1", + "is-set": "^2.0.3", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.1", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.4", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.4", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "stop-iteration-iterator": "^1.1.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.19" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-iterator-helpers": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.2.1.tgz", + "integrity": "sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.6", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "iterator.prototype": "^1.1.4", + "safe-array-concat": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-prettier": { + "version": "8.10.2", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.2.tgz", + "integrity": "sha512-/IGJ6+Dka158JnP5n5YFMOszjDWrXggGz1LaK/guZq9vZTmniaKlHcsscvkAhn9y4U+BU3JuUdYvtAMcv30y4A==", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-eslint-comments": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.2.0.tgz", + "integrity": "sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5", + "ignore": "^5.0.5" + }, + "engines": { + "node": ">=6.5.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=4.19.1" + } + }, + "node_modules/eslint-plugin-eslint-comments/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint-plugin-eslint-comments/node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/eslint-plugin-ft-flow": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-ft-flow/-/eslint-plugin-ft-flow-2.0.3.tgz", + "integrity": "sha512-Vbsd/b+LYA99jUbsL6viEUWShFaYQt2YQs3QN3f+aeszOhh2sgdcU0mjzDyD4yyBvMc8qy2uwvBBWfMzEX06tg==", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash": "^4.17.21", + "string-natural-compare": "^3.0.1" + }, + "engines": { + "node": ">=12.22.0" + }, + "peerDependencies": { + "@babel/eslint-parser": "^7.12.0", + "eslint": "^8.1.0" + } + }, + "node_modules/eslint-plugin-jest": { + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.2.1.tgz", + "integrity": "sha512-0WLIezrIxitUGbjMIGwznVzSIp0uFJV0PZ2fiSvpyVcxe+QMXKUt7MRhUpzdbctnnLwiOTOFkACplgB0wAglFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/utils": "^8.0.0" + }, + "engines": { + "node": "^20.12.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^8.0.0", + "eslint": "^8.57.0 || ^9.0.0", + "jest": "*" + }, + "peerDependenciesMeta": { + "@typescript-eslint/eslint-plugin": { + "optional": true + }, + "jest": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react": { + "version": "7.37.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", + "integrity": "sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.8", + "array.prototype.findlast": "^1.2.5", + "array.prototype.flatmap": "^1.3.3", + "array.prototype.tosorted": "^1.1.4", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.2.1", + "estraverse": "^5.3.0", + "hasown": "^2.0.2", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.9", + "object.fromentries": "^2.0.8", + "object.values": "^1.2.1", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.5", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.12", + "string.prototype.repeat": "^1.0.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.2.0.tgz", + "integrity": "sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-react-native": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-native/-/eslint-plugin-react-native-4.1.0.tgz", + "integrity": "sha512-QLo7rzTBOl43FvVqDdq5Ql9IoElIuTdjrz9SKAXCvULvBoRZ44JGSkx9z4999ZusCsb4rK3gjS8gOGyeYqZv2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-plugin-react-native-globals": "^0.1.1" + }, + "peerDependencies": { + "eslint": "^3.17.0 || ^4 || ^5 || ^6 || ^7 || ^8" + } + }, + "node_modules/eslint-plugin-react-native-globals": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-native-globals/-/eslint-plugin-react-native-globals-0.1.2.tgz", + "integrity": "sha512-9aEPf1JEpiTjcFAmmyw8eiIXmcNZOqaZyHO77wgm0/dWfT/oxC1SrIq8ET38pMxHYrcB6Uew+TzUVsBeczF88g==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-plugin-react/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint-plugin-react/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-react/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-scope/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "license": "(MIT OR WTFPL)", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/exponential-backoff": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.3.tgz", + "integrity": "sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==", + "license": "Apache-2.0" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "devOptional": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-xml-parser": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.3.tgz", + "integrity": "sha512-RKihhV+SHsIUGXObeVy9AXiBbFwkVk7Syp8XgwN5U3JV416+Gwp/GO9i0JYKmikykgz/UHRrrV4ROuZEo/T0ig==", + "devOptional": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "dependencies": { + "strnum": "^1.1.1" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/fastq": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "devOptional": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fb-dotslash": { + "version": "0.5.8", + "resolved": "https://registry.npmjs.org/fb-dotslash/-/fb-dotslash-0.5.8.tgz", + "integrity": "sha512-XHYLKk9J4BupDxi9bSEhkfss0m+Vr9ChTrjhf9l2iw3jB5C7BnY4GVPoMcqbrTutsKJso6yj2nAB6BI/F2oZaA==", + "license": "(MIT OR Apache-2.0)", + "bin": { + "dotslash": "bin/dotslash" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "license": "Apache-2.0", + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/fbjs": { + "version": "0.8.18", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.18.tgz", + "integrity": "sha512-EQaWFK+fEPSoibjNy8IxUtaFOMXcWsY0JaVrQoZR9zC8N2Ygf9iDITPWjUTVIax95b6I742JFLqASHfsag/vKA==", + "license": "MIT", + "dependencies": { + "core-js": "^1.0.0", + "isomorphic-fetch": "^2.1.1", + "loose-envify": "^1.0.0", + "object-assign": "^4.1.0", + "promise": "^7.1.1", + "setimmediate": "^1.0.5", + "ua-parser-js": "^0.7.30" + } + }, + "node_modules/fbjs/node_modules/promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "license": "MIT", + "dependencies": { + "asap": "~2.0.3" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "license": "MIT", + "optional": true + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/filter-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", + "integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/finalhandler/node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "license": "Apache-2.0", + "dependencies": { + "micromatch": "^4.0.2" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/flow-enums-runtime": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/flow-enums-runtime/-/flow-enums-runtime-0.0.6.tgz", + "integrity": "sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw==", + "license": "MIT" + }, + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "license": "MIT", + "optional": true + }, + "node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/generator-function": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", + "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-symbol-description": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "license": "MIT", + "optional": true + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, + "node_modules/has-bigints": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC", + "optional": true + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hermes-compiler": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/hermes-compiler/-/hermes-compiler-0.0.0.tgz", + "integrity": "sha512-boVFutx6ME/Km2mB6vvsQcdnazEYYI/jV1pomx1wcFUG/EVqTkr5CU0CW9bKipOA/8Hyu3NYwW3THg2Q1kNCfA==", + "license": "MIT" + }, + "node_modules/hermes-estree": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.32.0.tgz", + "integrity": "sha512-KWn3BqnlDOl97Xe1Yviur6NbgIZ+IP+UVSpshlZWkq+EtoHg6/cwiDj/osP9PCEgFE15KBm1O55JRwbMEm5ejQ==", + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.32.0.tgz", + "integrity": "sha512-g4nBOWFpuiTqjR3LZdRxKUkij9iyveWeuks7INEsMX741f3r9xxrOe8TeQfUxtda0eXmiIFiMQzoeSQEno33Hw==", + "license": "MIT", + "dependencies": { + "hermes-estree": "0.32.0" + } + }, + "node_modules/hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "license": "BSD-3-Clause", + "dependencies": { + "react-is": "^16.7.0" + } + }, + "node_modules/hoist-non-react-statics/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "license": "MIT" + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/html2canvas": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz", + "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==", + "license": "MIT", + "dependencies": { + "css-line-break": "^2.1.0", + "text-segmentation": "^1.0.3" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", + "integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==", + "license": "BSD-2-Clause", + "optional": true + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-errors/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "license": "MIT", + "optional": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "devOptional": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "devOptional": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/image-size": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.2.1.tgz", + "integrity": "sha512-rH+46sQJ2dlwfjfhCyNx5thzrv+dtmBIhPHk0zgRUukHzZ/kRueTJXoYYsclBaKcSMBWuGbOFXtioLpzTb5euw==", + "license": "MIT", + "dependencies": { + "queue": "6.0.2" + }, + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=16.x" + } + }, + "node_modules/immediate": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", + "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==", + "license": "MIT" + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "license": "ISC", + "optional": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "license": "ISC", + "optional": true + }, + "node_modules/internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "node_modules/ip-address": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz", + "integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/is-generator-function": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", + "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.4", + "generator-function": "^2.0.0", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "license": "MIT", + "optional": true + }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/isomorphic-fetch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", + "integrity": "sha512-9c4TNAKYXM5PRyVcwUZrF3W09nQ+sO7+jydgs4ZGW9dhsLG2VOlISJABombdQqQRXCwuYG3sYV/puGf5rp0qmA==", + "license": "MIT", + "dependencies": { + "node-fetch": "^1.0.1", + "whatwg-fetch": ">=0.10.0" + } + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/iterator.prototype": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.5.tgz", + "integrity": "sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "get-proto": "^1.0.0", + "has-symbols": "^1.1.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runtime": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-watcher": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/joi": { + "version": "17.13.3", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.13.3.tgz", + "integrity": "sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==", + "devOptional": true, + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^9.3.0", + "@hapi/topo": "^5.1.0", + "@sideway/address": "^4.1.5", + "@sideway/formula": "^3.0.1", + "@sideway/pinpoint": "^2.0.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsc-safe-url": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/jsc-safe-url/-/jsc-safe-url-0.2.4.tgz", + "integrity": "sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q==", + "license": "0BSD" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.3.0.tgz", + "integrity": "sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "devOptional": true, + "license": "MIT", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", + "license": "Public Domain", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.11" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/launch-editor": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.12.0.tgz", + "integrity": "sha512-giOHXoOtifjdHqUamwKq6c49GzBdLjvxrd2D+Q4V6uOHopJv7p9VJxikDsQ/CBXZbEITgUqSVHXLTG3VhPP1Dg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "picocolors": "^1.1.1", + "shell-quote": "^1.8.3" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lighthouse-logger": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/lighthouse-logger/-/lighthouse-logger-1.4.2.tgz", + "integrity": "sha512-gPWxznF6TKmUHrOQjlVo2UbaL2EJ71mb2CCeRs/2qBpi4L/g4LUVc9+3lKQ6DTUZwJswfM7ainGrLO1+fOqa2g==", + "license": "Apache-2.0", + "dependencies": { + "debug": "^2.6.9", + "marky": "^1.2.2" + } + }, + "node_modules/lighthouse-logger/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/lighthouse-logger/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/lodash.map": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", + "integrity": "sha512-worNHGKLDetmcEYDvh2stPCrrQRkP20E4l0iIS7F8EvzMqBBi7ltvFN5m1HvTf1P7Jk1txKhvFcmYsCr8O2F1Q==", + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==", + "license": "MIT" + }, + "node_modules/lodash.zipobject": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lodash.zipobject/-/lodash.zipobject-4.1.3.tgz", + "integrity": "sha512-A9SzX4hMKWS25MyalwcOnNoplyHbkNVsjidhTp8ru0Sj23wY9GWBKS8gAIGDSAqeWjIjvE4KBEl24XXAs+v4wQ==", + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/logkitty": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/logkitty/-/logkitty-0.7.1.tgz", + "integrity": "sha512-/3ER20CTTbahrCrpYfPn7Xavv9diBROZpoXGVZDWMw4b/X4uuUwAC0ki85tgsdMRONURyIJbcOvS94QsUBYPbQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "ansi-fragments": "^0.2.1", + "dayjs": "^1.8.15", + "yargs": "^15.1.0" + }, + "bin": { + "logkitty": "bin/logkitty.js" + } + }, + "node_modules/logkitty/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "devOptional": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/logkitty/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/logkitty/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/logkitty/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/logkitty/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/logkitty/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/logkitty/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "devOptional": true, + "license": "ISC" + }, + "node_modules/logkitty/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/logkitty/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "devOptional": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "license": "ISC", + "optional": true, + "dependencies": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/make-fetch-happen/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/make-fetch-happen/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/make-fetch-happen/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-fetch-happen/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC", + "optional": true + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "license": "BSD-3-Clause", + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/marky": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/marky/-/marky-1.3.0.tgz", + "integrity": "sha512-ocnPZQLNpvbedwTy9kNrQEsknEfgvcLMvOtz3sFeWApDq1MXH1TqkCIx58xlpESsfwQOnuBO9beyQuNGzVvuhQ==", + "license": "Apache-2.0" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mdn-data": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", + "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", + "license": "CC0-1.0" + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/memoize-one": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", + "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==", + "license": "MIT" + }, + "node_modules/merge-options": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", + "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", + "license": "MIT", + "dependencies": { + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/metro": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro/-/metro-0.83.3.tgz", + "integrity": "sha512-+rP+/GieOzkt97hSJ0MrPOuAH/jpaS21ZDvL9DJ35QYRDlQcwzcvUlGUf79AnQxq/2NPiS/AULhhM4TKutIt8Q==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/core": "^7.25.2", + "@babel/generator": "^7.25.0", + "@babel/parser": "^7.25.3", + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.3", + "@babel/types": "^7.25.2", + "accepts": "^1.3.7", + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "connect": "^3.6.5", + "debug": "^4.4.0", + "error-stack-parser": "^2.0.6", + "flow-enums-runtime": "^0.0.6", + "graceful-fs": "^4.2.4", + "hermes-parser": "0.32.0", + "image-size": "^1.0.2", + "invariant": "^2.2.4", + "jest-worker": "^29.7.0", + "jsc-safe-url": "^0.2.2", + "lodash.throttle": "^4.1.1", + "metro-babel-transformer": "0.83.3", + "metro-cache": "0.83.3", + "metro-cache-key": "0.83.3", + "metro-config": "0.83.3", + "metro-core": "0.83.3", + "metro-file-map": "0.83.3", + "metro-resolver": "0.83.3", + "metro-runtime": "0.83.3", + "metro-source-map": "0.83.3", + "metro-symbolicate": "0.83.3", + "metro-transform-plugins": "0.83.3", + "metro-transform-worker": "0.83.3", + "mime-types": "^2.1.27", + "nullthrows": "^1.1.1", + "serialize-error": "^2.1.0", + "source-map": "^0.5.6", + "throat": "^5.0.0", + "ws": "^7.5.10", + "yargs": "^17.6.2" + }, + "bin": { + "metro": "src/cli.js" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-babel-transformer": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.83.3.tgz", + "integrity": "sha512-1vxlvj2yY24ES1O5RsSIvg4a4WeL7PFXgKOHvXTXiW0deLvQr28ExXj6LjwCCDZ4YZLhq6HddLpZnX4dEdSq5g==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "flow-enums-runtime": "^0.0.6", + "hermes-parser": "0.32.0", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-cache": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.83.3.tgz", + "integrity": "sha512-3jo65X515mQJvKqK3vWRblxDEcgY55Sk3w4xa6LlfEXgQ9g1WgMh9m4qVZVwgcHoLy0a2HENTPCCX4Pk6s8c8Q==", + "license": "MIT", + "dependencies": { + "exponential-backoff": "^3.1.1", + "flow-enums-runtime": "^0.0.6", + "https-proxy-agent": "^7.0.5", + "metro-core": "0.83.3" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-cache-key": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.83.3.tgz", + "integrity": "sha512-59ZO049jKzSmvBmG/B5bZ6/dztP0ilp0o988nc6dpaDsU05Cl1c/lRf+yx8m9WW/JVgbmfO5MziBU559XjI5Zw==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-config": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.83.3.tgz", + "integrity": "sha512-mTel7ipT0yNjKILIan04bkJkuCzUUkm2SeEaTads8VfEecCh+ltXchdq6DovXJqzQAXuR2P9cxZB47Lg4klriA==", + "license": "MIT", + "dependencies": { + "connect": "^3.6.5", + "flow-enums-runtime": "^0.0.6", + "jest-validate": "^29.7.0", + "metro": "0.83.3", + "metro-cache": "0.83.3", + "metro-core": "0.83.3", + "metro-runtime": "0.83.3", + "yaml": "^2.6.1" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-core": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.83.3.tgz", + "integrity": "sha512-M+X59lm7oBmJZamc96usuF1kusd5YimqG/q97g4Ac7slnJ3YiGglW5CsOlicTR5EWf8MQFxxjDoB6ytTqRe8Hw==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "lodash.throttle": "^4.1.1", + "metro-resolver": "0.83.3" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-file-map": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.83.3.tgz", + "integrity": "sha512-jg5AcyE0Q9Xbbu/4NAwwZkmQn7doJCKGW0SLeSJmzNB9Z24jBe0AL2PHNMy4eu0JiKtNWHz9IiONGZWq7hjVTA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "fb-watchman": "^2.0.0", + "flow-enums-runtime": "^0.0.6", + "graceful-fs": "^4.2.4", + "invariant": "^2.2.4", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "nullthrows": "^1.1.1", + "walker": "^1.0.7" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-minify-terser": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.83.3.tgz", + "integrity": "sha512-O2BmfWj6FSfzBLrNCXt/rr2VYZdX5i6444QJU0fFoc7Ljg+Q+iqebwE3K0eTvkI6TRjELsXk1cjU+fXwAR4OjQ==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "terser": "^5.15.0" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-resolver": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.83.3.tgz", + "integrity": "sha512-0js+zwI5flFxb1ktmR///bxHYg7OLpRpWZlBBruYG8OKYxeMP7SV0xQ/o/hUelrEMdK4LJzqVtHAhBm25LVfAQ==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-runtime": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.83.3.tgz", + "integrity": "sha512-JHCJb9ebr9rfJ+LcssFYA2x1qPYuSD/bbePupIGhpMrsla7RCwC/VL3yJ9cSU+nUhU4c9Ixxy8tBta+JbDeZWw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.25.0", + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-source-map": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.83.3.tgz", + "integrity": "sha512-xkC3qwUBh2psVZgVavo8+r2C9Igkk3DibiOXSAht1aYRRcztEZNFtAMtfSB7sdO2iFMx2Mlyu++cBxz/fhdzQg==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.3", + "@babel/traverse--for-generate-function-map": "npm:@babel/traverse@^7.25.3", + "@babel/types": "^7.25.2", + "flow-enums-runtime": "^0.0.6", + "invariant": "^2.2.4", + "metro-symbolicate": "0.83.3", + "nullthrows": "^1.1.1", + "ob1": "0.83.3", + "source-map": "^0.5.6", + "vlq": "^1.0.0" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-source-map/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/metro-symbolicate": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.83.3.tgz", + "integrity": "sha512-F/YChgKd6KbFK3eUR5HdUsfBqVsanf5lNTwFd4Ca7uuxnHgBC3kR/Hba/RGkenR3pZaGNp5Bu9ZqqP52Wyhomw==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "invariant": "^2.2.4", + "metro-source-map": "0.83.3", + "nullthrows": "^1.1.1", + "source-map": "^0.5.6", + "vlq": "^1.0.0" + }, + "bin": { + "metro-symbolicate": "src/index.js" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-symbolicate/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/metro-transform-plugins": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.83.3.tgz", + "integrity": "sha512-eRGoKJU6jmqOakBMH5kUB7VitEWiNrDzBHpYbkBXW7C5fUGeOd2CyqrosEzbMK5VMiZYyOcNFEphvxk3OXey2A==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/generator": "^7.25.0", + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.3", + "flow-enums-runtime": "^0.0.6", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-transform-worker": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.83.3.tgz", + "integrity": "sha512-Ztekew9t/gOIMZX1tvJOgX7KlSLL5kWykl0Iwu2cL2vKMKVALRl1hysyhUw0vjpAvLFx+Kfq9VLjnHIkW32fPA==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/generator": "^7.25.0", + "@babel/parser": "^7.25.3", + "@babel/types": "^7.25.2", + "flow-enums-runtime": "^0.0.6", + "metro": "0.83.3", + "metro-babel-transformer": "0.83.3", + "metro-cache": "0.83.3", + "metro-cache-key": "0.83.3", + "metro-minify-terser": "0.83.3", + "metro-source-map": "0.83.3", + "metro-transform-plugins": "0.83.3", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro/node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "license": "MIT" + }, + "node_modules/metro/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/metro/node_modules/ws": { + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-4.1.0.tgz", + "integrity": "sha512-X5ju04+cAzsojXKes0B/S4tcYtFAJ6tTMuSPBEn9CPGlrWr8Fiw7qYeLT0XyH80HSoAoqWCaz+MWKh22P7G1cw==", + "funding": [ + "https://github.com/sponsors/broofa" + ], + "license": "MIT", + "bin": { + "mime": "bin/cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "license": "MIT", + "optional": true, + "dependencies": { + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "optionalDependencies": { + "encoding": "^0.1.12" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC", + "optional": true + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "license": "MIT", + "optional": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC", + "optional": true + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "license": "MIT", + "optional": true + }, + "node_modules/moment": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/napi-build-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", + "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "license": "MIT", + "optional": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz", + "integrity": "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nocache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/nocache/-/nocache-3.0.4.tgz", + "integrity": "sha512-WDD0bdg9mbq6F4mRxEYcPWwfA1vxd0mrvKOyxI7Xj/atfRHVeutzuWByG//jfm4uPzp0y4Kj051EORCBSQMycw==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/node-abi": { + "version": "3.85.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.85.0.tgz", + "integrity": "sha512-zsFhmbkAzwhTft6nd3VxcG0cvJsT70rL+BIGHWVq5fi6MwGrHwzqKaxXE+Hl2GmnGItnDKPPkO5/LQqjVkIdFg==", + "license": "MIT", + "optional": true, + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-abi/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "license": "MIT", + "optional": true + }, + "node_modules/node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "license": "MIT", + "dependencies": { + "encoding": "^0.1.11", + "is-stream": "^1.0.1" + } + }, + "node_modules/node-fetch/node_modules/is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/node-gyp": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", + "license": "MIT", + "optional": true, + "dependencies": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", + "nopt": "^5.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": ">= 10.12.0" + } + }, + "node_modules/node-gyp/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "license": "MIT" + }, + "node_modules/node-stream-zip": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/node-stream-zip/-/node-stream-zip-1.15.0.tgz", + "integrity": "sha512-LN4fydt9TqhZhThkZIVQnF9cwjU3qmUH9h78Mx/K7d3VvfRqqwthLwJEUOEL0QPZ0XQmNN7be5Ggit5+4dq3Bw==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/antelle" + } + }, + "node_modules/noop-fn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/noop-fn/-/noop-fn-1.0.0.tgz", + "integrity": "sha512-pQ8vODlgXt2e7A3mIbFDlizkr46r75V+BJxVAyat8Jl7YmI513gG5cfyRL0FedKraoZ+VAouI1h4/IWpus5pcQ==", + "license": "MIT" + }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/nullthrows": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz", + "integrity": "sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==", + "license": "MIT" + }, + "node_modules/ob1": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.83.3.tgz", + "integrity": "sha512-egUxXCDwoWG06NGCS5s5AdcpnumHKJlfd3HH06P3m9TEMwwScfcY35wpQxbm9oHof+dM/lVH9Rfyu1elTVelSA==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.9.tgz", + "integrity": "sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.values": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/on-headers": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz", + "integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/open": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/open/-/open-6.4.0.tgz", + "integrity": "sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "is-wsl": "^1.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "license": "BlueOak-1.0.0" + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/patch-package": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.1.tgz", + "integrity": "sha512-VsKRIA8f5uqHQ7NGhwIna6Bx6D9s/1iXlA1hthBVBEbkq+t4kXD0HHt+rJhf/Z+Ci0F/HCB2hvn0qLdLG+Qxlw==", + "license": "MIT", + "dependencies": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^4.1.2", + "ci-info": "^3.7.0", + "cross-spawn": "^7.0.3", + "find-yarn-workspace-root": "^2.0.0", + "fs-extra": "^10.0.0", + "json-stable-stringify": "^1.0.2", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.6", + "open": "^7.4.2", + "semver": "^7.5.3", + "slash": "^2.0.0", + "tmp": "^0.2.4", + "yaml": "^2.2.2" + }, + "bin": { + "patch-package": "index.js" + }, + "engines": { + "node": ">=14", + "npm": ">5" + } + }, + "node_modules/patch-package/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/patch-package/node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/patch-package/node_modules/jsonfile": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", + "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/patch-package/node_modules/open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/patch-package/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/patch-package/node_modules/slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/patch-package/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-extra": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/path-extra/-/path-extra-1.0.3.tgz", + "integrity": "sha512-vYm3+GCkjUlT1rDvZnDVhNLXIRvwFPaN8ebHAFcuMJM/H0RBOPD7JrcldiNLd9AS3dhAyUHLa4Hny5wp1A+Ffw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, + "node_modules/path-scurry/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/paths-js": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/paths-js/-/paths-js-0.4.11.tgz", + "integrity": "sha512-3mqcLomDBXOo7Fo+UlaenG6f71bk1ZezPQy2JCmYHy2W2k5VKpP+Jbin9H0bjXynelTbglCqdFhSEkeIkKTYUA==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.11.0" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/point-in-polygon": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/point-in-polygon/-/point-in-polygon-1.1.0.tgz", + "integrity": "sha512-3ojrFwjnnw8Q9242TzgXuTD+eKiutbzyslcq1ydfu82Db2y+Ogbmyrkpv0Hgj31qwT3lbS9+QAAO/pIQM35XRw==", + "license": "MIT" + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/postinstall-postinstall": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz", + "integrity": "sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ==", + "hasInstallScript": true, + "license": "MIT" + }, + "node_modules/prebuild-install": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", + "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", + "license": "MIT", + "optional": true, + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^2.0.0", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/promise": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", + "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", + "license": "MIT", + "dependencies": { + "asap": "~2.0.6" + } + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "license": "ISC", + "optional": true + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "license": "MIT", + "optional": true, + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/prop-types/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "license": "MIT" + }, + "node_modules/pump": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", + "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", + "license": "MIT", + "optional": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "devOptional": true, + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/query-string": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.1.3.tgz", + "integrity": "sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==", + "license": "MIT", + "dependencies": { + "decode-uri-component": "^0.2.2", + "filter-obj": "^1.1.0", + "split-on-first": "^1.0.0", + "strict-uri-encode": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/queue": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz", + "integrity": "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==", + "license": "MIT", + "dependencies": { + "inherits": "~2.0.3" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "devOptional": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", + "optional": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react": { + "version": "19.1.1", + "resolved": "https://registry.npmjs.org/react/-/react-19.1.1.tgz", + "integrity": "sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-addons-shallow-compare": { + "version": "15.6.2", + "resolved": "https://registry.npmjs.org/react-addons-shallow-compare/-/react-addons-shallow-compare-15.6.2.tgz", + "integrity": "sha512-yAV9tOObmKPiohqne1jiMcx6kDjfz7GeL8K9KHgI+HvDsbrRv148uyUzrPc6GwepZnQcJ59Q3lp1ghrkyPwtjg==", + "license": "MIT", + "dependencies": { + "fbjs": "^0.8.4", + "object-assign": "^4.1.0" + } + }, + "node_modules/react-devtools-core": { + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-6.1.5.tgz", + "integrity": "sha512-ePrwPfxAnB+7hgnEr8vpKxL9cmnp7F322t8oqcPshbIQQhDKgFDW4tjhF2wjVbdXF9O/nyuy3sQWd9JGpiLPvA==", + "license": "MIT", + "dependencies": { + "shell-quote": "^1.6.1", + "ws": "^7" + } + }, + "node_modules/react-devtools-core/node_modules/ws": { + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/react-freeze": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/react-freeze/-/react-freeze-1.0.4.tgz", + "integrity": "sha512-r4F0Sec0BLxWicc7HEyo2x3/2icUTrRmDjaaRyzzn+7aDyFZliszMDOgLVwSnQnYENOlL1o569Ze2HZefk8clA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "react": ">=17.0.0" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT" + }, + "node_modules/react-native": { + "version": "0.82.1", + "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.82.1.tgz", + "integrity": "sha512-tFAqcU7Z4g49xf/KnyCEzI4nRTu1Opcx05Ov2helr8ZTg1z7AJR/3sr2rZ+AAVlAs2IXk+B0WOxXGmdD3+4czA==", + "license": "MIT", + "dependencies": { + "@jest/create-cache-key-function": "^29.7.0", + "@react-native/assets-registry": "0.82.1", + "@react-native/codegen": "0.82.1", + "@react-native/community-cli-plugin": "0.82.1", + "@react-native/gradle-plugin": "0.82.1", + "@react-native/js-polyfills": "0.82.1", + "@react-native/normalize-colors": "0.82.1", + "@react-native/virtualized-lists": "0.82.1", + "abort-controller": "^3.0.0", + "anser": "^1.4.9", + "ansi-regex": "^5.0.0", + "babel-jest": "^29.7.0", + "babel-plugin-syntax-hermes-parser": "0.32.0", + "base64-js": "^1.5.1", + "commander": "^12.0.0", + "flow-enums-runtime": "^0.0.6", + "glob": "^7.1.1", + "hermes-compiler": "0.0.0", + "invariant": "^2.2.4", + "jest-environment-node": "^29.7.0", + "memoize-one": "^5.0.0", + "metro-runtime": "^0.83.1", + "metro-source-map": "^0.83.1", + "nullthrows": "^1.1.1", + "pretty-format": "^29.7.0", + "promise": "^8.3.0", + "react-devtools-core": "^6.1.5", + "react-refresh": "^0.14.0", + "regenerator-runtime": "^0.13.2", + "scheduler": "0.26.0", + "semver": "^7.1.3", + "stacktrace-parser": "^0.1.10", + "whatwg-fetch": "^3.0.0", + "ws": "^6.2.3", + "yargs": "^17.6.2" + }, + "bin": { + "react-native": "cli.js" + }, + "engines": { + "node": ">= 20.19.4" + }, + "peerDependencies": { + "@types/react": "^19.1.1", + "react": "^19.1.1" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-native-animatable": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/react-native-animatable/-/react-native-animatable-1.4.0.tgz", + "integrity": "sha512-DZwaDVWm2NBvBxf7I0wXKXLKb/TxDnkV53sWhCvei1pRyTX3MVFpkvdYBknNBqPrxYuAIlPxEp7gJOidIauUkw==", + "license": "MIT", + "dependencies": { + "prop-types": "^15.8.1" + } + }, + "node_modules/react-native-animated-splash-screen": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/react-native-animated-splash-screen/-/react-native-animated-splash-screen-2.0.5.tgz", + "integrity": "sha512-VTZmcYHQq8lxtVtiXQFJKGSSftewI+F3hgLY0ONBA2g3GP/jIgLJHoShup4HBLeA0Q2mjvyNT39JpfTDcLKtHQ==", + "license": "MIT", + "dependencies": { + "prop-types": "^15.7.2" + } + }, + "node_modules/react-native-blob-util": { + "version": "0.22.2", + "resolved": "https://registry.npmjs.org/react-native-blob-util/-/react-native-blob-util-0.22.2.tgz", + "integrity": "sha512-Czx01QMg7aLsm/4F/7+eqoRAi1q/qjLY2Kao16g+n2SRnTH1+qkD8Qhx2q9okB+VNQvZKB1LbiXhktzYQV52xQ==", + "license": "MIT", + "dependencies": { + "base-64": "0.1.0", + "glob": "^10.3.10" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-blob-util/node_modules/base-64": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz", + "integrity": "sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==" + }, + "node_modules/react-native-blob-util/node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/react-native-blob-util/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/react-native-chart-kit": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/react-native-chart-kit/-/react-native-chart-kit-6.12.0.tgz", + "integrity": "sha512-nZLGyCFzZ7zmX0KjYeeSV1HKuPhl1wOMlTAqa0JhlyW62qV/1ZPXHgT8o9s8mkFaGxdqbspOeuaa6I9jUQDgnA==", + "license": "MIT", + "dependencies": { + "lodash": "^4.17.13", + "paths-js": "^0.4.10", + "point-in-polygon": "^1.0.1" + }, + "peerDependencies": { + "react": "> 16.7.0", + "react-native": ">= 0.50.0", + "react-native-svg": "> 6.4.1" + } + }, + "node_modules/react-native-collapsible": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/react-native-collapsible/-/react-native-collapsible-1.6.2.tgz", + "integrity": "sha512-MCOBVJWqHNjnDaGkvxX997VONmJeebh6wyJxnHEgg0L1PrlcXU1e/bo6eK+CDVFuMrCafw8Qh4DOv/C4V/+Iew==", + "license": "MIT", + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-device-info": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/react-native-device-info/-/react-native-device-info-15.0.1.tgz", + "integrity": "sha512-U5waZRXtT3l1SgZpZMlIvMKPTkFZPH8W7Ks6GrJhdH723aUIPxjVer7cRSij1mvQdOAAYFJV/9BDzlC8apG89A==", + "license": "MIT", + "peerDependencies": { + "react-native": "*" + } + }, + "node_modules/react-native-draggable-flatlist": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/react-native-draggable-flatlist/-/react-native-draggable-flatlist-4.0.3.tgz", + "integrity": "sha512-2F4x5BFieWdGq9SetD2nSAR7s7oQCSgNllYgERRXXtNfSOuAGAVbDb/3H3lP0y5f7rEyNwabKorZAD/SyyNbDw==", + "license": "MIT", + "dependencies": { + "@babel/preset-typescript": "^7.17.12" + }, + "peerDependencies": { + "react-native": ">=0.64.0", + "react-native-gesture-handler": ">=2.0.0", + "react-native-reanimated": ">=2.8.0" + } + }, + "node_modules/react-native-drawer-layout": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/react-native-drawer-layout/-/react-native-drawer-layout-4.2.0.tgz", + "integrity": "sha512-XFGK5RMcVhEqr2F4iH/cTXrcTm1uK3gIBNFPqHNO7rCXuXZTPBbQYA5yc9/Lqgw2KNQ3sAeHKvW6/WoTURo/eA==", + "license": "MIT", + "dependencies": { + "color": "^4.2.3", + "use-latest-callback": "^0.2.4" + }, + "peerDependencies": { + "react": ">= 18.2.0", + "react-native": "*", + "react-native-gesture-handler": ">= 2.0.0", + "react-native-reanimated": ">= 2.0.0" + } + }, + "node_modules/react-native-element-dropdown": { + "version": "2.12.4", + "resolved": "https://registry.npmjs.org/react-native-element-dropdown/-/react-native-element-dropdown-2.12.4.tgz", + "integrity": "sha512-abZc5SVji9FIt7fjojRYrbuvp03CoeZJrgvezQoDoSOrpiTqkX69ix5m+j06W2AVncA0VWvbT+vCMam8SoVadw==", + "license": "MIT", + "dependencies": { + "lodash": "^4.17.21" + }, + "engines": { + "node": ">= 16.0.0" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-file-viewer": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/react-native-file-viewer/-/react-native-file-viewer-2.1.5.tgz", + "integrity": "sha512-MGC6sx9jsqHdefhVQ6o0akdsPGpkXgiIbpygb2Sg4g4bh7v6K1cardLV1NwGB9A6u1yICOSDT/MOC//9Ez6EUg==", + "license": "MIT", + "peerDependencies": { + "react-native": ">=0.47" + } + }, + "node_modules/react-native-fs": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/react-native-fs/-/react-native-fs-2.20.0.tgz", + "integrity": "sha512-VkTBzs7fIDUiy/XajOSNk0XazFE9l+QlMAce7lGuebZcag5CnjszB+u4BdqzwaQOdcYb5wsJIsqq4kxInIRpJQ==", + "license": "MIT", + "dependencies": { + "base-64": "^0.1.0", + "utf8": "^3.0.0" + }, + "peerDependencies": { + "react-native": "*", + "react-native-windows": "*" + }, + "peerDependenciesMeta": { + "react-native-windows": { + "optional": true + } + } + }, + "node_modules/react-native-fs/node_modules/base-64": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz", + "integrity": "sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==" + }, + "node_modules/react-native-geolocation-service": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/react-native-geolocation-service/-/react-native-geolocation-service-5.3.1.tgz", + "integrity": "sha512-LTXPtPNmrdhx+yeWG47sAaCgQc3nG1z+HLLHlhK/5YfOgfLcAb9HAkhREPjQKPZOUx8pKZMIpdGFUGfJYtimXQ==", + "license": "MIT" + }, + "node_modules/react-native-gesture-handler": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-2.29.1.tgz", + "integrity": "sha512-du3qmv0e3Sm7qsd9SfmHps+AggLiylcBBQ8ztz7WUtd8ZjKs5V3kekAbi9R2W9bRLSg47Ntp4GGMYZOhikQdZA==", + "license": "MIT", + "dependencies": { + "@egjs/hammerjs": "^2.0.17", + "hoist-non-react-statics": "^3.3.0", + "invariant": "^2.2.4" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-google-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/react-native-google-maps/-/react-native-google-maps-1.0.0.tgz", + "integrity": "sha512-EbvyzGhlhXRHNxruGE1BwwjzlLUwQNxnkHRFF4qa+4AVnCe25hOHghxT2b1AJH7dMBVE84bmTTlm/IWAc43jMA==", + "license": "MIT" + }, + "node_modules/react-native-image-marker": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/react-native-image-marker/-/react-native-image-marker-1.2.9.tgz", + "integrity": "sha512-X+W5gHNY24h1+nWAgK+MCDuxm4jbZtjgNKOztObHXjWVwRMV5/MgMJUD5bJuh459GFmA2CelDnGLixK8sXm7XA==", + "license": "MIT", + "dependencies": { + "patch-package": "^8.0.0", + "postinstall-postinstall": "^2.1.0" + }, + "engines": { + "node": ">= 16.0.0" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-image-pan-zoom": { + "version": "2.1.12", + "resolved": "https://registry.npmjs.org/react-native-image-pan-zoom/-/react-native-image-pan-zoom-2.1.12.tgz", + "integrity": "sha512-BF66XeP6dzuANsPmmFsJshM2Jyh/Mo1t8FsGc1L9Q9/sVP8MJULDabB1hms+eAoqgtyhMr5BuXV3E1hJ5U5H6Q==", + "license": "ISC", + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-image-picker": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/react-native-image-picker/-/react-native-image-picker-8.2.1.tgz", + "integrity": "sha512-FBeGYJGFDjMdGCcyubDJgBAPCQ4L1D3hwLXyUU91jY9ahOZMTbluceVvRmrEKqnDPFJ0gF1NVhJ0nr1nROFLdg==", + "license": "MIT", + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-image-resizer": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/react-native-image-resizer/-/react-native-image-resizer-1.4.5.tgz", + "integrity": "sha512-33EgL3C9pyvjKpullAB6fWyD5QhoYEpNNB9rxNvUsrpAnL2mHBW7PTrUCCZudJeB6Weg7nbweKrSw1nnto5aqg==", + "deprecated": "🚨 react-native-image-resizer has moved to @bam.tech/react-native-image-resizer", + "license": "MIT", + "peerDependencies": { + "react-native": ">=v0.40.0" + } + }, + "node_modules/react-native-image-zoom-viewer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/react-native-image-zoom-viewer/-/react-native-image-zoom-viewer-3.0.1.tgz", + "integrity": "sha512-la6s5DNSuq4GCRLsi5CZ29FPjgTpdCuGIRdO5T9rUrAtxrlpBPhhSnHrbmPVxsdtOUvxHacTh2Gfa9+RraMZQA==", + "license": "MIT", + "dependencies": { + "react-native-image-pan-zoom": "^2.1.12" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-is-edge-to-edge": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/react-native-is-edge-to-edge/-/react-native-is-edge-to-edge-1.2.1.tgz", + "integrity": "sha512-FLbPWl/MyYQWz+KwqOZsSyj2JmLKglHatd3xLZWskXOpRaio4LfEDEz8E/A6uD8QoTHW6Aobw1jbEwK7KMgR7Q==", + "license": "MIT", + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-keychain": { + "version": "9.2.3", + "resolved": "https://registry.npmjs.org/react-native-keychain/-/react-native-keychain-9.2.3.tgz", + "integrity": "sha512-dbn50fk4HLr4JQ71X3j6ZSTbKv+G9s85Zv9cE2na7k7KGn1j+wxjqGTE3wG+WKB3nNEylgu/KXR99mtsC/hpRQ==", + "license": "MIT", + "workspaces": [ + "KeychainExample", + "website" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/react-native-linear-gradient": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/react-native-linear-gradient/-/react-native-linear-gradient-2.8.3.tgz", + "integrity": "sha512-KflAXZcEg54PXkLyflaSZQ3PJp4uC4whM7nT/Uot9m0e/qxFV3p6uor1983D1YOBJbJN7rrWdqIjq0T42jOJyA==", + "license": "MIT", + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-maps": { + "version": "1.26.18", + "resolved": "https://registry.npmjs.org/react-native-maps/-/react-native-maps-1.26.18.tgz", + "integrity": "sha512-aJeczgR2Y5AeAazod3QAIkpAqNteYjKlZUH8YRKueaORsjdDbGryD/4aPL8UR4J6bjsSJK8lgzoMCvCky6FRpA==", + "license": "MIT", + "dependencies": { + "@types/geojson": "^7946.0.13" + }, + "engines": { + "node": ">= 20.19.4" + }, + "peerDependencies": { + "react": ">= 18.3.1", + "react-native": ">= 0.76.0", + "react-native-web": ">= 0.11" + }, + "peerDependenciesMeta": { + "react-native-web": { + "optional": true + } + } + }, + "node_modules/react-native-modal": { + "version": "14.0.0-rc.1", + "resolved": "https://registry.npmjs.org/react-native-modal/-/react-native-modal-14.0.0-rc.1.tgz", + "integrity": "sha512-v5pvGyx1FlmBzdHyPqBsYQyS2mIJhVmuXyNo5EarIzxicKhuoul6XasXMviGcXboEUT0dTYWs88/VendojPiVw==", + "license": "MIT", + "dependencies": { + "react-native-animatable": "1.4.0" + }, + "peerDependencies": { + "react": "*", + "react-native": ">=0.70.0" + } + }, + "node_modules/react-native-modal-datetime-picker": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/react-native-modal-datetime-picker/-/react-native-modal-datetime-picker-18.0.0.tgz", + "integrity": "sha512-0jdvhhraZQlRACwr7pM6vmZ2kxgzJ4CpnmV6J3TVA6MrXMXK6Zo/upRBKkRp0+fTOiKuNblzesA2U59rYo6SGA==", + "license": "MIT", + "dependencies": { + "prop-types": "^15.7.2" + }, + "peerDependencies": { + "@react-native-community/datetimepicker": ">=6.7.0", + "react-native": ">=0.65.0" + } + }, + "node_modules/react-native-modal-selector": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/react-native-modal-selector/-/react-native-modal-selector-2.1.2.tgz", + "integrity": "sha512-+Cvoz/yNUFmfIkJ7xkmlLR2nhJOUhx00S6BPqp2Ruy8LkmaiNr7WMZ4BzsgzylyEgZ84Q+42HQ0v0QzJYobviA==", + "license": "MIT", + "dependencies": { + "prop-types": "^15.5.10" + } + }, + "node_modules/react-native-multiple-select": { + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/react-native-multiple-select/-/react-native-multiple-select-0.5.12.tgz", + "integrity": "sha512-lFw0u798/2qHr4TwDdxMtReRtsNOCC2SWPzWHRGKE4XcBiUll0hHhke7iqQg4xJdfo46C/h69f1ZXphDOjZY3A==", + "license": "MIT", + "dependencies": { + "prop-types": "^15.7.2" + }, + "peerDependencies": { + "deprecated-react-native-prop-types": ">2.0.0", + "lodash": ">4.17.00", + "react": ">16.6.0", + "react-native": ">0.57.0", + "react-native-vector-icons": ">6.0.0" + } + }, + "node_modules/react-native-orientation-locker": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/react-native-orientation-locker/-/react-native-orientation-locker-1.7.0.tgz", + "integrity": "sha512-2PhG4UyRJktb3KCTISStuu8/q+Q3q3oPesGg9DhdY0b6Cu/ZzxkCvkbJte2TPWRYkS0JpClimvqVaonulGvDrA==", + "license": "MIT", + "peerDependencies": { + "react": ">=16.13.1", + "react-native": ">=0.63.2", + "react-native-windows": ">=0.63.3" + }, + "peerDependenciesMeta": { + "react-native-windows": { + "optional": true + } + } + }, + "node_modules/react-native-otp-inputs": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/react-native-otp-inputs/-/react-native-otp-inputs-7.4.0.tgz", + "integrity": "sha512-+phHrlcQQ63VuOrHaOZze7LP9WmzUGxGMlQx2A/jhPhYkCi/5hXDjxNcWyPXCy/RFRoLX+70HNpGqTgo0mDg7Q==", + "license": "MIT", + "peerDependencies": { + "@react-native-clipboard/clipboard": "*", + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-paper": { + "version": "5.14.5", + "resolved": "https://registry.npmjs.org/react-native-paper/-/react-native-paper-5.14.5.tgz", + "integrity": "sha512-eaIH5bUQjJ/mYm4AkI6caaiyc7BcHDwX6CqNDi6RIxfxfWxROsHpll1oBuwn/cFvknvA8uEAkqLk/vzVihI3AQ==", + "license": "MIT", + "workspaces": [ + "example", + "docs" + ], + "dependencies": { + "@callstack/react-theme-provider": "^3.0.9", + "color": "^3.1.2", + "use-latest-callback": "^0.2.3" + }, + "peerDependencies": { + "react": "*", + "react-native": "*", + "react-native-safe-area-context": "*" + } + }, + "node_modules/react-native-paper/node_modules/color": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.3", + "color-string": "^1.6.0" + } + }, + "node_modules/react-native-paper/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/react-native-paper/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/react-native-permissions": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-5.4.4.tgz", + "integrity": "sha512-WB5lRCBGXETfuaUhem2vgOceb9+URCeyfKpLGFSwoOffLuyJCA6+NTR3l1KLkrK4Ykxsig37z16/shUVufmt7A==", + "license": "MIT", + "peerDependencies": { + "react": ">=18.1.0", + "react-native": ">=0.70.0", + "react-native-windows": ">=0.70.0" + }, + "peerDependenciesMeta": { + "react-native-windows": { + "optional": true + } + } + }, + "node_modules/react-native-reanimated": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-4.1.5.tgz", + "integrity": "sha512-UA6VUbxwhRjEw2gSNrvhkusUq3upfD3Cv+AnB07V+kC8kpvwRVI+ivwY95ePbWNFkFpP+Y2Sdw1WHpHWEV+P2Q==", + "license": "MIT", + "dependencies": { + "react-native-is-edge-to-edge": "^1.2.1", + "semver": "7.7.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0", + "react": "*", + "react-native": "*", + "react-native-worklets": ">=0.5.0" + } + }, + "node_modules/react-native-reanimated/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/react-native-responsive-screen": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/react-native-responsive-screen/-/react-native-responsive-screen-1.4.2.tgz", + "integrity": "sha512-BLYz0UUpeohrib7jbz6wDmtBD5OmiuMRko4IT8kIF63taXPod/c5iZgmWnr5qOnK8hMuKiGMvsM3sC+eHX/lEQ==", + "license": "MIT", + "peerDependencies": { + "react-native": ">=0.35" + } + }, + "node_modules/react-native-safe-area-context": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-5.6.2.tgz", + "integrity": "sha512-4XGqMNj5qjUTYywJqpdWZ9IG8jgkS3h06sfVjfw5yZQZfWnRFXczi0GnYyFyCc2EBps/qFmoCH8fez//WumdVg==", + "license": "MIT", + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-screens": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-4.18.0.tgz", + "integrity": "sha512-mRTLWL7Uc1p/RFNveEIIrhP22oxHduC2ZnLr/2iHwBeYpGXR0rJZ7Bgc0ktxQSHRjWTPT70qc/7yd4r9960PBQ==", + "license": "MIT", + "dependencies": { + "react-freeze": "^1.0.0", + "warn-once": "^0.1.0" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-snackbar": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/react-native-snackbar/-/react-native-snackbar-2.9.0.tgz", + "integrity": "sha512-6FdTKbFRSeV2Y/NXVupPuDg4uayo3jjUs1u6DPWHLIF7gy8hoaj6YFYW3FT9VbUt3wvwn4hyV54bBuZ1WvmBLg==", + "license": "MIT", + "peerDependencies": { + "react": ">=16", + "react-native": ">=0.60" + } + }, + "node_modules/react-native-snap-carousel": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/react-native-snap-carousel/-/react-native-snap-carousel-3.9.1.tgz", + "integrity": "sha512-xWEGusacIgK1YaDXLi7Gao2+ISLoGPVEBR8fcMf4tOOJQufutlNwkoLu0l6B8Qgsrre0nTxoVZikRgGRDWlLaQ==", + "license": "BSD-3-Clause", + "dependencies": { + "prop-types": "^15.6.1", + "react-addons-shallow-compare": "15.6.2" + }, + "peerDependencies": { + "react": ">=15.0.0", + "react-native": "*" + } + }, + "node_modules/react-native-splash-screen": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/react-native-splash-screen/-/react-native-splash-screen-3.3.0.tgz", + "integrity": "sha512-rGjt6HkoSXxMqH4SQUJ1gnPQlPJV8+J47+4yhgTIan4bVvAwJhEeJH7wWt9hXSdH4+VfwTS0GTaflj1Tw83IhA==", + "license": "MIT", + "peerDependencies": { + "react-native": ">=0.57.0" + } + }, + "node_modules/react-native-sqlite-2": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/react-native-sqlite-2/-/react-native-sqlite-2-3.6.2.tgz", + "integrity": "sha512-C5+0qG6EIyycGuCNnVOXpEQiFt5m+Hd0ky7K9z+Ma78uNvJ39pq2sOF91Q/24+suaAfGDedmlQAC26lcjWvkAw==", + "license": "Apache-2.0", + "dependencies": { + "lodash.map": "^4.6.0", + "lodash.zipobject": "^4.1.3", + "websql": "^2.0.3" + }, + "peerDependencies": { + "react-native": ">= 0.60.0" + } + }, + "node_modules/react-native-svg": { + "version": "15.15.0", + "resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-15.15.0.tgz", + "integrity": "sha512-/Wx6F/IZ88B/GcF88bK8K7ZseJDYt+7WGaiggyzLvTowChQ8BM5idmcd4pK+6QJP6a6DmzL2sfOMukFUn/NArg==", + "license": "MIT", + "dependencies": { + "css-select": "^5.1.0", + "css-tree": "^1.1.3", + "warn-once": "0.1.1" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-vector-icons": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-10.3.0.tgz", + "integrity": "sha512-IFQ0RE57819hOUdFvgK4FowM5aMXg7C7XKsuGLevqXkkIJatc3QopN0wYrb2IrzUgmdpfP+QVIbI3S6h7M0btw==", + "deprecated": "react-native-vector-icons package has moved to a new model of per-icon-family packages. See the https://github.com/oblador/react-native-vector-icons/blob/master/MIGRATION.md on how to migrate", + "license": "MIT", + "dependencies": { + "prop-types": "^15.7.2", + "yargs": "^16.1.1" + }, + "bin": { + "fa-upgrade.sh": "bin/fa-upgrade.sh", + "fa5-upgrade": "bin/fa5-upgrade.sh", + "fa6-upgrade": "bin/fa6-upgrade.sh", + "generate-icon": "bin/generate-icon.js" + } + }, + "node_modules/react-native-vector-icons/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/react-native-vector-icons/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/react-native-vector-icons/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/react-native-version-check": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/react-native-version-check/-/react-native-version-check-3.5.0.tgz", + "integrity": "sha512-JJbOQjCcbUvh9wceb6kn4GXwsKWM1TKg8ZDuwhk8pqhSsnrLKn9VtBfw9qLChhx7caHy0gqeKUiH3C1kgZUpMw==", + "license": "MIT", + "dependencies": { + "lodash": "^4.17.21", + "semver": "^6.1.1" + }, + "peerDependencies": { + "react-native": ">=0.48.0" + } + }, + "node_modules/react-native-video": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/react-native-video/-/react-native-video-6.18.0.tgz", + "integrity": "sha512-9BjAtAh1uGq6h/GNCCh5yzb/iI9qJHuflwNGExyhoUxbhPD1s+15h+CdpJ2MKKJTXw6J7w+nQOp1Ywa54R8w7Q==", + "license": "MIT", + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-video-controls": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/react-native-video-controls/-/react-native-video-controls-2.8.1.tgz", + "integrity": "sha512-dBmrE3TAKaR1gYMfbukjAM6Xo8OMZyRrxPzZtnaUgWcvGo11PQwzaI/j8HPD5fLgO+rlweP2pDpEJyIBsJvJkw==", + "license": "MIT", + "dependencies": { + "lodash": "^4.16.4" + }, + "peerDependencies": { + "react-native": ">=0.46.0", + "react-native-video": ">=2.0.0" + } + }, + "node_modules/react-native-view-shot": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/react-native-view-shot/-/react-native-view-shot-4.0.3.tgz", + "integrity": "sha512-USNjYmED7C0me02c1DxKA0074Hw+y/nxo+xJKlffMvfUWWzL5ELh/TJA/pTnVqFurIrzthZDPtDM7aBFJuhrHQ==", + "license": "MIT", + "dependencies": { + "html2canvas": "^1.4.1" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-vision-camera": { + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-4.7.3.tgz", + "integrity": "sha512-g1/neOyjSqn1kaAa2FxI/qp5KzNvPcF0bnQw6NntfbxH6tm0+8WFZszlgb5OV+iYlB6lFUztCbDtyz5IpL47OA==", + "license": "MIT", + "peerDependencies": { + "@shopify/react-native-skia": "*", + "react": "*", + "react-native": "*", + "react-native-reanimated": "*", + "react-native-worklets-core": "*" + }, + "peerDependenciesMeta": { + "@shopify/react-native-skia": { + "optional": true + }, + "react-native-reanimated": { + "optional": true + }, + "react-native-worklets-core": { + "optional": true + } + } + }, + "node_modules/react-native-vision-camera-face-detector": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/react-native-vision-camera-face-detector/-/react-native-vision-camera-face-detector-1.9.1.tgz", + "integrity": "sha512-OsTe61R1+CyzZLp3xLI3PBMBGd3zEWbeHPgqZPOSbB0gEKWyIaTahBUCft47pVdi72onDlke//hPM+xyFOYBjQ==", + "license": "MIT", + "peerDependencies": { + "react": ">= 18", + "react-native": ">= 0.74", + "react-native-vision-camera": ">= 4.0" + } + }, + "node_modules/react-native-webview": { + "version": "13.16.0", + "resolved": "https://registry.npmjs.org/react-native-webview/-/react-native-webview-13.16.0.tgz", + "integrity": "sha512-Nh13xKZWW35C0dbOskD7OX01nQQavOzHbCw9XoZmar4eXCo7AvrYJ0jlUfRVVIJzqINxHlpECYLdmAdFsl9xDA==", + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^4.0.0", + "invariant": "2.2.4" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-worklets": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/react-native-worklets/-/react-native-worklets-0.6.1.tgz", + "integrity": "sha512-URca8l7c7Uog7gv4mcg9KILdJlnbvwdS5yfXQYf5TDkD2W1VY1sduEKrD+sA3lUPXH/TG1vmXAvNxCNwPMYgGg==", + "license": "MIT", + "dependencies": { + "@babel/plugin-transform-arrow-functions": "^7.0.0-0", + "@babel/plugin-transform-class-properties": "^7.0.0-0", + "@babel/plugin-transform-classes": "^7.0.0-0", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.0.0-0", + "@babel/plugin-transform-optional-chaining": "^7.0.0-0", + "@babel/plugin-transform-shorthand-properties": "^7.0.0-0", + "@babel/plugin-transform-template-literals": "^7.0.0-0", + "@babel/plugin-transform-unicode-regex": "^7.0.0-0", + "@babel/preset-typescript": "^7.16.7", + "convert-source-map": "^2.0.0", + "semver": "7.7.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0", + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-worklets-core": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/react-native-worklets-core/-/react-native-worklets-core-1.6.2.tgz", + "integrity": "sha512-zw73JfL40ZL/OD2TOil1El4D9ZwS3l6AFPeFfUWXh+V2/dHN8i28jHX8QXlz5DYtAkR+Ju3U1h4yiaODi/igZw==", + "license": "MIT", + "dependencies": { + "string-hash-64": "^1.0.3" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-worklets/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/react-native/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/react-native/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/react-redux": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz", + "integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==", + "license": "MIT", + "dependencies": { + "@types/use-sync-external-store": "^0.0.6", + "use-sync-external-store": "^1.4.0" + }, + "peerDependencies": { + "@types/react": "^18.2.25 || ^19", + "react": "^18.0 || ^19", + "redux": "^5.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "redux": { + "optional": true + } + } + }, + "node_modules/react-refresh": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", + "integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-test-renderer": { + "version": "19.1.1", + "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-19.1.1.tgz", + "integrity": "sha512-aGRXI+zcBTtg0diHofc7+Vy97nomBs9WHHFY1Csl3iV0x6xucjNYZZAkiVKGiNYUv23ecOex5jE67t8ZzqYObA==", + "dev": true, + "license": "MIT", + "dependencies": { + "react-is": "^19.1.1", + "scheduler": "^0.26.0" + }, + "peerDependencies": { + "react": "^19.1.1" + } + }, + "node_modules/react-test-renderer/node_modules/react-is": { + "version": "19.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.0.tgz", + "integrity": "sha512-x3Ax3kNSMIIkyVYhWPyO09bu0uttcAIoecO/um/rKGQ4EltYWVYtyiGkS/3xMynrbVQdS69Jhlv8FXUEZehlzA==", + "dev": true, + "license": "MIT" + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/redux": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz", + "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==", + "license": "MIT" + }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "license": "MIT" + }, + "node_modules/regenerate-unicode-properties": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.2.2.tgz", + "integrity": "sha512-m03P+zhBeQd1RGnYxrGyDAPpWX/epKirLrp8e3qevZdVkKtnCrjjWczIbYc8+xd6vcTStVlqfycTx1KR4LOr0g==", + "license": "MIT", + "dependencies": { + "regenerate": "^1.4.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "license": "MIT" + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexpu-core": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.4.0.tgz", + "integrity": "sha512-0ghuzq67LI9bLXpOX/ISfve/Mq33a4aFRzoQYhnnok1JOFpmE/A2TBGkNVenOGEeSBCjIiWcc6MVOG5HEQv0sA==", + "license": "MIT", + "dependencies": { + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^10.2.2", + "regjsgen": "^0.8.0", + "regjsparser": "^0.13.0", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.2.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==", + "license": "MIT" + }, + "node_modules/regjsparser": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.13.0.tgz", + "integrity": "sha512-NZQZdC5wOE/H3UT28fVGL+ikOZcEzfMGk/c3iN9UGxzWHMa1op7274oyiUVrAG4B2EuFhus8SvkaYnhvW92p9Q==", + "license": "BSD-2-Clause", + "dependencies": { + "jsesc": "~3.1.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "devOptional": true, + "license": "ISC" + }, + "node_modules/require-resolve": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/require-resolve/-/require-resolve-0.0.2.tgz", + "integrity": "sha512-eafQVaxdQsWUB8HybwognkdcIdKdQdQBwTxH48FuE6WI0owZGKp63QYr1MRp73PoX0AcyB7MDapZThYUY8FD0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "x-path": "^0.0.2" + } + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve.exports": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", + "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "devOptional": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "devOptional": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "devOptional": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/scheduler": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", + "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/send/node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/send/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/serialize-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", + "integrity": "sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/serve-static/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "devOptional": true, + "license": "ISC" + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "license": "MIT" + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "optional": true + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "optional": true, + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/simple-swizzle": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.4.tgz", + "integrity": "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==", + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/simple-swizzle/node_modules/is-arrayish": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.4.tgz", + "integrity": "sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==", + "license": "MIT" + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/slice-ansi/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/slice-ansi/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.7", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz", + "integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==", + "license": "MIT", + "optional": true, + "dependencies": { + "ip-address": "^10.0.1", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", + "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/socks-proxy-agent/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/split-on-first": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", + "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "license": "BSD-3-Clause" + }, + "node_modules/sqlite3": { + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz", + "integrity": "sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "optional": true, + "dependencies": { + "bindings": "^1.5.0", + "node-addon-api": "^7.0.0", + "prebuild-install": "^7.1.1", + "tar": "^6.1.11" + }, + "optionalDependencies": { + "node-gyp": "8.x" + }, + "peerDependencies": { + "node-gyp": "8.x" + }, + "peerDependenciesMeta": { + "node-gyp": { + "optional": true + } + } + }, + "node_modules/ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.1.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", + "license": "MIT" + }, + "node_modules/stacktrace-parser": { + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.11.tgz", + "integrity": "sha512-WjlahMgHmCJpqzU8bIBy4qtsZdU9lRlcZE3Lvyej6t4tuOuv1vk57OW3MBrj6hXBFx/nNoC9MPMTcr5YA7NQbg==", + "license": "MIT", + "dependencies": { + "type-fest": "^0.7.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/stacktrace-parser/node_modules/type-fest": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", + "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/stop-iteration-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/strict-uri-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", + "integrity": "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-hash-64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string-hash-64/-/string-hash-64-1.0.3.tgz", + "integrity": "sha512-D5OKWKvDhyVWWn2x5Y9b+37NUllks34q1dCDhk/vYcso9fmhs+Tl3KR/gE4v5UNj2UA35cnX4KdVVGkG1deKqw==", + "license": "MIT" + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-natural-compare": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/string-natural-compare/-/string-natural-compare-3.0.1.tgz", + "integrity": "sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.matchall": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", + "integrity": "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "regexp.prototype.flags": "^1.5.3", + "set-function-name": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.repeat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", + "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strnum": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.1.2.tgz", + "integrity": "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==", + "devOptional": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "license": "ISC", + "optional": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar-fs": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz", + "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-fs/node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC", + "optional": true + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "license": "ISC", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC", + "optional": true + }, + "node_modules/terser": { + "version": "5.44.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.44.1.tgz", + "integrity": "sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw==", + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.15.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT" + }, + "node_modules/terser/node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/text-segmentation": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz", + "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==", + "license": "MIT", + "dependencies": { + "utrie": "^1.0.2" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "license": "MIT" + }, + "node_modules/throat": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", + "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", + "license": "MIT" + }, + "node_modules/tiny-queue": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tiny-queue/-/tiny-queue-0.2.1.tgz", + "integrity": "sha512-EijGsv7kzd9I9g0ByCl6h42BWNGUZrlCSejfrb3AKeHC33SGbASu1VDf5O3rRiiUOhAC9CHdZxFPbZu0HmR70A==", + "license": "Apache 2" + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/tmp": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", + "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", + "license": "MIT", + "engines": { + "node": ">=14.14" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "license": "BSD-3-Clause" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/ts-api-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/ua-parser-js": { + "version": "0.7.41", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.41.tgz", + "integrity": "sha512-O3oYyCMPYgNNHuO7Jjk3uacJWZF8loBgwrfd/5LE/HyZ3lUIOdniQ7DNXJcIgZbwioZxk0fLfI4EVnetdiX5jg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + }, + { + "type": "github", + "url": "https://github.com/sponsors/faisalman" + } + ], + "license": "MIT", + "bin": { + "ua-parser-js": "script/cli.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/unbox-primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "license": "MIT" + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz", + "integrity": "sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "license": "MIT", + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.1.tgz", + "integrity": "sha512-JQ84qTuMg4nVkx8ga4A16a1epI9H6uTXAknqxkGF/aFfRLw1xC/Bp24HNLaZhHSkWd3+84t8iXnp1J0kYcZHhg==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.2.0.tgz", + "integrity": "sha512-hpbDzxUY9BFwX+UeBnxv3Sh1q7HFxj48DTmXchNgRa46lO8uj3/1iEn3MiNUYTg1g9ctIqXCCERn8gYZhHC5lQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "unique-slug": "^2.0.0" + } + }, + "node_modules/unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "license": "ISC", + "optional": true, + "dependencies": { + "imurmurhash": "^0.1.4" + } + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz", + "integrity": "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/use-latest-callback": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/use-latest-callback/-/use-latest-callback-0.2.6.tgz", + "integrity": "sha512-FvRG9i1HSo0wagmX63Vrm8SnlUU3LMM3WyZkQ76RnslpBrX694AdG4A0zQBx2B3ZifFA0yv/BaEHGBnEax5rZg==", + "license": "MIT", + "peerDependencies": { + "react": ">=16.8" + } + }, + "node_modules/use-sync-external-store": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", + "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", + "license": "MIT" + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/utrie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz", + "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==", + "license": "MIT", + "dependencies": { + "base64-arraybuffer": "^1.0.2" + } + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vlq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-1.0.1.tgz", + "integrity": "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==", + "license": "MIT" + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "license": "Apache-2.0", + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/warn-once": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/warn-once/-/warn-once-0.1.1.tgz", + "integrity": "sha512-VkQZJbO8zVImzYFteBXvBOZEl1qL175WH8VmZcxF2fZAoudNhNDvHi+doCaAEdU2l2vtcIwa2zn0QK5+I1HQ3Q==", + "license": "MIT" + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/websql": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/websql/-/websql-2.0.3.tgz", + "integrity": "sha512-bSYpuhQ4ODKrWLb6S+9BG2T4AMqHLjCQA9r8UWCapPvTZYXoembz0O14Ga4EAfJuO1wkmFcJjgU/6tzvPfGbmA==", + "license": "Apache-2.0", + "dependencies": { + "argsarray": "^0.0.1", + "immediate": "^3.2.2", + "noop-fn": "^1.0.0", + "tiny-queue": "^0.2.1" + }, + "optionalDependencies": { + "sqlite3": "^5.0.2" + } + }, + "node_modules/whatwg-fetch": { + "version": "3.6.20", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz", + "integrity": "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==", + "license": "MIT" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "devOptional": true, + "license": "ISC" + }, + "node_modules/which-typed-array": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "license": "ISC", + "optional": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/ws": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.3.tgz", + "integrity": "sha512-jmTjYU0j60B+vHey6TfR3Z7RD61z/hmxBS3VMSGIrroOWXQEneK1zNuotOUrGyBHQj0yrpsLHPWtigEFd13ndA==", + "license": "MIT", + "dependencies": { + "async-limiter": "~1.0.0" + } + }, + "node_modules/x-path": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/x-path/-/x-path-0.0.2.tgz", + "integrity": "sha512-zQ4WFI0XfJN1uEkkrB19Y4TuXOlHqKSxUJo0Yt+axPjRm8tCG6SJ6+Wo3/+Kjg4c2c8IvBXuJ0uYoshxNn4qMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-extra": "^1.0.2" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "license": "ISC" + }, + "node_modules/yaml": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..0fa8fa5 --- /dev/null +++ b/package.json @@ -0,0 +1,108 @@ +{ + "name": "PerformicsManager", + "version": "0.0.1", + "private": true, + "scripts": { + "android": "react-native run-android", + "ios": "react-native run-ios", + "lint": "eslint .", + "start": "react-native start", + "test": "jest", + "postinstall": "patch-package", + "clean": "react-native-clean-project" + }, + "dependencies": { + "@dominicvonk/react-native-apk-installer": "^2.2.2", + "@react-native-async-storage/async-storage": "^2.2.0", + "@react-native-clipboard/clipboard": "^1.16.2", + "@react-native-community/checkbox": "^0.5.20", + "@react-native-community/datetimepicker": "^8.4.1", + "@react-native-community/netinfo": "^11.4.1", + "@react-native-documents/picker": "^11.0.0", + "@react-native/new-app-screen": "0.82.1", + "@react-navigation/drawer": "^7.5.8", + "@react-navigation/native": "^7.1.18", + "@react-navigation/stack": "^7.4.8", + "base-64": "^1.0.0", + "deprecated-react-native-prop-types": "^2.3.0", + "mime": "^4.0.7", + "moment": "^2.30.1", + "prop-types": "^15.8.1", + "react": "19.1.1", + "react-native": "0.82.1", + "react-native-animated-splash-screen": "^2.0.5", + "react-native-blob-util": "^0.22.2", + "react-native-chart-kit": "^6.12.0", + "react-native-collapsible": "^1.6.2", + "react-native-device-info": "^15.0.1", + "react-native-draggable-flatlist": "^4.0.3", + "react-native-element-dropdown": "^2.12.4", + "react-native-file-viewer": "^2.1.5", + "react-native-fs": "^2.20.0", + "react-native-geolocation-service": "^5.3.1", + "react-native-gesture-handler": "^2.25.0", + "react-native-google-maps": "^1.0.0", + "react-native-image-marker": "^1.2.9", + "react-native-image-pan-zoom": "^2.1.12", + "react-native-image-picker": "^8.2.1", + "react-native-image-resizer": "^1.4.5", + "react-native-image-zoom-viewer": "^3.0.1", + "react-native-keychain": "^9.2.3", + "react-native-linear-gradient": "^2.8.3", + "react-native-maps": "^1.24.1", + "react-native-modal": "^14.0.0-rc.1", + "react-native-modal-datetime-picker": "^18.0.0", + "react-native-modal-selector": "^2.1.2", + "react-native-multiple-select": "^0.5.12", + "react-native-orientation-locker": "^1.7.0", + "react-native-otp-inputs": "^7.4.0", + "react-native-paper": "^5.14.5", + "react-native-permissions": "^5.4.1", + "react-native-reanimated": "^4.1.5", + "react-native-responsive-screen": "^1.4.2", + "react-native-safe-area-context": "^5.5.2", + "react-native-screens": "^4.11.1", + "react-native-snackbar": "^2.9.0", + "react-native-snap-carousel": "^3.9.1", + "react-native-splash-screen": "^3.3.0", + "react-native-sqlite-2": "^3.6.2", + "react-native-svg": "^15.12.0", + "react-native-vector-icons": "^10.2.0", + "react-native-version-check": "^3.5.0", + "react-native-video": "^6.14.1", + "react-native-video-controls": "^2.8.1", + "react-native-view-shot": "^4.0.3", + "react-native-vision-camera": "^4.7.3", + "react-native-vision-camera-face-detector": "^1.9.1", + "react-native-webview": "^13.15.0", + "react-native-worklets": "^0.6.1", + "react-native-worklets-core": "^1.6.2", + "react-redux": "^9.2.0", + "redux": "^5.0.1", + "utf8": "^3.0.0" + }, + "devDependencies": { + "@babel/core": "^7.25.2", + "@babel/preset-env": "^7.25.3", + "@babel/runtime": "^7.25.0", + "@react-native-community/cli": "20.0.0", + "@react-native-community/cli-platform-android": "20.0.0", + "@react-native-community/cli-platform-ios": "20.0.0", + "@react-native/babel-preset": "0.82.1", + "@react-native/eslint-config": "0.82.1", + "@react-native/metro-config": "0.82.1", + "@react-native/typescript-config": "0.82.1", + "@types/jest": "^29.5.13", + "@types/react": "^19.1.1", + "@types/react-test-renderer": "^19.1.0", + "babel-plugin-inline-import": "^3.0.0", + "eslint": "^8.19.0", + "jest": "^29.6.3", + "prettier": "2.8.8", + "react-test-renderer": "19.1.1", + "typescript": "^5.8.3" + }, + "engines": { + "node": ">=20" + } +} diff --git a/patches/@dominicvonk+react-native-apk-installer+2.2.2.patch b/patches/@dominicvonk+react-native-apk-installer+2.2.2.patch new file mode 100644 index 0000000..5e47a8a --- /dev/null +++ b/patches/@dominicvonk+react-native-apk-installer+2.2.2.patch @@ -0,0 +1,482 @@ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build.gradle b/node_modules/@dominicvonk/react-native-apk-installer/android/build.gradle +index 425bd08..9bbd07e 100644 +--- a/node_modules/@dominicvonk/react-native-apk-installer/android/build.gradle ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build.gradle +@@ -1,11 +1,9 @@ + buildscript { + // The Android Gradle plugin is only required when opening the android folder stand-alone. +- // This avoids unnecessary downloads and potential conflicts when the library is included as a +- // module dependency in an application project. + if (project == rootProject) { + repositories { + google() +- jcenter() ++ mavenCentral() // Replaced jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:4.1.0' +@@ -21,10 +19,12 @@ def safeExtGet(prop, fallback) { + + android { + compileSdkVersion safeExtGet('compileSdkVersion', 29) ++ + defaultConfig { + minSdkVersion safeExtGet('minSdkVersion', 21) + targetSdkVersion safeExtGet('targetSdkVersion', 29) + } ++ + lintOptions { + abortOnError false + } +@@ -32,19 +32,22 @@ android { + + repositories { + mavenLocal() ++ + maven { +- // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm ++ // React Native binaries from node_modules + url "$rootDir/../node_modules/react-native/android" + } ++ + maven { +- // Android JSC is installed from npm ++ // JSC from node_modules + url "$rootDir/../node_modules/jsc-android/dist" + } ++ + google() +- jcenter() ++ mavenCentral() // Replaced jcenter() + } + + dependencies { + //noinspection GradleDynamicVersion +- implementation 'com.facebook.react:react-native:+' // From node_modules ++ implementation 'com.facebook.react:react-native:+' // From node_modules + } +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/292a3499c126888e1dcdddb745113ba0/results.bin b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/292a3499c126888e1dcdddb745113ba0/results.bin +new file mode 100644 +index 0000000..0d259dd +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/292a3499c126888e1dcdddb745113ba0/results.bin +@@ -0,0 +1 @@ ++o/classes +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/292a3499c126888e1dcdddb745113ba0/transformed/classes/classes_dex/classes.dex b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/292a3499c126888e1dcdddb745113ba0/transformed/classes/classes_dex/classes.dex +new file mode 100644 +index 0000000..d315206 +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/292a3499c126888e1dcdddb745113ba0/transformed/classes/classes_dex/classes.dex differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/results.bin b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/results.bin +new file mode 100644 +index 0000000..7ed749e +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/results.bin +@@ -0,0 +1 @@ ++o/bundleLibRuntimeToDirDebug +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nodece/apkinstallern/BuildConfig.dex b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nodece/apkinstallern/BuildConfig.dex +new file mode 100644 +index 0000000..e82384b +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nodece/apkinstallern/BuildConfig.dex differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nodece/apkinstallern/RNApkInstallerNFileProvider.dex b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nodece/apkinstallern/RNApkInstallerNFileProvider.dex +new file mode 100644 +index 0000000..1afca8e +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nodece/apkinstallern/RNApkInstallerNFileProvider.dex differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nodece/apkinstallern/RNApkInstallerNModule.dex b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nodece/apkinstallern/RNApkInstallerNModule.dex +new file mode 100644 +index 0000000..e5c3551 +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nodece/apkinstallern/RNApkInstallerNModule.dex differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nodece/apkinstallern/RNApkInstallerNPackage.dex b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nodece/apkinstallern/RNApkInstallerNPackage.dex +new file mode 100644 +index 0000000..52b1759 +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nodece/apkinstallern/RNApkInstallerNPackage.dex differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +new file mode 100644 +index 0000000..601f245 +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/.transforms/9451d6f4f089b5ece95e74f77887d066/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/generated/source/buildConfig/debug/com/nodece/apkinstallern/BuildConfig.java b/node_modules/@dominicvonk/react-native-apk-installer/android/build/generated/source/buildConfig/debug/com/nodece/apkinstallern/BuildConfig.java +new file mode 100644 +index 0000000..9c8de3c +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/generated/source/buildConfig/debug/com/nodece/apkinstallern/BuildConfig.java +@@ -0,0 +1,10 @@ ++/** ++ * Automatically generated file. DO NOT MODIFY ++ */ ++package com.nodece.apkinstallern; ++ ++public final class BuildConfig { ++ public static final boolean DEBUG = Boolean.parseBoolean("true"); ++ public static final String LIBRARY_PACKAGE_NAME = "com.nodece.apkinstallern"; ++ public static final String BUILD_TYPE = "debug"; ++} +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +new file mode 100644 +index 0000000..0b2a028 +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +@@ -0,0 +1,23 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +new file mode 100644 +index 0000000..1312313 +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +@@ -0,0 +1,18 @@ ++{ ++ "version": 3, ++ "artifactType": { ++ "type": "AAPT_FRIENDLY_MERGED_MANIFESTS", ++ "kind": "Directory" ++ }, ++ "applicationId": "com.nodece.apkinstallern", ++ "variantName": "debug", ++ "elements": [ ++ { ++ "type": "SINGLE", ++ "filters": [], ++ "attributes": [], ++ "outputFile": "AndroidManifest.xml" ++ } ++ ], ++ "elementType": "File" ++} +\ No newline at end of file +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +new file mode 100644 +index 0000000..1211b1e +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +@@ -0,0 +1,6 @@ ++aarFormatVersion=1.0 ++aarMetadataVersion=1.0 ++minCompileSdk=1 ++minCompileSdkExtension=0 ++minAndroidGradlePluginVersion=1.0.0 ++coreLibraryDesugaringEnabled=false +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +new file mode 100644 +index 0000000..9e26dfe +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +@@ -0,0 +1 @@ ++{} +\ No newline at end of file +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +new file mode 100644 +index 0000000..f83c4da +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +new file mode 100644 +index 0000000..3d8234d +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +new file mode 100644 +index 0000000..ba8758a +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +@@ -0,0 +1 @@ ++int xml file_paths 0x0 +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/xml_file_paths.xml.flat b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/xml_file_paths.xml.flat +new file mode 100644 +index 0000000..2e1f087 +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/xml_file_paths.xml.flat differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +new file mode 100644 +index 0000000..0d7c013 +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +@@ -0,0 +1,2 @@ ++#Sat Nov 29 10:29:15 IST 2025 ++com.nodece.apkinstallern.dominicvonk_react-native-apk-installer-main-6\:/xml/file_paths.xml=/Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/packaged_res/debug/packageDebugResources/xml/file_paths.xml +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +new file mode 100644 +index 0000000..c11b34f +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +@@ -0,0 +1,2 @@ ++ ++ +\ No newline at end of file +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/incremental/mergeDebugAssets/merger.xml b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +new file mode 100644 +index 0000000..a10128d +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +@@ -0,0 +1,2 @@ ++ ++ +\ No newline at end of file +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +new file mode 100644 +index 0000000..fa7dffd +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +@@ -0,0 +1,2 @@ ++ ++ +\ No newline at end of file +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/incremental/mergeDebugShaders/merger.xml b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +new file mode 100644 +index 0000000..7d043cc +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +@@ -0,0 +1,2 @@ ++ ++ +\ No newline at end of file +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/nodece/apkinstallern/BuildConfig.class b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/nodece/apkinstallern/BuildConfig.class +new file mode 100644 +index 0000000..8720505 +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/nodece/apkinstallern/BuildConfig.class differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/nodece/apkinstallern/RNApkInstallerNFileProvider.class b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/nodece/apkinstallern/RNApkInstallerNFileProvider.class +new file mode 100644 +index 0000000..a265760 +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/nodece/apkinstallern/RNApkInstallerNFileProvider.class differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/nodece/apkinstallern/RNApkInstallerNModule.class b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/nodece/apkinstallern/RNApkInstallerNModule.class +new file mode 100644 +index 0000000..422a4c2 +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/nodece/apkinstallern/RNApkInstallerNModule.class differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/nodece/apkinstallern/RNApkInstallerNPackage.class b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/nodece/apkinstallern/RNApkInstallerNPackage.class +new file mode 100644 +index 0000000..d1282cb +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/nodece/apkinstallern/RNApkInstallerNPackage.class differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +new file mode 100644 +index 0000000..dc007c2 +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +@@ -0,0 +1,3 @@ ++R_DEF: Internal format may change without notice ++local ++xml file_paths +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +new file mode 100644 +index 0000000..2dc3147 +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +@@ -0,0 +1,38 @@ ++1 ++2 ++4 ++5 ++6 ++7 ++7-->/Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:4:5-83 ++7-->/Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:4:22-80 ++8 ++8-->/Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:5:5-81 ++8-->/Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:5:22-78 ++9 ++9-->/Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:6:5-80 ++9-->/Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:6:22-77 ++10 ++11 ++11-->/Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:8:5-18:19 ++12 /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:9:9-17:20 ++13 android:name="com.nodece.apkinstallern.RNApkInstallerNFileProvider" ++13-->/Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:10:13-80 ++14 android:authorities="${applicationId}.fileprovider" ++14-->/Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:11:13-64 ++15 android:exported="false" ++15-->/Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:12:13-37 ++16 android:grantUriPermissions="true" > ++16-->/Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:13:13-47 ++17 /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:14:13-16:53 ++18 android:name="android.support.FILE_PROVIDER_PATHS" ++18-->/Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:15:17-67 ++19 android:resource="@xml/file_paths" /> ++19-->/Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:16:17-51 ++20 ++21 ++22 ++23 +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +new file mode 100644 +index 0000000..03eb111 +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +@@ -0,0 +1,23 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +new file mode 100644 +index 0000000..0637a08 +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +@@ -0,0 +1 @@ ++[] +\ No newline at end of file +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +new file mode 100644 +index 0000000..08f4ebe +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +@@ -0,0 +1 @@ ++0 Warning/Error +\ No newline at end of file +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/packaged_res/debug/packageDebugResources/xml/file_paths.xml b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/packaged_res/debug/packageDebugResources/xml/file_paths.xml +new file mode 100644 +index 0000000..1de7aa9 +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/packaged_res/debug/packageDebugResources/xml/file_paths.xml +@@ -0,0 +1,26 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nodece/apkinstallern/BuildConfig.class b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nodece/apkinstallern/BuildConfig.class +new file mode 100644 +index 0000000..8720505 +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nodece/apkinstallern/BuildConfig.class differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nodece/apkinstallern/RNApkInstallerNFileProvider.class b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nodece/apkinstallern/RNApkInstallerNFileProvider.class +new file mode 100644 +index 0000000..a265760 +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nodece/apkinstallern/RNApkInstallerNFileProvider.class differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nodece/apkinstallern/RNApkInstallerNModule.class b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nodece/apkinstallern/RNApkInstallerNModule.class +new file mode 100644 +index 0000000..422a4c2 +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nodece/apkinstallern/RNApkInstallerNModule.class differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nodece/apkinstallern/RNApkInstallerNPackage.class b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nodece/apkinstallern/RNApkInstallerNPackage.class +new file mode 100644 +index 0000000..d1282cb +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nodece/apkinstallern/RNApkInstallerNPackage.class differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +new file mode 100644 +index 0000000..5805dfa +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar differ +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +new file mode 100644 +index 0000000..5d0b226 +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +@@ -0,0 +1,2 @@ ++com.nodece.apkinstallern ++xml file_paths +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/outputs/logs/manifest-merger-debug-report.txt b/node_modules/@dominicvonk/react-native-apk-installer/android/build/outputs/logs/manifest-merger-debug-report.txt +new file mode 100644 +index 0000000..cc79642 +--- /dev/null ++++ b/node_modules/@dominicvonk/react-native-apk-installer/android/build/outputs/logs/manifest-merger-debug-report.txt +@@ -0,0 +1,47 @@ ++-- Merging decision tree log --- ++manifest ++ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:1:1-19:12 ++INJECTED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:1:1-19:12 ++ package ++ ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:2:5-39 ++ INJECTED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml ++ xmlns:android ++ ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:1:11-69 ++uses-permission#android.permission.REQUEST_INSTALL_PACKAGES ++ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:4:5-83 ++ android:name ++ ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:4:22-80 ++uses-permission#android.permission.WRITE_EXTERNAL_STORAGE ++ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:5:5-81 ++ android:name ++ ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:5:22-78 ++uses-permission#android.permission.READ_EXTERNAL_STORAGE ++ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:6:5-80 ++ android:name ++ ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:6:22-77 ++application ++ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:8:5-18:19 ++provider#com.nodece.apkinstallern.RNApkInstallerNFileProvider ++ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:9:9-17:20 ++ android:grantUriPermissions ++ ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:13:13-47 ++ android:authorities ++ ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:11:13-64 ++ android:exported ++ ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:12:13-37 ++ android:name ++ ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:10:13-80 ++meta-data#android.support.FILE_PROVIDER_PATHS ++ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:14:13-16:53 ++ android:resource ++ ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:16:17-51 ++ android:name ++ ADDED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml:15:17-67 ++uses-sdk ++INJECTED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml reason: use-sdk injection requested ++INJECTED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml ++INJECTED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml ++ android:targetSdkVersion ++ INJECTED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml ++ android:minSdkVersion ++ INJECTED from /Users/cpm/Me/cpmCodes/projects/PerformicsManagerAjeet/node_modules/@dominicvonk/react-native-apk-installer/android/src/main/AndroidManifest.xml +diff --git a/node_modules/@dominicvonk/react-native-apk-installer/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin b/node_modules/@dominicvonk/react-native-apk-installer/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +new file mode 100644 +index 0000000..4ccf468 +Binary files /dev/null and b/node_modules/@dominicvonk/react-native-apk-installer/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin differ diff --git a/patches/react-native-image-marker+1.2.9.patch b/patches/react-native-image-marker+1.2.9.patch new file mode 100644 index 0000000..814e24f --- /dev/null +++ b/patches/react-native-image-marker+1.2.9.patch @@ -0,0 +1,12 @@ +diff --git a/node_modules/react-native-image-marker/android/build.gradle b/node_modules/react-native-image-marker/android/build.gradle +index 2cc828f..84ecdea 100644 +--- a/node_modules/react-native-image-marker/android/build.gradle ++++ b/node_modules/react-native-image-marker/android/build.gradle +@@ -67,7 +67,6 @@ android { + repositories { + mavenCentral() + google() +- jcenter() + } + + def kotlin_version = getExtOrDefault("kotlinVersion") diff --git a/patches/react-native-maps+1.20.1.patch b/patches/react-native-maps+1.20.1.patch new file mode 100644 index 0000000..68ce22a --- /dev/null +++ b/patches/react-native-maps+1.20.1.patch @@ -0,0 +1,1130 @@ +diff --git a/node_modules/react-native-maps/android/build/.transforms/4facfb5a5eb4422e910b8d1a37327046/results.bin b/node_modules/react-native-maps/android/build/.transforms/4facfb5a5eb4422e910b8d1a37327046/results.bin +new file mode 100644 +index 0000000..0d259dd +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/.transforms/4facfb5a5eb4422e910b8d1a37327046/results.bin +@@ -0,0 +1 @@ ++o/classes +diff --git a/node_modules/react-native-maps/android/build/.transforms/4facfb5a5eb4422e910b8d1a37327046/transformed/classes/classes_dex/classes.dex b/node_modules/react-native-maps/android/build/.transforms/4facfb5a5eb4422e910b8d1a37327046/transformed/classes/classes_dex/classes.dex +new file mode 100644 +index 0000000..85d7049 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/4facfb5a5eb4422e910b8d1a37327046/transformed/classes/classes_dex/classes.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/results.bin b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/results.bin +new file mode 100644 +index 0000000..7ed749e +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/results.bin +@@ -0,0 +1 @@ ++o/bundleLibRuntimeToDirDebug +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/BuildConfig.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/BuildConfig.dex +new file mode 100644 +index 0000000..7b0b110 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/BuildConfig.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/FileUtil.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/FileUtil.dex +new file mode 100644 +index 0000000..737990c +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/FileUtil.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/FusedLocationSource$1.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/FusedLocationSource$1.dex +new file mode 100644 +index 0000000..bd353b9 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/FusedLocationSource$1.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/FusedLocationSource$2.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/FusedLocationSource$2.dex +new file mode 100644 +index 0000000..97426a8 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/FusedLocationSource$2.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/FusedLocationSource.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/FusedLocationSource.dex +new file mode 100644 +index 0000000..8b64fb9 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/FusedLocationSource.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ImageReadable.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ImageReadable.dex +new file mode 100644 +index 0000000..ef7a30d +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ImageReadable.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ImageReader$1.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ImageReader$1.dex +new file mode 100644 +index 0000000..b4304c6 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ImageReader$1.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ImageReader.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ImageReader.dex +new file mode 100644 +index 0000000..2cfdb44 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ImageReader.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ImageUtil.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ImageUtil.dex +new file mode 100644 +index 0000000..e8f4eba +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ImageUtil.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/LatLngBoundsUtils.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/LatLngBoundsUtils.dex +new file mode 100644 +index 0000000..daa6560 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/LatLngBoundsUtils.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapCallout.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapCallout.dex +new file mode 100644 +index 0000000..3a177d3 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapCallout.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapCalloutManager.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapCalloutManager.dex +new file mode 100644 +index 0000000..5dad21c +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapCalloutManager.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapCircle.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapCircle.dex +new file mode 100644 +index 0000000..e2849e0 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapCircle.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapCircleManager.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapCircleManager.dex +new file mode 100644 +index 0000000..a9c4468 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapCircleManager.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapFeature.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapFeature.dex +new file mode 100644 +index 0000000..e89a991 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapFeature.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapGradientPolyline$AirMapGradientPolylineProvider.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapGradientPolyline$AirMapGradientPolylineProvider.dex +new file mode 100644 +index 0000000..96d1109 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapGradientPolyline$AirMapGradientPolylineProvider.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapGradientPolyline$MutPoint.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapGradientPolyline$MutPoint.dex +new file mode 100644 +index 0000000..99432e1 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapGradientPolyline$MutPoint.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapGradientPolyline.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapGradientPolyline.dex +new file mode 100644 +index 0000000..8b33bae +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapGradientPolyline.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapGradientPolylineManager.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapGradientPolylineManager.dex +new file mode 100644 +index 0000000..f9bf99b +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapGradientPolylineManager.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapHeatmap.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapHeatmap.dex +new file mode 100644 +index 0000000..3c7ec1e +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapHeatmap.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapHeatmapManager.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapHeatmapManager.dex +new file mode 100644 +index 0000000..5c63f85 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapHeatmapManager.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapLocalTile$AIRMapLocalTileProvider.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapLocalTile$AIRMapLocalTileProvider.dex +new file mode 100644 +index 0000000..4fc8eaf +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapLocalTile$AIRMapLocalTileProvider.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapLocalTile.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapLocalTile.dex +new file mode 100644 +index 0000000..1aa3044 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapLocalTile.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapLocalTileManager.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapLocalTileManager.dex +new file mode 100644 +index 0000000..342d114 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapLocalTileManager.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapManager.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapManager.dex +new file mode 100644 +index 0000000..fde6367 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapManager.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapMarker$1.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapMarker$1.dex +new file mode 100644 +index 0000000..be56cf2 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapMarker$1.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapMarker$2.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapMarker$2.dex +new file mode 100644 +index 0000000..ca53a18 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapMarker$2.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapMarker.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapMarker.dex +new file mode 100644 +index 0000000..ed65daa +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapMarker.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapMarkerManager$AirMapMarkerSharedIcon.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapMarkerManager$AirMapMarkerSharedIcon.dex +new file mode 100644 +index 0000000..e6bffca +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapMarkerManager$AirMapMarkerSharedIcon.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapMarkerManager.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapMarkerManager.dex +new file mode 100644 +index 0000000..452c9eb +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapMarkerManager.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapModule$1.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapModule$1.dex +new file mode 100644 +index 0000000..0541692 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapModule$1.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapModule.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapModule.dex +new file mode 100644 +index 0000000..e001cfd +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapModule.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapOverlay.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapOverlay.dex +new file mode 100644 +index 0000000..c018780 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapOverlay.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapOverlayManager.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapOverlayManager.dex +new file mode 100644 +index 0000000..9a86890 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapOverlayManager.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapPolygon.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapPolygon.dex +new file mode 100644 +index 0000000..4fc14a4 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapPolygon.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapPolygonManager.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapPolygonManager.dex +new file mode 100644 +index 0000000..c3b03c6 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapPolygonManager.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapPolyline.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapPolyline.dex +new file mode 100644 +index 0000000..9ccbb3d +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapPolyline.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapPolylineManager.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapPolylineManager.dex +new file mode 100644 +index 0000000..1954b50 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapPolylineManager.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapTileProvider$AIRMapUrlTileProvider.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapTileProvider$AIRMapUrlTileProvider.dex +new file mode 100644 +index 0000000..db7236c +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapTileProvider$AIRMapUrlTileProvider.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapTileProvider.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapTileProvider.dex +new file mode 100644 +index 0000000..92f4bde +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapTileProvider.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapTileWorker.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapTileWorker.dex +new file mode 100644 +index 0000000..506b7d8 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapTileWorker.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapUIBlock.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapUIBlock.dex +new file mode 100644 +index 0000000..a9da698 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapUIBlock.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapUrlTile.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapUrlTile.dex +new file mode 100644 +index 0000000..4cdc76f +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapUrlTile.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapUrlTileManager.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapUrlTileManager.dex +new file mode 100644 +index 0000000..fd14f9c +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapUrlTileManager.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$1.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$1.dex +new file mode 100644 +index 0000000..1ba76ed +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$1.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$10.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$10.dex +new file mode 100644 +index 0000000..b4232a8 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$10.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$11.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$11.dex +new file mode 100644 +index 0000000..6be9a4b +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$11.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$12.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$12.dex +new file mode 100644 +index 0000000..a177773 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$12.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$13.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$13.dex +new file mode 100644 +index 0000000..66f928a +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$13.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$14.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$14.dex +new file mode 100644 +index 0000000..a17f37e +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$14.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$15.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$15.dex +new file mode 100644 +index 0000000..31ce462 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$15.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$16.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$16.dex +new file mode 100644 +index 0000000..d3344ee +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$16.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$17.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$17.dex +new file mode 100644 +index 0000000..4a0cf0b +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$17.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$2.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$2.dex +new file mode 100644 +index 0000000..917fe90 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$2.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$3.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$3.dex +new file mode 100644 +index 0000000..8142b7c +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$3.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$4.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$4.dex +new file mode 100644 +index 0000000..704bd58 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$4.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$5.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$5.dex +new file mode 100644 +index 0000000..3fc673c +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$5.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$6.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$6.dex +new file mode 100644 +index 0000000..c1a3018 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$6.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$7.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$7.dex +new file mode 100644 +index 0000000..6df33ba +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$7.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$8.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$8.dex +new file mode 100644 +index 0000000..ce694c8 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$8.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$9.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$9.dex +new file mode 100644 +index 0000000..878b857 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView$9.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView.dex +new file mode 100644 +index 0000000..6850a8b +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapView.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider$AIRMapWMSTileProvider.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider$AIRMapWMSTileProvider.dex +new file mode 100644 +index 0000000..69ab783 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider$AIRMapWMSTileProvider.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider.dex +new file mode 100644 +index 0000000..9619cb8 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapWMSTile.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapWMSTile.dex +new file mode 100644 +index 0000000..0c0ec4c +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapWMSTile.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapWMSTileManager.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapWMSTileManager.dex +new file mode 100644 +index 0000000..705e5e9 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapWMSTileManager.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapsPackage.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapsPackage.dex +new file mode 100644 +index 0000000..73bb107 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/MapsPackage.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/RegionChangeEvent.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/RegionChangeEvent.dex +new file mode 100644 +index 0000000..020d930 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/RegionChangeEvent.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/SizeReportingShadowNode.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/SizeReportingShadowNode.dex +new file mode 100644 +index 0000000..8206ee5 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/SizeReportingShadowNode.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/UIBlockInterface.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/UIBlockInterface.dex +new file mode 100644 +index 0000000..ff382e3 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/UIBlockInterface.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ViewAttacherGroup.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ViewAttacherGroup.dex +new file mode 100644 +index 0000000..f3d410b +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ViewAttacherGroup.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ViewChangesTracker$1.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ViewChangesTracker$1.dex +new file mode 100644 +index 0000000..bc42aa1 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ViewChangesTracker$1.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ViewChangesTracker.dex b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ViewChangesTracker.dex +new file mode 100644 +index 0000000..3425db5 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/rnmaps/maps/ViewChangesTracker.dex differ +diff --git a/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +new file mode 100644 +index 0000000..29c6ca6 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/.transforms/a19912258ee8ef7263f0842c9e9aa4f5/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin differ +diff --git a/node_modules/react-native-maps/android/build/generated/source/buildConfig/debug/com/rnmaps/maps/BuildConfig.java b/node_modules/react-native-maps/android/build/generated/source/buildConfig/debug/com/rnmaps/maps/BuildConfig.java +new file mode 100644 +index 0000000..7f1620c +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/generated/source/buildConfig/debug/com/rnmaps/maps/BuildConfig.java +@@ -0,0 +1,12 @@ ++/** ++ * Automatically generated file. DO NOT MODIFY ++ */ ++package com.rnmaps.maps; ++ ++public final class BuildConfig { ++ public static final boolean DEBUG = Boolean.parseBoolean("true"); ++ public static final String LIBRARY_PACKAGE_NAME = "com.rnmaps.maps"; ++ public static final String BUILD_TYPE = "debug"; ++ // Field from default config. ++ public static final boolean IS_NEW_ARCHITECTURE_ENABLED = true; ++} +diff --git a/node_modules/react-native-maps/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml b/node_modules/react-native-maps/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +new file mode 100644 +index 0000000..a6ec305 +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +@@ -0,0 +1,7 @@ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +diff --git a/node_modules/react-native-maps/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json b/node_modules/react-native-maps/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +new file mode 100644 +index 0000000..578d892 +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +@@ -0,0 +1,18 @@ ++{ ++ "version": 3, ++ "artifactType": { ++ "type": "AAPT_FRIENDLY_MERGED_MANIFESTS", ++ "kind": "Directory" ++ }, ++ "applicationId": "com.rnmaps.maps", ++ "variantName": "debug", ++ "elements": [ ++ { ++ "type": "SINGLE", ++ "filters": [], ++ "attributes": [], ++ "outputFile": "AndroidManifest.xml" ++ } ++ ], ++ "elementType": "File" ++} +\ No newline at end of file +diff --git a/node_modules/react-native-maps/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties b/node_modules/react-native-maps/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +new file mode 100644 +index 0000000..1211b1e +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +@@ -0,0 +1,6 @@ ++aarFormatVersion=1.0 ++aarMetadataVersion=1.0 ++minCompileSdk=1 ++minCompileSdkExtension=0 ++minAndroidGradlePluginVersion=1.0.0 ++coreLibraryDesugaringEnabled=false +diff --git a/node_modules/react-native-maps/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json b/node_modules/react-native-maps/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +new file mode 100644 +index 0000000..9e26dfe +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +@@ -0,0 +1 @@ ++{} +\ No newline at end of file +diff --git a/node_modules/react-native-maps/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar b/node_modules/react-native-maps/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +new file mode 100644 +index 0000000..43375de +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar b/node_modules/react-native-maps/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +new file mode 100644 +index 0000000..588cd91 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt b/node_modules/react-native-maps/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +new file mode 100644 +index 0000000..e69de29 +diff --git a/node_modules/react-native-maps/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties b/node_modules/react-native-maps/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +new file mode 100644 +index 0000000..50fb3c0 +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +@@ -0,0 +1 @@ ++#Fri Feb 07 13:30:35 IST 2025 +diff --git a/node_modules/react-native-maps/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml b/node_modules/react-native-maps/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +new file mode 100644 +index 0000000..3ab7c99 +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +@@ -0,0 +1,2 @@ ++ ++ +\ No newline at end of file +diff --git a/node_modules/react-native-maps/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml b/node_modules/react-native-maps/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +new file mode 100644 +index 0000000..a576b59 +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +@@ -0,0 +1,2 @@ ++ ++ +\ No newline at end of file +diff --git a/node_modules/react-native-maps/android/build/intermediates/incremental/mergeDebugShaders/merger.xml b/node_modules/react-native-maps/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +new file mode 100644 +index 0000000..9f1741f +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +@@ -0,0 +1,2 @@ ++ ++ +\ No newline at end of file +diff --git a/node_modules/react-native-maps/android/build/intermediates/incremental/packageDebugAssets/merger.xml b/node_modules/react-native-maps/android/build/intermediates/incremental/packageDebugAssets/merger.xml +new file mode 100644 +index 0000000..8501e68 +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/intermediates/incremental/packageDebugAssets/merger.xml +@@ -0,0 +1,2 @@ ++ ++ +\ No newline at end of file +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/BuildConfig.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/BuildConfig.class +new file mode 100644 +index 0000000..005bbfc +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/BuildConfig.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/FileUtil.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/FileUtil.class +new file mode 100644 +index 0000000..2ddef0c +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/FileUtil.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/FusedLocationSource$1.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/FusedLocationSource$1.class +new file mode 100644 +index 0000000..dc8b8ac +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/FusedLocationSource$1.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/FusedLocationSource$2.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/FusedLocationSource$2.class +new file mode 100644 +index 0000000..4794f5f +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/FusedLocationSource$2.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/FusedLocationSource.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/FusedLocationSource.class +new file mode 100644 +index 0000000..db43dc5 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/FusedLocationSource.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ImageReadable.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ImageReadable.class +new file mode 100644 +index 0000000..696cc70 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ImageReadable.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ImageReader$1.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ImageReader$1.class +new file mode 100644 +index 0000000..43ccaa7 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ImageReader$1.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ImageReader.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ImageReader.class +new file mode 100644 +index 0000000..9490744 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ImageReader.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ImageUtil.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ImageUtil.class +new file mode 100644 +index 0000000..23b41bc +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ImageUtil.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/LatLngBoundsUtils.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/LatLngBoundsUtils.class +new file mode 100644 +index 0000000..c0e7aa9 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/LatLngBoundsUtils.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapCallout.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapCallout.class +new file mode 100644 +index 0000000..5312da6 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapCallout.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapCalloutManager.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapCalloutManager.class +new file mode 100644 +index 0000000..84b5ed7 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapCalloutManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapCircle.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapCircle.class +new file mode 100644 +index 0000000..e76b618 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapCircle.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapCircleManager.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapCircleManager.class +new file mode 100644 +index 0000000..e402cb2 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapCircleManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapFeature.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapFeature.class +new file mode 100644 +index 0000000..1753e54 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapFeature.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapGradientPolyline$AirMapGradientPolylineProvider.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapGradientPolyline$AirMapGradientPolylineProvider.class +new file mode 100644 +index 0000000..18cb525 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapGradientPolyline$AirMapGradientPolylineProvider.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapGradientPolyline$MutPoint.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapGradientPolyline$MutPoint.class +new file mode 100644 +index 0000000..0a166ce +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapGradientPolyline$MutPoint.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapGradientPolyline.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapGradientPolyline.class +new file mode 100644 +index 0000000..0b8bc6e +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapGradientPolyline.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapGradientPolylineManager.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapGradientPolylineManager.class +new file mode 100644 +index 0000000..b77919f +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapGradientPolylineManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapHeatmap.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapHeatmap.class +new file mode 100644 +index 0000000..499244e +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapHeatmap.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapHeatmapManager.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapHeatmapManager.class +new file mode 100644 +index 0000000..1609b2d +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapHeatmapManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapLocalTile$AIRMapLocalTileProvider.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapLocalTile$AIRMapLocalTileProvider.class +new file mode 100644 +index 0000000..bbf9445 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapLocalTile$AIRMapLocalTileProvider.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapLocalTile.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapLocalTile.class +new file mode 100644 +index 0000000..e9f8b1e +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapLocalTile.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapLocalTileManager.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapLocalTileManager.class +new file mode 100644 +index 0000000..210202e +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapLocalTileManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapManager.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapManager.class +new file mode 100644 +index 0000000..0b3891a +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapMarker$1.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapMarker$1.class +new file mode 100644 +index 0000000..bba1e68 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapMarker$1.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapMarker$2.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapMarker$2.class +new file mode 100644 +index 0000000..7b59afd +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapMarker$2.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapMarker.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapMarker.class +new file mode 100644 +index 0000000..92e4f3a +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapMarker.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapMarkerManager$AirMapMarkerSharedIcon.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapMarkerManager$AirMapMarkerSharedIcon.class +new file mode 100644 +index 0000000..9ee6d20 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapMarkerManager$AirMapMarkerSharedIcon.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapMarkerManager.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapMarkerManager.class +new file mode 100644 +index 0000000..e2ae47c +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapMarkerManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapModule$1.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapModule$1.class +new file mode 100644 +index 0000000..c6ed4e1 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapModule$1.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapModule.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapModule.class +new file mode 100644 +index 0000000..b2fff45 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapModule.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapOverlay.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapOverlay.class +new file mode 100644 +index 0000000..4a0af12 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapOverlay.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapOverlayManager.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapOverlayManager.class +new file mode 100644 +index 0000000..14c7202 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapOverlayManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapPolygon.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapPolygon.class +new file mode 100644 +index 0000000..5544155 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapPolygon.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapPolygonManager.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapPolygonManager.class +new file mode 100644 +index 0000000..f6654aa +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapPolygonManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapPolyline.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapPolyline.class +new file mode 100644 +index 0000000..9752dd6 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapPolyline.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapPolylineManager.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapPolylineManager.class +new file mode 100644 +index 0000000..8dec163 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapPolylineManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapTileProvider$AIRMapUrlTileProvider.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapTileProvider$AIRMapUrlTileProvider.class +new file mode 100644 +index 0000000..91d9647 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapTileProvider$AIRMapUrlTileProvider.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapTileProvider.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapTileProvider.class +new file mode 100644 +index 0000000..345ff34 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapTileProvider.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapTileWorker.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapTileWorker.class +new file mode 100644 +index 0000000..408ff57 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapTileWorker.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapUIBlock.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapUIBlock.class +new file mode 100644 +index 0000000..6ad0ed2 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapUIBlock.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapUrlTile.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapUrlTile.class +new file mode 100644 +index 0000000..e236f9d +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapUrlTile.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapUrlTileManager.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapUrlTileManager.class +new file mode 100644 +index 0000000..1b47e2c +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapUrlTileManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$1.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$1.class +new file mode 100644 +index 0000000..a5b444d +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$1.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$10.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$10.class +new file mode 100644 +index 0000000..7901a3b +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$10.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$11.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$11.class +new file mode 100644 +index 0000000..6fdad72 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$11.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$12.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$12.class +new file mode 100644 +index 0000000..283bb80 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$12.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$13.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$13.class +new file mode 100644 +index 0000000..a4a723d +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$13.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$14.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$14.class +new file mode 100644 +index 0000000..7834b36 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$14.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$15.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$15.class +new file mode 100644 +index 0000000..acc3aa0 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$15.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$16.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$16.class +new file mode 100644 +index 0000000..c9c5283 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$16.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$17.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$17.class +new file mode 100644 +index 0000000..5a0b4fe +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$17.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$2.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$2.class +new file mode 100644 +index 0000000..db7b3cb +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$2.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$3.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$3.class +new file mode 100644 +index 0000000..e0e9ff4 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$3.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$4.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$4.class +new file mode 100644 +index 0000000..0a042d9 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$4.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$5.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$5.class +new file mode 100644 +index 0000000..0d82558 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$5.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$6.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$6.class +new file mode 100644 +index 0000000..952ecc6 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$6.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$7.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$7.class +new file mode 100644 +index 0000000..a423bb6 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$7.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$8.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$8.class +new file mode 100644 +index 0000000..c3e78ef +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$8.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$9.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$9.class +new file mode 100644 +index 0000000..174ee71 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView$9.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView.class +new file mode 100644 +index 0000000..9907ef8 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapView.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider$AIRMapWMSTileProvider.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider$AIRMapWMSTileProvider.class +new file mode 100644 +index 0000000..91f29e1 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider$AIRMapWMSTileProvider.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider.class +new file mode 100644 +index 0000000..be52547 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapWMSTile.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapWMSTile.class +new file mode 100644 +index 0000000..aafe4fe +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapWMSTile.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapWMSTileManager.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapWMSTileManager.class +new file mode 100644 +index 0000000..bbafb04 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapWMSTileManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapsPackage.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapsPackage.class +new file mode 100644 +index 0000000..408840f +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/MapsPackage.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/RegionChangeEvent.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/RegionChangeEvent.class +new file mode 100644 +index 0000000..6663566 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/RegionChangeEvent.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/SizeReportingShadowNode.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/SizeReportingShadowNode.class +new file mode 100644 +index 0000000..efbf4b1 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/SizeReportingShadowNode.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/UIBlockInterface.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/UIBlockInterface.class +new file mode 100644 +index 0000000..836c597 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/UIBlockInterface.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ViewAttacherGroup.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ViewAttacherGroup.class +new file mode 100644 +index 0000000..55b7b4e +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ViewAttacherGroup.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ViewChangesTracker$1.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ViewChangesTracker$1.class +new file mode 100644 +index 0000000..ba59812 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ViewChangesTracker$1.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ViewChangesTracker.class b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ViewChangesTracker.class +new file mode 100644 +index 0000000..e467567 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnmaps/maps/ViewChangesTracker.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt b/node_modules/react-native-maps/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +new file mode 100644 +index 0000000..78ac5b8 +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +@@ -0,0 +1,2 @@ ++R_DEF: Internal format may change without notice ++local +diff --git a/node_modules/react-native-maps/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt b/node_modules/react-native-maps/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +new file mode 100644 +index 0000000..b4f2e45 +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +@@ -0,0 +1,7 @@ ++1 ++2 ++4 ++5 ++6 ++7 +diff --git a/node_modules/react-native-maps/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml b/node_modules/react-native-maps/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +new file mode 100644 +index 0000000..a6ec305 +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +@@ -0,0 +1,7 @@ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +diff --git a/node_modules/react-native-maps/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json b/node_modules/react-native-maps/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +new file mode 100644 +index 0000000..0637a08 +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +@@ -0,0 +1 @@ ++[] +\ No newline at end of file +diff --git a/node_modules/react-native-maps/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt b/node_modules/react-native-maps/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +new file mode 100644 +index 0000000..08f4ebe +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +@@ -0,0 +1 @@ ++0 Warning/Error +\ No newline at end of file +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/BuildConfig.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/BuildConfig.class +new file mode 100644 +index 0000000..005bbfc +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/BuildConfig.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/FileUtil.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/FileUtil.class +new file mode 100644 +index 0000000..2ddef0c +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/FileUtil.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/FusedLocationSource$1.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/FusedLocationSource$1.class +new file mode 100644 +index 0000000..dc8b8ac +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/FusedLocationSource$1.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/FusedLocationSource$2.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/FusedLocationSource$2.class +new file mode 100644 +index 0000000..4794f5f +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/FusedLocationSource$2.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/FusedLocationSource.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/FusedLocationSource.class +new file mode 100644 +index 0000000..db43dc5 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/FusedLocationSource.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ImageReadable.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ImageReadable.class +new file mode 100644 +index 0000000..696cc70 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ImageReadable.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ImageReader$1.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ImageReader$1.class +new file mode 100644 +index 0000000..43ccaa7 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ImageReader$1.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ImageReader.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ImageReader.class +new file mode 100644 +index 0000000..9490744 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ImageReader.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ImageUtil.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ImageUtil.class +new file mode 100644 +index 0000000..23b41bc +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ImageUtil.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/LatLngBoundsUtils.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/LatLngBoundsUtils.class +new file mode 100644 +index 0000000..c0e7aa9 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/LatLngBoundsUtils.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapCallout.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapCallout.class +new file mode 100644 +index 0000000..5312da6 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapCallout.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapCalloutManager.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapCalloutManager.class +new file mode 100644 +index 0000000..84b5ed7 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapCalloutManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapCircle.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapCircle.class +new file mode 100644 +index 0000000..e76b618 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapCircle.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapCircleManager.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapCircleManager.class +new file mode 100644 +index 0000000..e402cb2 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapCircleManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapFeature.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapFeature.class +new file mode 100644 +index 0000000..1753e54 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapFeature.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapGradientPolyline$AirMapGradientPolylineProvider.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapGradientPolyline$AirMapGradientPolylineProvider.class +new file mode 100644 +index 0000000..18cb525 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapGradientPolyline$AirMapGradientPolylineProvider.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapGradientPolyline$MutPoint.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapGradientPolyline$MutPoint.class +new file mode 100644 +index 0000000..0a166ce +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapGradientPolyline$MutPoint.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapGradientPolyline.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapGradientPolyline.class +new file mode 100644 +index 0000000..0b8bc6e +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapGradientPolyline.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapGradientPolylineManager.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapGradientPolylineManager.class +new file mode 100644 +index 0000000..b77919f +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapGradientPolylineManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapHeatmap.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapHeatmap.class +new file mode 100644 +index 0000000..499244e +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapHeatmap.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapHeatmapManager.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapHeatmapManager.class +new file mode 100644 +index 0000000..1609b2d +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapHeatmapManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapLocalTile$AIRMapLocalTileProvider.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapLocalTile$AIRMapLocalTileProvider.class +new file mode 100644 +index 0000000..bbf9445 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapLocalTile$AIRMapLocalTileProvider.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapLocalTile.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapLocalTile.class +new file mode 100644 +index 0000000..e9f8b1e +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapLocalTile.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapLocalTileManager.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapLocalTileManager.class +new file mode 100644 +index 0000000..210202e +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapLocalTileManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapManager.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapManager.class +new file mode 100644 +index 0000000..0b3891a +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapMarker$1.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapMarker$1.class +new file mode 100644 +index 0000000..bba1e68 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapMarker$1.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapMarker$2.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapMarker$2.class +new file mode 100644 +index 0000000..7b59afd +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapMarker$2.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapMarker.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapMarker.class +new file mode 100644 +index 0000000..92e4f3a +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapMarker.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapMarkerManager$AirMapMarkerSharedIcon.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapMarkerManager$AirMapMarkerSharedIcon.class +new file mode 100644 +index 0000000..9ee6d20 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapMarkerManager$AirMapMarkerSharedIcon.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapMarkerManager.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapMarkerManager.class +new file mode 100644 +index 0000000..e2ae47c +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapMarkerManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapModule$1.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapModule$1.class +new file mode 100644 +index 0000000..c6ed4e1 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapModule$1.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapModule.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapModule.class +new file mode 100644 +index 0000000..b2fff45 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapModule.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapOverlay.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapOverlay.class +new file mode 100644 +index 0000000..4a0af12 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapOverlay.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapOverlayManager.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapOverlayManager.class +new file mode 100644 +index 0000000..14c7202 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapOverlayManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapPolygon.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapPolygon.class +new file mode 100644 +index 0000000..5544155 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapPolygon.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapPolygonManager.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapPolygonManager.class +new file mode 100644 +index 0000000..f6654aa +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapPolygonManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapPolyline.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapPolyline.class +new file mode 100644 +index 0000000..9752dd6 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapPolyline.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapPolylineManager.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapPolylineManager.class +new file mode 100644 +index 0000000..8dec163 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapPolylineManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapTileProvider$AIRMapUrlTileProvider.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapTileProvider$AIRMapUrlTileProvider.class +new file mode 100644 +index 0000000..91d9647 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapTileProvider$AIRMapUrlTileProvider.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapTileProvider.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapTileProvider.class +new file mode 100644 +index 0000000..345ff34 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapTileProvider.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapTileWorker.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapTileWorker.class +new file mode 100644 +index 0000000..408ff57 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapTileWorker.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapUIBlock.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapUIBlock.class +new file mode 100644 +index 0000000..6ad0ed2 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapUIBlock.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapUrlTile.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapUrlTile.class +new file mode 100644 +index 0000000..e236f9d +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapUrlTile.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapUrlTileManager.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapUrlTileManager.class +new file mode 100644 +index 0000000..1b47e2c +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapUrlTileManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$1.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$1.class +new file mode 100644 +index 0000000..a5b444d +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$1.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$10.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$10.class +new file mode 100644 +index 0000000..7901a3b +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$10.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$11.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$11.class +new file mode 100644 +index 0000000..6fdad72 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$11.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$12.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$12.class +new file mode 100644 +index 0000000..283bb80 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$12.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$13.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$13.class +new file mode 100644 +index 0000000..a4a723d +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$13.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$14.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$14.class +new file mode 100644 +index 0000000..7834b36 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$14.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$15.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$15.class +new file mode 100644 +index 0000000..acc3aa0 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$15.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$16.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$16.class +new file mode 100644 +index 0000000..c9c5283 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$16.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$17.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$17.class +new file mode 100644 +index 0000000..5a0b4fe +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$17.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$2.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$2.class +new file mode 100644 +index 0000000..db7b3cb +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$2.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$3.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$3.class +new file mode 100644 +index 0000000..e0e9ff4 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$3.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$4.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$4.class +new file mode 100644 +index 0000000..0a042d9 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$4.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$5.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$5.class +new file mode 100644 +index 0000000..0d82558 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$5.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$6.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$6.class +new file mode 100644 +index 0000000..952ecc6 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$6.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$7.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$7.class +new file mode 100644 +index 0000000..a423bb6 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$7.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$8.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$8.class +new file mode 100644 +index 0000000..c3e78ef +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$8.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$9.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$9.class +new file mode 100644 +index 0000000..174ee71 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView$9.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView.class +new file mode 100644 +index 0000000..9907ef8 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapView.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider$AIRMapWMSTileProvider.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider$AIRMapWMSTileProvider.class +new file mode 100644 +index 0000000..91f29e1 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider$AIRMapWMSTileProvider.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider.class +new file mode 100644 +index 0000000..be52547 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapWMSTile$AIRMapGSUrlTileProvider.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapWMSTile.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapWMSTile.class +new file mode 100644 +index 0000000..aafe4fe +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapWMSTile.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapWMSTileManager.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapWMSTileManager.class +new file mode 100644 +index 0000000..bbafb04 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapWMSTileManager.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapsPackage.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapsPackage.class +new file mode 100644 +index 0000000..408840f +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/MapsPackage.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/RegionChangeEvent.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/RegionChangeEvent.class +new file mode 100644 +index 0000000..6663566 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/RegionChangeEvent.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/SizeReportingShadowNode.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/SizeReportingShadowNode.class +new file mode 100644 +index 0000000..efbf4b1 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/SizeReportingShadowNode.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/UIBlockInterface.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/UIBlockInterface.class +new file mode 100644 +index 0000000..836c597 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/UIBlockInterface.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ViewAttacherGroup.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ViewAttacherGroup.class +new file mode 100644 +index 0000000..55b7b4e +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ViewAttacherGroup.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ViewChangesTracker$1.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ViewChangesTracker$1.class +new file mode 100644 +index 0000000..ba59812 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ViewChangesTracker$1.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ViewChangesTracker.class b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ViewChangesTracker.class +new file mode 100644 +index 0000000..e467567 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rnmaps/maps/ViewChangesTracker.class differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +new file mode 100644 +index 0000000..0e6e703 +Binary files /dev/null and b/node_modules/react-native-maps/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar differ +diff --git a/node_modules/react-native-maps/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt b/node_modules/react-native-maps/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +new file mode 100644 +index 0000000..d2faa16 +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +@@ -0,0 +1 @@ ++com.rnmaps.maps +diff --git a/node_modules/react-native-maps/android/build/outputs/logs/manifest-merger-debug-report.txt b/node_modules/react-native-maps/android/build/outputs/logs/manifest-merger-debug-report.txt +new file mode 100644 +index 0000000..95ff189 +--- /dev/null ++++ b/node_modules/react-native-maps/android/build/outputs/logs/manifest-merger-debug-report.txt +@@ -0,0 +1,16 @@ ++-- Merging decision tree log --- ++manifest ++ADDED from /Users/cpm/Me/cpmCodes/projects/Performics/node_modules/react-native-maps/android/src/main/AndroidManifest.xml:1:1-2:12 ++INJECTED from /Users/cpm/Me/cpmCodes/projects/Performics/node_modules/react-native-maps/android/src/main/AndroidManifest.xml:1:1-2:12 ++ package ++ INJECTED from /Users/cpm/Me/cpmCodes/projects/Performics/node_modules/react-native-maps/android/src/main/AndroidManifest.xml ++ xmlns:android ++ ADDED from /Users/cpm/Me/cpmCodes/projects/Performics/node_modules/react-native-maps/android/src/main/AndroidManifest.xml:1:11-69 ++uses-sdk ++INJECTED from /Users/cpm/Me/cpmCodes/projects/Performics/node_modules/react-native-maps/android/src/main/AndroidManifest.xml reason: use-sdk injection requested ++INJECTED from /Users/cpm/Me/cpmCodes/projects/Performics/node_modules/react-native-maps/android/src/main/AndroidManifest.xml ++INJECTED from /Users/cpm/Me/cpmCodes/projects/Performics/node_modules/react-native-maps/android/src/main/AndroidManifest.xml ++ android:targetSdkVersion ++ INJECTED from /Users/cpm/Me/cpmCodes/projects/Performics/node_modules/react-native-maps/android/src/main/AndroidManifest.xml ++ android:minSdkVersion ++ INJECTED from /Users/cpm/Me/cpmCodes/projects/Performics/node_modules/react-native-maps/android/src/main/AndroidManifest.xml +diff --git a/node_modules/react-native-maps/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin b/node_modules/react-native-maps/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +new file mode 100644 +index 0000000..1c51e1f +Binary files /dev/null and b/node_modules/react-native-maps/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin differ +diff --git a/node_modules/react-native-maps/lib/MapMarker.js b/node_modules/react-native-maps/lib/MapMarker.js +index 90b689e..d22177f 100644 +--- a/node_modules/react-native-maps/lib/MapMarker.js ++++ b/node_modules/react-native-maps/lib/MapMarker.js +@@ -29,7 +29,7 @@ const react_native_1 = require("react-native"); + const decorateMapComponent_1 = __importStar(require("./decorateMapComponent")); + const MapMarkerNativeComponent_1 = require("./MapMarkerNativeComponent"); + class MapMarker extends React.Component { +- getNativeComponent; ++ // getNativeComponent; + getMapManagerCommand; + getUIManagerCommand; + static Animated; diff --git a/patches/react-native-snap-carousel+3.9.1.patch b/patches/react-native-snap-carousel+3.9.1.patch new file mode 100644 index 0000000..4f328fb --- /dev/null +++ b/patches/react-native-snap-carousel+3.9.1.patch @@ -0,0 +1,125 @@ +diff --git a/node_modules/react-native-snap-carousel/src/carousel/Carousel.js b/node_modules/react-native-snap-carousel/src/carousel/Carousel.js +index dae71a3..b195d0e 100644 +--- a/node_modules/react-native-snap-carousel/src/carousel/Carousel.js ++++ b/node_modules/react-native-snap-carousel/src/carousel/Carousel.js +@@ -43,8 +43,16 @@ export default class Carousel extends Component { + autoplayDelay: PropTypes.number, + autoplayInterval: PropTypes.number, + callbackOffsetMargin: PropTypes.number, +- containerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, +- contentContainerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, ++ containerCustomStyle: PropTypes.oneOfType([ ++ PropTypes.object, ++ PropTypes.array, ++ PropTypes.number ++ ]), ++ contentContainerCustomStyle: PropTypes.oneOfType([ ++ PropTypes.object, ++ PropTypes.array, ++ PropTypes.number ++ ]), + enableMomentum: PropTypes.bool, + enableSnap: PropTypes.bool, + firstItem: PropTypes.number, +@@ -61,7 +69,11 @@ export default class Carousel extends Component { + scrollEnabled: PropTypes.bool, + scrollInterpolator: PropTypes.func, + slideInterpolatedStyle: PropTypes.func, +- slideStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, ++ slideStyle: PropTypes.oneOfType([ ++ PropTypes.object, ++ PropTypes.array, ++ PropTypes.number ++ ]), + shouldOptimizeUpdates: PropTypes.bool, + swipeThreshold: PropTypes.number, + useScrollView: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]), +diff --git a/node_modules/react-native-snap-carousel/src/pagination/Pagination.js b/node_modules/react-native-snap-carousel/src/pagination/Pagination.js +index 5c021cf..0fff08d 100644 +--- a/node_modules/react-native-snap-carousel/src/pagination/Pagination.js ++++ b/node_modules/react-native-snap-carousel/src/pagination/Pagination.js +@@ -14,16 +14,32 @@ export default class Pagination extends PureComponent { + dotsLength: PropTypes.number.isRequired, + activeOpacity: PropTypes.number, + carouselRef: PropTypes.object, +- containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, ++ containerStyle: PropTypes.oneOfType([ ++ PropTypes.object, ++ PropTypes.array, ++ PropTypes.number ++ ]), + dotColor: PropTypes.string, +- dotContainerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, ++ dotContainerStyle: PropTypes.oneOfType([ ++ PropTypes.object, ++ PropTypes.array, ++ PropTypes.number ++ ]), + dotElement: PropTypes.element, +- dotStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, ++ dotStyle: PropTypes.oneOfType([ ++ PropTypes.object, ++ PropTypes.array, ++ PropTypes.number ++ ]), + inactiveDotColor: PropTypes.string, + inactiveDotElement: PropTypes.element, + inactiveDotOpacity: PropTypes.number, + inactiveDotScale: PropTypes.number, +- inactiveDotStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, ++ inactiveDotStyle: PropTypes.oneOfType([ ++ PropTypes.object, ++ PropTypes.array, ++ PropTypes.number ++ ]), + renderDots: PropTypes.func, + tappableDots: PropTypes.bool, + vertical: PropTypes.bool, +diff --git a/node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js b/node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js +index e59d196..c7936c1 100644 +--- a/node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js ++++ b/node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js +@@ -12,11 +12,23 @@ export default class PaginationDot extends PureComponent { + activeOpacity: PropTypes.number, + carouselRef: PropTypes.object, + color: PropTypes.string, +- containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, ++ containerStyle: PropTypes.oneOfType([ ++ PropTypes.object, ++ PropTypes.array, ++ PropTypes.number ++ ]), + inactiveColor: PropTypes.string, +- inactiveStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, ++ inactiveStyle: PropTypes.oneOfType([ ++ PropTypes.object, ++ PropTypes.array, ++ PropTypes.number ++ ]), + index: PropTypes.number, +- style: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, ++ style: PropTypes.oneOfType([ ++ PropTypes.object, ++ PropTypes.array, ++ PropTypes.number ++ ]), + tappable: PropTypes.bool + }; + +diff --git a/node_modules/react-native-snap-carousel/src/parallaximage/ParallaxImage.js b/node_modules/react-native-snap-carousel/src/parallaximage/ParallaxImage.js +index 8bc774a..5de735d 100644 +--- a/node_modules/react-native-snap-carousel/src/parallaximage/ParallaxImage.js ++++ b/node_modules/react-native-snap-carousel/src/parallaximage/ParallaxImage.js +@@ -16,7 +16,11 @@ export default class ParallaxImage extends Component { + sliderHeight: PropTypes.number, // passed from + sliderWidth: PropTypes.number, // passed from + vertical: PropTypes.bool, // passed from +- containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, ++ containerStyle: PropTypes.oneOfType([ ++ PropTypes.object, ++ PropTypes.array, ++ PropTypes.number ++ ]), + dimensions: PropTypes.shape({ + width: PropTypes.number, + height: PropTypes.number diff --git a/patches/react-native-vision-camera+4.6.3.patch b/patches/react-native-vision-camera+4.6.3.patch new file mode 100644 index 0000000..431dcbf --- /dev/null +++ b/patches/react-native-vision-camera+4.6.3.patch @@ -0,0 +1,12 @@ +diff --git a/node_modules/react-native-vision-camera/ios/Core/CameraSession.swift b/node_modules/react-native-vision-camera/ios/Core/CameraSession.swift +index 10b0f33..5f8dc6a 100644 +--- a/node_modules/react-native-vision-camera/ios/Core/CameraSession.swift ++++ b/node_modules/react-native-vision-camera/ios/Core/CameraSession.swift +@@ -133,6 +133,7 @@ final class CameraSession: NSObject, AVCaptureVideoDataOutputSampleBufferDelegat + + do { + // If needed, configure the AVCaptureSession (inputs, outputs) ++ self.captureSession.automaticallyConfiguresCaptureDeviceForWideColor = false; + if difference.isSessionConfigurationDirty { + self.captureSession.beginConfiguration() + diff --git a/patches/react-native-worklets-core+1.6.2.patch b/patches/react-native-worklets-core+1.6.2.patch new file mode 100644 index 0000000..3351970 --- /dev/null +++ b/patches/react-native-worklets-core+1.6.2.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/react-native-worklets-core/android/CMakeLists.txt b/node_modules/react-native-worklets-core/android/CMakeLists.txt +index cc4cbfe..61e1b56 100644 +--- a/node_modules/react-native-worklets-core/android/CMakeLists.txt ++++ b/node_modules/react-native-worklets-core/android/CMakeLists.txt +@@ -81,7 +81,7 @@ if(${JS_RUNTIME} STREQUAL "hermes") + + target_link_libraries( + ${PACKAGE_NAME} +- hermes-engine::libhermes ++ hermes-engine::hermesvm + ) + + if(${HERMES_ENABLE_DEBUGGER}) diff --git a/src/assets/cpm_logo.png b/src/assets/cpm_logo.png new file mode 100644 index 0000000..e4d9ae6 Binary files /dev/null and b/src/assets/cpm_logo.png differ diff --git a/src/assets/icons/audit/40x40.png b/src/assets/icons/audit/40x40.png new file mode 100644 index 0000000..c00d657 Binary files /dev/null and b/src/assets/icons/audit/40x40.png differ diff --git a/src/assets/icons/audit/50x50.png b/src/assets/icons/audit/50x50.png new file mode 100644 index 0000000..12b584a Binary files /dev/null and b/src/assets/icons/audit/50x50.png differ diff --git a/src/assets/icons/audit/Approved.png b/src/assets/icons/audit/Approved.png new file mode 100644 index 0000000..c342322 Binary files /dev/null and b/src/assets/icons/audit/Approved.png differ diff --git a/src/assets/icons/audit/NoDataImage.png b/src/assets/icons/audit/NoDataImage.png new file mode 100644 index 0000000..eca50f6 Binary files /dev/null and b/src/assets/icons/audit/NoDataImage.png differ diff --git a/src/assets/icons/audit/Reject.png b/src/assets/icons/audit/Reject.png new file mode 100644 index 0000000..241ecc7 Binary files /dev/null and b/src/assets/icons/audit/Reject.png differ diff --git a/src/assets/icons/audit/audit.png b/src/assets/icons/audit/audit.png new file mode 100644 index 0000000..9de41af Binary files /dev/null and b/src/assets/icons/audit/audit.png differ diff --git a/src/assets/icons/audit/grooming.png b/src/assets/icons/audit/grooming.png new file mode 100644 index 0000000..276a725 Binary files /dev/null and b/src/assets/icons/audit/grooming.png differ diff --git a/src/assets/icons/back.png b/src/assets/icons/back.png new file mode 100644 index 0000000..766d366 Binary files /dev/null and b/src/assets/icons/back.png differ diff --git a/src/assets/icons/crossmodal.svg b/src/assets/icons/crossmodal.svg new file mode 100644 index 0000000..aba965b --- /dev/null +++ b/src/assets/icons/crossmodal.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/icons/downarrow.svg b/src/assets/icons/downarrow.svg new file mode 100644 index 0000000..1032656 --- /dev/null +++ b/src/assets/icons/downarrow.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/image/60x60.png b/src/assets/image/60x60.png new file mode 100644 index 0000000..9de41af Binary files /dev/null and b/src/assets/image/60x60.png differ diff --git a/src/assets/image/PerformicsLogo.png b/src/assets/image/PerformicsLogo.png new file mode 100644 index 0000000..1d072e2 Binary files /dev/null and b/src/assets/image/PerformicsLogo.png differ diff --git a/src/assets/image/ThaiNamthip.Thai_1024x1024.png b/src/assets/image/ThaiNamthip.Thai_1024x1024.png new file mode 100644 index 0000000..2e766ba Binary files /dev/null and b/src/assets/image/ThaiNamthip.Thai_1024x1024.png differ diff --git a/src/assets/image/astrickcamera.svg b/src/assets/image/astrickcamera.svg new file mode 100644 index 0000000..76c8c8c --- /dev/null +++ b/src/assets/image/astrickcamera.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/assets/image/camera_asterisk.png b/src/assets/image/camera_asterisk.png new file mode 100644 index 0000000..bd5c39a Binary files /dev/null and b/src/assets/image/camera_asterisk.png differ diff --git a/src/assets/image/greybg.jpg b/src/assets/image/greybg.jpg new file mode 100644 index 0000000..418a8ea Binary files /dev/null and b/src/assets/image/greybg.jpg differ diff --git a/src/assets/image/loader.gif b/src/assets/image/loader.gif new file mode 100644 index 0000000..d2decc9 Binary files /dev/null and b/src/assets/image/loader.gif differ diff --git a/src/assets/image/logo.png b/src/assets/image/logo.png new file mode 100644 index 0000000..11a738a Binary files /dev/null and b/src/assets/image/logo.png differ diff --git a/src/assets/image/olay_logo.png b/src/assets/image/olay_logo.png new file mode 100644 index 0000000..18e7128 Binary files /dev/null and b/src/assets/image/olay_logo.png differ diff --git a/src/assets/image/parinaam_tag_line.png b/src/assets/image/parinaam_tag_line.png new file mode 100644 index 0000000..1d072e2 Binary files /dev/null and b/src/assets/image/parinaam_tag_line.png differ diff --git a/src/assets/performics/Covered.svg b/src/assets/performics/Covered.svg new file mode 100644 index 0000000..6c6ef6d --- /dev/null +++ b/src/assets/performics/Covered.svg @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/Planned.svg b/src/assets/performics/Planned.svg new file mode 100644 index 0000000..430c66f --- /dev/null +++ b/src/assets/performics/Planned.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/add_image.svg b/src/assets/performics/add_image.svg new file mode 100644 index 0000000..4f2efbc --- /dev/null +++ b/src/assets/performics/add_image.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/assets/performics/apply_for_leave.svg b/src/assets/performics/apply_for_leave.svg new file mode 100644 index 0000000..d92587d --- /dev/null +++ b/src/assets/performics/apply_for_leave.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/arrow_danger_icon.svg b/src/assets/performics/arrow_danger_icon.svg new file mode 100644 index 0000000..47728bd --- /dev/null +++ b/src/assets/performics/arrow_danger_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/assets/performics/arrow_success_icon.svg b/src/assets/performics/arrow_success_icon.svg new file mode 100644 index 0000000..d913034 --- /dev/null +++ b/src/assets/performics/arrow_success_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/assets/performics/arrow_warning_icon.svg b/src/assets/performics/arrow_warning_icon.svg new file mode 100644 index 0000000..2684a5b --- /dev/null +++ b/src/assets/performics/arrow_warning_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/assets/performics/calendar_icon.svg b/src/assets/performics/calendar_icon.svg new file mode 100644 index 0000000..0664c0c --- /dev/null +++ b/src/assets/performics/calendar_icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/assets/performics/call_outline.svg b/src/assets/performics/call_outline.svg new file mode 100644 index 0000000..240697a --- /dev/null +++ b/src/assets/performics/call_outline.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/performics/camera_front_image.svg b/src/assets/performics/camera_front_image.svg new file mode 100644 index 0000000..6f76278 --- /dev/null +++ b/src/assets/performics/camera_front_image.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/assets/performics/camera_icon.svg b/src/assets/performics/camera_icon.svg new file mode 100644 index 0000000..8973625 --- /dev/null +++ b/src/assets/performics/camera_icon.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/assets/performics/camera_tick.svg b/src/assets/performics/camera_tick.svg new file mode 100644 index 0000000..c532e18 --- /dev/null +++ b/src/assets/performics/camera_tick.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/assets/performics/camera_white_icon.svg b/src/assets/performics/camera_white_icon.svg new file mode 100644 index 0000000..d03e25d --- /dev/null +++ b/src/assets/performics/camera_white_icon.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/assets/performics/circle_cream.svg b/src/assets/performics/circle_cream.svg new file mode 100644 index 0000000..0c6f141 --- /dev/null +++ b/src/assets/performics/circle_cream.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/assets/performics/circle_green.svg b/src/assets/performics/circle_green.svg new file mode 100644 index 0000000..d519224 --- /dev/null +++ b/src/assets/performics/circle_green.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/assets/performics/circle_grey.svg b/src/assets/performics/circle_grey.svg new file mode 100644 index 0000000..3ec9c9c --- /dev/null +++ b/src/assets/performics/circle_grey.svg @@ -0,0 +1,87 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/src/assets/performics/circle_red.svg b/src/assets/performics/circle_red.svg new file mode 100644 index 0000000..0e7cce8 --- /dev/null +++ b/src/assets/performics/circle_red.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/assets/performics/client_logo.svg b/src/assets/performics/client_logo.svg new file mode 100644 index 0000000..8e94917 --- /dev/null +++ b/src/assets/performics/client_logo.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/clock_icon.svg b/src/assets/performics/clock_icon.svg new file mode 100644 index 0000000..de54d47 --- /dev/null +++ b/src/assets/performics/clock_icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/assets/performics/close_shot.svg b/src/assets/performics/close_shot.svg new file mode 100644 index 0000000..0c35a4b --- /dev/null +++ b/src/assets/performics/close_shot.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + Close Shot + + diff --git a/src/assets/performics/daily_route_plan.svg b/src/assets/performics/daily_route_plan.svg new file mode 100644 index 0000000..b30a86c --- /dev/null +++ b/src/assets/performics/daily_route_plan.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/delete_icon.svg b/src/assets/performics/delete_icon.svg new file mode 100644 index 0000000..d9aad87 --- /dev/null +++ b/src/assets/performics/delete_icon.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/assets/performics/delete_icon_red.svg b/src/assets/performics/delete_icon_red.svg new file mode 100644 index 0000000..89fdf16 --- /dev/null +++ b/src/assets/performics/delete_icon_red.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/assets/performics/download_data.svg b/src/assets/performics/download_data.svg new file mode 100644 index 0000000..3ad3ab4 --- /dev/null +++ b/src/assets/performics/download_data.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/assets/performics/exit_icon.svg b/src/assets/performics/exit_icon.svg new file mode 100644 index 0000000..5f7a7e5 --- /dev/null +++ b/src/assets/performics/exit_icon.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + diff --git a/src/assets/performics/image.svg b/src/assets/performics/image.svg new file mode 100644 index 0000000..0299513 --- /dev/null +++ b/src/assets/performics/image.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/assets/performics/kwaza.png b/src/assets/performics/kwaza.png new file mode 100644 index 0000000..2288b1b Binary files /dev/null and b/src/assets/performics/kwaza.png differ diff --git a/src/assets/performics/leave_status.svg b/src/assets/performics/leave_status.svg new file mode 100644 index 0000000..72fcfe3 --- /dev/null +++ b/src/assets/performics/leave_status.svg @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/like.svg b/src/assets/performics/like.svg new file mode 100644 index 0000000..b12631b --- /dev/null +++ b/src/assets/performics/like.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/assets/performics/lock_outline.svg b/src/assets/performics/lock_outline.svg new file mode 100644 index 0000000..2f99a0b --- /dev/null +++ b/src/assets/performics/lock_outline.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/performics/login.svg b/src/assets/performics/login.svg new file mode 100644 index 0000000..af1ccaf --- /dev/null +++ b/src/assets/performics/login.svg @@ -0,0 +1,358 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LOGIN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Login + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/long_shot.svg b/src/assets/performics/long_shot.svg new file mode 100644 index 0000000..033ef87 --- /dev/null +++ b/src/assets/performics/long_shot.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + Long Shot + + diff --git a/src/assets/performics/main_menu_icons/POSM_tracking_icon.svg b/src/assets/performics/main_menu_icons/POSM_tracking_icon.svg new file mode 100644 index 0000000..15577ee --- /dev/null +++ b/src/assets/performics/main_menu_icons/POSM_tracking_icon.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/main_menu_icons/addFree_visibility_icon.svg b/src/assets/performics/main_menu_icons/addFree_visibility_icon.svg new file mode 100644 index 0000000..db87f4e --- /dev/null +++ b/src/assets/performics/main_menu_icons/addFree_visibility_icon.svg @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/main_menu_icons/backroom_stock_icon.svg b/src/assets/performics/main_menu_icons/backroom_stock_icon.svg new file mode 100644 index 0000000..d1e068b --- /dev/null +++ b/src/assets/performics/main_menu_icons/backroom_stock_icon.svg @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/main_menu_icons/brand_sampling_icon.svg b/src/assets/performics/main_menu_icons/brand_sampling_icon.svg new file mode 100644 index 0000000..fc1854e --- /dev/null +++ b/src/assets/performics/main_menu_icons/brand_sampling_icon.svg @@ -0,0 +1,970 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/main_menu_icons/competition_promotion_icon.svg b/src/assets/performics/main_menu_icons/competition_promotion_icon.svg new file mode 100644 index 0000000..53fb4ad --- /dev/null +++ b/src/assets/performics/main_menu_icons/competition_promotion_icon.svg @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/main_menu_icons/competition_sampling_icon.svg b/src/assets/performics/main_menu_icons/competition_sampling_icon.svg new file mode 100644 index 0000000..98df840 --- /dev/null +++ b/src/assets/performics/main_menu_icons/competition_sampling_icon.svg @@ -0,0 +1,970 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/main_menu_icons/competition_visibility_icon.svg b/src/assets/performics/main_menu_icons/competition_visibility_icon.svg new file mode 100644 index 0000000..17c4f50 --- /dev/null +++ b/src/assets/performics/main_menu_icons/competition_visibility_icon.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/main_menu_icons/contact_conversion_icon.svg b/src/assets/performics/main_menu_icons/contact_conversion_icon.svg new file mode 100644 index 0000000..bc6871c --- /dev/null +++ b/src/assets/performics/main_menu_icons/contact_conversion_icon.svg @@ -0,0 +1,997 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/main_menu_icons/other_visibility_icon.svg b/src/assets/performics/main_menu_icons/other_visibility_icon.svg new file mode 100644 index 0000000..c80b94b --- /dev/null +++ b/src/assets/performics/main_menu_icons/other_visibility_icon.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/main_menu_icons/paid_visibility_icon.svg b/src/assets/performics/main_menu_icons/paid_visibility_icon.svg new file mode 100644 index 0000000..e9a24e7 --- /dev/null +++ b/src/assets/performics/main_menu_icons/paid_visibility_icon.svg @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/main_menu_icons/program_icon.svg b/src/assets/performics/main_menu_icons/program_icon.svg new file mode 100644 index 0000000..eb9e518 --- /dev/null +++ b/src/assets/performics/main_menu_icons/program_icon.svg @@ -0,0 +1,1090 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/main_menu_icons/promotion_icon.svg b/src/assets/performics/main_menu_icons/promotion_icon.svg new file mode 100644 index 0000000..419c959 --- /dev/null +++ b/src/assets/performics/main_menu_icons/promotion_icon.svg @@ -0,0 +1,750 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/main_menu_icons/sale_icon.svg b/src/assets/performics/main_menu_icons/sale_icon.svg new file mode 100644 index 0000000..0dde6f0 --- /dev/null +++ b/src/assets/performics/main_menu_icons/sale_icon.svg @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/main_menu_icons/share_of_shelf_icon.svg b/src/assets/performics/main_menu_icons/share_of_shelf_icon.svg new file mode 100644 index 0000000..2d2ac1f --- /dev/null +++ b/src/assets/performics/main_menu_icons/share_of_shelf_icon.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/main_menu_icons/stock_icon.svg b/src/assets/performics/main_menu_icons/stock_icon.svg new file mode 100644 index 0000000..2110f34 --- /dev/null +++ b/src/assets/performics/main_menu_icons/stock_icon.svg @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/main_menu_icons/window_icon.svg b/src/assets/performics/main_menu_icons/window_icon.svg new file mode 100644 index 0000000..160b035 --- /dev/null +++ b/src/assets/performics/main_menu_icons/window_icon.svg @@ -0,0 +1,627 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/map_icon.svg b/src/assets/performics/map_icon.svg new file mode 100644 index 0000000..81e1766 --- /dev/null +++ b/src/assets/performics/map_icon.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/merchandised.svg b/src/assets/performics/merchandised.svg new file mode 100644 index 0000000..8bc8b66 --- /dev/null +++ b/src/assets/performics/merchandised.svg @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/message_icon.svg b/src/assets/performics/message_icon.svg new file mode 100644 index 0000000..2a3d688 --- /dev/null +++ b/src/assets/performics/message_icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/assets/performics/message_outline.svg b/src/assets/performics/message_outline.svg new file mode 100644 index 0000000..578dfe7 --- /dev/null +++ b/src/assets/performics/message_outline.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/assets/performics/mpin.svg b/src/assets/performics/mpin.svg new file mode 100644 index 0000000..5eca1e7 --- /dev/null +++ b/src/assets/performics/mpin.svg @@ -0,0 +1,374 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MPIN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Next + + + + + + + Confirm Your Pin + + Your Pin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/next_icon.svg b/src/assets/performics/next_icon.svg new file mode 100644 index 0000000..8a42b09 --- /dev/null +++ b/src/assets/performics/next_icon.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/assets/performics/notification_icon.svg b/src/assets/performics/notification_icon.svg new file mode 100644 index 0000000..cd9db3b --- /dev/null +++ b/src/assets/performics/notification_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/assets/performics/oqad_graphic.svg b/src/assets/performics/oqad_graphic.svg new file mode 100644 index 0000000..22236db --- /dev/null +++ b/src/assets/performics/oqad_graphic.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/assets/performics/otp.svg b/src/assets/performics/otp.svg new file mode 100644 index 0000000..2f9300c --- /dev/null +++ b/src/assets/performics/otp.svg @@ -0,0 +1,1397 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OTP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Next + + + + OTP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/password.svg b/src/assets/performics/password.svg new file mode 100644 index 0000000..1bac421 --- /dev/null +++ b/src/assets/performics/password.svg @@ -0,0 +1,355 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PASSWORD + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Next + + + + User id + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/pasword_icon.svg b/src/assets/performics/pasword_icon.svg new file mode 100644 index 0000000..07fd623 --- /dev/null +++ b/src/assets/performics/pasword_icon.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/performics/performic_logo.png b/src/assets/performics/performic_logo.png new file mode 100644 index 0000000..9245be9 Binary files /dev/null and b/src/assets/performics/performic_logo.png differ diff --git a/src/assets/performics/performic_logo.svg b/src/assets/performics/performic_logo.svg new file mode 100644 index 0000000..76fc328 --- /dev/null +++ b/src/assets/performics/performic_logo.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/product_id.svg b/src/assets/performics/product_id.svg new file mode 100644 index 0000000..70a42a4 --- /dev/null +++ b/src/assets/performics/product_id.svg @@ -0,0 +1,1395 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PROJECT ID + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Next + + + + Project Id + + + + + + + + + diff --git a/src/assets/performics/profile_default.svg b/src/assets/performics/profile_default.svg new file mode 100644 index 0000000..6e54875 --- /dev/null +++ b/src/assets/performics/profile_default.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/assets/performics/reason_icon.svg b/src/assets/performics/reason_icon.svg new file mode 100644 index 0000000..3c02161 --- /dev/null +++ b/src/assets/performics/reason_icon.svg @@ -0,0 +1,6 @@ + + + + ! + + diff --git a/src/assets/performics/reports_icon.svg b/src/assets/performics/reports_icon.svg new file mode 100644 index 0000000..7023903 --- /dev/null +++ b/src/assets/performics/reports_icon.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + diff --git a/src/assets/performics/share.svg b/src/assets/performics/share.svg new file mode 100644 index 0000000..537b453 --- /dev/null +++ b/src/assets/performics/share.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/assets/performics/sidemenu_icons/adhoc_route_plan_icon.svg b/src/assets/performics/sidemenu_icons/adhoc_route_plan_icon.svg new file mode 100644 index 0000000..c2e5054 --- /dev/null +++ b/src/assets/performics/sidemenu_icons/adhoc_route_plan_icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/assets/performics/sidemenu_icons/automated_reimbursement.svg b/src/assets/performics/sidemenu_icons/automated_reimbursement.svg new file mode 100644 index 0000000..b0a0b91 --- /dev/null +++ b/src/assets/performics/sidemenu_icons/automated_reimbursement.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/assets/performics/sidemenu_icons/break_management_icon.svg b/src/assets/performics/sidemenu_icons/break_management_icon.svg new file mode 100644 index 0000000..3742c30 --- /dev/null +++ b/src/assets/performics/sidemenu_icons/break_management_icon.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/sidemenu_icons/consumer_section_icon.svg b/src/assets/performics/sidemenu_icons/consumer_section_icon.svg new file mode 100644 index 0000000..d8cb900 --- /dev/null +++ b/src/assets/performics/sidemenu_icons/consumer_section_icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/assets/performics/sidemenu_icons/daily_route_plan_icon.svg b/src/assets/performics/sidemenu_icons/daily_route_plan_icon.svg new file mode 100644 index 0000000..5a159aa --- /dev/null +++ b/src/assets/performics/sidemenu_icons/daily_route_plan_icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/assets/performics/sidemenu_icons/download_data_icon.svg b/src/assets/performics/sidemenu_icons/download_data_icon.svg new file mode 100644 index 0000000..ff80a65 --- /dev/null +++ b/src/assets/performics/sidemenu_icons/download_data_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/assets/performics/sidemenu_icons/exit_icon.svg b/src/assets/performics/sidemenu_icons/exit_icon.svg new file mode 100644 index 0000000..14fe215 --- /dev/null +++ b/src/assets/performics/sidemenu_icons/exit_icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/assets/performics/sidemenu_icons/language_selection_icon.svg b/src/assets/performics/sidemenu_icons/language_selection_icon.svg new file mode 100644 index 0000000..e41678d --- /dev/null +++ b/src/assets/performics/sidemenu_icons/language_selection_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/performics/sidemenu_icons/leave_management_icon.svg b/src/assets/performics/sidemenu_icons/leave_management_icon.svg new file mode 100644 index 0000000..a3b3622 --- /dev/null +++ b/src/assets/performics/sidemenu_icons/leave_management_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/assets/performics/sidemenu_icons/non_merchandised_icon.svg b/src/assets/performics/sidemenu_icons/non_merchandised_icon.svg new file mode 100644 index 0000000..043e76b --- /dev/null +++ b/src/assets/performics/sidemenu_icons/non_merchandised_icon.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/assets/performics/sidemenu_icons/personal_document_icon.svg b/src/assets/performics/sidemenu_icons/personal_document_icon.svg new file mode 100644 index 0000000..9364b83 --- /dev/null +++ b/src/assets/performics/sidemenu_icons/personal_document_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/performics/sidemenu_icons/reports_icon.svg b/src/assets/performics/sidemenu_icons/reports_icon.svg new file mode 100644 index 0000000..6086ce1 --- /dev/null +++ b/src/assets/performics/sidemenu_icons/reports_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/performics/sidemenu_icons/resume-svgrepo-com.svg b/src/assets/performics/sidemenu_icons/resume-svgrepo-com.svg new file mode 100644 index 0000000..80b91c5 --- /dev/null +++ b/src/assets/performics/sidemenu_icons/resume-svgrepo-com.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/sidemenu_icons/resume.svg b/src/assets/performics/sidemenu_icons/resume.svg new file mode 100644 index 0000000..80b91c5 --- /dev/null +++ b/src/assets/performics/sidemenu_icons/resume.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/sidemenu_icons/services_icon.svg b/src/assets/performics/sidemenu_icons/services_icon.svg new file mode 100644 index 0000000..cd667c7 --- /dev/null +++ b/src/assets/performics/sidemenu_icons/services_icon.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/assets/performics/sidemenu_icons/training_section_icon.svg b/src/assets/performics/sidemenu_icons/training_section_icon.svg new file mode 100644 index 0000000..2ef11fd --- /dev/null +++ b/src/assets/performics/sidemenu_icons/training_section_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/assets/performics/sidemenu_icons/upload_data_icon.svg b/src/assets/performics/sidemenu_icons/upload_data_icon.svg new file mode 100644 index 0000000..b738d9c --- /dev/null +++ b/src/assets/performics/sidemenu_icons/upload_data_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/assets/performics/sidemenu_icons/user_profile_icon.svg b/src/assets/performics/sidemenu_icons/user_profile_icon.svg new file mode 100644 index 0000000..923c9ac --- /dev/null +++ b/src/assets/performics/sidemenu_icons/user_profile_icon.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/assets/performics/sidemenu_icons/visitor_login_icon.svg b/src/assets/performics/sidemenu_icons/visitor_login_icon.svg new file mode 100644 index 0000000..4655bb5 --- /dev/null +++ b/src/assets/performics/sidemenu_icons/visitor_login_icon.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/assets/performics/store.svg b/src/assets/performics/store.svg new file mode 100644 index 0000000..2b9145c --- /dev/null +++ b/src/assets/performics/store.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/store_covered.svg b/src/assets/performics/store_covered.svg new file mode 100644 index 0000000..ad29602 --- /dev/null +++ b/src/assets/performics/store_covered.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/store_merch.svg b/src/assets/performics/store_merch.svg new file mode 100644 index 0000000..d9f117f --- /dev/null +++ b/src/assets/performics/store_merch.svg @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/performics/time_icon.svg b/src/assets/performics/time_icon.svg new file mode 100644 index 0000000..88e49de --- /dev/null +++ b/src/assets/performics/time_icon.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/assets/performics/training.svg b/src/assets/performics/training.svg new file mode 100644 index 0000000..78bc0bb --- /dev/null +++ b/src/assets/performics/training.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/assets/performics/upload_data.svg b/src/assets/performics/upload_data.svg new file mode 100644 index 0000000..d0003b0 --- /dev/null +++ b/src/assets/performics/upload_data.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/assets/performics/uploaded_icon.svg b/src/assets/performics/uploaded_icon.svg new file mode 100644 index 0000000..b277114 --- /dev/null +++ b/src/assets/performics/uploaded_icon.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/assets/performics/user_icon.svg b/src/assets/performics/user_icon.svg new file mode 100644 index 0000000..7077d5f --- /dev/null +++ b/src/assets/performics/user_icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/assets/performics/user_outline.svg b/src/assets/performics/user_outline.svg new file mode 100644 index 0000000..3b99e88 --- /dev/null +++ b/src/assets/performics/user_outline.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/assets/performics/users-strike.png b/src/assets/performics/users-strike.png new file mode 100644 index 0000000..d92afc5 Binary files /dev/null and b/src/assets/performics/users-strike.png differ diff --git a/src/assets/performics/visitor_login_icon.svg b/src/assets/performics/visitor_login_icon.svg new file mode 100644 index 0000000..39ffe32 --- /dev/null +++ b/src/assets/performics/visitor_login_icon.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + diff --git a/src/components/Camera.js b/src/components/Camera.js new file mode 100644 index 0000000..c3aa213 --- /dev/null +++ b/src/components/Camera.js @@ -0,0 +1,782 @@ +import React, { useRef, useCallback, useState, useEffect, useMemo } from "react"; +import { Dimensions, Image, Platform, StatusBar, Text, TouchableOpacity, View,Animated, Alert } from "react-native"; +import Reanimated, { Extrapolate, interpolate, useAnimatedProps, useSharedValue } from 'react-native-reanimated'; + +import { StyleSheet} from "react-native"; +import { customCamera, customStyles, deffontfamily, GetPageTheme, WP } from "../styles/Global"; +import { useRoute } from '@react-navigation/native'; +import { notify } from "./notify"; +import { hasCameraPermission } from "./geolocation"; +import { Entypo, MaterialCommunityIcons, MaterialIcons } from "./icons"; +import { connect } from 'react-redux'; +import { mapStateToProps, mapDispatchToProps } from '../reducers/contextProvider'; +import { launchImageLibrary } from 'react-native-image-picker'; +import Orientation from 'react-native-orientation-locker'; +import { PORTRAIT } from "react-native-orientation-locker"; +import moment from "dayjs"; +import * as RNFS from 'react-native-fs'; +import ViewShot from "react-native-view-shot"; +import CustomModal from "./CustomModal"; +// import QRCodeScanner from "react-native-qrcode-scanner"; +import { PERMISSIONS, request, check, RESULTS } from 'react-native-permissions'; +import { Gesture, GestureDetector } from 'react-native-gesture-handler'; + + +const VC_OR={ + "landscapeLeft":"landscapeLeft", + "landscapeRight":"landscapeRight", + "portraitUpsideDown":"portraitUpsideDown", + "portrait":"portrait", +} + + +import { + Camera, + useCameraDevice, + useCameraDevices, + useFrameProcessor + } from 'react-native-vision-camera' + import { + useFaceDetector + } from 'react-native-vision-camera-face-detector' + + import { Worklets } from 'react-native-worklets-core' + + const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get('window') + + + +function CustomCamera(props) { + const route = useRoute(); + const PageTheme = GetPageTheme(props.DarkTheme, route.name); + const cameraStyle = customCamera(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + + const camera = useRef(null) + + // const camera = useRef(null) + const viewShort = useRef(); + const viewShotRef = useRef(); + const svgRef = useRef(); + const faceDetecRef = useRef(false); + const faceDetecDataRef = useRef([]); + + const devices = useCameraDevices(); + const supportsCameraFlipping = useMemo(() => devices.back != null && devices.front != null, [devices.back, devices.front]); + const dim = Dimensions.get("window"); + const format = device?.formats.find(f => f.supportedColorSpaces?.length > 0) || device?.formats[0]; + console.log("Available Formats:", device?.formats.map(f => ({ + width: f.photoWidth, + height: f.photoHeight, + colorSpaces: f.supportedColorSpaces + }))); + const [barcode, setBarcode] = React.useState({}); + const [isScanned, setIsScanned] = React.useState(false); + const [qrCodeEnable, setQRCodeEnable] = useState(false); + const orAnim=useRef(new Animated.Value(0)).current; + const [showImage, setshowImage] = useState(false); + const [imgurl, setimgurl] = useState(''); + const [temp_imgurl, setTemp_imgurl] = useState(''); + const [BottomText, setBottomText] = useState(props.BottomText || ''); + const [BottomSubText, setBottomSubText] = useState(''); + const [BottomSubText2, setBottomSubText2] = useState(''); + const [TopText, setTopText] = useState(''); + const [photoObj, setPhotoObj] = useState({}); + const [isActive, setisActive] = useState(false); + const [isPhotoTaken, setIsPhotoTaken] = useState(false); + const [isCameraActive, setIsCameraActive] = useState(false); + const [activeFlashMode, setActiveFlashMode] = useState('off'); + + const [orientation, setOrientation] = useState(PORTRAIT.toLowerCase()); + const [islandscape, setIslandscape] = useState(false); + const [showCameraForScreen, setShowCameraForScreen] = useState(true); + const [gridEnable, setGridEnable] = useState(false); + const [showCapLandsImgAlert, setShowCapLandsImgAlert] = useState(false); + const [count, setCount] = useState(0); + const [ImageExtraSPace, setImageExtraSPace] = useState(1.06); + const [ImgLoading, setImgLoading] = useState(false); + const layoutProcessedCount=useRef(0); + const [cameraPosition, setCameraPosition] = useState((props.cameraType == 'front'?'front':'back')); + const [detectedFaces, setDetectedFaces] = useState([]) + const [faceData, setFaceData] = useState([]); + + + const device = useCameraDevice(cameraPosition) + + const lastBlinkTime = useRef(0); + const blinkCount = useRef(0); + + + const faceDetectionOptions = useRef({ + // landmarkMode: 'none', + landmarkMode: 'all', + performanceMode: 'fast', + // classificationMode: 'none', + classificationMode: 'all', + minFaceSize: 0.1, + mode: 'fast' + }).current + + + const { detectFaces } = useFaceDetector( faceDetectionOptions ) + + useEffect(() => { + (async () => { + const status = await Camera.requestCameraPermission() + await Camera.configure({ + ...(Platform.OS === "ios" ? { colorSpace: undefined } : {}), // Remove colorSpace on iOS + }); + })() + }, [device]) + + const handleDetectedFaces = Worklets.createRunOnJS((faces) => { + faceDetecRef.current = faces?.length > 0 + faceDetecDataRef.current=[...faces] + setDetectedFaces(faces) + }) + + + const handleBlinkDetected = Worklets.createRunOnJS(() => { + console.log("Blink detected! Count:", blinkCount.current); + + const now = Date.now(); + // Simple debounce - only consider blinks > 300ms apart + if (now - lastBlinkTime.current > 300) { + lastBlinkTime.current = now; + blinkCount.current += 1; + + // Take photo after 2 blinks (adjust as needed) + if (blinkCount.current >= 2) { + blinkCount.current = 0; + takePhoto(); + } + } + }); + + const frameProcessor = useFrameProcessor((frame) => { + 'worklet' + // Detect faces in the frame (this is synchronous) + const faces = detectFaces(frame) + // Send the detected faces to the JS thread + handleDetectedFaces(faces) + if (faces.length > 0) { + const face = faces[0]; + if (face.leftEyeOpenProbability < 0.3 && face.rightEyeOpenProbability < 0.3) { + // Simple debounce - only consider blinks > 300ms apart + handleBlinkDetected() + } + } + }, [handleDetectedFaces]) + + + const ReanimatedCamera = Reanimated.createAnimatedComponent(Camera) + Reanimated.addWhitelistedNativeProps({ + zoom: true, + }) + const zoom = useSharedValue(0) + // zoom.value=0 + // const minZoom = device?.minZoom ?? 1; + const minZoom = device?.minZoom ?? 1; + const maxZoom = Math.min(device?.maxZoom ?? 1, 20); + + const onZoomPress = useCallback(() => { + // setCount(count+1) + zoom.value = withSpring(count) + }, [count]) + + + const SCALE_FULL_ZOOM = 3; + const BUTTON_SIZE = 40; + + + const pinchGesture = Gesture.Pinch() + .onStart(() => { + pinchGesture.startZoom = zoom.value; + }) + .onUpdate((event) => { + const startZoom = pinchGesture.startZoom ?? 0; + const scale = interpolate( + event.scale, + [1 - 1 / SCALE_FULL_ZOOM, 1, SCALE_FULL_ZOOM], + [-1, 0, 1], + Extrapolate.CLAMP + ); + zoom.value = interpolate( + scale, + [-1, 0, 1], + [minZoom, startZoom, maxZoom], + Extrapolate.CLAMP + ); + }); + + + const animatedProps = useAnimatedProps( + () => ({ zoom: zoom.value }), + [zoom] + ) + +const requestCameraPermission = async () => { + const result = await request(PERMISSIONS.IOS.CAMERA); + + if (result === RESULTS.GRANTED) { + console.log('Camera permission granted'); + } else { + Alert.alert( + 'Permission Required', + 'Camera permission is required to use this feature. Please enable it in Settings.', + [{ text: 'OK' }] + ); + } +}; + +const checkCameraPermission = async () => { + const result = await check(PERMISSIONS.IOS.CAMERA); + + if (result === RESULTS.GRANTED) { + console.log('Camera permission already granted'); + } else { + await requestCameraPermission(); + } +}; + + useEffect(() => { + if(Platform.OS =="ios") checkCameraPermission(); + }, []); + + useEffect(() => { + let showGrid = props.gridEnable != null ? (props.gridEnable) : false; + setGridEnable(showGrid); + },[props.gridEnable]) + + useEffect(() => { + let showQRCam = props.QRCodeEnable != null ? (props.QRCodeEnable) : false; + setQRCodeEnable(showQRCam); + },[props.QRCodeEnable]) + + useEffect(() => { + + console.log('CameraGallery in camera :', props.CameraGallery, 'for screen:', props.enableGallerForScreen); + let showScreenCam = props.enableGallerForScreen != null ? (props.enableGallerForScreen) : true; + + + setShowCameraForScreen(showScreenCam); + hasCameraPermission(); + + Orientation.addDeviceOrientationListener((orientation) => { + let or=orientation.toLowerCase(); + if(or=='unknown') or='portrait'; + + let isLS=(or == 'landscape-left' || or == 'landscape-right' || or == 'landscape'); + let or_VC= or=='landscape-left'?VC_OR.landscapeRight:(or=='landscape-right'?VC_OR.landscapeLeft:(or=='portrait-upside-down'?VC_OR.portraitUpsideDown:VC_OR.portrait)); + setOrientation(or_VC); + setIslandscape(isLS); + Animated.timing(orAnim, { + toValue: isLS?1:0, + duration:400, + useNativeDriver:false, + }).start(); + + console.log("onchange:",orientation,or_VC); + }); + + return () => { + Orientation.removeOrientationListener((orientation) => { console.log("or listener removed") }); + Orientation.removeAllListeners(); + } + + }, []); + + useEffect(() => { + console.log('showCamera changed:', props.showCamera); + if (props.showCamera == true) { + showCamera(); + } + else { + hideCamera(); + } + }, [props.showCamera]); + + function showCamera() { + console.log('showCamera customcamera'); + if(props.cameraType != 'front' ){ + setShowCapLandsImgAlert(true); + setTimeout(() => { + setShowCapLandsImgAlert(false); + }, 1000); + } + setIsCameraActive(true); + setisActive(true); + } + + async function hideCamera(type='') { + setIsCameraActive(false); + setisActive(false); + setimgurl(''); + setIsPhotoTaken(false); + setshowImage(true); + if(props.isCameraScreen!=null && props.isCameraScreen==true){ + // Don't call onHideCamera if it is a camera screen + if(type=='cancel'){ + props.onHideCamera(); + } + } + else{ + if (props.onHideCamera != null && typeof props.onHideCamera === 'function') { + props.onHideCamera(); + } + } + } + + function closeCamera() { + setIsCameraActive(false); + } + + + const onFlipCameraPressed = useCallback(() => { + setCameraPosition((p) => (p === 'back' ? 'front' : 'back')); + }, []); + + + async function takePhoto() { + if (camera?.current != null && typeof camera?.current === 'object') { + + const photo = await camera?.current?.takePhoto({ + flash: activeFlashMode, + // qualityPrioritization: 'speed' + }) + + + console.log("taken photo params:",photo) + if (photo != null) { + let path = photo?.path?.includes('file://') ? photo.path :'file://' + photo.path; + let picture_clicked_time=moment().format('DD-MM-YYYY HH:mm:ss'); + let ExtraSpace=1.1; + + + if(photo.width>photo.height){ + // landscape image + ExtraSpace=1.2 + } + console.log("takephhoto:w x h",photo.width,photo.height,photo); + + let obj = { uri: path,original_path: photo.path, width: parseInt(photo.width), height: parseInt(photo.height), ExtendedHeight: parseInt(photo.height*ExtraSpace),or_Mode:orientation }; + + setImageExtraSPace(ExtraSpace); + setPhotoObj(obj); + setTemp_imgurl(path) + + let bText=props.BottomText+" | Date: "+picture_clicked_time; + setBottomText(bText); + setTopText(picture_clicked_time); + setIsPhotoTaken(true); + setImgLoading(false); + } + else { + notify('Something went wrong! Cannot take picture.'); + setisActive(false); + setImgLoading(false); + } + } + else { + notify('Camera not found!.'); + setisActive(false); + setImgLoading(false); + } + + closeCamera(); + + } + + async function onRetake() { + await RNFS.unlink(temp_imgurl); + // setTemp_imgurl(''); + setIsPhotoTaken(false); + setshowImage(false); + setIsCameraActive(true); + setisActive(true); + // setTopText(''); + // setBottomText(''); + } + async function onCameraImgOk() { + zoom.value=0 + + let obj = photoObj; + + obj.viewShotRef=viewShotRef; + setPhotoObj(obj); + setisActive(false); + setIsPhotoTaken(false); + setshowImage(true); + + if (props.onImageCaptured != null && typeof props.onImageCaptured === 'function') { + props.onImageCaptured(obj); + } + hideCamera(); + } + + async function onQRScanned(qrData){ + console.log("qrData:",qrData.data); + setisActive(false); + if (props.onImageCaptured != null && typeof props.onImageCaptured === 'function') { + let QR_withValidChars=qrData.data!=null && qrData.data!=''?qrData.data.replace(/["']/g,''):''; + props.onImageCaptured(QR_withValidChars); + } + hideCamera(); + } + + function flashOnOff(type = '') { + console.log('setflashmode:', type); + if (type != '' && type != null) { + setActiveFlashMode(type); + if (type == 'on') { + + } + else if (type == 'off') { + + } + else if (type == 'auto') { + + } + } + } + + function pickGalleryImage(img) { + console.log('pickGalleryImage:', img, typeof img.assets); + if (img != null && img.assets != null && typeof img.assets === 'object' && img.assets.length > 0 && img.assets[0].uri != null) { + let photo = img.assets[0]; + let path = photo.uri; + console.log(path); + let times = photo.timestamp != null && photo.timestamp != '' ? photo.timestamp : new Date(); + let obj = { uri: path, width: photo.width, height: photo.height, 'fromGallery': true, 'datetime': times }; + setPhotoObj(obj); + setTemp_imgurl(path) + let picture_clicked_time=moment().format('DD-MM-YYYY HH:mm:ss'); + let bText=props.BottomText+" | "+picture_clicked_time; + + setTopText(picture_clicked_time); + setBottomText(bText); + setIsPhotoTaken(true); + } + else { + notify('Something went wrong! Cannot take picture.'); + setisActive(false); + } + } + + function getImageFromGallery() { + launchImageLibrary({ mediaType: 'photo', selectionLimit: 1, includeExtra: true, cameraType: 'front' }, pickGalleryImage) + } + + function _renderCaptureBtn() { + return ( + <> + { takePhoto(); }}> + + + + ) + } + + function _renderGalleryBtn() { + return ( + { getImageFromGallery() }}> + + + + + + + ) + } + + function _renderBottomControls() { + return ( + + {_renderCaptureBtn()} + {props.CameraGallery == true && showCameraForScreen == true && + _renderGalleryBtn() + } + + ) + } + function _renderOrientationIcon() { + let deg=0; + if(orAnim!=null ){ + deg=orAnim.interpolate({ + inputRange:[0,1], + outputRange:['0deg', '90deg'], + }); + } + } + + function _renderCancelBtn() { + return ( + { hideCamera('cancel') }}> + + + Cancel + + + ) + } + + function _renderRetakeBtn() { + return ( + { onRetake() }}> + + + + + Retake + + + ) + } + + + + function _renderSaveImgBtn() { + return ( + { onCameraImgOk() }}> + + + Ok + + + ) + } + + + + function _renderImageControls() { + return ( + + + {_renderCancelBtn()} + {_renderRetakeBtn()} + {_renderSaveImgBtn()} + + + ) + } + + function _renderFlashBtn(type = 'on') { + return ( + { flashOnOff(type) }}> + {type == 'on' && } + {type == 'off' && } + {type == 'auto' && } + + ) + } + + function _renderCameraSwapMode() { + return ( + { onFlipCameraPressed() }}> + {cameraPosition == 'front' && } + {cameraPosition == 'back' && } + + ) + } + + function _renderTopControls() { + return ( + + + {_renderFlashBtn('on')} + {_renderFlashBtn('off')} + + + ) + } + + function _renderSideControls() { + + let enableCameraFlip = props.enableCameraFlip != null ? (props.enableCameraFlip) : false; + return ( + + + {_renderFlashBtn('on')} + {_renderFlashBtn('off')} + {supportsCameraFlipping && enableCameraFlip==true && + _renderCameraSwapMode() + } + + + ) + } + const cameraAnimatedProps = useAnimatedProps(() => { + const z = Math.max(Math.min(zoom.value, maxZoom), minZoom); + return { + zoom: z, + }; + }, [maxZoom, minZoom, zoom]); + + + + const cameraView = () =>{ + return ( + <> + {/* */} + + ) + } + + function _render_AutoAlertModal(){ + return ( + + + + ) + } + + function _renderSCreenSHotView(){ + let is_photo_mode_LS=(photoObj.or_Mode==VC_OR.landscapeLeft || photoObj.or_Mode==VC_OR.landscapeRight) + let imgSIze=(photoObj.or_Mode!=null && photoObj.or_Mode!='' ?(is_photo_mode_LS?{width:'100%'}:{height:'100%'}):{}); + let vieshotStyle={}; + let itemW=photoObj.width,itemH=photoObj.height; + + let hR=(itemH/itemW )*100; + let screenWidth=WP('100%'); + let ht=screenWidth*(hR/100); + vieshotStyle ={width:'100%',height:ht}; + + return( + + {temp_imgurl!=null && temp_imgurl!='' && + + + } + {_renderImageControls()} + + ) + } + + const convertToScreenCoordinates = (bounds) => { + const xRatio = SCREEN_WIDTH / 1080; // Assuming 1080p image from the camera + const yRatio = SCREEN_HEIGHT / 1920; // Assuming 1920p image from the camera + return { + x: bounds.x * xRatio, + y: bounds.y * yRatio, + width: bounds.width * xRatio, + height: bounds.height * yRatio, + }; + }; + + let enableFacDet = route.params?.facDet != null ? (route.params?.facDet) : false; + + return ( + + {temp_imgurl!=null && temp_imgurl!='' && + + + + + {TopText!=null && TopText!='' && {TopText}} + {BottomText!=null && BottomText!='' && {BottomText}} + + + + } + {props.showCamera == true && isActive == true && + + + + ) + } + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {ConfirmSaveAlert(props,showRemoveConfirm_M,()=>{setshowRemoveConfirm_M(false)},Remove_AddVis,'Do you really want to remove this promotion?')} + {ConfirmSaveAlert(props,showRAllC_M,()=>{setShowRAllC_M(false)},onConfirmRemoveAll,'Do you really want to remove all promotion data?')} + {UpdateShowCamera_Ref(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{UpdateShowCamera_Ref(false);}}/> + + + + { Object.keys(storeData).length>0 && + + {_render_addVisFormTop()} + + } + + {onSubmitData()}}/> + + + + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(CompetitionPromotion); \ No newline at end of file diff --git a/src/screens/CompetitionVisibility.js b/src/screens/CompetitionVisibility.js new file mode 100644 index 0000000..7693d63 --- /dev/null +++ b/src/screens/CompetitionVisibility.js @@ -0,0 +1,750 @@ +import React, { useState, useEffect, useRef } from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles, customStyles, GetPageTheme } from "../styles/Global"; +import { StatusBar, Image, TextInput, View, Text, ScrollView, TouchableOpacity, Platform, PermissionsAndroid, FlatList, Alert, Animated } from 'react-native'; +import { ReactReduxContext, connect, useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps, mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import { notify } from '../components/notify'; +import moment from 'moment'; +import { getDownloadJson, marktext1, marktext2 } from '../controller/functions'; +import { get_item, set_item, clear_item } from '../components/localStorage'; +import { version, sloganline, appname, testurl, db, colors_Arr, common_ImagePath } from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import { Card, Menu, Switch } from 'react-native-paper'; +import { AntDesign, Entypo, FontAwesome, MaterialCommunityIcons } from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import { launchCamera, launchImageLibrary, CameraOptions } from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector' +import { CustomPicker } from '../components/CustomPicker'; +import CustomCamera from '../components/Camera'; + +function CompetitionVisibility(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const animatedChoice = useRef(new Animated.Value(0)).current; + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [brandData, setBrandData] = useState([]); + const [rerenderdata, setrerenderdata] = useState(0); + const [rerenderdata2, setrerenderdata2] = useState(0); + + const [AddVisibility, setAddVisibility] = useState([]); + const [AddVisFormData, setAddVisFormData] = useState({}); + const [isAddVisPresent, setIsAddVisPresent] = useState(0); + const [showAlert, setShowAlert] = useState(false); + const [Companies, setCompanies] = useState([]); + const [Categories, setCategories] = useState([]); + const [SubCategories, setSubCategories] = useState([]); + const [Brands, setBrands] = useState([]); + const [DisplayList, setDisplayList] = useState([]); + const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps, setGetImageProps] = useState({}); + const [toRemoveId, setToRemoveId] = useState(''); + const [toRemoveItem, setToRemoveItem] = useState({}); + const [showRemoveConfirm_M, setshowRemoveConfirm_M] = useState(false); + const [showRAllC_M, setShowRAllC_M] = useState(false); + const [EmpData, setEmpData] = useState([]); + + + const d1 = new Date(); + const d2 = moment(d1).format('MM/DD/YYYY'); + + + useEffect(() => { + let params = props.route.params ? props.route.params : {}; + let storeData1 = params.storeData || {}; + let menu1 = params.menu || {}; + let empData1 = params.empData || {}; + + let isAdhoc = params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setEmpData(empData1); + setCurrentMenu(menu1); + + getData(storeData1); + + const onremoveSubscription = props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + return onremoveSubscription; + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + const onremoveSubscription = props.navigation.addListener('beforeRemove', onBeforeRemove); + return onremoveSubscription; + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e) { + if (showCamera == true) { + e.preventDefault(); + setShowCamera(false); + } + else { + if (hasUnsavedChanges == true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else { + return; + } + } + } + + function onRemoveScreen(e) { + { setHasUnsavedChanges(false); props.navigation.dispatch(e.data.action); } + // Alert.alert( + // "", + // "Do you really want to exit the screen?", + // [ + // { + // text: "Cancel", + // onPress: () => {}, + // style: "cancel" + // }, + // { text: "OK", onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + // ] + // ); + } + + + async function getData(storeData1) { + try { + let { StoreId, ChainId, StateId, StoreTypeId, MerchandiserId } = storeData1; + + + db.transaction(async function (txn) { + + let q4 = `Select distinct CategoryId,CategoryName from Sup_Product_Master where IsCompetitor ='1'`; + await txn.executeSql(q4, [], async function (txn2, txnres2) { + if (txnres2.rows.length > 0) { + let arr = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + arr.push(data); + if (i == txnres2.rows.length - 1) { setCategories(arr); } + } + } + }, function (txn2, txnerr) { console.log(txnerr); },); + + let q2 = `Select Distinct DisplayId,DisplayName from Sup_Master_Display`; + await txn.executeSql(q2, [], async function (txn2, txnres2) { + if (txnres2.rows.length > 0) { + let arr = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + arr.push(data); + if (i == txnres2.rows.length - 1) { setDisplayList(arr); } + } + } + }, function (txn2, txnerr) { console.log(txnerr); },); + + + let q3 = `Select * from ${AppTables.COMPETITION_VISIBILITY} WHERE STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' and VISIT_DATE='${d2}' `; + await txn.executeSql(q3, [], async function (txn2, txnres2) { + if (txnres2.rows.length > 0) { + let arr = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + let { PRESENT, CATEGORY, CATEGORY_ID, SUB_CATEGORY, SUB_CATEGORY_ID, BRAND, BRAND_ID, DISPLAY, DISPLAY_ID, REMARK, IMAGE } = data; + let datan = { CategoryName: CATEGORY, CategoryId: CATEGORY_ID, SubCategoryName: SUB_CATEGORY, SubCategoryId: SUB_CATEGORY_ID, BrandName: BRAND, BrandId: BRAND_ID, DisplayName: DISPLAY, DisplayId: DISPLAY_ID, Remark: REMARK, Image1: IMAGE } + // datan.Image1Path=common_ImagePath+IMAGE; + datan.Image1Path = 'file://' + common_ImagePath + IMAGE; + PRESENT == 1 ? arr.push(datan) : ''; + let isPresent = PRESENT; + if (i == txnres2.rows.length - 1) { + Animated.timing(animatedChoice, { + toValue: isPresent, + duration: 400, + useNativeDriver: false, + }).start(); + setAddVisibility(arr); + setIsAddVisPresent(isPresent); + + } + } + } + }, function (txn2, txnerr) { console.log(txnerr); },); + + setProcessing(false); + + }); + } catch (err) { + console.log(err); + } + } + + + + async function getImage(imgdata) { + let type = getImageProps.type || ''; + if (typeof imgdata == 'object' && imgdata.errorCode == 'camera_unavailable') { + notify('Camera unavailable'); + } + else if (typeof imgdata == 'object' && imgdata.uri != null) { + const img = imgdata; + const imgurl = img.uri, imgWidth = img.width, imgHeight = img.height; + + + let picture_clicked_time = new Date(); + picture_clicked_time = moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1 = picture_clicked_time; + const mark_text2 = 'Store Name:' + storeData.StoreName + ' | Store Id:' + storeData.StoreId + ' | User Id:' + storeData.EmpId + ' | Image Type: Comp. Visibility' + ' | Date:' + picture_clicked_time; + + await marktext1(mark_text1, imgurl) + .then((res) => { + if (res.success) { + let uri = res.uri; + marktext2(mark_text2, uri, imgWidth, imgHeight) + .then((res) => { + if (res.success) { + let picture_clickedd = new Date(); + let picture_clicked_date = moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time = moment(picture_clickedd).format('HHmmss'); + let filename = storeData.StoreId + '_' + (props.UserId || '') + '_CompVisibilityImg-' + picture_clicked_date + '_' + picture_clicked_time + '.jpg'; + + + let addvisdata = AddVisFormData; + let image_key = 'Image1'; + let image_path_key = 'Image1Path'; + addvisdata[image_key] = filename; + + // renamefile + let imagePath = `${common_ImagePath}/${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri = 'file://' + imagePath; + console.log('image marker', uri); + addvisdata[image_path_key] = uri; + + setAddVisFormData(addvisdata); + setHasUnsavedChanges(true); + setrerenderdata2(!rerenderdata2); + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else { + if (res.imagenotfound) { + notify('Please capture a image'); + } + else { + notify(res.error); + } + } + }); + } + else { + if (res.imagenotfound) { + notify('Please capture a image'); + } + else { + notify(res.error); + } + } + }); + } + } + + async function openCamera(type = '1') { + setGetImageProps({ 'type': type }); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function onSubmitData() { + let isvalid = await validate(); + if (isvalid) { + setShowAlert(true); + } + } + + async function saveData() { + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + try { + let { StoreId, ChainId, StateId, StoreTypeId } = storeData; + await db.transaction(async function (txn) { + + let q = `DELETE FROM ${AppTables.COMPETITION_VISIBILITY} WHERE STORE_ID='${StoreId}' and EMP_ID='${storeData.MerchandiserId}' and VISIT_DATE='${d2}' `; + + // remove old data + await txn.executeSql(q, [], async function (txn2, txnres) { + console.log('cv data deleted'); + }, function (txn2, txnerr) { console.log(txnerr); },); + + var values = ''; + if (isAddVisPresent == 1 && AddVisibility.length > 0) { + for (var i = 0; i < AddVisibility.length; i++) { + let catIndex = i; + let item = AddVisibility[catIndex]; + let { CategoryName, CategoryId, SubCategoryName, SubCategoryId, BrandName, BrandId, DisplayName, DisplayId, Remark, Image1, Image1Path } = item; + values += values != '' ? ' , ' : ''; + values += ` ('${storeData.MerchandiserId}','${StoreId}','${d2}','${isAddVisPresent}','${CategoryName}','${CategoryId}','${SubCategoryName}','${SubCategoryId}','${BrandName}','${BrandId}','${DisplayName}','${DisplayId}','${Remark}','${Image1}','${d2}') `; + + } + } + else { + values += `('${storeData.MerchandiserId}','${StoreId}','${d2}','${isAddVisPresent}','','','','','','','','','','','${d2}')`; + } + + console.log('values:', values); + let add_data = `INSERT INTO ${AppTables.COMPETITION_VISIBILITY} (EMP_ID,STORE_ID,VISIT_DATE,PRESENT,CATEGORY,CATEGORY_ID,SUB_CATEGORY,SUB_CATEGORY_ID,BRAND,BRAND_ID,DISPLAY,DISPLAY_ID,REMARK,IMAGE,ADDED_DATE) VALUES ${values} `; + + await txn.executeSql(add_data, [], async function (txn2, txnres) { + console.log('av added'); + notify('Competition Visibility added successfully', 'SHORT'); + setProcessing(false); + props.navigation.goBack(); + }, function (txn2, txnerr) { console.log(txnerr); setProcessing(false); notify('Cannot add competition visibility') },); + + + }); + } catch (err) { + console.log(err); + } + } + + + + + async function validate() { + + let isValid = true; + if (isAddVisPresent == 1 && AddVisibility.length <= 0) { + isValid = false; + notify('Please add first', 'SHORT'); + } + + console.log('isValid:', isValid); + return isValid; + } + + async function validateForm() { + let isValid = true; + let { CategoryName, CategoryId, SubCategoryName, SubCategoryId, BrandName, BrandId, DisplayName, DisplayId, Remark, Image1, Image1Path } = AddVisFormData; + + if ((CategoryName == '' || CategoryName == null) || (CategoryId == '' || CategoryId == null)) { + isValid = false; + notify('Please select category', 'SHORT'); + } + else if ((SubCategoryName == '' || SubCategoryName == null) || (SubCategoryId == '' || SubCategoryId == null)) { + isValid = false; + notify('Please select sub category', 'SHORT'); + } + else if ((BrandName == '' || BrandName == null) || (BrandId == '' || BrandId == null)) { + isValid = false; + notify('Please select brand', 'SHORT'); + } + else if ((DisplayName == '' || DisplayName == null) || (DisplayId == '' || DisplayId == null)) { + isValid = false; + notify('Please select display type', 'SHORT'); + } + else if ((Remark == '' || Remark == null)) { + isValid = false; + notify('Please enter remark', 'SHORT'); + } + else if ((Image1 == '' || Image1 == null)) { + isValid = false; + notify('Please click image', 'SHORT'); + } + + + console.log('isValid:', isValid); + return isValid; + } + + function onFormDataChange(val, key) { + let data = AddVisFormData; + data[key] = val; + setAddVisFormData(data); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onselectionChange(option, keyLbl, keyVal, otherData) { + + let data = AddVisFormData; + data[keyVal] = option.value; + data[keyLbl] = option.label; + + setHasUnsavedChanges(true); + + if (keyLbl == 'CategoryName') { + loadData(option.value, 'SubCategories', '', ''); + + data['SubCategoryId'] = ''; + data['SubCategoryName'] = ''; + data['BrandId'] = ''; + data['BrandName'] = ''; + data['DisplayId'] = ''; + data['DisplayName'] = ''; + + + + } + else if (keyLbl == 'SubCategoryName') { + loadData(option.value, 'Brands'); + + data['BrandId'] = ''; + data['BrandName'] = ''; + } + + setAddVisFormData(data); + setrerenderdata(!rerenderdata); + + + } + + async function loadData(qId, type) { + try { + await db.transaction(async function (txn) { + let q = ''; + if (type == 'SubCategories') q = `Select Distinct p.SubCategoryId,p.SubCategoryName from Sup_Product_Master p where p.CategoryId='${qId}' and IsCompetitor ='1' order by p.SubCategorySequence`; + else if (type == 'Brands') q = `Select Distinct p.BrandName,p.BrandId from Sup_Product_Master p Where p.SubCategoryId='${qId}' and p.CategoryId='${AddVisFormData['CategoryId']}' and IsCompetitor ='1' order by p.BrandSequence`; + + console.log("sub query------------------------------------->",q) + await txn.executeSql(q, [], async function (txn2, txnres2) { + if (txnres2.rows.length > 0) { + let arr = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + arr.push(data); + if (i == txnres2.rows.length - 1) { + if (type == 'SubCategories') setSubCategories(arr); + else if (type == 'Brands') setBrands(arr); + } + } + } + }, function (txn2, txnerr) { console.log(txnerr); },); + + }); + } catch (err) { + console.log(err); + } + } + + + + function onChoiceSelect(val, key) { + if (val == 0 && AddVisibility.length > 0) { + setShowRAllC_M(true); + return; + } + var val1 = val == 1 ? 1 : 0; + if (animatedChoice != null) { + Animated.timing(animatedChoice, { + toValue: val1, + duration: 400, + useNativeDriver: false, + }).start(); + } + setIsAddVisPresent(val); + setHasUnsavedChanges(true); + if (val == 0) { + setAddVisibility([]); + setAddVisFormData({}); + } + } + + function onConfirmRemoveAll() { + // Remove all data + if (animatedChoice != null) { + Animated.timing(animatedChoice, { + toValue: 0, + duration: 400, + useNativeDriver: false, + }).start(); + } + setIsAddVisPresent(0); + setHasUnsavedChanges(true); + setAddVisibility([]); + setAddVisFormData({}); + setShowRAllC_M(false); + } + + function onSaveCancel() { + setShowAlert(false); + } + + async function Add_AddVis() { + let isValid = await validateForm(); + console.log('isValid add:', isValid); + if (isValid) { + let arr = AddVisibility; + let { CategoryName, CategoryId, SubCategoryName, SubCategoryId, BrandName, BrandId, DisplayName, DisplayId, Remark, Image1, Image1Path } = AddVisFormData; + console.log(AddVisFormData); + // let index=AddVisibility.findIndex(i=> i.CategoryId==CategoryId && i.SubCategoryId==SubCategoryId && i.BrandId==BrandId && i.DisplayId==DisplayId); + // if(index>=0){ + // notify('This visibility has already been added','LONG'); + // } + // else{ + arr.push(AddVisFormData); + // setAddVisibility(arr); + // setHasUnsavedChanges(true); + notify('Visibility added successfully', 'LONG'); + setrerenderdata(!rerenderdata); + + // clear data + setAddVisFormData({}); + // } + } + + } + + function showRemoveConfirm(item, index) { + setToRemoveId(index); + setToRemoveItem(item); + setshowRemoveConfirm_M(true); + } + + function Remove_AddVis() { + let index = toRemoveId + let item = toRemoveItem; + let arr = AddVisibility; + console.log('toRemoveId:', index); + if (index >= 0 && index < arr.length) { + arr.splice(index, 1); + setAddVisibility(arr); + setHasUnsavedChanges(true); + notify('Visibility removed successfully', 'LONG') + setrerenderdata(!rerenderdata); + } + else { + notify('Cannot remove! Visibility not found', 'LONG') + } + setToRemoveId(''); + setToRemoveItem({}); + setshowRemoveConfirm_M(false); + } + + + + + function _render_addVisFormTop() { + let xpos = 0; + if (animatedChoice != null) { + xpos = animatedChoice.interpolate({ + inputRange: [0, 1], + outputRange: [0, -75], + }); + } + return ( + + + {'Is Present'} + + + + { onChoiceSelect(1, 'isPresent') }}> + Yes + + { onChoiceSelect(0, 'isPresent') }}> + No + + + + + + { + isAddVisPresent == 1 && (rerenderdata == rerenderdata) && + + + + + + + Category + {CustomPicker(props, Categories, 'CategoryName', 'CategoryId', 'CategoryName', 'CategoryId', onselectionChange, { value: AddVisFormData.CategoryName, otherData: {} })} + + + + + + Sub Category + {CustomPicker(props, SubCategories, 'SubCategoryName', 'SubCategoryId', 'SubCategoryName', 'SubCategoryId', onselectionChange, { value: AddVisFormData.SubCategoryName, otherData: {} })} + + + + + Brands + + {CustomPicker(props, Brands, 'BrandName', 'BrandId', 'BrandName', 'BrandId', onselectionChange, { value: AddVisFormData.BrandName })} + + + + + Display Type + {CustomPicker(props, DisplayList, 'DisplayName', 'DisplayId', 'DisplayName', 'DisplayId', onselectionChange, { value: AddVisFormData.DisplayName })} + + + + + Remark + { onFormDataChange(val, 'Remark'); }} + autoComplete='off' + /> + + + + + Image + + + {(AddVisFormData.Image1Path == '' || AddVisFormData.Image1Path == null) && + { openCamera('1') }}> + + + } + {(AddVisFormData.Image1Path != '' && AddVisFormData.Image1Path != null) && + + + { openCamera('1') }}> + + + + } + + + + + + + { Add_AddVis() }}> + Add + + + + + + Added Visibilities + + { + AddVisibility.length > 0 && + AddVisibility.map((item, index) => { + console.log(item); + return ( + + + + + Category : + {item.CategoryName} + + + Sub Category : + {item.SubCategoryName} + + + Brand : + {item.BrandName} + + + Display Type : + {item.DisplayName} + + + Remark : + {item.Remark} + + + + {/* */} + Image + {(item.Image1Path != null && item.Image1Path != '') && } + {/* */} + + { showRemoveConfirm(item, index) }}> + + + + + + + ); + }) + } + + + + } + + ) + } + + return ( + + {processing && } + + {ConfirmSaveAlert(props, showAlert, onSaveCancel, saveData)} + {ConfirmSaveAlert(props, showRemoveConfirm_M, () => { setshowRemoveConfirm_M(false) }, Remove_AddVis, 'Do you really want to remove this visibility?')} + {ConfirmSaveAlert(props, showRAllC_M, () => { setShowRAllC_M(false) }, onConfirmRemoveAll, 'Do you really want to remove all visibility data?')} + { setShowCamera(false); getImage(imgData) }} showCamera={showCamera} onHideCamera={() => { setShowCamera(false); }} /> + + + + {Object.keys(storeData).length > 0 && + + {_render_addVisFormTop()} + + } + + { onSubmitData() }} /> + + + + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(CompetitionVisibility); \ No newline at end of file diff --git a/src/screens/ContactConversion.js b/src/screens/ContactConversion.js new file mode 100644 index 0000000..82d00c0 --- /dev/null +++ b/src/screens/ContactConversion.js @@ -0,0 +1,278 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, Animated} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, FontAwesome, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector' + +function ContactConversion(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const animatedChoice=useRef(new Animated.Value(0)).current; + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [TotalContact, setTotalContact] = useState(''); + const [CustomerConv, setCustomerConv] = useState(''); + const [showAlert, setShowAlert] = useState(false); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + function onBeforeRemove(e){ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + function onRemoveScreen(e){ + Alert.alert( + "", + "Do you really want to exit the screen?", + [ + { + text: "Cancel", + onPress: () => {}, + style: "cancel" + }, + { text: "OK", onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + + async function getData(storeData1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + await db.transaction(async function (txn) { + + + let q3=`Select * from ${AppTables.CONTACT_CONVERSION} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + await txn.executeSql(q3,[],async function (txn2, txnres2) { + + if(txnres2.rows.length>0){ + let arr=[]; + let data =txnres2.rows.item(0); + let {TOTAL_CONTACT,CST_CONTACT}=data; + setTotalContact(TOTAL_CONTACT); + setCustomerConv(CST_CONTACT); + } + },function (txn2, txnerr) { console.log(txnerr); },); + + setProcessing(false); + + }); + } catch (err) { + console.log(err); + } + } + + + + async function onSubmitData(){ + let isvalid=validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + let q=`DELETE FROM ${AppTables.CONTACT_CONVERSION} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // remove old data + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('cc data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + var values=''; + values+=` ('${StoreId}','${d2}','${TotalContact}','${CustomerConv}','${d2}') `; + + let add_data=`INSERT INTO ${AppTables.CONTACT_CONVERSION} (STORE_ID,VISIT_DATE,TOTAL_CONTACT,CST_CONTACT,ADDED_DATE) VALUES ${values} `; + + await txn.executeSql(add_data,[],async function (txn2, txnres) { + console.log('cc added'); + notify('Contact conversion added successfully','SHORT'); + setProcessing(false); + props.navigation.goBack(); + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot add contact conversion') },); + + + }); + } catch (err) { + console.log(err); + } + } + + function validate(){ + let isValid=true; + if(TotalContact!==0 && (TotalContact=='' || TotalContact==null)){ + isValid=false; + notify('Please enter total contacts for today','SHORT'); + } + else if(CustomerConv!==0 && ( CustomerConv=='' || CustomerConv==null)){ + isValid=false; + notify('Please enter customer converted for today','SHORT'); + } + else if((CustomerConv!='' && CustomerConv!=null && TotalContact!='' && TotalContact!=null) && (parseInt(CustomerConv)>parseInt(TotalContact))){ + isValid=false; + notify('Customer Converted cannot be greater than Total Contacts','SHORT'); + } + + console.log('isValid:',isValid); + return isValid; + } + + + function onSaveCancel(){ + setShowAlert(false); + } + + async function onTotalContactChange(val){ + if(!isNaN(val)){ + if(val.includes('.')){ + notify('Please enter whole numbers only','SHORT'); + return; + } + } + + setTotalContact(val); + setHasUnsavedChanges(true); + } + + async function onCustomerConvChange(val){ + if(!isNaN(val)){ + if(val.includes('.')){ + notify('Please enter whole numbers only','SHORT'); + return; + } + } + + setCustomerConv(val); + setHasUnsavedChanges(true); + } + + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + + + { Object.keys(storeData).length>0 && + + + + + + Total Contacts + {console.log('on focus out'); if(CustomerConv!='' && CustomerConv!=null ) validate();}} + onChangeText={(val)=>{onTotalContactChange(val);}} + autoComplete='off' + /> + + + + + + Customer Converted + {console.log('on focus out'); if(TotalContact!='' && TotalContact!=null ) validate();}} + onChangeText={(val)=>{ onCustomerConvChange(val);}} + autoComplete='off' + /> + + + + + + } + + {onSubmitData()}}/> + + + + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(ContactConversion); \ No newline at end of file diff --git a/src/screens/ContactUs.js b/src/screens/ContactUs.js new file mode 100644 index 0000000..6e2f5e9 --- /dev/null +++ b/src/screens/ContactUs.js @@ -0,0 +1,72 @@ +import React, {useState, useEffect} from 'react'; +import Container from '../components/container'; +import {useRoute} from '@react-navigation/native'; +import {globalStyles, customStyles, GetPageTheme} from '../styles/Global'; +import { StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList,} from 'react-native'; +import {ReactReduxContext,connect,useSelector,useDispatch,} from 'react-redux'; +import {mapStateToProps, mapDispatchToProps} from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,DownloadData} from '../controller/functions'; +import {get_item, set_item, clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db,} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { Entypo, FontAwesome, Fontisto, Foundation, Ionicons, MaterialCommunityIcons } from '../components/icons'; +import NoDataComponent from '../components/NoDataComponent'; +import WebView from 'react-native-webview'; + +function ContactUs(props) { + const route = useRoute(); + + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const globalStyle = globalStyles(props.DarkMode, route.name); + + + + + useEffect(() => { + + }, []); + + + + return ( + + + + + + + { + + + {ST.MeetUs} + + + + +91 11 4969 4969 + + + + cpmindiait@cpmindia.com + + + + B-227, Upper Ground Floor, Okhla Industrial Area, Phase 1, New Delhi - 110020 + + + } + + + + + ); +} + +export default connect(mapStateToProps, mapDispatchToProps)(ContactUs); diff --git a/src/screens/DBNonWorkingReasons.js b/src/screens/DBNonWorkingReasons.js new file mode 100644 index 0000000..28a7ff9 --- /dev/null +++ b/src/screens/DBNonWorkingReasons.js @@ -0,0 +1,712 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { customStyles,GetPageTheme } from "../styles/Global"; +import {Image,View,Text,ScrollView,TouchableOpacity,FlatList} from 'react-native'; +import { connect } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {marktext1,marktext2, resizeImage, UpdateDistributorStatus, UpdateStoreStatus, UploadData, UploadData2, UploadFormData} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {AppVersion, db, URL_IMAGE, version} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {AntDesign, Entypo, MaterialCommunityIcons,} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import NoDataComponent from '../components/NoDataComponent'; +import {SvgXml} from 'react-native-svg'; +import CustomModal from '../components/CustomModal'; +import GradientButton from '../components/gradientButton'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import Geolocation from 'react-native-geolocation-service'; +import {_checkLocationPermission} from '../components/geolocation'; +import CustomCamera from '../components/Camera'; + +import cameraImg from '../assets/performics/camera_front_image.svg'; +import CameraImg2 from '../assets/performics/camera_icon.svg'; +import CameraImg3 from '../assets/performics/camera_tick.svg'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; +import { AppTables } from '../constants/tableConstants'; +import { uploadDBStatus, uploadStoreStatus } from '../constants/uploadData'; +import { ConfirmSaveAlert } from '../components/alert'; + + +function DBNonWorkingReasons(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const [processing, setProcessing] = useState((props.isDataDownloaded?true:false)); + + const [storeData, setStoreData] = useState({}); + const [nonWorkingRsns, setNonWorkingRsns] = useState([]); + const [selectedReason, setSelectedReason] = useState({}); + const [reason, setReason] = useState(''); + const [reasonId, setReasonId] = useState(''); + const [Image1, setImage1] = useState(''); + const [Image1Path, setImage1Path] = useState(''); + const [showModal, setShowModal] = useState(false); + const [showImageSaveOp, setShowImageSaveOp] = useState(true); + const [rerenderdata, setrerenderdata]= useState(0); + const [location, setLocation] = useState({}); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [isBeatPlan, setIsBeatPlan] = useState(false); + const [isAnyStoreUploaded, setIsAnyStoreUploaded] = useState(false); + const [showAlert, setShowAlert] = useState(false); + + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + getNonWorkingRsns(); + getData(); + + const unsubscribe=props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + return unsubscribe; + }; + }, []); + + useEffect(() => { + const unsubscribe=props.navigation.addListener('beforeRemove', onBeforeRemove); + return unsubscribe; + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + return; + } + } + + + + async function getNonWorkingRsns(){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + + // set store type: adhoc or planned + let params=props.route.params? props.route.params:{}; + + + + let token=await get_item('loginToken'); + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + let storeData1=params.storeData || {}; + setStoreData(storeData1); + + // let q=`SELECT * FROM Non_Working_ReasonDistributor WHERE EntryAllow=1`; + let q=`SELECT * FROM Sup_Non_Working_ReasonDistributor`; + + await db.transaction(async function (txn) { + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + // show from local + var storeArr=[]; + for(var i=0;i{ + db.transaction(async function (txn) { + + let q=`Select t1.* from Sup_MasterDistributor t1 where t1.UploadStatus!='N' and t1.UploadStatus!='' ` + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + // show from local + resolve(true); + } + else{ + resolve(false); + } + },function(Etxn,txnerr){console.log(txnerr);resolve(false); }); + + }); + + }).then((val)=>{ + return val; + }).catch((err)=>{ + return false; + }); + } + + async function _getCurrentLocation() { + + const hasPermission=await _checkLocationPermission(); + if(hasPermission==true) + { + setProcessing(true); + Geolocation.getCurrentPosition( + async (position) => { + let loc={lat:position.coords.latitude,lng:position.coords.longitude}; + setLocation(loc); + // let EntryAllow=(selectedReason.EntryAllow=='true' || selectedReason.EntryAllow==true || selectedReason.EntryAllow==1); + let ImageAllow=(selectedReason.ImageAllow=='true' || selectedReason.ImageAllow==true || selectedReason.ImageAllow==1); + // checkOutAfterLoc(loc); + let UploadStatus=ImageAllow?'L':'U'; + + if(ImageAllow){ + await uploadNonWRsnWithImage(loc,UploadStatus); + } + else{ + await uploadNonWRsn(loc,UploadStatus); + } + }, + (error) => { + notify(ST.Cannotgetuserposition); + setProcessing(false); + }, + { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + ); + } + else{ + notify(ST.Pleaseallowlocationpermission); + } + } + + // async function checkOutAfterLoc(loc){ + // setLoaderTitle(ST.UploadingData+'...'); + // let EntryAllow=(selectedReason.EntryAllow=='true' || selectedReason.EntryAllow==true || selectedReason.EntryAllow==1); + // let createJourneyPlan=(isAdhocScreen==true || isBeatPlan==true || isNonMerchan==true || isNonProg==true); + // // createJourneyPlan? await createJCP(loc,EntryAllow): (EntryAllow?await uploadNonWRsnWithImage(loc,'L'):await uploadNonWRsn(loc,'U',storeData)); + // } + + async function uploadNonWRsn(loc,UploadStatus='L'){ + console.log('uploadNonWRsn'); + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let data={ + "DistributorId":storeData.StoreId, + "VisitDate":d2, + "Latitude":(loc.lat || ''), + "Longitude":(loc.lng || ''), + "ReasonId":reasonId, + // "Remark":"", + // "Appversion":AppVersion, + "UploadStatus":UploadStatus, + "UserId":(props.UserId || ''), + "CheckInImage":Image1, + "CheckoutImage":"", + } + + const url=props.baseurl+getMethodName(METHODS.DISTRIBUTOR_COVERAGE); + console.log(url,data); + await UploadData(url,data) + .then(async(res)=>{ + console.log('uploadNonWRsn res:',res); + if(res>0){ + let isUpdated=await InsertCoverageData(loc,true,UploadStatus); + if(isUpdated==true){ + let isupdated=await update_Store_UploadStatus(UploadStatus=='L'); + if(isupdated==true){ + notify(ST.AllDataUploaded+'!','SHORT'); + setProcessing(false); + goBack(); + } + else{ + notify('Cannot update distributor status!','SHORT'); + setProcessing(false); + } + } + else{ + setProcessing(false); + notify(ST.Cannotuploaddata); + } + } + else{ + setProcessing(false); + notify(ST.Cannotuploaddata,'SHORT'); + } + }) + .catch((err)=>{ + console.log(err); + }); + } + + async function uploadNonWRsnWithImage(loc,UploadStatus='L'){ + console.log('uploadNonWRsnWithImage'); + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + + var data1 = new FormData(); + if(Image1Path!='' && Image1Path!=null){ + + data1.append('file', { + uri: Image1Path, + type: 'image/jpg', + name: Image1, + }); + + data1.append('Foldername','DBCoverageImages'); + data1.append('Path', d2); + } + + let data={ + "DistributorId":storeData.StoreId, + "VisitDate":d2, + "Latitude":(loc.lat || ''), + "Longitude":(loc.lng || ''), + "ReasonId":reasonId, + // "Remark":"", + // "Appversion":AppVersion, + "UploadStatus":UploadStatus, + "UserId":(props.UserId || ''), + "CheckInImage":Image1, + "CheckoutImage":"", + } + + const url=props.baseurl+getMethodName(METHODS.DISTRIBUTOR_COVERAGE); + const url1=(props.imageUploadUrl || URL_IMAGE)+getMethodName(METHODS.UPLOADIMAGES_METHOD); + console.log(url,data); + + await UploadData2(url,data) + .then(async(res)=>{ + console.log('res:',res); + if(parseInt(res)>0){ + let isUpdated=await InsertCoverageData(loc,true,UploadStatus); + if(isUpdated==true){ + // Upload Image + if((selectedReason.ImageAllow=='true' || selectedReason.ImageAllow==true) && Image1Path!='' && Image1Path!=null){ + await UploadFormData(url1,data1) + .then(async(res1)=>{ + console.log('res1:',res1); + // let tbname=isBeatPlan==true?'JourneyPlan_RouteWise':(isAdhocScreen==true?'Adhoc_JourneyPlan':'Mapping_JourneyPlan'); + let tbname='Sup_MasterDistributor'; + + // let isuploaded=await uploadStoreStatus(props,storeData,'U',tbname); + let isuploaded=await uploadDBStatus(props,storeData,'U',tbname,loc) + if(isuploaded==true){ + notify(ST.DataUploaded+'!'); + setProcessing(false); + goBack(); + } + else{ + notify(ST.Cannotuploaddata); + setProcessing(false); + } + + }) + .catch((err)=>{ + console.log(err); + }); + } + else{ + // let tbname=isBeatPlan==true?'JourneyPlan_RouteWise':(isAdhocScreen==true?'Adhoc_JourneyPlan':'Mapping_JourneyPlan'); + // let isuploaded=await uploadStoreStatus(props,storeData,'U',tbname); + let tbname='Sup_MasterDistributor'; + let isuploaded=await uploadDBStatus(props,storeData,'U',tbname,loc) + if(isuploaded==true){ + notify(ST.DataUploaded+'!'); + setProcessing(false); + goBack(); + } + else{ + notify(ST.Cannotuploaddata); + setProcessing(false); + } + + } + } + else{ + setProcessing(false); + notify(ST.Cannotuploaddata); + } + } + else{ + setProcessing(false); + notify(ST.Cannotuploaddata); + } + }) + .catch((err)=>{ + console.log(err);setProcessing(false);notify(ST.Cannotuploaddata); + }); + } + + async function InsertCoverageData(loc,entryAllowed=true,UploadStatus){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let now=moment(d1).format('MM/DD/YYYY HH:mm:ss'); + + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let {StoreId,MID}=storeData; + // let {lat,lng}=location; + let {lat,lng}=loc; + let q=`delete from ${AppTables.DISTRIBUTOR_CHECKIN} where DISTRIBUTOR_ID='${StoreId}' and VISIT_DATE='${d2}' `; + let JcpType='Sup_MasterDistributor'; + + let values=` ('${StoreId}','${d2}','${lat}','${lng}','${now}','${Image1Path}','${now}','${Image1Path}','','${d2}')`; + let insert_q=` insert into ${AppTables.DISTRIBUTOR_CHECKIN}(DISTRIBUTOR_ID,VISIT_DATE,LATITUDE,LONGITUDE,CHECKIN_TIME,CHECKIN_IMAGE,CHECKOUT_TIME,CHECKOUT_IMAGE,REMARK,ADDED_DATE) values ${values}`; + + + console.log("InsertCoverageData-------",insert_q) + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('store coverage deleted'); + await txn.executeSql(insert_q,[],async function (txn2, txnres3) { + console.log('InsertCoverageData done'); + + // let isupdated=await update_Store_UploadStatus(UploadStatus=='L'); + let isupdated=await update_Store_UploadStatus(entryAllowed); + + resolve(isupdated); + + },function(Etxn,txnerr){console.log(txnerr);resolve(false);}); + },function(Etxn,txnerr){console.log(txnerr);resolve(false);}); + + + }); + }).then((val)=>{ + console.log('on InsertCoverageData complete:',val); + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + + + + + } + + const goBack=()=>{ + props.navigation.goBack(); + } + + + async function update_Store_UploadStatus(entryAllowed=true){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + console.log("entryAllowed-----",entryAllowed,entryAllowed==false) + // if(entryAllowed==false){ + let EntryAllow=(selectedReason.EntryAllow=='true' || selectedReason.EntryAllow==true || selectedReason.EntryAllow==1); + if(!EntryAllow){ + // if(!entryAllowed){ + // let q=`UPDATE Sup_MasterDistributor SET UploadStatus='U' WHERE DistributorId='${storeData.StoreId}' `; + let q=`UPDATE Sup_MasterDistributor SET UploadStatus='U'`; + await txn.executeSql(q,[],async function (txn2, txnres1) { + console.log('store status updated') + resolve(true); + },function(Etxn,txnerr){console.log(txnerr);resolve(false);}); + } + else{ + let datan={StoreId:storeData.StoreId,UploadStatus:'U',tbname:'Sup_MasterDistributor'} ; + const isUpdated=await UpdateDistributorStatus(props,datan); + resolve(isUpdated); + } + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }) + } + + async function submitNonWorkingRsns(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + function onSaveCancel(){ + setShowAlert(false); + } + + async function saveData(){ + setShowAlert(false); + setLoaderTitle(ST.UploadingData+'...'); + _getCurrentLocation(); + } + + function validate(){ + if(reasonId=='' || reasonId==null || reason=='' || reason==null){ + notify(ST.Pleaseselectreasonfornotworking,'SHORT'); + return false; + } + if( selectedReason.ImageAllow=='true' && (Image1Path=='' || Image1Path==null)){ + notify('Plesae click selfie in front of warehouse','SHORT'); + return false; + } + return true; + } + + async function selectReason(item){ + if(isAnyStoreUploaded==true && (item.EntryAllow=='false' || item.EntryAllow==false)){ + notify('You cannot select this reason, you have already uploaded data for a distributor!'); + return; + } + + setSelectedReason(item); + setReason(item.Reason); + setReasonId(item.ReasonId); + setrerenderdata(!rerenderdata); + + if(item.ImageAllow=='true'){ + if((Image1Path!='' && Image1Path!=null)){ + setShowImageSaveOp(false); + } + else{ + setShowImageSaveOp(true); + } + openImageModal(); + } + } + + function openImageModal(){ + setShowModal(true); + } + + function closeImageModal(){ + setShowModal(false); + } + + function cancelImage(){ + setImage1(''); + setImage1Path(''); + closeImageModal(); + } + + async function getImage(imgdata){ + + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.ExtendedHeight; + let isImgFromGallery=img.fromGallery!=null?img.fromGallery:false; + let picture_clickedd=isImgFromGallery==true?img.datetime:new Date(); + let picture_clicked_time=moment(picture_clickedd).format('DD-MM-YYYY HH:mm:ss') + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: DB Not Working'+' | Date:'+picture_clicked_time; + + let picture_clicked_date1=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time1=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_NonworkImg-'+picture_clicked_date1+'_'+picture_clicked_time1+'.jpg'; + + setImage1(filename); + + let imagePath=`${RNFS.DocumentDirectoryPath}/${filename}`; + RNFS.copyFile(imgurl, imagePath) + .then(async(resn) => { + // render data with clicked image + let uri='file://'+imagePath; + setImage1Path(uri); + + // add metdata then resize image and restored back to the imagePath + let restore_data={"destFilePath":imagePath,"imgurl":imgurl,imgWidth,imgHeight,mark_text1,mark_text2} + let is_restored=await restore_ImageWithMetaData(restore_data,imgdata); + console.log("image restored:",is_restored); + }) + .catch(err => { + console.log(ST.Errorimagefilewritefailed+'!!!'); + console.log(err.message, err.code); + }); + // resize file + // let resize_res=await resizeImage(imgurl,imgWidth,imgHeight) + + + // if(resize_res.success){ + // file resized now rename file + + // } + // else{ + // if(resize_res.error){ + // notify("Error in image: ",resize_res.error); + // }else if (resize_res.imagenotfound){ + // notify("Cannot find image!"); + // }else{ + // notify("Something went wrong while capturing image!"); + // } + // } + } + } + + async function openCamera(){ + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'front'}) + } + + function _OpenCaptureImage_Modal(){ + const isImageCap=(Image1Path=='' || Image1Path==null)?false:true; + return ( + + { + !isImageCap && + + {openCamera()}}> + + + {closeImageModal()}}> + {ST.Cancel} + + + } + { + isImageCap && + + + + + {openCamera()}}> + + + { showImageSaveOp && + + {cancelImage()}}> + {ST.Cancel} + + {closeImageModal()}}> + {ST.Save} + + } + {!showImageSaveOp && + {closeImageModal()}}> + {ST.Close} + + } + + + + } + + ) + } + + + return ( + + {processing && } + + {_OpenCaptureImage_Modal()} + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + { !props.isDataDownloaded && } + {props.isDataDownloaded && Object.keys(storeData).length>0 && + + + + + + + + {storeData.StoreName} + + + + + + {'Distributor Id:'} + {storeData.StoreId} + + + {'Distributor Code:'} + {storeData.StoreCode} + + + + + {'Address:'} + {storeData.Address} + + + + + + + + + + + {'Reason for not working in warehouse'} + { + + const nWselStyle=reasonId==item.ReasonId?customStyle.nWselStyle:{}; + const nWselStyleText=reasonId==item.ReasonId?customStyle.nWselStyleText:{}; + const CapImageShow=(Image1Path!='' && Image1Path!=null) && reasonId==item.ReasonId?true:false; + let isDisabled=(isAnyStoreUploaded==true && (item.EntryAllow=='false' || item.EntryAllow==false)); + return ( + {selectReason(item)}}> + {item.Reason} + { item.ImageAllow=='true' && + {selectReason(item)}}> + {!CapImageShow && } + {CapImageShow && } + + } + + ); + }} + /> + + + + + {submitNonWorkingRsns();}}/> + + + + + } + + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(DBNonWorkingReasons); \ No newline at end of file diff --git a/src/screens/DBVisiCooler.js b/src/screens/DBVisiCooler.js new file mode 100644 index 0000000..dcbb24d --- /dev/null +++ b/src/screens/DBVisiCooler.js @@ -0,0 +1,737 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, Animated} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,marktext1,marktext2, validateNumber} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, FontAwesome, Ionicons, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector' +import { CustomPicker } from '../components/CustomPicker'; +import CustomCamera from '../components/Camera'; + +function DBVisiCooler(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const animatedChoice=useRef(new Animated.Value(0)).current; + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [StoreCameraAllow, setStoreCameraAllow] = useState(true); + + const [currentMenu, setCurrentMenu] = useState({}); + const [brandData, setBrandData] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + + const [AddVisibility, setAddVisibility] = useState([]); + const [PreviousVisicooler, setPreviousVisicooler] = useState([]); + const [AddVisFormData, setAddVisFormData] = useState({}); + const [isAddVisPresent, setIsAddVisPresent] = useState(0); + const [showAlert, setShowAlert] = useState(false); + const [Categories, setCategories] = useState([]); + const [SubCategories, setSubCategories] = useState([]); + const [Brands, setBrands] = useState([]); + const [DisplayList, setDisplayList] = useState([]); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [clickImageType,setClickImageType]= useState('1'); + const [toRemoveId,setToRemoveId]= useState(''); + const [toRemoveItem,setToRemoveItem]= useState({}); + const [showRemoveConfirm_M,setshowRemoveConfirm_M]= useState(false); + const [showRAllC_M,setShowRAllC_M]= useState(false); + + const [QREnable, setQREnable] = useState(false); + const [QRqtnData, setQRqtnData] = useState({}); + const [showQRCamera, setShowQRCamera] = useState(false); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + let cameraAllow=storeData1.CameraAllow=='true' || storeData1.CameraAllow==1?true:false; + setStoreCameraAllow(cameraAllow); + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + function onRemoveScreen(e){ + Alert.alert( + "", + ST.Doyoureallywanttoexitthescreen, + [ + { + text: ST.Cancel, + onPress: () => {}, + style: "cancel" + }, + { text: ST.OK, onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + async function getData(storeData1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + await db.transaction(async function (txn) { + + + let q3=`Select * from ${AppTables.DB_VISICOOLER} WHERE DISTRIBUTOR_ID='${StoreId}' and VISIT_DATE='${d2}' `; + await txn.executeSql(q3,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i0){ + let arr=[]; + for(var i=0;i{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+(props.UserId || '')+'_AddVisibilityImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + + let addvisdata=AddVisFormData; + let image_key='Image1'; + let image_path_key='Image1Path'; + addvisdata[image_key]=filename; + + // renamefile + let imagePath=`${common_ImagePath}/${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker',uri); + addvisdata[image_path_key]=uri; + + setAddVisFormData(addvisdata); + setHasUnsavedChanges(true); + setrerenderdata2(!rerenderdata2); + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(type='1'){ + console.log('openCamera'); + setClickImageType(type); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function onSubmitData(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData+'...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + let q=`DELETE FROM ${AppTables.DB_VISICOOLER} WHERE DISTRIBUTOR_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // remove old data + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('av data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + var values=''; + // if(isAddVisPresent==1 && AddVisibility.length>0){ + for(var i=0;i0){ + let arr=[]; + for(var i=0;i0){ + setShowRAllC_M(true); + return ; + } + var val1=val==1?1:0; + if(animatedChoice!=null){ + Animated.timing(animatedChoice, { + toValue: val1, + duration:400, + useNativeDriver:false, + }).start(); + } + setIsAddVisPresent(val); + setHasUnsavedChanges(true); + if(val==0){ + setAddVisibility([]); + setAddVisFormData({}); + } + } + + function onConfirmRemoveAll(){ + // Remove all data + if(animatedChoice!=null){ + Animated.timing(animatedChoice, { + toValue: 0, + duration:400, + useNativeDriver:false, + }).start(); + } + setIsAddVisPresent(0); + setHasUnsavedChanges(true); + setAddVisibility([]); + setAddVisFormData({}); + setShowRAllC_M(false); + } + + function onSaveCancel(){ + setShowAlert(false); + } + + async function onQRScanned(imgdata){ + // let qtn=QRqtnData.qtn || {}; + // let window=QRqtnData.window || {}; + let QR_withValidChars=imgdata!=null && imgdata!=''?imgdata.replace(/["']/g,''):''; + let value=QR_withValidChars;//imgdata && imgdata[0] && imgdata[0].displayValue ? imgdata[0].displayValue :"" + // setTextValue(value,qtn,window) + console.log("value------",value) + onFormDataChange(value,'QRCode','qrtext') + } + + async function Add_AddVis(){ + let isValid=await validateForm(); + console.log('isValid add:',isValid); + if(isValid){ + let arr=AddVisibility; + + arr.push(AddVisFormData); + setAddVisibility(arr); + setHasUnsavedChanges(true); + notify(ST.AdditionalVisibilityaddedsuccessfully,'LONG'); + setrerenderdata(!rerenderdata); + + // clear data + setAddVisFormData({}); + } + + } + + function showRemoveConfirm(item,index){ + setToRemoveId(index); + setToRemoveItem(item); + setshowRemoveConfirm_M(true); + } + + function Remove_AddVis(){ + let index=toRemoveId + let item=toRemoveItem; + let arr=AddVisibility; + console.log('toRemoveId:',index); + if(index>=0 && index + + { + (rerenderdata== rerenderdata) && + + + + + + {"QR Code"} + + {onFormDataChange(val,'QRCode',"qrtext");}} + autoComplete='off' + /> + {setQREnable(true);setQRqtnData({});setShowQRCamera(true);}}> + + + + + + + + + + {"Asset Code"} + {onFormDataChange(val,'AssetCode');}} + autoComplete='off' + /> + + + + + {ST.Image} + + + { (AddVisFormData.Image1Path=='' || AddVisFormData.Image1Path==null) && + {openCamera('1')}}> + + + } + { (AddVisFormData.Image1Path!='' && AddVisFormData.Image1Path!=null) && + + + {openCamera('1')}}> + + + + } + + + + + + + {Add_AddVis()}}> + {ST.Add} + + + + + + + {"Added Visicooler List"} + + { + AddVisibility.length>0 && + AddVisibility.map((item,index)=>{ + console.log(item); + return ( + + + + + {'QR Code :'} + {item.QRCode} + + + + {'Asset Code :'} + {item.AssetCode} + + + + + {ST.Image} + {console.log("Image1Path--------",item.Image1Path)} + {(item.Image1Path!=null && item.Image1Path!='') && } + + {showRemoveConfirm(item,index)}}> + + + + + + + ); + }) + } + + + + + { PreviousVisicooler.length>0 &&{"Previous Visicooler List"}} + + { + PreviousVisicooler.length>0 && + PreviousVisicooler.map((item,index)=>{ + console.log(item); + return ( + + + + + {'QR Code :'} + {item.QRCode} + + + + {'Asset Code :'} + {item.AssetCode} + + + + { + (item.Image1Path!=null && item.Image1Path!='') && + + {ST.Image} + {(item.Image1Path!=null && item.Image1Path!='') && } + + } + + + + + ); + }) + } + + + + } + + ) + } + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {ConfirmSaveAlert(props,showRemoveConfirm_M,()=>{setshowRemoveConfirm_M(false)},Remove_AddVis,ST.Doyoureallywanttoremovethisvisibility)} + {ConfirmSaveAlert(props,showRAllC_M,()=>{setShowRAllC_M(false)},onConfirmRemoveAll,ST.Doyoureallywanttoremoveallvisibilitydata)} + {setShowQRCamera(false);onQRScanned(imgData)}} showCamera={showQRCamera} onHideCamera={()=>{setShowQRCamera(false);}}/> + + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + { Object.keys(storeData).length>0 && + + {_render_addVisFormTop()} + + } + + {onSubmitData()}}/> + + + + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(DBVisiCooler); \ No newline at end of file diff --git a/src/screens/DB_POSM.js b/src/screens/DB_POSM.js new file mode 100644 index 0000000..247922d --- /dev/null +++ b/src/screens/DB_POSM.js @@ -0,0 +1,723 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, Animated} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,getKPIFields,marktext1,marktext2, validateNumber} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath, ImageFolderPath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, FontAwesome, Fontisto, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector' +import { CustomPicker, CustomPicker2 } from '../components/CustomPicker'; +import CustomCamera from '../components/Camera'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import DateTimePicker from '@react-native-community/datetimepicker'; + + +import cameraImg from '../assets/performics/camera_front_image.svg' +import MultiSelect from 'react-native-multiple-select'; + +function DB_POSM(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const animatedChoice=useRef(new Animated.Value(0)).current; + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + const [rerenderdata3, setrerenderdata3]= useState(0); + const [rerenderdata4, setrerenderdata4]= useState(0); + + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + + const [dateValue, setDateValue] = useState(''); + const [WindowData, setWindowData] = useState([]); + const [reasons_list, setReasons_list] = useState([]); + const [Windows, setWindows] = useState([]); + const [globalWindows, setGlobalWindows] = useState([]); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [refImageIndex, setrefImageIndex] = useState(0); + const [showAlert, setShowAlert] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const zoomView=useRef(null); + const [showRating, setShowRating] = useState(false); + const [RatingQtn, setRatingQtn] = useState({}); + const [RatingWindow, setRatingWindow] = useState({}); + const [RatingOrder, setRatingOrder] = useState([]); + const [searchedItem, setSearchedItem]= useState(''); + const [KPIFields, setKPIFields] = useState([]); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + + const unsubscribe=props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + return unsubscribe; + }; + }, []); + + useEffect(() => { + const unsubscribe=props.navigation.addListener('beforeRemove', onBeforeRemove); + return unsubscribe; + }, [hasUnsavedChanges]); + + useEffect(() => { + const unsubscribe=props.navigation.addListener('beforeRemove', onBeforeRemove); + return unsubscribe; + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + + function onRemoveScreen(e){ + Alert.alert( + "", + ST.Doyoureallywanttoexitthescreen, + [ + { + text: ST.Cancel, + onPress: () => {}, + style: "cancel" + }, + { text: ST.OK, onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + + async function getData(storeData1,menu1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + let AllKPIFields=await getKPIFields(menu1); + setKPIFields(AllKPIFields); + + await db.transaction(async function (txn) { + + + + // let q5=`Delete from ${AppTables.DBPOSM_HDR_DATA}`; + // await txn.executeSql(q5,[],async function (txn2, txnres2) { + // console.log('hdr data deleted') + // },function (txnE,txnerr) { console.log(txnerr); },); + + // check if data exists + let selectlist=` w.DISTRIBUTOR_ID as DistributorId,w.POSM_HEADER_ID as posmHeaderId,wd.POSMDefinitionId,wd.PosmId,wd.POSMName,wd.PosmTypeId,wd.POSMTypeName,wd.POSMDefinitionTitle,wd.POSMDefinitionTitleEnable,wd.POSMTable,wd.POSMField,wd.POSMValue,wd.ChildName,wd.POSMRefImage,w.IS_PRESENT as IsPresent,w.POSM_IMAGE as POSMImage,w.STOCK_QTY as StockQty`; + let join=` inner join Master_POSMDefinition wd on w.POSM_DEFINITION_ID=wd.POSMDefinitionId `; + let q=` Select ${selectlist} from ${AppTables.DBPOSM_HDR_DATA} w ${join} where w.DISTRIBUTOR_ID='${StoreId}' `; + + // else pick data from masters + let selectlist2=` db.DistributorId,w.POSMDefinitionId,w.PosmId,w.POSMName,w.PosmTypeId,w.POSMTypeName,w.POSMDefinitionTitle,w.POSMDefinitionTitleEnable,w.POSMTable,w.POSMField,w.POSMValue,w.ChildName,w.POSMRefImage,'' as IsPresent,'' as POSMImage,'' as StockQty`; + let q2=`select Distinct ${selectlist2} from Sup_MasterDistributor db + INNER JOIN Mapping_JourneyPlan jcp on db.DistributorId=jcp.DistributorId + INNER JOIN Mapping_StorePOSM MW on MW.StoreId=jcp.StoreId + INNER JOIN Master_POSMDefinition w on w.POSMDefinitionId=MW.POSMDefinitionId + + UNION + + select Distinct ${selectlist2} from Sup_MasterDistributor db + INNER JOIN Adhoc_JourneyPlan jcp on db.DistributorId=jcp.DistributorId + INNER JOIN Mapping_StorePOSM MW on MW.StoreId=jcp.StoreId + INNER JOIN Master_POSMDefinition w on w.POSMDefinitionId=MW.POSMDefinitionId + + `+(props.ShowNonMerList==true?` + UNION + + select Distinct ${selectlist2} from Sup_MasterDistributor db + INNER JOIN NonMerchandising_JourneyPlan jcp on db.DistributorId=jcp.DistributorId + INNER JOIN Mapping_StorePOSM MW on MW.StoreId=jcp.StoreId + INNER JOIN Master_POSMDefinition w on w.POSMDefinitionId=MW.POSMDefinitionId + + + `:'') + +(props.ShowNonProgram==true?` + UNION + + select Distinct ${selectlist2} from Sup_MasterDistributor db + INNER JOIN NonProgram_JourneyPlan jcp on db.DistributorId=jcp.DistributorId + INNER JOIN Mapping_StorePOSM MW on MW.StoreId=jcp.StoreId + INNER JOIN Master_POSMDefinition w on w.POSMDefinitionId=MW.POSMDefinitionId + + + `:'') + +(props.ShowBeatPlanList==true?` + UNION + + select Distinct ${selectlist2} from Sup_MasterDistributor db + INNER JOIN JourneyPlan_RouteWise jcp on db.DistributorId=jcp.DistributorId + INNER JOIN Mapping_StorePOSM MW on MW.StoreId=jcp.StoreId + INNER JOIN Master_POSMDefinition w on w.POSMDefinitionId=MW.POSMDefinitionId + + + `:'') + +` Where db.DistributorId='${StoreId}' order by db.DistributorId,w.POSMDefinitionId ` + ; + + + + + console.log("dbposm q:",q) + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log("added rows",txnres2.rows.length) + if(txnres2.rows.length>0){ + let arr=[];let images=[],allWindowsData=[]; + for(var i=0;i0){ + let arr=[],images=[],allWindowsData=[]; + for(var i=0;i{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+window.POSMDefinitionId+'_'+window.PosmId+'_'+(props.UserId || '')+'_DBPOSMImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let allData=WindowData; + let defData={'PosmId':window.PosmId,'POSMDefinitionId':window.POSMDefinitionId}; + const wind_index=allData.findIndex(i=>i.PosmId==window.PosmId && i.POSMDefinitionId==window.POSMDefinitionId) ; + let wind=wind_index>=0?allData[wind_index]:defData; + + let image_key='Image1'; + let image_key_path='Image1Path'; + wind[image_key]=filename; + + // renamefile + let imagePath=`${ImageFolderPath+currentMenu.ScreenName}/${filename}`;; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker',uri); + + wind[image_key_path]=uri; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(window){ + setGetImageProps({'window':window}); + setShowCamera(true); + } + + + async function onSubmitData(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData+'...'); + setProcessing(true); + let d1n=new Date(); + let d3=moment(d1n).format('MM/DD/YYYY'); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + // remove old data + await txn.executeSql(`DELETE FROM ${AppTables.DBPOSM_HDR_DATA} WHERE DISTRIBUTOR_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window hdr data deleted'); + },function (txnE,txnerr) { console.log(txnerr); },); + + // add data + var values='',childV=''; + for (const wi in Windows){ + const window=Windows[wi]; + + const wind=WindowData.find(i=>i.PosmId==window.PosmId && i.POSMDefinitionId==window.POSMDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let Image1=wind.Image1!=null?wind.Image1:''; + let Image1Path=wind.Image1Path!=null?wind.Image1Path:''; + + + let POSM_HEADER_ID='POSM'+wi+(Math.floor(Math.random()*1000)+1); + let {POSMDefinitionId,PosmId,POSMName,PosmTypeId,POSMTypeName,POSMTable,POSMField,POSMValue,ChildName}=window; + let StockQty=wind.StockQty!=null?wind.StockQty:''; + + values+=values!=''?' , ':''; + values+=` ('${POSM_HEADER_ID}','${StoreId}','${d3}','${POSMDefinitionId}','${PosmId}','${POSMName}','${PosmTypeId}','${POSMTypeName}','${POSMTable}','${POSMField}','${POSMValue}','${ChildName}','${isPresent}','${Image1}','${StockQty}','${d3}') `; + } + + let add_hdr_data=`INSERT INTO ${AppTables.DBPOSM_HDR_DATA}(POSM_HEADER_ID,DISTRIBUTOR_ID,VISIT_DATE,POSM_DEFINITION_ID,POSM_ID,POSM_NAME,POSM_TYPE_ID,POSM_TYPE_NAME,POSM_TABLE,POSM_FIELD,POSM_VALUE,CHILD_NAME,IS_PRESENT,POSM_IMAGE,STOCK_QTY,ADDED_DATE) VALUES ${values} `; + await txn.executeSql(add_hdr_data,[],async function (txn2, txnres) { + console.log('posm header data added'); + setProcessing(false);notify(ST.POSMdataupdatedsuccessfully); + props.navigation.goBack(); + },function (txnE,txnerr) { console.log(txnerr);setProcessing(false);notify(ST.CannotaddPOSMdata); },); + }); + } catch (err) { + console.log(err); + } + } + + async function validate(){ + let isValid=true; + return new Promise((resolve,reject)=>{ + for (const wi in Windows){ + const window=Windows[wi]; + const wind=WindowData.find(i=>i.PosmId==window.PosmId && i.POSMDefinitionId==window.POSMDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let Image1=wind.Image1!=null?wind.Image1:''; + let Image1Path=wind.Image1Path!=null?wind.Image1Path:''; + let StockQty=wind.StockQty!=null?wind.StockQty:''; + + if(isPresent=='1'){ + if(StockQty==''){ + notify(`Please enter stock for ${window.POSMName}`,'LONG'); + resolve(false);return; + } + else if(Image1==''){ + notify(`${ST.Pleaseclickallimagesfor} ${window.POSMName}`,'LONG'); + resolve(false);return; + } + } + else{ + + } + + if(wi==(Windows.length-1)){ + resolve(true);return; + } + + } + + }).then((val)=>{return val}) + .catch((err)=>{console.log(err); return false}); + + } + + + + function onChoiceSelect(item,val,key,animatedChoice){ + var val1=0; + val==1?val1=1:''; + if(animatedChoice!=null){ + Animated.timing(animatedChoice, { + toValue: val1, + duration:400, + useNativeDriver:false, + }).start(); + } + onWindowDataChange(item,val,key) + } + + function onWindowDataChange(item,val,key,type=''){ + if(val!=''){ + let isValid=validateNumber(val,type); + if(!isValid){ + return; + } + } + let allData=WindowData; + let defData={'PosmId':item.PosmId,'POSMDefinitionId':item.POSMDefinitionId}; + const win_index=allData.findIndex(i=>i.PosmId==item.PosmId && i.POSMDefinitionId==item.POSMDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[key]=val; + + if(key=='ReasonId'){ + let rsn=reasons_list.find(r=>r.ReasonId==val) || {}; + wind['Reason']=rsn.Reason || ''; + } + + win_index>=0?allData[win_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + + function onSaveCancel(){ + setShowAlert(false); + } + + + + function openImageRefView(windowIndex=0){ + setrefImageIndex(windowIndex); + setShow_zoomImage(true); + } + + + function _renderWindow(){ + return ( + `posm_${index.toString()}`} + renderItem={({item,index})=>{ + const window=item; + + let RefImage=window.POSMRefImage; + + const wind=WindowData.find(i=>i.PosmId==window.PosmId && i.POSMDefinitionId==window.POSMDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + + let StockQty=wind.StockQty!=null?wind.StockQty+'':''; + let Image1=wind.Image1!=null?wind.Image1:''; + let Image1Path=wind.Image1Path!=null?wind.Image1Path:''; + + + var xpos=isPresent=='1'?-75:0; + if(window.animatedChoice!=null ){ + xpos=window.animatedChoice.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + + + return( + + + + {window.POSMName} + {openImageRefView(index)}}> + + + + + + + + + {ST.IsPresent} + + + + {onChoiceSelect(window,1,'isPresent',window.animatedChoice)}}> + {ST.Yes} + + {onChoiceSelect(window,0,'isPresent',window.animatedChoice)}}> + {ST.No} + + + + + + + {(isPresent=='1') && + + + {'Stock'} + {onWindowDataChange(window,val,'StockQty','numeric')}} + /> + + + + {ST.CaptureImage} + + + + { (Image1Path=='' || Image1Path==null) && + {openCamera(window)}}> + + + } + { (Image1Path!='' && Image1Path!=null) && + + + {openCamera(window)}}> + + + + } + + + + + } + + + + + ); + }} + /> + ) + } + + function _renderHeader(currentIndex){ + return( + + {`${(currentIndex+1)}/${zoomImageUrl.length}`} + {setShow_zoomImage(false) }}> + + + + ) + } + + function FilterStores(searchedQry){ + searchedQry=searchedQry.toLowerCase(); + console.log('searchedQry',searchedQry); + let arr=[]; + var arr2={}; + if(searchedQry!=null && searchedQry!=''){ + for(let i=0;ii.KPIFieldName=='SearchEnable') + let isSearchEnableKPIObj=isSearchEnableIndex>=0?KPIFields[isSearchEnableIndex]:{}; + let isSearchEnable=isSearchEnableIndex>=0?isSearchEnableKPIObj['KPIFieldEnable']:false; + if(isSearchEnable==true){ + return ( + + {setSearchedItem(val); FilterStores(val)}} + /> + {FilterStores(searchedItem)}}> + + + + ) + } + else{ + return( + + ) + } + } + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + {getSearchBar()} + { Object.keys(storeData).length>0 && + + {_renderWindow()} + + } + + {onSubmitData()}}/> + + + + + + {show_zoomImage && + + null} + /> + + } + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(DB_POSM); \ No newline at end of file diff --git a/src/screens/DB_StoreDailyMenu.js b/src/screens/DB_StoreDailyMenu.js new file mode 100644 index 0000000..75514b4 --- /dev/null +++ b/src/screens/DB_StoreDailyMenu.js @@ -0,0 +1,362 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import {checkFilledSurveys, getAvailblQuery, getIfAvlbl, getIfKPIDone, getQuery, Q_GetAvailabityDefaultData, Q_getCategoryforAdditional, Q_getdefaltShareofSelf, Q_getMyDBMenuList, Q_getMyStoresMenuList, Q_getpaidvisibility, Q_getpromotionmappingList, Q_getSamplingData, Q_getSurveys, Q_MenuList} from '../constants/ConstantQueries'; + +import grey_bg_image from '../assets/performics/circle_grey.svg'; +import { SvgXml } from 'react-native-svg'; + +function DB_StoreDailyMenu(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [StoreIntro, setStoreIntro] = useState(false); + const [StorePhotosDone, setStorePhotosDone] = useState(false); + const [StoreSKUPhotosDone, setStoreSKUPhotosDone] = useState(false); + const [StoreSKUActPhotosDone, setStoreSKUActPhotosDone] = useState(false); + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [isBeatPlan, setIsBeatPlan] = useState(false); + const [storeData, setStoreData] = useState({}); + const [dailyMenu, setDailyMenu] = useState([]); + const [refreshMenuStatus, setRefreshMenuStatus] = useState(false); + const [checkAvailable, setcheckAvailable] = useState(false); + const [refreshMenuRender, setRefreshMenuRender] = useState(0); + const [isLoaded, setIsLoaded] = useState(false); + + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + setStoreData(storeData1); + + getDailyMenu(storeData1,false); + const willFocusSubscription = props.navigation.addListener('focus', () => { + console.log('DB_StoreDailyMenu onfocus'); + getDailyMenu(storeData1,false); + }); + + return willFocusSubscription; + }, []); + + // useEffect(() => { + // if(refreshMenuStatus==true){ + // updateStatus(); + // } + // }, [refreshMenuStatus]); + + // useEffect(() => { + // if(checkAvailable==true){ + // checkAvailability(); + // } + // }, [checkAvailable]); + + useEffect(() => { + console.log('AutoGoToPrev dailmenu onchange',props.AutoGoToPrev); + if(props.AutoGoToPrev==true){ + getDailyMenu(storeData,true); + } + }, [props.AutoGoToPrev]); + + + async function getDailyMenu(storeData1,isAutoBack=false){ + setProcessing(true); + console.log('getDailyMenu'); + try { + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let {StoreId,ChannelId,RegionId,StoreTypeId}=storeData1; + let q=await Q_getMyDBMenuList(storeData1,props); + console.log('My menu q:',q); + await db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + let allDone=true; + for(var i=0;i0; + let isDone=parseInt(KPIAVBL)>0 && parseInt(DataRowCount)>0; + data['isAvlbl']=isAvlbl; + data['isKPI_Done']=isDone; + arr.push(data); + + if(isAvlbl && !isDone){ + allDone=false; + } + + if(i==(txnres.rows.length-1)){ + setDailyMenu(arr); + setIsLoaded(true); + setProcessing(false); + console.log('isAllKPIDone dailymenu :',allDone,props.AutoGoToPrev,isAutoBack) + if(allDone==true && props.AutoGoToPrev==true && isAutoBack==true){ + // props.set_autoback({'AutoGoToPrev':true}); + setTimeout(() => { + props.navigation.goBack(); + },3000); + } + } + } + } + else{ + setProcessing(false); + } + },function (txnE,txnerr) { console.log(txnerr); setProcessing(false);},); + + }); + } catch (err) { + console.log(err); + } + } + + async function checkAvailability(storeData1,data){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q2=getAvailblQuery(data.ScreenName,storeData1); + if(data.ScreenName=='ADDITIONALVISI'){ + console.log('POSM query:',q2); + } + if(q2!='' && q2!=null){ + await txn.executeSql(q2,[],async function (txn2, txnres2) { + if(data.ScreenName=='ADDITIONALVISI'){ + console.log('POSM count:',txnres2.rows.length); + for(var n=0;n{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + } + + async function updateStatus(storeData1,data,isAvlbl){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q2=getQuery(data.ScreenName,storeData1); + if(q2!='' && q2!=null && isAvlbl==true){ + await txn.executeSql(q2,[],async function (txn2, txnres2) { + let isDone=await getIfKPIDone(data.ScreenName,txnres2,storeData1); + resolve(isDone); + },function (txnE,txnerr) { console.log(txnerr); resolve(false);},); + } + else{ + resolve(false); + } + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + + } + + + + async function checkForData(ScreenName,callback=()=>{},extraData={}){ + try { + await db.transaction(async function (txn) { + let q2=getQuery2(ScreenName,extraData); + if(q2!='' && q2!=null){ + await txn.executeSql(q2,[],async function (txn2, txnres2) { + callback(txnres2); + },function (txnE,txnerr) { console.log(txnerr); },); + } + }); + } catch (err) { + console.log(err); + } + } + + async function gotoKPITaskScreen(item){ + switch(item.ScreenName){ + case 'DBWINDOWONEAPP':{ + gotoPage('DB_Window',item); + } + return; + case 'DBPOSMONEAPP':{ + gotoPage('DB_POSM',item); + } + return; + case 'VISICOOLER':{ + gotoPage('DBVisiCooler',item); + } + return; + + default:return; + } + } + + function gotoPage(screenname='',item){ + props.set_autoback({'AutoGoToPrev':false}); + props.navigation.navigate(screenname,{storeData:storeData,menu:item}) + } + + + function _renderLeftMenuItem(index,RowContent){ + return( + + {RowContent[0]} + + ) + } + + + function _renderRightMenuItem(item,index,RowContent){ + return( + + {RowContent[0]} + {_renderMenuItem(item,index)} + + ) + + } + + function _renderMenuItem(item,index){ + let newi=index>2?((index%3)):index; + let firstitem=(index%2==0)?true:false; + let arr=colors_Arr[newi]?colors_Arr[newi].bg:colors_Arr["0"].bg; + let unavlbl_bg=['#bfbfbf','#bfbfbf']; + let arr_new=item.isAvlbl==false?unavlbl_bg:arr; + let iconColor=colors_Arr[newi]?colors_Arr[newi].color:colors_Arr["0"].color; + const imgPath=item.MenuPath+(item.isAvlbl==false?item.GreyIcon:item.NormalIcon); + + let m_bgimage=colors_Arr[newi]?colors_Arr[newi].bgImage:colors_Arr["0"].bgImage; + m_bgimage=item.isAvlbl==false?grey_bg_image:m_bgimage; + + return( + {if(item.isAvlbl!=false){gotoKPITaskScreen(item)}}}> + + + + + + + + {(imgPath!=null && imgPath!='') && } + + + {item.MenuName} + {item.isKPI_Done==true && + + } + + + ) + } + + + function _renderDailyMenu(){ + var RowContent=[]; + return( + + + {refreshMenuRender==refreshMenuRender && dailyMenu.length>0 && + dailyMenu.map((item,index)=>{ + let firstitem=(index%2==0)?true:false; + + if(firstitem){ + var content=_renderMenuItem(item,index); + RowContent=[content]; + if(index==dailyMenu.length-1){ + return _renderLeftMenuItem(index,RowContent); + } + } + else{ + return _renderRightMenuItem(item,index,RowContent); + } + + }) + } + + + + ); + } + + return ( + + {processing && } + + + + { Object.keys(storeData).length>0 && + + + + + + + + {storeData.StoreName} + + {storeData.StoreType} + + + + + + + {'Distributor Id:'} + {storeData.StoreId} + + + {'Distributor Code:'} + {storeData.StoreCode} + + + + + + + {isLoaded==true && _renderDailyMenu()} + + } + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(DB_StoreDailyMenu); \ No newline at end of file diff --git a/src/screens/DashboardDrilldown.js b/src/screens/DashboardDrilldown.js new file mode 100644 index 0000000..776ec36 --- /dev/null +++ b/src/screens/DashboardDrilldown.js @@ -0,0 +1,361 @@ + +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, StyleSheet, Modal} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,DownloadData, getDownloadJson1, get_rowColSettings} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl, db} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign, MaterialCommunityIcons} from '../components/icons'; +import { WebView } from 'react-native-webview'; +import CustomLoader from '../components/CustomLoader'; +import NoDataComponent from '../components/NoDataComponent'; +import LinearGradient from 'react-native-linear-gradient'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; +import cross_icon from '../assets/icons/crossmodal.svg'; +import { SvgXml } from 'react-native-svg'; + +function DashboardDrilldown(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + + const [processing, setProcessing] = useState(true); + const [isDataFound, setisDataFound] = useState(false); + const [AllReports, setAllReports] = useState([]); + const [aggrData, setAggrData] = useState({}); + const [cols, setcols] = useState([]); + const [colWidth, setColWidth] = useState('100%'); + const [currentReportMenu, setCurrentReportMenu] = useState({}); + const [KPIId, setKPIId] = useState(""); + const [tabname, setTabName] = useState(""); + + const [modaldata, setModalData] = useState({colname: '', colValue:'', 'row':{}}); + + // modal + const [modalVisible, setModalVisible] = useState(false); + + const toggleModal = (colname, colValue, row) => { + setModalVisible(!modalVisible); + setModalData({colname:colname , colValue: colValue, row:row}) + }; + + const [designation, setDesignation] = useState(''); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let ReportMenu=params.ReportData || {}; + let AdKPIId=params.AdKPIId || ""; + let tabName = params?.tabName || ""; + let data = params?.data || []; + + + // console.log("ReportMenu",ReportMenu ,"AdKPIId",AdKPIId ,"tabName" , tabName , "data------ ", data[0]) + setTabName(tabName); + setCurrentReportMenu(ReportMenu); + setKPIId(AdKPIId); + getData(AdKPIId ,data); + + }, []); + + async function getData(AdKPIId ,data){ + setProcessing(true); + + try { + let {DashboardId,DashboardName,ParentId}=data[0] ; + db.transaction(async function (txn) { + // get data for report + let q=`Select * from Sup_MenuAppDashboard where ParentId='${DashboardId}' `; + console.log("Detailed reports q:",q); + txn.executeSql(q,[],async function (txn2, txnres2) { + console.log("Detailed reports count:",txnres2.rows.length); + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i 0) { + + let allCols = []; + let columnWidth = '50%'; + let keylen = Object.keys(allData[0] || {}).length; + for (let row of allData) { + let i = 0; + for (let key in row) { + if (i < keylen) { + let obj = { 'actual_colname': key }; + + + let colname = key.replace(/[$$]/g, ' ').replace(/Percent/g, '%'); + obj['colname'] = colname; + + + let dontShowCol = ( + colname === 'Srno' || + colname === 'AdKPIId' || + colname === 'Color' || + colname === 'DisplayOrder' || + colname === 'KPIDrilldown' + ); + + // Add unique columns to display + if (!dontShowCol && !allCols.some(col => col.actual_colname === key)) { + allCols.push(obj); + } + } + i++; + } + } + + + if (allCols.length > 0) { + let colLen = allCols.length; + columnWidth = (94 / colLen) + '%'; + } + + + let defData = { + "success": true, + "data": { + "report_data": allData, + "report_colWidth": columnWidth, + "report_cols": allCols + } + }; + + + setAllReports(defData?.data); + setProcessing(false); + setisDataFound(true); + } else { + notify(ST.Nodatafound); + setAllReports([]); + setProcessing(false); + setisDataFound(false); + } + } catch (err) { + console.error('Error fetching data:', err); + setAllReports([]); + setProcessing(false); + setisDataFound(false); + }} + + + async function DownloadReport(AdKPIId, data1){ + + let downloadKey = data1[0]?.DownloadKey; + + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url=props.baseurl+getMethodName(METHODS.DOWNLOADJSON_METHOD); + let data={ + Downloadtype:downloadKey, + Username: loginDetails.UserId, + Param1: AdKPIId, + Param2: '', + }; + + console.log(url,data); + return await getDownloadJson1(url,data) + .then(async(res)=>{ + if (res[downloadKey]) { + let data_arr = res[downloadKey] || []; + return data_arr; + } + else{ + return []; + } + }) + .catch((err)=>{ + console.log('onPage Team error',err); + return []; + }); + } + + + //end + + + function _renderTabularReport(){ + + let filtered_data=AllReports?.report_data?.length>0?AllReports?.report_data.filter(i=>i.AdKPIId==KPIId):[]; + + return ( + + + {/* render columns */} + + {/* render header */} + + {AllReports?.report_cols?.map((column,index)=>{ + return( + + {column.colname} + + ) + })} + + {/* render content */} + + + {filtered_data.map((row,row_index)=>{ + + return( + + {AllReports?.report_cols.map((column,index)=>{ + let colValue=row[column.actual_colname]!=null?row[column.actual_colname]:''; + + let color_obj=get_rowColSettings(colValue,column.actual_colname,row); + + let cust_style={},bg_style={}; + if(color_obj.color!=null && color_obj.color!=''){ + bg_style["backgroundColor"]=color_obj.color; + cust_style["color"]='#fff' + } + if(color_obj.fontsize!=null && color_obj.fontsize!=''){ + cust_style["fontSize"]=color_obj.fontsize + } + if(color_obj.bold==1){ + cust_style["fontWeight"]="600" + } + return( + toggleModal(column.colname,colValue, row)}> + {colValue} + + ) + })} + + ) + })} + + + + + + + ) + } + + function _renderDashboardReports(){ + return ( + + { + _renderTabularReport() + } + + ) + } + + const excludeKeys = ['AdKPIId']; + + return ( + + {processing && } + + + + + {currentReportMenu.KPI+' Detail'} + + + + { isDataFound==false && + + {ST.NoDataAvailable} + + } + + {isDataFound==true && + + {_renderDashboardReports()} + { + Alert.alert('Modal has been closed.'); + setModalVisible(!modalVisible); + }}> + + + + + setModalVisible(false)}> + {currentReportMenu.KPI+' Detail'} + + + + + {Object.entries(modaldata?.row) + .filter(([key]) => !excludeKeys.includes(key)) + .map(([key, value]) => ( + + {key}: + {value.toString()} + + ))} + + + + + + + + } + + + + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(DashboardDrilldown); + +const styles = StyleSheet.create({ +}) \ No newline at end of file diff --git a/src/screens/DashboardReportDetail.js b/src/screens/DashboardReportDetail.js new file mode 100644 index 0000000..3c71a22 --- /dev/null +++ b/src/screens/DashboardReportDetail.js @@ -0,0 +1,556 @@ + +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme , WP, HP} from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList,StyleSheet, Dimensions, Modal, Pressable} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,DownloadData, getDownloadJson1, get_rowColSettings} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl, db} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign, MaterialCommunityIcons, Feather} from '../components/icons'; +import { WebView } from 'react-native-webview'; +import CustomLoader from '../components/CustomLoader'; +import NoDataComponent from '../components/NoDataComponent'; +import LinearGradient from 'react-native-linear-gradient'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; +import { ProgressChart } from 'react-native-chart-kit'; +import cross_icon from '../assets/icons/crossmodal.svg'; +import { SvgXml } from 'react-native-svg'; + +function DashboardReportDetail(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const globalStyle=globalStyles(props.DarkMode,route.name); + + + const [processing, setProcessing] = useState(true); + const [isDataFound, setisDataFound] = useState(false); + const [AllReports, setAllReports] = useState([]); + const [aggrData, setAggrData] = useState({}); + const [cols, setcols] = useState([]); + const [colWidth, setColWidth] = useState('100%'); + const [currentReportMenu, setCurrentReportMenu] = useState({}); + const [KPIId, setKPIId] = useState(""); + const [modaldata, setModalData] = useState({colname: '', colValue:'', 'row':{}, item :{}}); + + // modal + const [modalVisible, setModalVisible] = useState(false); + const toggleModal = (colname, colValue, row , item) => { + setModalVisible(!modalVisible); + setModalData({colname:colname , colValue: colValue, row:row, item : item}) + }; + + const [designation, setDesignation] = useState(''); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let ReportMenu=params.ReportData || {}; + let AdKPIId=params.AdKPIId || ""; + + setCurrentReportMenu(ReportMenu); + setKPIId(AdKPIId); + getData(); + }, []); + + + async function getData(){ + try { + + db.transaction(async function (txn) { + // get data for report + let q=`Select * from Sup_MenuAppDashboard where DashboardSection ='DetailScreen' order by DisplayOrder`; + console.log("Dashboard Detailed reports q:",q); + txn.executeSql(q,[],async function (txn2, txnres2) { + console.log("Detailed reports count:",txnres2.rows.length); + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i item?.DashboardSection == "DetailScreen")?.map(item => item?.TabName)?.filter(tabName => tabName); + + + const uniqueTabs = [...new Set(mainScreenTabs)]; + + const tabs = uniqueTabs.map((tabName) => ({ + title: tabName, + // content: '' , + })); + + + const filteredData = AllReports?.filter((item) => item?.TabName?.includes(tabs[activeTab]?.title)); + + function _renderTabularReport(item, index ,filteredData){ + let report_key=item.DownloadKey; + let reportContentObj=props.AppDashboardReports!=null && typeof props.AppDashboardReports=='object' && props.AppDashboardReports[report_key]!=null && props.AppDashboardReports[report_key]!=''?props.AppDashboardReports[report_key]:{}; + + let tabName = item?.TabName || '' ; + // {"report_data":data_arr,"report_colWidth":columnWidth,"report_cols":allCols} + let report_data=reportContentObj['report_data']!=null?reportContentObj['report_data']:[]; + let report_colWidth=reportContentObj['report_colWidth']!=null?reportContentObj['report_colWidth']:'50%'; + let report_cols=reportContentObj['report_cols']!=null?reportContentObj['report_cols']:[]; + // console.log("report_cols:",report_cols); + + return ( + + {/* render No data */} + {report_data.length<=0 && No Data} + {report_data.length>0 && + {/* render columns */} + + {/* render header */} + + {report_cols.map((column,index)=>{ + return( + + {column.colname} + + ) + })} + + {/* render content */} + + + {report_data.map((row,row_index)=>{ + return( + {props.navigation.navigate("DashboardDrilldown",{"ReportData":row,"AdKPIId":row["AdKPIId"] , "tabName" : tabName , "data" : filteredData})}} + > + {report_cols.map((column,index)=>{ + let colValue=row[column.actual_colname]!=null?row[column.actual_colname]:''; + + let color_obj=get_rowColSettings(colValue,column.actual_colname,row); + + let cust_style={},bg_style={}; + if(color_obj.color!=null && color_obj.color!=''){ + bg_style["backgroundColor"]=color_obj.color; + cust_style["color"]='#fff' + } + if(color_obj.fontsize!=null && color_obj.fontsize!=''){ + cust_style["fontSize"]=color_obj.fontsize + } + if(color_obj.bold==1){ + cust_style["fontWeight"]="600" + } + + return( + toggleModal(column.colname,colValue, row , item)} + onPress={()=>{props.navigation.navigate("DashboardDrilldown",{"ReportData":row,"AdKPIId":row["AdKPIId"] , "tabName" : tabName , "data" : filteredData})}} + > + {colValue} + + ) + })} + + ) + })} + + + + + } + + ) + } + + + function _renderCardReport(item,index, filteredData){ + + let tabName = item?.TabName || '' ; + + let report_key=item.DownloadKey; + let reportContentObj=props.AppDashboardReports!=null && typeof props.AppDashboardReports=='object' && props.AppDashboardReports[report_key]!=null && props.AppDashboardReports[report_key]!=''?props.AppDashboardReports[report_key]:{}; + // {"report_data":data_arr,"report_colWidth":columnWidth,"report_cols":allCols} + let report_data=reportContentObj['report_data']!=null?reportContentObj['report_data']:[]; + let report_colWidth=reportContentObj['report_colWidth']!=null?reportContentObj['report_colWidth']:'50%'; + let report_cols=reportContentObj['report_cols']!=null?reportContentObj['report_cols']:[]; + let ShowGraph = item?.ShowGraph ; + let isLastItem = report_data.length % 2 !== 0 && index == report_data.length - 1; + console.log(isLastItem,"isLastItem", report_data) + + const renderItemcardNew = (item, index, tabName, ShowGraph, isLastItem, isOdd) => { + let gset_obj = item["Color"] != null && item["Color"] !== '' ? item["Color"] : {}; + + const chartConfig = { + backgroundGradientFrom: "#fff", + backgroundGradientTo: "#fff", + color: (opacity = 1, dataIndex) => { + // If there's a color available for the current dataIndex, use it, else set it transparent + const color = gset_obj; // Get the color based on index + return color ? `${color}${Math?.floor(opacity * 255)?.toString(16)?.padStart(2, '0')}` : `rgba(255, 255, 255, 0)`; + }, + strokeWidth: 2, + barPercentage: 0.5, + useShadowColorFromDataset: false , + }; + + let label=[]; + let labelVal=[]; + let barColor=[]; + + label.push(item?.KPI); + let percentage = item?.PER?.replace('%', ''); + + if(percentage > 100) { + labelVal.push(parseFloat(100) / 100); + } else { + labelVal.push(parseFloat(item?.PER) / 100); + } + + barColor.push(() => item?.Color); + + let showgraph = ShowGraph ? ShowGraph : false; + // let itemStyle = isOdd && isLastItem ? { flex: 0.98, marginLeft: 'auto', marginRight: 'auto', width: '95%' } : { flex: 0}; + + return( + { + props.navigation.navigate("DashboardDrilldown", { + "ReportData": item, + "AdKPIId": item["AdKPIId"], + "tabName" : tabName, + "data" : filteredData + }); + }} + > + + + + + + {item?.KPI != null && item?.KPI != undefined && {item?.KPI}} + + {item.KPIDrilldown && } + + + {item?.TGT != null && item?.TGT != undefined && + + Target: + {item?.TGT} + + } + + {item?.ACT != null && item?.ACT != undefined && ( + !showgraph ? ( + + + {item?.ACT} + Achievement + + + {item?.PER} + + + ) : ( + + + {item?.ACT} + Achievement + + + + + {item?.PER} + + + + ) + )} + + + + + ) + } + + + return ( + + {/* render No data */} + {report_data.length<=0 && No Data} + {report_data.length>0 && + + {/* render content */} + + renderItemcardNew(item, index, tabName , ShowGraph,index === report_data.length - 1,report_data.length % 2 !== 0 )} + ItemSeparatorComponent={ + } + keyExtractor={(item, index) => index.toString()} + numColumns={2} + columnWrapperStyle={{ + justifyContent: 'space-between' + }} + contentContainerStyle={{ marginHorizontal: 0 }} + /> + + + } + + ) + } + + const renderItem = ( item, index , filteredData) => { + + return ( + + + {item.DashboardName} + + {/* Render attendance data separately */} + {/* isAttendance == true && _renderAttendanceReport(item) */} + + {/* Render custom view for Attendance reports */} + {item.DashboardType === 'Card' && _renderCardReport(item,index,filteredData)} + + {item.DashboardType === 'Tabular' && _renderTabularReport(item,index,filteredData)} + + {/* Uncomment if needed */} + {/* {item.DrillDown && + { }}> + + } */} + + + ); + }; + + const excludeKeys = ['AdKPIId', 'Color', 'KPIDrilldown', 'DisplayOrder']; + + return ( + + {processing && } + + + + {!isDataFound && } + + + + {/* Custom Tab Bar */} + + {tabs.map((tab, index) => ( + setActiveTab(index)} + > + + {tab.title} + + + ))} + + + {/* Screen Content */} + + renderItem(item, index, filteredData)} + keyExtractor={(item, index) => index.toString()} + contentContainerStyle={{ paddingBottom: 0 }} + /> + + + + + { + Alert.alert('Modal has been closed.'); + setModalVisible(!modalVisible); + }}> + + + + + setModalVisible(false)}> + {modaldata?.item.DashboardName+' Detail'} + + + + + {Object.entries(modaldata?.row) + .filter(([key]) => !excludeKeys.includes(key)) // Filter out excluded keys + .map(([key, value]) => ( + + {key}: + {value.toString()} + + ))} + + + + + + + + + + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(DashboardReportDetail); + +const styles = StyleSheet.create({ + container: { + backgroundColor: '#F5F5F5', + }, + tabBar: { + flexDirection: 'row', + justifyContent: 'space-around', + backgroundColor: '#b1e4de', + paddingVertical:10 + }, + tabButton: { + paddingHorizontal: 30, + paddingVertical:10, + + }, + tabText: { + fontSize: 16, + color: '#000', + }, + // activeTab: { + // borderBottomWidth: 4, + // borderBottomColor: '#00968e', + // }, + // activeTabText: { + // color: '#00968e', + // }, + + activeTab: { + borderWidth: 2, + borderColor: '#00968e', + borderRadius : 5, + backgroundColor: '#00968e', + + }, + activeTabText: { + color: '#FFF', + }, + inActiveTab: { + borderWidth: 2, + borderColor: '#00968e', + borderRadius : 5, + backgroundColor: 'transparent' + }, + inActiveTabText: { + color: '#000', + }, + //KPI's + + listContainer: { + paddingHorizontal: 20, + paddingVertical: 10, + }, + itemContainer: { + borderBottomWidth: 1, + borderBottomColor: '#ccc', + paddingVertical: 15, + }, + row: { + flexDirection: 'row', + justifyContent: 'space-between', + }, + kpiTitle: { + fontWeight: 'bold', + fontSize: 16, + flex: 1, + }, + value: { + fontSize: 16, + flex: 0.5, + textAlign: 'right', + }, + //header + headerContainer: { + borderBottomWidth: 2, + borderBottomColor: '#000', + paddingVertical: 10, + }, + headerText: { + fontWeight: 'bold', + fontSize: 16, + flex: 1, + textAlign: 'center', + }, + chartContainer: { + position: 'relative', + alignItems: 'center', + marginTop:10 + }, + percentageContainer: { + position: 'absolute', + top: '50%', + left: '50%', + transform: [{ translateX: -18 }, { translateY: -12 }], + }, +}) \ No newline at end of file diff --git a/src/screens/DistributorList.js b/src/screens/DistributorList.js new file mode 100644 index 0000000..e88089f --- /dev/null +++ b/src/screens/DistributorList.js @@ -0,0 +1,1549 @@ +import React,{useState,useEffect, memo} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,TouchableHighlight,Platform,PermissionsAndroid,FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,AddStore, checkRange, UploadData2, UploadData, UpdateDistributorStatus, getKPIS, marktext1, marktext2, UploadFormData} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, AppVersion} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign, Entypo, EvilIcons, Feather, FontAwesome, Fontisto, Ionicons, MaterialCommunityIcons} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import NoDataComponent from '../components/NoDataComponent'; +import {SvgXml} from 'react-native-svg'; +import MapIcon from '../assets/performics/map_icon.svg'; +import CustomModal from '../components/CustomModal'; +import { AppTables } from '../constants/tableConstants'; +import { _checkLocationPermission } from '../components/geolocation'; +import Geolocation from 'react-native-geolocation-service'; +import { getAvailblQuery, getIfAvlbl, getIfKPIDone, getQuery, Q_getMyDistributorList, Q_getMyStoresList, Q_DBMenuList } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; +import { uploadAll_DBData, uploadAllImages, uploadDBStatus } from '../constants/uploadData'; +import { PrimaryTheme } from '../styles/Themes'; +import NetworkStatusBar from '../components/NetworkStatusBar'; +import * as RNFS from 'react-native-fs'; + +import CameraImg2 from '../assets/performics/camera_icon.svg'; +import CustomCamera from '../components/Camera'; +import HeaderTabs from '../components/HeaderTabsTeam'; +import DownloadDataModal from '../components/downloadDataModal'; + + + +const DistributorItem=memo((props)=>{ + const route = useRoute(); + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const item=props.item; + + const ST=props.StaticText || {}; + + async function get_to_store_details(data){ + + if(data.UploadStatus=='U'){ + notify('All data already uploaded for the distributor'); + } + else if(data.UploadStatus=='L'){ + notify('Already marked not working reasons for the distributor'); + } + else if(data.UploadStatus=='I'){ + let MenuListLen=data.MenuListLen; + console.log('menuList length:',MenuListLen); + if(MenuListLen>0) + { + props.set_autoback({'AutoGoToPrev':false}); + props.navigation.navigate('DB_StoreDailyMenu',{storeData:data}); + }else{ + notify("No menu map for this distributor!"); + } + + } + else if(data.UploadStatus=='C'){ + notify(ST.Alreadycheckedout); + } + else if(data.UploadStatus=='D'){ + notify(ST.Dataalreadyuploaded); + } + else if(data.UploadStatus=='P'){ + notify(ST.Datapartiallyuploaded); + } + else if(data.UploadStatus=='N' || data.UploadStatus==''){ + let isChcekedIn=await checkIfAlreadyCheckdIn(); + console.log('isChcekedIn',isChcekedIn); + if(isChcekedIn==true){ + notify('You have already checked in into other distributor','LONG'); + } + else{ + props.setShowStoreVisitModal(true); + props.setCurrentStore(data); + } + } + + } + + async function AskForCancelCheckin(data){ + props.setCancelCheckOutStore(data); + props.setShowCancelCIModal(true); + } + + + + async function checkIfAlreadyCheckdIn(){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let join=`INNER JOIN ${AppTables.DISTRIBUTOR_CHECKIN} t2 on t2.DISTRIBUTOR_ID=t1.DistributorId `; + let q=`Select t1.* from Sup_MasterDistributor t1 ${join} where t2.VISIT_DATE='${d2}' and t1.UploadStatus='I'` + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + // show from local + resolve(true); + } + else{ + resolve(false); + } + },function(Etxn,txnerr){console.log(txnerr);resolve(false); }); + + }); + + }).then((val)=>{ + return val; + }).catch((err)=>{ + return false; + }); + } + + return( + {get_to_store_details(item)}}> + + + + {item.StoreName} + + + + + + {'Distributor Id:'} + {item.StoreId} + + + + + {'Distributor Code:'} + {item.StoreCode} + + + + { + (item.CheckInTime!=null && item.CheckInTime!='') && + + + + {ST.CheckIn+':'} + + {item.CheckInTime} + + {(item.CheckOutTime!=null && item.CheckOutTime!='') && + + {ST.CheckOut+':'} + {item.CheckOutTime} + + } + + } + { (item.UploadStatus!=null && item.UploadStatus!='' && item.UploadStatus!='N') && + + + + {/* {item.UploadStatus!=null && (item.UploadStatus=='I' || item.UploadStatus=='L') && + {AskForCancelCheckin(item)}}> + {item.UploadStatus=='L' ? :} + {item.UploadStatus=='L' ? {ST.NotWorking}:{ST.CheckedIn}} + + + + + } */} + {/* {item.UploadStatus!=null && item.UploadStatus=='I' && + + + Checked In + } */} + {item.UploadStatus!=null && item.UploadStatus=='L' && + + + {ST.NotWorking} + } + {item.UploadStatus!=null && item.UploadStatus=='I' && + + + {ST.CheckedIn} + } + {item.UploadStatus!=null && item.UploadStatus=='C' && + + + {ST.CheckedOut} + } + {item.UploadStatus!=null && item.UploadStatus=='P' && + + + {ST.PartiallyUploaded} + } + {item.UploadStatus!=null && item.UploadStatus=='D' && + + + {ST.DataUploaded} + } + {item.UploadStatus!=null && item.UploadStatus=='U' && + + + {ST.Uploaded} + } + + + { item.allDone==true && (item.UploadStatus=='I') && + {props.onCheckOut?props.onCheckOut(item):'';}}> + {ST.CheckOut} + + } + + } + + { item.GeoTag=='Y' && + {props.navigation.navigate('ShowMap',{storeData:item})}} > + + + } + { item.GeoTag=='N' && + {}} > + + + } + + + ); +}); + +function DistributorList(props) { + const route = useRoute(); + + const ST=props.StaticText || {}; + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const [loaderTitle, setLoaderTitle] = useState(); + const [processing, setProcessing] = useState((props.isDataDownloaded?true:false)); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [nodataFound, setNodataFound] = useState(false); + const [showStoreVisitModal, setShowStoreVisitModal] = useState(false); + const [showGeoTagModal, setShowGeoTagModal] = useState(false); + const [showDistanceModal, setShowDistanceModal] = useState(false); + const [currentStore, setCurrentStore] = useState({}); + const [storeDistance, setStoreDistance] = useState('0 M'); + const [storeDistanceinM, setStoreDistanceinM] = useState(0); + const [showAlert, setShowAlert] = useState(false); + const [checkOutStore,setCheckOutStore]=useState({}); + const [rerenderdata, setrerenderdata]= useState(false); + let [state, setState] = useState({storeList:[]}); + const [globalStorelist, setGlobalStorelist] = useState([]); + const [cancelCheckOutStore,setCancelCheckOutStore]=useState({}); + const [showCancelCIModal, setShowCancelCIModal]= useState(false); + const [searchedItem, setSearchedItem]= useState(''); + + + const [CheckOutImage, setCheckOutImage] = useState(''); + const [CheckOutImagePath, setCheckOutImagePath] = useState(''); + const [CheckOutImageModal, setCheckOutImageModal] = useState(false); + const [CheckOutLoc, setCheckOutLoc] = useState({}); + const [showImageSaveOp, setShowImageSaveOp] = useState(true); + const [showCamera, setShowCamera] = useState(false); + const [DBCO_GeoFenceEnable, setDBCO_GeoFenceEnable] = useState(false); + const [DBCO_GeoFenceRadius, setDBCO_GeoFenceRadius] = useState(''); + + + const [uploadedCount, setUploadedCount] = useState(0); + const [TotalUpCount, setTotalUpCount] = useState(0); + const [startUploading, setStartUploading] = useState(false); + const [UploadingSubText, setUploadingSubText] = useState(""); + const [UploadingText, setUploadingText] = useState("Uploading Data..."); + const [showProgresssBar, setshowProgresssBar] = useState(false); + + + + useEffect(() => { + setLoaderTitle(ST.Loading+'...'); + + console.log('props.isDataDownloaded in storelist:',props.isDataDownloaded); + + let CO_GeoFenceEnable=props.DBCO_GeoFenceEnable!=null?props.DBCO_GeoFenceEnable:false; + let CO_GeoFenceRadius=props.DBCO_GeoFenceRadius!=null?props.DBCO_GeoFenceRadius:''; + setDBCO_GeoFenceEnable(CO_GeoFenceEnable); + setDBCO_GeoFenceRadius(CO_GeoFenceRadius); + + getData(); + + const unsubscribe=props.navigation.addListener('beforeRemove', onBeforeRemove); + + const unsubscribeFocus=props.navigation.addListener('focus', () => { + checkLocalData(); + }); + + return function cleanup() { + unsubscribeFocus(); + return unsubscribe; + }; + }, []); + + useEffect(() => { + const unsubscribe=props.navigation.addListener('beforeRemove', onBeforeRemove); + return unsubscribe; + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + return; + } + } + + + + async function calLocatDistance(){ + if(currentStore.Latitude !='' && currentStore.Latitude!=null){ + const hasPermission=await _checkLocationPermission(); + if(hasPermission==true) + { + Geolocation.getCurrentPosition( + async (position) => { + let loc={lat:position.coords.latitude,lng:position.coords.longitude}; + + var distance = checkRange(loc.lat,loc.lng,currentStore.Latitude,currentStore.Longitude); + // console.log('distance:',distance); + let dinKM=(distance / 1000); + let distanceinM=(distance=='' || distance==null || isNaN(distance))?' 0 m':( dinKM > 1 ? dinKM.toFixed(1) + ' Km' : distance + ' m'); + setStoreDistance(distanceinM); + setStoreDistanceinM(distance); + + if(props.DBCI_GeoFenceEnable==true && distance>props.DBCI_GeoFenceRadius){ + setShowDistanceModal(true); + } + else{ + props.navigation.navigate('DistributorCheckIn',{storeData:currentStore}); + } + }, + (error) => { + notify(ST.Cannotgetuserposition); + }, + { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + ); + } + else{ + notify(ST.Pleaseallowlocationpermission); + } + } + else{ + notify(ST.Storelocationnotavailable); + } + + } + + + async function getData(){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + + let token=await get_item('loginToken'); + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + // let params=props.route.params? props.route.params:{}; + + // let myDistributorsListQ=await Q_getMyDistributorList(props); + // console.log('myDistributorsListQ:',myDistributorsListQ); + + let checkInData=await checkIfCheckInAvlbl(); + console.log('checkInData',checkInData); + if(checkInData!=null && checkInData.DistributorId!=null && checkInData.IsCheckInAvlbl==0){ + await restoreCheckIn(checkInData); + } + + checkLocalData(); + } + + + + async function checkLocalData(){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + + let token=await get_item('loginToken'); + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + // let params=props.route.params? props.route.params:{}; + + let myDistributorsListQ=await Q_getMyDistributorList(props); + console.log('myDistributorsListQ:',myDistributorsListQ); + + + await db.transaction(async function (txn) { + await txn.executeSql(myDistributorsListQ,[],async function (txn2, txnres2) { + console.log('distr:',txnres2.rows.length); + if(txnres2.rows.length>0){ + // show from local + var storeArr=[]; + for(var i=0;i{ + db.transaction(async function (txn) { + + let join=`LEFT OUTER JOIN ${AppTables.DISTRIBUTOR_CHECKIN} t2 on t2.DISTRIBUTOR_ID=t1.DistributorId and t2.VISIT_DATE='${d2}' `; + let q=`Select t1.*,(CASE WHEN t2.DISTRIBUTOR_ID is null THEN 0 ELSE 1 END ) as IsCheckInAvlbl from Sup_MasterDistributor t1 ${join} where t1.UploadStatus='I'` + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + // show from local + let data =txnres2.rows.item(0); + let {DistributorId}=data; + console.log('data:',data); + resolve(data); + } + else{ + resolve({}); + } + },function(Etxn,txnerr){console.log(txnerr);resolve({}); }); + + }); + + }).then((val)=>{ + return val; + }).catch((err)=>{ + return {}; + }); + } + + async function restoreCheckIn(item){ + console.log('restoreCheckIn'); + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let {DistributorId,DMID,Latitude, Longitude,UploadStatus,InTime,OutTime}=item; + let JcpType='Sup_MasterDistributor'; + + let In_Time=(InTime!='' && InTime!=null && InTime!='00:00:00' && InTime!='00:00')?moment(d2+' '+InTime).format('MM/DD/YYYY HH:mm:ss'):''; + let Out_Time=(OutTime!='' && OutTime!=null && OutTime!='00:00:00' && OutTime!='00:00')?moment(d2+' '+OutTime).format('MM/DD/YYYY HH:mm:ss'):''; + let CHECKOUT_TIME=(Out_Time!='' && Out_Time!=null)?Out_Time:In_Time; + + + // add storeCheckin data + let q2=`delete from ${AppTables.DISTRIBUTOR_CHECKIN} where DISTRIBUTOR_ID='${DistributorId}' and VISIT_DATE='${d2}' `; + let values2=` ('${DistributorId}','${d2}','${Latitude}','${Longitude}','${In_Time}','','${Out_Time}','','','${d2}')`; + let insert_q2=` INSERT INTO ${AppTables.DISTRIBUTOR_CHECKIN}(DISTRIBUTOR_ID,VISIT_DATE,LATITUDE,LONGITUDE,CHECKIN_TIME,CHECKIN_IMAGE,CHECKOUT_TIME,CHECKOUT_IMAGE,REMARK,ADDED_DATE) values ${values2}`; + + await txn.executeSql(q2,[],async function (txn2, txnres4) { + console.log('removed'); + await txn.executeSql(insert_q2,[],async function (txn2, txnres5) { + console.log('checkin data added'); + resolve(true); + },function(Etxn,txnerr){console.log(txnerr);resolve(false);}); + },function(Etxn,txnerr){console.log(txnerr);resolve(false);}); + + }); + + }).then((val)=>{ + return val; + }).catch((err)=>{ + return false; + }); + } + + async function getDailyMenu(storeData1){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let {StoreId,ChannelId,RegionId,StoreTypeId}=storeData1; + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q=Q_DBMenuList(storeData1); + await txn.executeSql(q,[],async function (txn2, txnres) { + + if(txnres.rows.length>0){ + let allDone=true; + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + + } + + async function getMenuList(storeData1){ + return new Promise((resolve,reject)=>{ + + db.transaction(async function (txn) { + let q=Q_DBMenuList(storeData1); + + await txn.executeSql(q,[],async function (txn2, txnres) { + + if(txnres.rows.length>0){ + let arr=[];//txnres.rows.raw(); + // resolve(arr); + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log('') + return [] + }) + } + + + + + async function checkAvailability(storeData1,data){ + + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q2=getAvailblQuery(data.ScreenName,storeData1); + if(q2!='' && q2!=null){ + + await txn.executeSql(q2,[],async function (txn2, txnres2) { + let isAvlbl=getIfAvlbl(data.ScreenName,txnres2,storeData1); + resolve(isAvlbl); + },function (txnE,txnerr) { console.log(txnerr); resolve(false);},); + } + else{ + let isAvlbl=getIfAvlbl(data.ScreenName,{},storeData1); + resolve(isAvlbl); + } + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + } + + + async function updateStatus(storeData1,data,isAvlbl){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q2=getQuery(data.ScreenName,storeData1); + if(q2!='' && q2!=null && isAvlbl==true){ + await txn.executeSql(q2,[],async function (txn2, txnres2) { + let isDone=await getIfKPIDone(data.ScreenName,txnres2,storeData1); + resolve(isDone); + + },function (txnE,txnerr) { console.log(txnerr); resolve(false);},); + } + else{ + resolve(false); + } + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + + } + + async function onCheckOut(storeData1){ + // let isAlldone=await getDailyMenu(storeData1); + if(storeData1.allDone==true){ + setCheckOutStore(storeData1); + setShowAlert(true); + } + else{ + notify(ST.PleasefillallKPI,false); + } + } + + function onSaveCancel(){ + setShowAlert(false); + } + + + + + async function getLocOnCheckout(){ + setShowAlert(false); + setLoaderTitle(ST.Gettinglocation+'...'); + setProcessing(true); + + Geolocation.getCurrentPosition( + async (position) => { + let {latitude,longitude} = position.coords; + let loc={lat:latitude,lng:longitude}; + var distance = checkRange(loc.lat,loc.lng,checkOutStore.Latitude,checkOutStore.Longitude); + // console.log('COut distance:',distance); + setProcessing(false); + // let dinKM=(distance / 1000); + // let distanceinM=(distance=='' || distance==null || isNaN(distance))?' 0 m':( dinKM > 1 ? dinKM.toFixed(1) + ' Km' : distance + ' m'); + if(DBCO_GeoFenceEnable==true){ + if(DBCO_GeoFenceRadius!='' && distance>DBCO_GeoFenceRadius){ + notify('You cannot checkout! You are not within the allowed distance from the distributor '+DBCO_GeoFenceRadius+' m') + } + else{ + checkOutAfterLoc(loc); + } + } + else{ + checkOutAfterLoc(loc); + } + + }, + (error) => { + notify(ST.Cannotgetuserposition); + setProcessing(false); + }, + { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + ); + } + + async function checkOutAfterLoc(loc){ + let CheckOut_PhotoReq=props.CheckOut_PhotoReq!=null?props.CheckOut_PhotoReq:false; + if(CheckOut_PhotoReq){ + setCheckOutLoc(loc); + setShowAlert(false); + setCheckOutImageModal(true); + } + else{ + UpdateCheckOutStatus(loc); + } + } + + async function UpdateCheckOutStatus(loc){ + + // setLoaderTitle(ST.UpdatingCheckoutStatus+'...'); + // setProcessing(true); + setTotalUpCount(0); + setshowProgresssBar(false); + setUploadingText(ST.UpdatingCheckoutStatus+'...'); + setStartUploading(true); + let {StoreId,MID}=checkOutStore; + let CheckOut_PhotoReq=props.CheckOut_PhotoReq!=null?props.CheckOut_PhotoReq:false; + let d=new Date(); + let d2=moment(d).format('MM/DD/YYYY'); + let d3=moment(d).format('MM/DD/YYYY HH:mm:ss'); + + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + + let data1={ + "UserId": loginDetails.UserId, + "DistributorId": StoreId, + "VisitDate": d2, + "CheckOutImage":CheckOut_PhotoReq==true?CheckOutImage:'', + } + + // let fpath=Platform.OS=='ios'?CheckOutImagePath.replace('file://',''):CheckOutImagePath; + var data2 = new FormData(); + data2.append('file', { + uri: CheckOutImagePath , + type: 'image/jpg', + name: CheckOutImage, + }); + + let foldername=getFolderName(CheckOutImage); + data2.append('Foldername','DBCoverageImages'); + data2.append('Path', d2); + + const url=props.baseurl+getMethodName(METHODS.DISTRIBUTOR_CHECKOUT_SUP); + const url1=(props.imageUploadUrl || URL_IMAGE)+getMethodName(METHODS.UPLOADIMAGES_METHOD); + console.log(url,data1); + await UploadData2(url,data1) + .then(async(res)=>{ + console.log('DB CheckOutSup1:',res,'MID:',MID); + if(!res.error){ + if(res==1){ + //Check out completed + if(CheckOut_PhotoReq){ + //Upload Image + await UploadFormData(url1,data2) + .then(async(res1)=>{ + console.log('checkout image upload:',res1); + }) + .catch((err)=>{ + console.log(err); + }); + } + + + let data={checkout_image:''} ; + const isCheckOutUpdated=await UpdateStoreCheckOut(data); + + if(isCheckOutUpdated==true){ + let datan={StoreId:StoreId,UploadStatus:'C',tbname:'Sup_MasterDistributor'} ; + const isUpdated=await UpdateDistributorStatus(props,datan); + if(isUpdated==true){ + let outtime=moment(d).format('HH:mm:ss'); ; + await UpdateDistributorStatuslocal('C',checkOutStore,false,true,outtime); + // setLoaderTitle(ST.UploadingData+'...'); + UploadOnCheckOut(loc); + } + else{ + // setProcessing(false); + setStartUploading(false); + notify(ST.Erroroccurwhilecheckout,'LONG'); + } + } + else{ + setStartUploading(false); + notify(ST.Erroroccurwhilecheckout,'LONG'); + } + + } + else{ + setStartUploading(false); + notify(ST.Somethingwentwrong,'SHORT'); + // setProcessing(false); + } + } + else{ + setStartUploading(false); + notify(ST.Somethingwentwrong,'SHORT'); + // setProcessing(false); + } + }) + .catch((err)=>{ + console.log('onPage Team error',err); + notify(ST.Somethingwentwrong,'SHORT'); + // setProcessing(false); + setStartUploading(false); + }); + + + } + async function UpdateDistributorStatuslocal(status,storeData1,updateCheckin=false,uCOut=false,cout_time=''){ + + let storeArr=state.storeList; + let sdata_index=storeArr.findIndex(i=>i.StoreId==storeData1.StoreId); + if(sdata_index>=0){ + let sdata=storeArr[sdata_index]; + sdata['UploadStatus']=status; + if(updateCheckin==true){ + sdata['CheckInTime']=''; + } + if(uCOut==true){ + sdata['CheckOutTime']=cout_time; + } + storeArr[sdata_index]=sdata; + setState({...state,storeArr}); + setGlobalStorelist(storeArr); + setrerenderdata(!rerenderdata); + } + } + + async function UpdateUploadCountLocal(upCount){ + // keep 1 less to actual count as DownloadDataModal shows it as provided_value+1 + setUploadedCount(upCount-1); + + } + + async function UpdateStoreCheckOut(data) { + let CheckOut_PhotoReq=props.CheckOut_PhotoReq!=null?props.CheckOut_PhotoReq:false; + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let now=moment(d1).format('MM/DD/YYYY HH:mm:ss'); + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let q=`UPDATE ${AppTables.DISTRIBUTOR_CHECKIN} SET CHECKOUT_TIME='${now}', CHECKOUT_IMAGE='${CheckOut_PhotoReq?CheckOutImage:''}' WHERE DISTRIBUTOR_ID='${checkOutStore.StoreId}' and VISIT_DATE='${d2}' `; + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('store checkout updated'); + resolve(true); + },function(Etxn,txnerr){console.log(txnerr);resolve(false);}); + + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + + + } + + + async function UploadOnCheckOut(loc){ + try { + console.log('UploadOnCheckOut'); + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let token = await get_item('loginToken'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + + let AllStores=await getPJPStoresData('Sup_MasterDistributor',[],d2); + + + await db.transaction(async function (txn) { + console.log('stores to upload:',AllStores.length); + if(AllStores.length>0){ + for (var i=0;i0){ + await UploadDataWithImages(index,AllStores,data,MenuList,allKPIs,JCP_TYPE,allFilesToUpload,loc); + } + else{ + notify(ST.Alldatauploadedfor+' '+StoreName,'SHORT'); + if(index==AllStores.length-1){ + // setProcessing(false); + setStartUploading(false); + } + } + } + else if(UploadStatus=='P'){ + setTotalUpCount(totalUpC); + setshowProgresssBar(true); + setUploadingText(ST.UploadingData+'...'); + await uploadAfter_P_status(index,AllStores,data,MenuList,allKPIs,JCP_TYPE,loc); + } + else if(UploadStatus=='L'){ + setshowProgresssBar(false); + setUploadingText(ST.UploadingData+'...'); + let isAllUploaded_S=await uploadDBStatus(props,data,'U',JCP_TYPE,loc); + if(isAllUploaded_S==true){ + await UpdateDistributorStatuslocal('U',data); + notify(ST.Alldatauploadedfor+' '+StoreName,'SHORT'); + if(index==AllStores.length-1){ + // setProcessing(false); + setStartUploading(false); + } + } + else{ + if(index==AllStores.length-1){ + // setProcessing(false); + setStartUploading(false); + notify(ST.Erroroccurwhileuploadingdata,'LONG'); + } + } + } + else{ + console.log("No UploadStatus case found while uploading Distributor"); + } + } + + } + }); + + + + } catch (err) { + console.log(err); + } + } + + async function uploadAfter_P_status(index,AllStores,data,MenuList,allKPIs,JCP_TYPE,loc){ + let {StoreName}=data; + if(MenuList.length>0){ + // Upload data with Images + let allFilesToUpload=await uploadAll_DBData(props,data,allKPIs,props.UserId,JCP_TYPE,true,loc,UpdateUploadCountLocal); + console.log('allFilesToUpload:',allFilesToUpload.length); + await UpdateDistributorStatuslocal('D',data); + UploadDataWithImages(index,AllStores,data,MenuList,allKPIs,JCP_TYPE,allFilesToUpload,loc); + } + else{ + // Upload status u if no data exists + let isAllUploaded_S=await uploadDBStatus(props,data,'U',JCP_TYPE,loc); + if(isAllUploaded_S==true){ + await UpdateDistributorStatuslocal('U',data); + notify(ST.Alldatauploadedfor+' '+StoreName,'SHORT'); + if(index==AllStores.length-1){ + // setProcessing(false); + setStartUploading(false); + } + } + else{ + if(index==AllStores.length-1){ + // setProcessing(false); + setStartUploading(false); + notify(ST.Erroroccurwhileuploadingdata,'LONG'); + } + } + } + } + + async function UploadDataWithImages(index,AllStores,data,MenuList,allKPIs,JCP_TYPE,allFilesToUpload,loc){ + let {StoreName}=data; + if(allFilesToUpload.length>0){ + // setLoaderTitle(ST.UploadingImages+'...'); + // console.log('set loader title'); + setUploadedCount(0); + setTotalUpCount(allFilesToUpload.length-1); + setshowProgresssBar(true); + setUploadingText(ST.UploadingImages+'...'); + let isAllUploaded=await uploadAllImages(props,data,allFilesToUpload,JCP_TYPE,loc,UpdateUploadCountLocal); + + if(isAllUploaded==true){ + await UpdateDistributorStatuslocal('U',data); + notify(ST.Alldataandimagesuploadedfor+' '+StoreName,'SHORT'); + if(index==AllStores.length-1){ + // setProcessing(false); + setStartUploading(false); + } + }else{ + notify(ST.Cannotuploadimagesfor+' '+StoreName,'SHORT'); + if(index==AllStores.length-1){ + // setProcessing(false); + setStartUploading(false); + } + } + } + else{ + let isupdatedU=await uploadDBStatus(props,data,'U',JCP_TYPE,loc); + console.log('on no files found to upload , isupdated::',isupdatedU); + if(isupdatedU){ + await UpdateDistributorStatuslocal('U',data); + notify(ST.Alldatauploadedfor+' '+StoreName,'SHORT'); + } + if(index==AllStores.length-1){ + // setProcessing(false); + setStartUploading(false); + } + } + } + + + + async function getPJPStoresData(tbname,Stores=[],d2){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let join=`INNER JOIN ${AppTables.DISTRIBUTOR_CHECKIN} t2 on t2.DISTRIBUTOR_ID=t1.DistributorId `; + await txn.executeSql(`Select t1.DMID as MID,t1.EmpId,t1.DistributorId as StoreId,t1.DistributorName as StoreName,t1.DistributorCode as StoreCode,t1.Latitude,t1.Longitude,t1.InTime,t1.OutTime,t1.UploadStatus,t1.GeoTag,'Sup_MasterDistributor' as JCP_TYPE,t2.CHECKIN_IMAGE from ${tbname} t1 ${join} where t2.VISIT_DATE='${d2}' and t1.UploadStatus in ('C','P','D','L')`,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + + for(var i=0;i{ + return val; + }) + .catch((err)=>{ + console.log(err); + return Stores; + }) + } + + + + + async function storeVisited(){ + console.log('isgeotag:',currentStore.GeoTag); + setShowStoreVisitModal(false); + if(currentStore.GeoTag=='N'){ + setShowGeoTagModal(true); + } + else if(currentStore.UploadStatus=='N' || currentStore.UploadStatus==''){ + calLocatDistance(); + } + else{ + + } + } + + async function storeNotVisited(){ + setShowStoreVisitModal(false); + props.navigation.navigate('DBNonWorkingReasons',{storeData:currentStore}); + } + + async function onVisitCancel(){ + setLoaderTitle(ST.DeletingCheckInData+'...') + setShowCancelCIModal(false); + setProcessing(true); + let {MID,StoreId}=cancelCheckOutStore; + let postdata={'Mid':MID,"UserName":props.UserId,} + + const url=props.baseurl+getMethodName(METHODS.DELETECOVERAGE_METHOD); + console.log(url,postdata); + await UploadData2(url,postdata) + .then(async(res)=>{ + console.log('delete coverage res:',res); + if(res=='1'){ + let isdeleted=await deleteStore(cancelCheckOutStore); + if(isdeleted==true){ + let data={"StoreId":StoreId,UploadStatus:"N",tbname:'Sup_MasterDistributor'}; + let isUpdated=await UpdateDistributorStatus(props,data); + if(isUpdated==true){ + await UpdateDistributorStatuslocal('N',cancelCheckOutStore,true); + setProcessing(false); + notify(ST.CheckInRemoved); + } + else{ + setProcessing(false); + notify(ST.CheckInremovedsuccessfullybutcannotupdatestatus); + } + } + else{ + setProcessing(false); + notify(ST.CheckInremovedsuccessfullybutcannotupdatestatus); + } + } + else{ + setProcessing(false); + notify(ST.CannotRemoveCheckIn); + } + + }).catch(err => { + console.log('onPage Team error', err); + setProcessing(false); + notify(ST.CannotRemoveCheckIn); + }); + + } + + async function deleteStore(storeData1){ + let {StoreId}=storeData1; + let allQueries=[ + `Delete from ${AppTables.COVERAGE_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.GEOTAG} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.HEADER_BACK_OF_STORE} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.CHILD_BACK_OF_STORE} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.SALES} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.INSERT_OPENINGHEADER_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.STOCK_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.SHARE_OF_SHELF_IMAGE} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.SHARE_OF_SHELF_FACING_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.INSERT_SAMPLED_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.CONTACT_CONVERSION} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.INSERT_ERROR_TRACKING} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.GROOMING_IMAGE_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.ADDITIONAL_VISIBILITY} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.COMPETITION_VISIBILITY} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.COMPETITION_PROMOTION} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.CHECKIN_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.PROMOTION_HEADER_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.PROMOTION_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.PAID_VISIBILITY_HEADER_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.PAID_VISIBILITY_CHILD_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.PAID_VIS_CHECKLIST} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.SURVEY} where STORE_ID='${StoreId}' `, + ] + + return await Promise.all( + allQueries.map(async (q,index) => { + let isDeleted= await executeQuery(q); + return isDeleted==true; + }) + ) + .then((val)=>{ + // if(val.indexOf(false)<0){} + return true; + }).catch((err)=>{ + console.log(err); + return false; + }) + } + + async function executeQuery(q,type='1'){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(type=='1'){ + resolve(true); + } + else{ + + if(txnres2.rows.length>0){ + let arr=[];//txnres2.rows.raw(); + // resolve(arr); + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log(err); + let d=type=='1'?false:[]; + return d; + }) + } + + function FilterStores(searchedQry){ + searchedQry=searchedQry.toLowerCase(); + console.log('searchedQry',searchedQry); + let {storeList}=state; + let arr=[] + if(searchedQry!=null && searchedQry!=''){ + globalStorelist.map((item,index)=>{ + let {StoreName,StoreId,StoreCode}=item; + StoreId=StoreId+''; + if(StoreName.toLowerCase().includes(searchedQry) || StoreCode.toLowerCase().includes(searchedQry) || StoreId.includes(searchedQry)){ + arr.push(item); + } + }); + } + else{ + arr=globalStorelist; + } + setState({storeList:arr}); + setrerenderdata(!rerenderdata) + } + + function _render_StoreVisitModal(){ + return ( + + + {storeVisited()}}> + {ST.Yes} + + {storeNotVisited()}}> + {ST.No} + + + + ) + } + + function _render_GeoTagModal(){ + return ( + + + {setShowGeoTagModal(false)}}> + {ST.Cancel} + + {setShowGeoTagModal(false);props.navigation.navigate('GeoTag',{storeData:currentStore,'isDistributor':true});}}> + {ST.OK} + + + + ) + + } + + function _render_CancelCheckinModal(){ + let storename=cancelCheckOutStore.StoreName || ''; + return ( + + + + {ST.Yourallcheckindatawillbelost} + + + + + {setShowCancelCIModal(false);}}> + {ST.Cancel} + + {onVisitCancel()}}> + {ST.OK} + + + + ) + } + + async function onDistanceM_OK(){ + + if(props.DBCI_GeoFenceEnable){ + if(storeDistanceinM>props.DBCI_GeoFenceRadius){ + setShowDistanceModal(false); + notify(ST.Youcannotcheckin+' '+ST.Youarenotwithinthealloweddistancefromthestore+' '+props.DBCI_GeoFenceRadius+' m','LONG') + } + else{ + setShowDistanceModal(false);props.navigation.navigate('DistributorCheckIn',{storeData:currentStore}); + } + } + else{ + setShowDistanceModal(false);props.navigation.navigate('DistributorCheckIn',{storeData:currentStore}); + } + } + + + function closeImageModal(){ + setCheckOutImageModal(false); + } + + function cancelImage(){ + setCheckOutImage(''); + setCheckOutImagePath(''); + closeImageModal(); + } + + async function openCamera(){ + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'front'}); + } + + async function getImage(imgdata){ + let storeData=checkOutStore + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + let isImgFromGallery=img.fromGallery!=null?img.fromGallery:false; + let picture_clickedd=isImgFromGallery==true?img.datetime:new Date(); + let picture_clicked_time=moment(picture_clickedd).format('DD-MM-YYYY HH:mm:ss') + + const mark_text1=picture_clicked_time; + const mark_text2='Distributor Name:'+storeData.StoreName+' | Distributor Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: DB Check Out'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_DBCheckoutImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + setCheckOutImage(filename); + // renamefile + let imagePath=`${RNFS.DocumentDirectoryPath}/${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker',uri); + setCheckOutImagePath(uri); + }) + .catch(err => { + console.log(ST.Errorimagefilewritefailed+'!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + + function _OpenCaptureImage_Modal(){ + const isImageCap=(CheckOutImagePath=='' || CheckOutImagePath==null)?false:true; + return ( + + { + !isImageCap && + + {openCamera()}}> + + + {closeImageModal()}}> + {ST.Cancel} + + + } + { + isImageCap && + + + + + {openCamera()}}> + + + { showImageSaveOp && + + {cancelImage()}}> + {ST.Cancel} + + {closeImageModal();UpdateCheckOutStatus(CheckOutLoc);}}> + {ST.Save} + + } + {!showImageSaveOp && + {closeImageModal()}}> + {ST.Close} + + } + + + + } + + ) + } + + function _render_DistanceModal(){ + return ( + + + {ST.Youneedtobeinthestore} + {ST.toCheckInCheckOut} + {`${ST.Alloweddistancefromstore}: ${(props.DBCI_GeoFenceEnable==true?props.DBCI_GeoFenceRadius:'500')} m`} + {`${ST.Yourdistancefromstore}: ${storeDistance}`} + {onDistanceM_OK()}}> + Ok + + + + ) + + } + + + return ( + + {processing && } + {(startUploading) && } + + + {_render_StoreVisitModal()} + {_render_GeoTagModal()} + {_render_DistanceModal()} + {_render_CancelCheckinModal()} + {_OpenCaptureImage_Modal()} + {ConfirmSaveAlert(props,showAlert,onSaveCancel,getLocOnCheckout,ST.Doyoureallywanttocheckout)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + { !props.isDataDownloaded && } + + + + + + + + {setSearchedItem(val); FilterStores(val)}} + /> + {FilterStores(searchedItem)}}> + + + + + { nodataFound && + + {ST.NoDataAvailable} + + } + { (props.isDataDownloaded==true && !nodataFound) && + + { + return( + + ); + }} + /> + + } + + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(DistributorList); \ No newline at end of file diff --git a/src/screens/DownloadDataScreen.js b/src/screens/DownloadDataScreen.js new file mode 100644 index 0000000..3f106a6 --- /dev/null +++ b/src/screens/DownloadDataScreen.js @@ -0,0 +1,296 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,TexVt,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,DownloadData} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; + +function DownloadDataScreen(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [state, setState] = useState({isDataDownloaded: false}); + const [teamList, setTeamList] = useState([]); + const [trainingList, settrainingList] = useState([]); + + const [masterBrand, setMasterBrand] = useState([]); + const [skuSize, setSkuSize] = useState([]); + const [compType, setCompType] = useState([]); + const [skuPacking, setSkuPacking] = useState([]); + const [flavours, setFlavours] = useState([]); + const [AuditQtns, setAuditQtns] = useState([]); + const [imageTypes, setImageTypes] = useState([]); + const [menuConfigurationList, setmenuConfigurationList] = useState([]); + const [processing, setProcessing] = useState(false); + const [dowloadedCount, setDowloadedCount] = useState(-1); + const totalCount=8; + + + + useEffect(() => { + console.log('processing:',processing); + if(processing){ + console.log('increment dowloadedCount changed'); + let count=dowloadedCount+1; + setDowloadedCount(count); + } + }, [teamList,skuSize,compType,skuPacking,flavours,AuditQtns,imageTypes]); + + + + useEffect(() => { + console.log('dowloadedCount changed',dowloadedCount); + if(dowloadedCount<=totalCount){ + dowloadAllData(); + } + else{ + setProcessing(false); + } + }, [dowloadedCount]); + + + + async function startDownload() { + setProcessing(true); + setDowloadedCount(0); + } + + + async function dowloadAllData() { + console.log('dowloadAllData',dowloadedCount); + let token = await get_item('loginToken'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + let teamArr=[],Master_Brand=[],Brand_Category=[],Master_SkuSize=[],Master_SkuPacking=[],Master_CompType=[],Qtns=[],imgTypes=[],Master_ProductFlavour=[],Mapping_MenuConfiguration_Sup=[],Training_List=[]; + + if(dowloadedCount==0){ + // download teamlist + var data = {Downloadtype: 'Sup_TeamList',username: loginDetails.UserId,empid: '',token: token,}; + await getDownloadJson(testurl, data) + .then(async(res) => { + if (res.Sup_TeamList) { + teamArr = res.Sup_TeamList || []; + setTeamList(teamArr); + } + }) + .catch(err => { + console.log('onPage Team error', err); + }); + + return; + } + + if(dowloadedCount==1){ + // download Brand_master + data = {Downloadtype: 'Master_Brand',username: loginDetails.UserId,empid: '',token: token,}; + await getDownloadJson(testurl, data) + .then(async(res) => { + if (res.Master_Brand) { + Master_Brand = res.Master_Brand || []; + setMasterBrand(Master_Brand); + } + else if(res.success==false && res.error){ + notify('Something went wrong while downloading data!'); + } + }) + .catch(err => { + console.log('onPage Team error', err); + }); + + return; + + } + + + if(dowloadedCount==2){ + + // download SKU Sizes + data = {Downloadtype: 'Master_SkuSize',username: loginDetails.UserId,empid: '',token: token,}; + await getDownloadJson(testurl, data) + .then(async(res) => { + if (res.Master_SkuSize) { + Master_SkuSize = res.Master_SkuSize || []; + setSkuSize(Master_SkuSize); + } + }) + .catch(err => { + console.log('onPage Team error', err); + }); + + return; + + } + + + if(dowloadedCount==3){ + // download SKU Packaging + data = {Downloadtype: 'Master_ProductPack',username: loginDetails.UserId,empid: '',token: token,}; + await getDownloadJson(testurl, data) + .then(async(res) => { + if (res.Master_ProductPack) { + Master_SkuPacking = res.Master_ProductPack || []; + setSkuPacking(Master_SkuPacking); + } + }) + .catch(err => { + console.log('onPage Team error', err); + }); + + return; + + } + + + if(dowloadedCount==4){ + // download comp type + data = {Downloadtype: 'Master_ActivationType',username: loginDetails.UserId,empid: '',token: token,}; + await getDownloadJson(testurl, data) + .then(async(res) => { + if (res.Master_ActivationType) { + Master_CompType = res.Master_ActivationType || []; + setCompType(Master_CompType); + } + }) + .catch(err => { + console.log('onPage Team error', err); + }); + + return; + + } + + if(dowloadedCount==5){ + // download product Flavour + data = {Downloadtype: 'Master_ProductFlavour',username: loginDetails.UserId,empid: '',token: token,}; + await getDownloadJson(testurl, data) + .then(async(res) => { + if (res.Master_ProductFlavour) { + Master_ProductFlavour = res.Master_ProductFlavour || []; + setFlavours(Master_ProductFlavour); + } + }) + .catch(err => { + console.log('onPage Team error', err); + }); + + return; + + } + + if(dowloadedCount==6){ + // download product Flavour + data = {Downloadtype: 'Sup_AuditQuestion',username: loginDetails.UserId,empid: '',token: token,}; + await getDownloadJson(testurl, data) + .then(async(res) => { + if (res.Sup_AuditQuestion) { + Qtns = res.Sup_AuditQuestion || []; + setAuditQtns(Qtns); + } + }) + .catch(err => { + console.log('onPage Team error', err); + }); + return; + } + + if(dowloadedCount==7){ + // download Sup_ImageType + data = {Downloadtype: 'Sup_ImageType',username: loginDetails.UserId,empid: '',token: token,}; + await getDownloadJson(testurl, data) + .then(async(res) => { + if (res.Sup_ImageType) { + imgTypes = res.Sup_ImageType || []; + setImageTypes(imgTypes); + } + }) + .catch(err => { + console.log('onPage Team error', err); + }); + + return; + + } + + + if(dowloadedCount==8){ + // download teamlist + var data = {Downloadtype: 'Mapping_MenuConfiguration_Sup',username: loginDetails.UserId,empid: '',token: token,}; + await getDownloadJson(testurl, data) + .then(async(res) => { + if (res.Mapping_MenuConfiguration_Sup) { + Mapping_MenuConfiguration_Sup = res.Mapping_MenuConfiguration_Sup || []; + setmenuConfigurationList(Mapping_MenuConfiguration_Sup); + } + }) + .catch(err => { + console.log('onPage Team error', err); + }); + + return; + } + + if(dowloadedCount==9){ + // download teamlist + var data = {Downloadtype: 'Sup_Master_DetailerContent',username: loginDetails.UserId,empid: '',token: token,}; + await getDownloadJson(testurl, data) + .then(async(res) => { + if (res.Master_DetailerContent) { + Training_List = res.Master_DetailerContent || []; + settrainingList(Training_List); + } + }) + .catch(err => { + console.log('onPage Team error', err); + }); + + return; + } + + + if(dowloadedCount==10){ + // create tables for if not created + let ddata={isDataDownloaded:false,teamList:teamList,Master_ActivationType:compType,Master_Brand:masterBrand,Master_ProductPack:skuPacking,Master_SkuSize:skuSize,Master_ProductFlavour:flavours,Sup_AuditQuestion:AuditQtns,Sup_ImageType:imageTypes,Mapping_MenuConfiguration_Sup:menuConfigurationList,Master_DetailerContent:trainingList}; + await DownloadData(props,ddata).then(()=>{ + setState({...state,isDataDownloaded:true}); + setProcessing(false); + notify('Data Downloaded','SHORT'); + props.navigation.goBack(); + }); + } + + } + + + return ( + + {processing && } + + + {startDownload()}}> + Download Data + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(DownloadDataScreen); \ No newline at end of file diff --git a/src/screens/DynamicStoreList.js b/src/screens/DynamicStoreList.js new file mode 100644 index 0000000..d7e72ee --- /dev/null +++ b/src/screens/DynamicStoreList.js @@ -0,0 +1,1347 @@ +import React,{useState,useEffect, memo} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,TouchableHighlight,Platform,PermissionsAndroid,FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,AddStore, checkRange, UploadData2, UploadData, UpdateStoreStatus} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, AppVersion} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign, Entypo, Feather, FontAwesome, Fontisto, Ionicons, MaterialCommunityIcons} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import NoDataComponent from '../components/NoDataComponent'; +import {SvgXml} from 'react-native-svg'; +import MapIcon from '../assets/performics/map_icon.svg'; +import CustomModal from '../components/CustomModal'; +import { AppTables } from '../constants/tableConstants'; +import { _checkLocationPermission } from '../components/geolocation'; +import Geolocation from '@react-native-community/geolocation'; +import { getAvailblQuery, getIfAvlbl, getIfKPIDone, getQuery, Q_MenuList } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import { getMethodName, METHODS } from '../constants/methodNames'; +import { uploadAllData, uploadAllImages, uploadStoreStatus } from '../constants/uploadData'; +import { PrimaryTheme } from '../styles/Themes'; +// import JSON from '../constants/storeList_definition.json'; +import * as RNFS from 'react-native-fs'; + +const StoreItem=memo((props)=>{ + const route = useRoute(); + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const item=props.item; + const item_index=props.index; + const JSONView=props.JSONView; + const storeList_def=JSONView.storeList_def || {}; + // (storeList_def!=null && typeof storeList_def=='object' && Object.keys(storeList_def).length>0) + let showInCard=storeList_def.showInCard; + showInCard=showInCard==0 || (showInCard!=null && showInCard!='')?showInCard:1; + let showCardDefaultColor=storeList_def.showCardDefaultColor || PageTheme.$bg_color ; + let rowData=storeList_def.rowData || [] ; + + async function get_to_store_details(data){ + + if(data.UploadStatus=='U'){ + notify('All Data already uploaded for this store!'); + } + else if(data.UploadStatus=='L'){ + notify('Already marked as not working status for this store!'); + } + else if(data.UploadStatus=='I'){ + let isChcekedIn=await checkIfCheckInAvlbl(); + let menuList=data.MenuList; + console.log('menuList length:',menuList.length); + if(isChcekedIn==true){ + menuList.length>0?props.navigation.navigate('StoreDailyMenu',{storeData:data,'isAdhoc':props.isAdhocScreen}):''; + } + else{ + let isrestored=await restoreCheckIn(data); + props.setProcessing(false); + console.log('isrestored:',isrestored); + if(isrestored==true){ + menuList.length>0?props.navigation.navigate('StoreDailyMenu',{storeData:data,'isAdhoc':props.isAdhocScreen}):''; + } + else{ + notify('Check-In data not available!'); + } + + } + + } + else if(data.UploadStatus=='C'){ + notify('Already checked out!'); + } + else if(data.UploadStatus=='D'){ + notify('Data already uploaded!'); + } + else if(data.UploadStatus=='P'){ + notify('Data partially uploaded!'); + } + else if(data.UploadStatus=='N' || data.UploadStatus==''){ + let isChcekedIn=await checkIfAlreadyCheckdIn(); + console.log('isChcekedIn',isChcekedIn); + if(isChcekedIn==true){ + notify('You are already checked in to the other store!','LONG'); + } + else{ + props.setShowStoreVisitModal(true); + props.setCurrentStore(data); + } + } + + } + + + + async function checkIfCheckInAvlbl(){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let join=`INNER JOIN ${AppTables.COVERAGE_DATA} t2 on t2.STORE_ID=t1.StoreId and t2.JCP_TYPE='Mapping_JourneyPlan' `; + let q=`Select t1.* from Mapping_JourneyPlan t1 ${join} where t1.VisitDate='${d2}' and t1.UploadStatus='I'` + + let join2=`INNER JOIN ${AppTables.COVERAGE_DATA} t2 on t2.STORE_ID=t1.StoreId and t2.JCP_TYPE='Adhoc_JourneyPlan' `; + let q2=`Select t1.* from Adhoc_JourneyPlan t1 ${join2} where t1.VisitDate='${d2}' and t1.UploadStatus='I'` + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + // show from local + resolve(true); + } + else{ + await txn.executeSql(q2,[],async function (txn2, txnres3) { + if(txnres3.rows.length>0){ + // show from local + resolve(true); + } + else{ + resolve(false); + } + },function(txn2,txnerr){console.log(txnerr);resolve(false); }); + } + },function(txn2,txnerr){console.log(txnerr);resolve(false); }); + + }); + + }).then((val)=>{ + return val; + }).catch((err)=>{ + return false; + }); + } + + + async function AskForCancelCheckin(data){ + props.setCancelCheckOutStore(data); + props.setShowCancelCIModal(true); + } + + + async function restoreCheckIn(item){ + props.setLoaderTitle('You have cleared the App-Data! Restoring Checkin Info...'); + props.setProcessing(true); + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let {StoreId,VisitDate,MID,Latitude, Longitude,UploadStatus,InTime,OutTime}=item; + let JcpType=props.isAdhocScreen==true?'Adhoc_JourneyPlan':'Mapping_JourneyPlan'; + + let In_Time=(InTime!='' && InTime!=null && InTime!='00:00:00' && InTime!='00:00')?moment(d2+' '+InTime).format('MM/DD/YYYY HH:mm:ss'):''; + let Out_Time=(OutTime!='' && OutTime!=null && OutTime!='00:00:00' && OutTime!='00:00')?moment(d2+' '+OutTime).format('MM/DD/YYYY HH:mm:ss'):''; + let CHECKOUT_TIME=(Out_Time!='' && Out_Time!=null)?Out_Time:In_Time; + + + // add store Coverage data + let q=`delete from ${AppTables.COVERAGE_DATA} where STORE_ID='${StoreId}' and VISIT_DATE='${VisitDate}' `; + let values=` ('${StoreId}','${VisitDate}','${Latitude}','${Longitude}','','${CHECKOUT_TIME}','','0','','','','${MID}','${JcpType}','${d2}')`; + let insert_q=` insert into ${AppTables.COVERAGE_DATA}(STORE_ID,VISIT_DATE ,LATITUDE,LONGITUDE,IMAGE,CHECKOUT_TIME,CHECKOUT_IMAGE,REASON_ID,REASON,REMARK,STORE_FLAG,MID,JCP_TYPE,ADDED_DATE) values ${values}`; + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('store coverage deleted'); + await txn.executeSql(insert_q,[],async function (txn2, txnres3) { + console.log('InsertCoverageData done'); + + + // add storeCheckin data + let q2=`delete from ${AppTables.CHECKIN_DATA} where STORE_ID='${StoreId}' and VISIT_DATE='${VisitDate}' `; + let values2=` ('${StoreId}','${VisitDate}','${Latitude}','${Longitude}','${In_Time}','','${Out_Time}','','','${JcpType}','${d2}')`; + let insert_q2=` INSERT INTO ${AppTables.CHECKIN_DATA}(STORE_ID,VISIT_DATE,LATITUDE,LONGITUDE,CHECKIN_TIME,CHECKIN_IMAGE,CHECKOUT_TIME,CHECKOUT_IMAGE,REMARK,JCP_TYPE,ADDED_DATE) values ${values2}`; + await txn.executeSql(q2,[],async function (txn2, txnres4) { + console.log('removed'); + await txn.executeSql(insert_q2,[],async function (txn2, txnres5) { + console.log('checkin data added'); + resolve(true); + },function(txn2,txnerr){console.log(txnerr);resolve(false);}); + },function(txn2,txnerr){console.log(txnerr);resolve(false);}); + + + },function(txn2,txnerr){console.log(txnerr);resolve(false);}); + },function(txn2,txnerr){console.log(txnerr);resolve(false);}); + + }); + + }).then((val)=>{ + return val; + }).catch((err)=>{ + return false; + }); + } + + async function checkIfAlreadyCheckdIn(){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let join=`INNER JOIN ${AppTables.COVERAGE_DATA} t2 on t2.STORE_ID=t1.StoreId and t2.JCP_TYPE='Mapping_JourneyPlan' `; + let q=`Select t1.* from Mapping_JourneyPlan t1 where t1.VisitDate='${d2}' and t1.UploadStatus='I'` + + let join2=`INNER JOIN ${AppTables.COVERAGE_DATA} t2 on t2.STORE_ID=t1.StoreId and t2.JCP_TYPE='Adhoc_JourneyPlan' `; + let q2=`Select t1.* from Adhoc_JourneyPlan t1 where t1.VisitDate='${d2}' and t1.UploadStatus='I'` + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + // show from local + resolve(true); + } + else{ + await txn.executeSql(q2,[],async function (txn2, txnres3) { + if(txnres3.rows.length>0){ + // show from local + resolve(true); + } + else{ + resolve(false); + } + },function(txn2,txnerr){console.log(txnerr);resolve(false); }); + } + },function(txn2,txnerr){console.log(txnerr);resolve(false); }); + + }); + + }).then((val)=>{ + return val; + }).catch((err)=>{ + return false; + }); + } + + + + function renderRow(rd,rd_index){ + let cols=rd.ShowString || []; + return ( + + { + cols.length>0 && + cols.map((col,col_index)=>{ + let sep=(col.fieldNameValueSeparator!=null && col.fieldNameValueSeparator!='')?' '+col.fieldNameValueSeparator:''; + let col_sep=col.afterConcatChar!=null && col.afterConcatChar!='' ? col.afterConcatChar:''; + let col_style={fontSize:(col.fontSize || 12),fontWeight:(col.fontWeight!=null && col.fontWeight!=''?col.fontWeight : '400')} //fontFamily:(col.fontName || 'sans-serif') + + return( + + {col.labelName+sep} + {item[col.fieldName]} + {col_sep} + + ) + }) + } + + ) + } + + return( + + {get_to_store_details(item)}}> + + {rowData.length>0 && + rowData.map((rd,rd_index)=>{ + return renderRow(rd,rd_index); + }) + } + + + + ); + + return( + + + + {item.StoreName} + + + + + + Store Id: + {item.StoreId} + + + Store Type: + {item.StoreType} + + + + + Store Code: + {item.StoreCode} + + + + + + Address: + {item.Address} + + + {(item.CheckInTime!=null && item.CheckInTime!='') && + + + + Check In: + {item.CheckInTime} + + {(item.CheckOutTime!=null && item.CheckOutTime!='') && + + Check Out: + {item.CheckOutTime} + + } + + } + { (item.UploadStatus!=null && item.UploadStatus!='' && item.UploadStatus!='N') && + + + + {item.UploadStatus!=null && (item.UploadStatus=='I' || item.UploadStatus=='L') && + {AskForCancelCheckin(item)}}> + {item.UploadStatus=='L' ? :} + {item.UploadStatus=='L' ? Not Working:Checked In} + + + + + } + {/* {item.UploadStatus!=null && item.UploadStatus=='I' && + + + Checked In + } */} + {item.UploadStatus!=null && item.UploadStatus=='C' && + + + Checked Out + } + {item.UploadStatus!=null && item.UploadStatus=='P' && + + + Partially Uploaded + } + {item.UploadStatus!=null && item.UploadStatus=='D' && + + + Data Uploaded + } + {item.UploadStatus!=null && item.UploadStatus=='U' && + + + Uploaded + } + {/* {item.UploadStatus!=null && item.UploadStatus=='L' && + + + Not Working + } */} + { item.allDone==true && (item.UploadStatus=='I') && + {props.onCheckOut?props.onCheckOut(item):'';}}> + Check Out + + } + + } + + { item.GeoTag=='Y' && + {props.navigation.navigate('ShowMap',{storeData:item})}} > + + + } + { item.GeoTag=='N' && + {}} > + + + } + + ) + + +}); + +function DynamicStoreList(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [processing, setProcessing] = useState((props.isDataDownloaded?true:false)); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [nodataFound, setNodataFound] = useState(false); + const [showStoreVisitModal, setShowStoreVisitModal] = useState(false); + const [showGeoTagModal, setShowGeoTagModal] = useState(false); + const [showDistanceModal, setShowDistanceModal] = useState(false); + const [currentStore, setCurrentStore] = useState({}); + const [storeDistance, setStoreDistance] = useState('0 M'); + const [showAlert, setShowAlert] = useState(false); + const [checkOutStore,setCheckOutStore]=useState({}); + const [rerenderdata, setrerenderdata]= useState(false); + let [state, setState] = useState({storeList:[]}); + const [cancelCheckOutStore,setCancelCheckOutStore]=useState({}); + const [showCancelCIModal, setShowCancelCIModal]= useState(false); + const [JSONView, setJSONView]= useState({}); + + useEffect(() => { + + getData(); + const willFocusSubscription = props.navigation.addListener('focus', () => { + checkLocalData(); + }); + + return willFocusSubscription + }, []); + + + async function getData(){ + // let json_ex1=JSON; + // setJSONView(json_ex1); + // return; + + let json_ex=require('../constants/storeList_definition.json'); + // let path =`file://${RNFS.ExternalStorageDirectoryPath}/Documents/test.json`; + // console.log('path:',path); + // let json_ex=await RNFS.readFile(path).then((val)=>{ + // return val; + // }) + setJSONView(json_ex); + checkLocalData(); + } + + + async function calLocatDistance(){ + if(currentStore.Latitude !='' && currentStore.Latitude!=null){ + const hasPermission=await _checkLocationPermission(); + if(hasPermission==true) + { + Geolocation.getCurrentPosition( + async (position) => { + let loc={lat:position.coords.latitude,lng:position.coords.longitude}; + + var distance = checkRange(loc.lat,loc.lng,currentStore.Latitude,currentStore.Longitude); + // console.log('distance:',distance); + let dinKM=(distance / 1000); + let distanceinM=(distance=='' || distance==null || isNaN(distance))?' 0 m':( dinKM > 1 ? dinKM.toFixed(1) + ' Km' : distance + ' m'); + setStoreDistance(distanceinM); + if(distance>500){ + setShowDistanceModal(true); + } + else{ + props.navigation.navigate('StoreCheckin',{storeData:currentStore,'isAdhoc':isAdhocScreen}); + } + }, + (error) => { + notify('Cannot get user position'); + }, + { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + ); + } + else{ + notify('Please allow location permission'); + } + } + else{ + notify('Store location not available'); + } + + } + + + + async function checkLocalData(){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + + let token=await get_item('loginToken'); + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + let params=props.route.params? props.route.params:{}; + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + + var q='',tb1='Mapping_JourneyPlan',tb2=AppTables.CHECKIN_DATA,tb3='Adhoc_JourneyPlan'; + + var join_tbl=isAdhoc==true?tb3:tb1; + var join =` left join ${tb2} on ${tb2}.STORE_ID=${join_tbl}.StoreId and ${tb2}.JCP_TYPE='${join_tbl}' and ${tb2}.VISIT_DATE='${d2}' and ${join_tbl}.UploadStatus in ('I','C','D','U','L') `; + var orderby=` group by ${join_tbl}.StoreId,${join_tbl}.VisitDate order by ${join_tbl}.StoreName,${tb2}.KEY_ID desc`; + + if(isAdhoc==true){ + q=`Select ${tb3}.*,${tb2}.CHECKIN_TIME as CheckInTime ,${tb2}.CHECKOUT_TIME as CheckOutTime from ${tb3} ${join} where ${tb3}.VisitDate='${d2}' ${orderby} `; + } + else{ + q=`Select ${tb1}.*,${tb2}.CHECKIN_TIME as CheckInTime ,${tb2}.CHECKOUT_TIME as CheckOutTime from ${tb1} ${join} where ${tb1}.VisitDate='${d2}' ${orderby} `; + } + + await db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + // show from local + var storeArr=[]; + for(var i=0;i0?await getDailyMenu(sdata):true; + sdata.allDone=allDone; + sdata.MenuList=MenuList || []; + storeArr.push(sdata); + + if(i==(txnres2.rows.length-1)){ + // console.log(storeArr); + setState({storeList:storeArr}); + setProcessing(false); + } + } + } + else{ + setProcessing(false); notify('No data found');setNodataFound(true); + } + },function(txn2,txnerr){console.log(txnerr);}); + }); + } + + async function getDailyMenu(storeData1){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let {StoreId,ChannelId,RegionId}=storeData1; + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let q=Q_MenuList(storeData1); + await txn.executeSql(q,[],async function (txn2, txnres) { + + if(txnres.rows.length>0){ + let allDone=true; + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + + } + + async function getMenuList(storeData1){ + let {StoreId,ChannelId,RegionId}=storeData1; + return new Promise((resolve,reject)=>{ + + db.transaction(async function (txn) { + let q=Q_MenuList(storeData1); + await txn.executeSql(q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log('') + return [] + }) + } + + async function getKPIS(MenuList){ + let allKpis=[]; + + return Promise.all( + MenuList.map((item,index)=>{ + let MenuId=item.MenuId || ''; + MenuId=MenuId+''; + switch(MenuId){ + case '1':allKpis.push('Stocks'); return 'Stocks'; + case '2':allKpis.push('BRS'); return 'BRS'; + case '3':allKpis.indexOf('Stocks')<0?allKpis.push('Stocks'):''; return 'Stocks'; + case '4':allKpis.indexOf('Stocks')<0?allKpis.push('Stocks'):''; return 'Stocks'; + case '5':allKpis.push('SOS'); return 'SOS'; + case '6':allKpis.push('PaidVis'); return 'PaidVis'; + case '7':allKpis.push('AddVis'); return 'AddVis'; + case '8':allKpis.push('CompVis'); return 'CompVis'; + case '9':allKpis.push('Promotion'); return 'Promotion'; + case '14':allKpis.push('CompPromo'); return 'CompPromo'; + case '15':allKpis.push('Contacts'); return 'Contacts'; + case '16':allKpis.push('Sale'); return 'Sale'; + case '17':allKpis.push('Survey'); return 'Survey'; + default: return ''; + } + }) + ).then((val)=>{ + console.log('allKPIs:',val,allKpis); + return allKpis; + }) + } + + + async function checkAvailability(storeData1,data){ + + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q2=getAvailblQuery(data.MenuId,storeData1); + if(q2!='' && q2!=null){ + await txn.executeSql(q2,[],async function (txn2, txnres2) { + let isAvlbl=getIfAvlbl(data.MenuId,txnres2,storeData1); + resolve(isAvlbl); + },function (txn2, txnerr) { console.log(txnerr); resolve(false);},); + } + else{ + let isAvlbl=getIfAvlbl(data.MenuId,{},storeData1); + resolve(isAvlbl); + } + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + } + + + async function updateStatus(storeData1,data,isAvlbl){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q2=getQuery(data.MenuId,storeData1); + if(q2!='' && q2!=null && isAvlbl==true){ + await txn.executeSql(q2,[],async function (txn2, txnres2) { + let isDone=await getIfKPIDone(data.MenuId,txnres2,storeData1); + resolve(isDone); + + },function (txn2, txnerr) { console.log(txnerr); resolve(false);},); + } + else{ + resolve(false); + } + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + + } + + async function onCheckOut(storeData1){ + // let isAlldone=await getDailyMenu(storeData1); + // if(isAlldone==true){ + setCheckOutStore(storeData1); + setShowAlert(true); + // } + // else{ + // notify('Please fill all KPI ',false); + // } + } + + function onSaveCancel(){ + setShowAlert(false); + } + + async function getLocOnCheckout(){ + setShowAlert(false); + setLoaderTitle('Updating Checkout Status...'); + setProcessing(true); + Geolocation.getCurrentPosition( + async (position) => { + let {latitude,longitude} = position.coords; + let loc={lat:latitude,lng:longitude}; + UpdateCheckOutStatus(loc) + }, + (error) => { + notify('Cannot get user position'); + setProcessing(false); + }, + { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + ); + } + + async function UpdateCheckOutStatus(loc){ + let {StoreId,MID}=checkOutStore; + let d=new Date(); + let d2=moment(d).format('MM/DD/YYYY'); + let d3=moment(d).format('MM/DD/YYYY HH:mm:ss'); + + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + + let data1={ + "UserId": loginDetails.UserId, + "StoreId": StoreId, + "Latitude": loc.lat, + "Longitude": loc.lng, + "Checkout_Date": d2, + } + + const url=props.baseurl+getMethodName(METHODS.CHECKOUTDETAIL_METHOD); + + console.log(url,data1); + await UploadData2(url,data1) + .then(async(res)=>{ + console.log('StoreCheckOutSup1:',res,'MID:',MID); + if(!res.error){ + if(res==1){ + //Check out completed + + let data={checkout_image:''} ; + const isCheckOutUpdated=await UpdateStoreCheckOut(data); + + if(isCheckOutUpdated==true){ + let datan={StoreId:StoreId,UploadStatus:'C',tbname:(isAdhocScreen==true?'Adhoc_JourneyPlan':'Mapping_JourneyPlan')} ; + const isUpdated=await UpdateStoreStatus(props,datan); + if(isUpdated==true){ + let outtime=moment(d).format('HH:mm:ss'); ; + await updateStoreStatuslocal('C',checkOutStore,false,true,outtime); + setLoaderTitle('Uploading Data...'); + UploadOnCheckOut(loc); + } + else{ + setProcessing(false);notify('Error occur while checkout','LONG'); + } + } + else{ + notify('Error occur while checkout','LONG'); + } + + } + else{ + notify('Something went wrong!','SHORT');setProcessing(false); + } + } + else{ + notify('Something went wrong!','SHORT');setProcessing(false); + } + }) + .catch((err)=>{ + console.log('onPage Team error',err); + notify('Something went wrong!','SHORT');setProcessing(false); + }); + + + } + + async function updateStoreStatuslocal(status,storeData1,updateCheckin=false,uCOut=false,cout_time=''){ + + let storeArr=state.storeList; + let sdata_index=storeArr.findIndex(i=>i.StoreId==storeData1.StoreId); + if(sdata_index>=0){ + let sdata=storeArr[sdata_index]; + sdata['UploadStatus']=status; + if(updateCheckin==true){ + sdata['CheckInTime']=''; + } + if(uCOut==true){ + sdata['CheckOutTime']=cout_time; + } + storeArr[sdata_index]=sdata; + setState({...state,storeArr}); + setrerenderdata(!rerenderdata); + } + } + + async function UpdateStoreCheckOut(data) { + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let now=moment(d1).format('MM/DD/YYYY HH:mm:ss'); + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q2=`UPDATE ${AppTables.COVERAGE_DATA} SET CHECKOUT_TIME='${now}', CHECKOUT_IMAGE='' WHERE STORE_ID='${checkOutStore.StoreId}' and VISIT_DATE='${d2}' `; + + await txn.executeSql(q2,[],async function (txn2, txnres2) { + console.log('store coverage updated'); + },function(txn2,txnerr){console.log(txnerr);resolve(false);}); + + let q=`UPDATE ${AppTables.CHECKIN_DATA} SET CHECKOUT_TIME='${now}', CHECKOUT_IMAGE='' WHERE STORE_ID='${checkOutStore.StoreId}' and VISIT_DATE='${d2}' `; + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('store checkout updated'); + resolve(true); + },function(txn2,txnerr){console.log(txnerr);resolve(false);}); + + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + + + } + + + async function UploadOnCheckOut(loc){ + try { + console.log('UploadOnCheckOut'); + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let token = await get_item('loginToken'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + + let PJPStores=await getPJPStoresData('Mapping_JourneyPlan',[],d2); + let AllStores=await getPJPStoresData('Adhoc_JourneyPlan',PJPStores,d2); + + + + await db.transaction(async function (txn) { + console.log('stores to upload:',AllStores.length); + if(AllStores.length>0){ + for (var i=0;i{ + console.log('status uploadres:',res,'MID:',MID); + + if(!res.error){ + let tbname=JCP_TYPE; + let datan={StoreId:StoreId,UploadStatus:'P',tbname:tbname} ; + const isUpdated=await UpdateStoreStatus(props,datan); + if(isUpdated==true){ + + await updateStoreStatuslocal('P',data); + await uploadAfter_P_status(index,AllStores,data,MenuList,allKPIs,JCP_TYPE); + + } + else{ + if(index==AllStores.length-1){ + setProcessing(false);notify('Error occur while uploading data','LONG'); + } + } + } + else{ + if(index==AllStores.length-1){ + setProcessing(false);notify('Error occur while uploading data','LONG'); + } + } + + }) + .catch((err)=>{ + console.log(err); + if(index==AllStores.length-1){ + setProcessing(false);notify('Error occur while uploading data','LONG'); + } + }); + } + else if (UploadStatus=='D'){ + // this never be called if there is no KPI + let allFilesToUpload=await uploadAllData(props,data,allKPIs,props.UserId,JCP_TYPE,false); + if(allFilesToUpload.length>0){ + await UploadDataWithImages(index,AllStores,data,MenuList,allKPIs,JCP_TYPE,allFilesToUpload); + } + else{ + notify('All data uploaded for '+StoreName,'SHORT'); + if(index==AllStores.length-1){ + setProcessing(false); + } + } + } + else if(UploadStatus=='P'){ + await uploadAfter_P_status(index,AllStores,data,MenuList,allKPIs,JCP_TYPE); + } + else if(UploadStatus=='L'){ + let isAllUploaded_S=await uploadStoreStatus(props,data,'U',JCP_TYPE); + if(isAllUploaded_S==true){ + await updateStoreStatuslocal('U',data); + notify('All data uploaded for '+StoreName,'SHORT'); + if(index==AllStores.length-1){ + setProcessing(false); + } + } + else{ + if(index==AllStores.length-1){ + setProcessing(false);notify('Error occur while uploading data','LONG'); + } + } + } + } + + } + }); + + + + } catch (err) { + console.log(err); + } + } + + async function uploadAfter_P_status(index,AllStores,data,MenuList,allKPIs,JCP_TYPE){ + let {StoreName}=data; + if(MenuList.length>0){ + // Upload data with Images + let allFilesToUpload=await uploadAllData(props,data,allKPIs,props.UserId,JCP_TYPE); + await updateStoreStatuslocal('D',data); + UploadDataWithImages(index,AllStores,data,MenuList,allKPIs,JCP_TYPE,allFilesToUpload); + } + else{ + // Upload statua u if no data exists + let isAllUploaded_S=await uploadStoreStatus(props,data,'U',JCP_TYPE); + if(isAllUploaded_S==true){ + await updateStoreStatuslocal('U',data); + notify('All data uploaded for '+StoreName,'SHORT'); + if(index==AllStores.length-1){ + setProcessing(false); + } + } + else{ + if(index==AllStores.length-1){ + setProcessing(false);notify('Error occur while uploading data','LONG'); + } + } + } + } + + async function UploadDataWithImages(index,AllStores,data,MenuList,allKPIs,JCP_TYPE,allFilesToUpload){ + let {StoreName}=data; + if(allFilesToUpload.length>0){ + setLoaderTitle('Uploading Images...'); + console.log('set loader title'); + let isAllUploaded=await uploadAllImages(props,data,allFilesToUpload,JCP_TYPE); + + if(isAllUploaded==true){ + await updateStoreStatuslocal('U',data); + notify('All data and images uploaded for '+StoreName,'SHORT'); + if(index==AllStores.length-1){ + setProcessing(false); + } + }else{ + notify('Cannot upload images for '+StoreName,'SHORT'); + if(index==AllStores.length-1){ + setProcessing(false); + } + } + } + else{ + notify('All data uploaded for '+StoreName,'SHORT'); + if(index==AllStores.length-1){ + setProcessing(false); + } + } + } + + + + async function getPJPStoresData(tbname,Stores=[],d2){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let join=`INNER JOIN ${AppTables.COVERAGE_DATA} t2 on t2.STORE_ID=t1.StoreId and t2.JCP_TYPE='${tbname}' `; + await txn.executeSql(`Select t1.*,t2.REASON_ID,t2.IMAGE,t2.JCP_TYPE from ${tbname} t1 ${join} where t1.VisitDate='${d2}' and t1.UploadStatus in ('C','P','D','L')`,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + + for(var i=0;i{ + return val; + }) + .catch((err)=>{ + console.log(err); + return Stores; + }) + } + + + + + async function storeVisited(){ + console.log('isgeotag:',currentStore.GeoTag); + setShowStoreVisitModal(false); + if(currentStore.GeoTag=='N'){ + setShowGeoTagModal(true); + } + else if(currentStore.UploadStatus=='N' || currentStore.UploadStatus==''){ + calLocatDistance(); + } + else{ + + } + } + + async function storeNotVisited(){ + setShowStoreVisitModal(false); + props.navigation.navigate('StoreNonWorkingReasons',{storeData:currentStore,'isAdhoc':isAdhocScreen}); + } + + async function onVisitCancel(){ + setLoaderTitle('Deleting Check-In Data...') + setShowCancelCIModal(false); + setProcessing(true); + let {MID,StoreId}=cancelCheckOutStore; + let postdata={'Mid':MID,"UserName":props.UserId,} + + const url=props.baseurl+getMethodName(METHODS.DELETECOVERAGE_METHOD); + console.log(url,postdata); + await UploadData2(url,postdata) + .then(async(res)=>{ + console.log('delete coverage res:',res); + if(res=='1'){ + let isdeleted=await deleteStore(cancelCheckOutStore); + if(isdeleted==true){ + let data={"StoreId":StoreId,UploadStatus:"N",tbname:(isAdhocScreen==true?'Adhoc_JourneyPlan':'Mapping_JourneyPlan')}; + let isUpdated=await UpdateStoreStatus(props,data); + if(isUpdated==true){ + await updateStoreStatuslocal('N',cancelCheckOutStore,true); + setProcessing(false); + notify('Check-In Removed'); + } + else{ + setProcessing(false); + notify('Check-In removed successfully, but cannot update status!'); + } + } + else{ + setProcessing(false); + notify('Check-In removed successfully, but cannot update status!'); + } + } + else{ + setProcessing(false); + notify('Cannot Remove Check-In!'); + } + + }).catch(err => { + console.log('onPage Team error', err); + setProcessing(false); + notify('Cannot Remove Check-In!'); + }); + + } + + async function deleteStore(storeData1){ + let {StoreId}=storeData1; + let allQueries=[ + `Delete from ${AppTables.COVERAGE_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.GEOTAG} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.HEADER_BACK_OF_STORE} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.CHILD_BACK_OF_STORE} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.SALES} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.INSERT_OPENINGHEADER_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.STOCK_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.SHARE_OF_SHELF_IMAGE} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.SHARE_OF_SHELF_FACING_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.INSERT_SAMPLED_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.CONTACT_CONVERSION} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.INSERT_ERROR_TRACKING} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.GROOMING_IMAGE_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.ADDITIONAL_VISIBILITY} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.COMPETITION_VISIBILITY} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.COMPETITION_PROMOTION} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.CHECKIN_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.PROMOTION_HEADER_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.PROMOTION_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.PAID_VISIBILITY_HEADER_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.PAID_VISIBILITY_CHILD_DATA} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.PAID_VIS_CHECKLIST} where STORE_ID='${StoreId}' `, + `Delete from ${AppTables.SURVEY} where STORE_ID='${StoreId}' `, + ] + + return await Promise.all( + allQueries.map(async (q,index) => { + let isDeleted= await executeQuery(q); + return isDeleted==true; + }) + ) + .then((val)=>{ + // if(val.indexOf(false)<0){} + return true; + }).catch((err)=>{ + console.log(err); + return false; + }) + } + + async function executeQuery(q,type='1'){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(type=='1'){ + resolve(true); + } + else{ + let arr=[]; + if(txnres2.rows.length>0){ + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log(err); + let d=type=='1'?false:[]; + return d; + }) + } + + function _render_StoreVisitModal(){ + return ( + + + {storeVisited()}}> + Yes + + {storeNotVisited()}}> + No + + + + ) + } + + function _render_GeoTagModal(){ + return ( + + + {setShowGeoTagModal(false)}}> + Cancel + + {setShowGeoTagModal(false);props.navigation.navigate('GeoTag',{storeData:currentStore,'isAdhoc':isAdhocScreen});}}> + Ok + + + + ) + + } + + function _render_CancelCheckinModal(){ + let storename=cancelCheckOutStore.StoreName || ''; + return ( + + + + Your all check-in data will be lost! + + + + + {setShowCancelCIModal(false);}}> + Cancel + + {onVisitCancel()}}> + Ok + + + + ) + } + + function _render_DistanceModal(){ + return ( + + + You need to be in the store + to CheckIn/CheckOut + {`Allowed distance from store: 500 m`} + {`Your distance from store: ${storeDistance}`} + {setShowDistanceModal(false);props.navigation.navigate('StoreCheckin',{storeData:currentStore,'isAdhoc':isAdhocScreen});}}> + Ok + + + + ) + + } + + function _renderList(){ + const storeList_def=JSONView.storeList_def || {}; + let showInCard=storeList_def.showInCard; + showInCard=showInCard==0 || (showInCard!=null && showInCard!='')?showInCard:1; + + return ( + + + { + state.storeList.map((item,index)=>{ + return( + + ); + }) + } + + + + ) + } + + + return ( + + {processing && } + + {_render_StoreVisitModal()} + {_render_GeoTagModal()} + {_render_DistanceModal()} + {_render_CancelCheckinModal()} + {ConfirmSaveAlert(props,showAlert,onSaveCancel,getLocOnCheckout,'Do you really want to checkout?')} + + + { !props.isDataDownloaded && } + + + + + {props.navigation.pop();props.navigation.push('DynamicStoreList')}}> + Planned + + {props.navigation.pop();props.navigation.push('DynamicStoreList',{'isAdhoc': true})}}> + Adhoc + + + + { nodataFound && + + No Data Available + + } + { (props.isDataDownloaded==true && !nodataFound) && rerenderdata==rerenderdata && + _renderList() + } + + + + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(DynamicStoreList); \ No newline at end of file diff --git a/src/screens/DynamicSurveyCat.js b/src/screens/DynamicSurveyCat.js new file mode 100644 index 0000000..c87d25c --- /dev/null +++ b/src/screens/DynamicSurveyCat.js @@ -0,0 +1,115 @@ +import React,{useState,useEffect, useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { customStyles,GetPageTheme, STATUSBAR_HEIGHT } from "../styles/Global"; +import {Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,FlatList, Alert,Animated} from 'react-native'; +import { connect } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {db,} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; + + +function DynamicSurveyCat(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [surveys, setSurveys] = useState([]); + const [ActiveSurvey, setActiveSurvey]= useState({}); + + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let surveydata=params.surveyData || {}; + let menu1=params.menu || {}; + let isAdhoc=params.isAdhocScreen || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setActiveSurvey(surveydata) + setCurrentMenu(menu1); + getData(surveydata,storeData1); + }, []); + + async function getData(surveydata,storeData1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + let surveyQtns=require('../constants/s_qtns.json'); + // setSurveyJson(surveyQtns); + let arr=[] + for(const i in surveyQtns){ + let item=surveyQtns[i] + let {SurveyName,SurveyId,ShowCat,CategoryId,Category,CategorySequence}=item; + let obj={SurveyName,SurveyId,ShowCat,Category,CategoryId} + + if(item.SurveyId==surveydata.SurveyId && arr.findIndex(a=>a.CategoryId==item.CategoryId)<0) + { + arr.push(obj); + } + } + setSurveys(arr);setProcessing(false); + + } catch (err) { + console.log(err); + } + } + + function openSurveyView(item){ + props.navigation.navigate('SurveyView',{'surveyData':ActiveSurvey,'catData':item,'storeData':storeData,'menu':currentMenu,'isAdhocScreen':isAdhocScreen}); + } + + + return ( + + {processing && } + + + + + + {(ActiveSurvey.SurveyName!=null?(ActiveSurvey.SurveyName.length>26?ActiveSurvey.SurveyName.substring(0,26)+'...':ActiveSurvey.SurveyName) : '')} + + + { Object.keys(storeData).length>0 && + { + return( + {openSurveyView(item)}}> + + + {item.Category.substring(0,1)} + + {item.Category} + + + ); + }} + /> + } + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(DynamicSurveyCat); \ No newline at end of file diff --git a/src/screens/DynamicSurveys.js b/src/screens/DynamicSurveys.js new file mode 100644 index 0000000..e302a11 --- /dev/null +++ b/src/screens/DynamicSurveys.js @@ -0,0 +1,112 @@ +import React,{useState,useEffect, useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { customStyles,GetPageTheme, STATUSBAR_HEIGHT } from "../styles/Global"; +import {Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,FlatList, Alert,Animated} from 'react-native'; +import { connect } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {db,} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; + + +function DynamicSurveys(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [surveys, setSurveys] = useState([]); + + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let storeData1={"Address": "test", "ChainId": 1, "ChainName": "GT", "ChannelId": 1, "CheckInTime": "", "CheckOutTime": "", "CityId": 3, "CityName": "Thailand", "ContactPerson": "bhhvhhhhhhh be", "Email": "njj", "EmpId": 4, "ExpiryStock": "N", "GeoFenceRadius": 500, "GeoTag": "Y", "InTime": "00:00:00", "Landmark": "-j", "Latitude": "28.5376374", "Location": "Lower Parel", "Longitude": "77.297907", "MID": 852, "Mobile": "9969999999", "OutTime": "00:00:00", "Phone": "6699996669", "Pincode": "400001", "RegionId": 1, "StateId": 1, "StateName": "Chiang Mai", "StoreCode": "W-S-LS-ST00008", "StoreId": 1, "StoreName": "teststore1", "StoreType": "D150", "StoreTypeId": 1, "UploadStatus": "N", "VisitDate": "05/09/2022"}; + let menu1={"MenuName":"Survey","MenuId":"1"}; + let isAdhoc=false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + getData(storeData1); + }, []); + + async function getData(storeData1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + let surveyQtns=require('../constants/s_qtns.json'); + // setSurveyJson(surveyQtns); + let arr=[] + for(const i in surveyQtns){ + let item=surveyQtns[i] + let obj={SurveyName:item.SurveyName,SurveyId:item.SurveyId,ShowCat:item.ShowCat} + if(arr.findIndex(a=>a.SurveyId==item.SurveyId)<0) + { + arr.push(obj); + } + } + setSurveys(arr);setProcessing(false); + + } catch (err) { + console.log(err); + } + } + + function openSurveyView(item){ + let {ShowCat}=item + console.log(item); + if(ShowCat==1){ + props.navigation.navigate('DynamicSurveyCat',{'surveyData':item,'storeData':storeData,'menu':currentMenu,'isAdhocScreen':isAdhocScreen}); + } + else{ + props.navigation.navigate('SurveyView',{'surveyData':item,'storeData':storeData,'menu':currentMenu,'isAdhocScreen':isAdhocScreen}); + } + } + + + return ( + + {processing && } + + + + + { Object.keys(storeData).length>0 && + { + return( + {openSurveyView(item)}}> + + + {item.SurveyName.substring(0,1)} + + {item.SurveyName} + + + ); + }} + /> + } + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(DynamicSurveys); \ No newline at end of file diff --git a/src/screens/Feedback.js b/src/screens/Feedback.js new file mode 100644 index 0000000..0ded774 --- /dev/null +++ b/src/screens/Feedback.js @@ -0,0 +1,1536 @@ +import React,{useState,useEffect, useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { customStyles,GetPageTheme, STATUSBAR_HEIGHT } from "../styles/Global"; +import {Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,FlatList, Alert, Dimensions,Animated, Easing} from 'react-native'; +import { connect } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {marktext1,marktext2} from '../controller/functions'; +import {db, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {AntDesign, Entypo, FontAwesome, FontAwesome5, Fontisto, MaterialCommunityIcons} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector'; +import MultiSelect from 'react-native-multiple-select'; +import { PrimaryTheme } from '../styles/Themes'; +import DateTimePicker from '@react-native-community/datetimepicker'; +import DraggableFlatList,{ScaleDecorator} from 'react-native-draggable-flatlist' +// import AudioRecorderPlayer, { AudioEncoderAndroidType, AudioSourceAndroidType, AVEncoderAudioQualityIOSType, AVEncodingOption, AVModeIOSOption } from 'react-native-audio-recorder-player'; +import CustomCamera from '../components/Camera'; + +const {height, width} = Dimensions.get('window'); +const topbarht=STATUSBAR_HEIGHT+50; +const actualWindowHt=parseInt((height-topbarht)+10); + +function Feedback(props) { + const route = useRoute(); + const audioRecorderPlayer = {}//new AudioRecorderPlayer(); + const AudioSet = {} + // { + // AudioEncoderAndroid: AudioEncoderAndroidType.AAC, + // AudioSourceAndroid: AudioSourceAndroidType.MIC, + // AVModeIOS: AVModeIOSOption.measurement, + // AVEncoderAudioQualityKeyIOS: AVEncoderAudioQualityIOSType.high, + // AVNumberOfChannelsKeyIOS: 2, + // AVFormatIDKeyIOS: AVEncodingOption.aac, + // }; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [showRating, setShowRating] = useState(false); + const [RatingQtn, setRatingQtn] = useState({}); + const [RatingOrder, setRatingOrder] = useState([]); + const [showRecorder, setShowRecorder] = useState(false); + const [VRS, setVRS] = useState({}); + const [RecorderTimer, setRecorderTimer] = useState({}); + const [playerTimer, setPlayerTimer] = useState({}); + const [rerenderView, setRerenderView] = useState(0); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [VoiceRecorderStatus, setVoiceRecorderStatus] = useState('Press mic to start recording voice'); + const [RecFilePath, setRecFilePath] = useState({}); + const [dateValue, setDateValue] = useState(''); + const [openDatePicker, setOpenDatePicker]= useState(0); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [rerenderdata, setrerenderdata]= useState(0); + const [SurveySubCats, setSurveySubCats]= useState([]); + const [SurveyQuestions, setSurveyQuestions]= useState([]); + const [QuestionsData,setQuestionsData]=useState({}); + const [showAlert, setShowAlert] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + + + const animatedRipple=useRef(new Animated.Value(0)).current; + const animatedRipple2=useRef(new Animated.Value(0.5)).current; + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + let isAdhoc=params.isAdhocScreen || false; + setStoreData(storeData1); + setCurrentMenu(menu1); + setIsAdhocScreen(isAdhoc); + + + getSurveyData(storeData1); + props.navigation.addListener('beforeRemove', onBeforeRemove); + return (()=>{ + // audioRecorderPlayer.removePlayBackListener(); + // audioRecorderPlayer.removeRecordBackListener(); + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }); + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + + function onRemoveScreen(e){ + Alert.alert( + "", + "Do you really want to exit the screen?", + [ + { + text: "Cancel", + onPress: () => {}, + style: "cancel" + }, + { text: "OK", onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + async function getSurveyData(storeData1){ + try { ; + + await db.transaction(async function (txn) { + + let q2=`SELECT DISTINCT FeedbackCategory as Category,FeedbackCategoryId as CategoryId FROM Master_FeedbackQuestion order by FeedbackQuestionSequence `; + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('feedback cats:',txnres.rows.length); + if(txnres.rows.length>0){ + let arr=[],allQtns=[]; + for(var i=0;i{ + try { + let {StoreId}=storeData1; + + db.transaction(async function (txn) { + + // get inserted audit + let selectlist=` DISTINCT T.FeedbackCategoryId as CategoryId,T.FeedbackCategory as Category,T.FeedbackQuestionId as QuestionId,T.FeedbackQuestionCode as QuestionCode,T.FeedbackQuestionName as Question,T.QuestionType,T.FQShowCamera,T.FQCameraMandatory,T.FQLengthValidationRequired,T.FQMinimumChar,T.FQMaximumChar,T.FQDecimalPoint,T.FQDateRangeMin,T.FQDateRangeMax,T.FQVoiceLengthInMinutes,T.FQDefaultQuestionEnable,T.FeedbackQuestionSequence,T1.ANSWER As Answer, T1.ANSWER_ID as AnswerId,T1.IMAGE_ALLOW1 as ImageAllow1,T1.IMAGE1 as Image1,T1.MULTI_OPTIONS_IDS as multi_op_ids,T1.IS_DISABLED as isDisabled `; + let join=` INNER JOIN ${AppTables.FEEDBACK_DATA} T1 on T.FeedbackQuestionId=T1.QUESTION_ID and T.FeedbackCategoryId=T1.CATEGORY_ID`; + let q2=`Select ${selectlist} FROM Master_FeedbackQuestion T ${join} WHERE T1.STORE_ID='${StoreId}' AND T1.VISIT_DATE= '${d2}' and T.FeedbackCategoryId='${cat.CategoryId}' ORDER BY T.FeedbackQuestionSequence `; + + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('fb data len',txnres.rows.length); + if(txnres.rows.length>0){ + let arr=[]; + var QD=QuestionsData; + for(var i=0;i0){ + for(var k=0;k=0)){ + showImageTag=true; + } + + if(qtn.QuestionType=='Single choice list' && (isandImgAl2 && ansss.AnswerId==selansid)){ + showImageTag2=true; + } + else if(qtn.QuestionType=='Multi choice list' && (isandImgAl2 && selansid.indexOf(ansss.AnswerId)>=0)){ + showImageTag2=true; + } + + } + } + } + + if(showImageTag){ + let imgPath=(Platform.OS=='ios'?'file://':'')+common_ImagePath+data.Image1; + QD[imgname_key]=data.Image1; + QD[img_key]=imgPath; + } + + if(showImageTag2){ + let imgPath=(Platform.OS=='ios'?'file://':'')+common_ImagePath+data.Image2; + QD[imgname_key2]=data.Image2; + QD[img_key2]=imgPath; + } + + + + if(qtn.QuestionType=='Audio'){ + let voicefile_path=(Platform.OS=='ios'?'file://':'')+common_ImagePath+'Recordings/'+data.Answer; + QD[voiceClip_key]={'path':voicefile_path,'filename':data.Answer}; + } + + if(qtn.QuestionType=='Date'){ + let dayonly=moment().format('DD'); + let actual_date=data.Answer?data.Answer.split('/'):[]; + let month=actual_date[0],year=actual_date[1]; + let fulldate=month+'/'+dayonly+'/'+year; + QD[date_key]=fulldate; + + } + arr.push(data); + if(i==txnres.rows.length-1){ + setQuestionsData(QD); + resolve(arr); + } + } + } + else{ + let sl=` DISTINCT T.FeedbackCategoryId as CategoryId,T.FeedbackCategory as Category,T.FeedbackQuestionId as QuestionId,T.FeedbackQuestionCode as QuestionCode,T.FeedbackQuestionName as Question,T.QuestionType,T.FQShowCamera,T.FQCameraMandatory,T.FQLengthValidationRequired,T.FQMinimumChar,T.FQMaximumChar,T.FQDecimalPoint,T.FQDateRangeMin,T.FQDateRangeMax,T.FQVoiceLengthInMinutes,T.FQDefaultQuestionEnable,T.FeedbackQuestionSequence`; + let q=` SELECT ${sl} FROM Master_FeedbackQuestion T WHERE T.FeedbackCategoryId='${cat.CategoryId}' order by T.FeedbackQuestionSequence `; + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('fb qtns:',txnres2.rows.length) + let arr=[]; + if(txnres2.rows.length>0){ + for(var i=0;i{ + db.transaction(async function (txn) { + // get inserted audit + let selectlist=` DISTINCT T.FeedbackAnswerId as AnswerId,T.FeedbackAnswerCode as AnswerCode,T.FeedbackAnswerName as Answer,T.FAShowCamera as ImageAllow1,T.FAQuestionEnable as EnableQuestion,T.FAQuestionDisable as DisableQuestion`; + let q2=`Select ${selectlist} FROM Master_FeedbackQuestion T WHERE T.FeedbackQuestionId='${qtn.QuestionId}' ORDER BY T.FASequence `; + + await txn.executeSql(q2,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return {'Answers':val,'Success':true}; + }).catch((err)=>{ + console.log(err); + return {'Success':false,'Error':err} + }); + } + + async function getImage(imgdata){ + let qtn=getImageProps.qtn || ''; + let type=getImageProps.type || '1'; + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify('Camera unavailable'); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | Question Id :'+qtn.QuestionId+' | Image Type: Feedback'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+qtn.QuestionId+'_FeedbackImg_'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let qd=QuestionsData; + let img_key=type=='1'?qtn.QuestionId+'_ImagePath1':qtn.QuestionId+'_ImagePath2'; + let imgname_key=type=='1'?qtn.QuestionId+'_ImageName1':qtn.QuestionId+'_ImageName2'; + qd[imgname_key]=filename; + + // renamefile + let imagePath=`${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker',uri); + qd[img_key]=uri; + + setQuestionsData(qd); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(qtn,type){ + setGetImageProps({'qtn':qtn,'type':type}); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function disableQtns(sqtns,DQtns,data,isreturn=false){ + if(DQtns.length>0){ + new Promise.all( + DQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.QuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=true + sqtns[s_qtnindex]=s_qtn; + let id_key=s_qtn.QuestionId+'_AnswerId'; + let ans_key=s_qtn.QuestionId+'_Answer'; + data[id_key]=0; + data[ans_key]=''; + return false + }) + ).then(async (val)=>{ + setSurveyQuestions(sqtns); + setQuestionsData(data); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + }) + } + } + + async function enableQtns(sqtns,EQtns,DQtns,data){ + new Promise.all( + EQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.QuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=false + sqtns[s_qtnindex]=s_qtn; + return false + }) + ).then(async (val)=>{ + if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data) + } + else{ + setSurveyQuestions(sqtns); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + }) + } + + function onselectionChange(option,qtn){ + let data=QuestionsData; + let id_key=qtn.QuestionId+'_AnswerId'; + let ans_key=qtn.QuestionId+'_Answer'; + data[id_key]=option.value; + data[ans_key]=option.label; + + setQuestionsData(data); + + let aq_ans=qtn.Answers!=null?qtn.Answers:[]; + let ans_obj=aq_ans.find(i=>i.AnswerId==option.value) || {}; + let EQtns=ans_obj.EnableQuestion!=null && ans_obj.EnableQuestion!=''?ans_obj.EnableQuestion.replace(' ','').split(','):[]; + let DQtns=ans_obj.DisableQuestion!=null && ans_obj.DisableQuestion!=''?ans_obj.DisableQuestion.replace(' ','').split(','):[]; + + let sqtns=SurveyQuestions + if(EQtns.length>0){ + enableQtns(sqtns,EQtns,DQtns,data) + } + else if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data) + } + else{ + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + + } + + function setTextValue(value,qtn) { + let id_key=qtn.QuestionId+'_AnswerId'; + let ans_key=qtn.QuestionId+'_Answer'; + + let obj=QuestionsData; + if(qtn.QuestionType=='Date' ){ + let date_key=qtn.QuestionId+'_Date'; + let d=value!=null?new Date(value):new Date(); + let mfdate=moment(d).format('MM/YYYY'); + showQtnDatePicker(qtn,false); + obj[id_key]=0; + obj[ans_key]=mfdate; + obj[date_key]=moment(d).format('MM/DD/YYYY'); + } + else{ + obj[id_key]=0; + obj[ans_key]=value; + } + console.log(value,obj); + setQuestionsData(obj); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function setRatingValue(data){ + // let ids=[]; + // data.map((item,index)=>{ + // ids.push(item.AnswerId); + // }) + setRatingOrder(data); + } + + + async function setMultiSelectValue(selectedItems=[],qtn) { + console.log('setMultiSelectValue',selectedItems); + let id_key=qtn.QuestionId+'_AnswerId'; + let ans_key=qtn.QuestionId+'_Answer'; + let multi_key=qtn.QuestionId+'_MultiOption'; + let obj=QuestionsData; + obj[id_key]=0; + obj[multi_key]=selectedItems.join(','); + let anss=[]; + selectedItems.map((itemValue)=>{ + let ans = qtn.Answers.find(c1 => c1.AnswerId == itemValue); + if(ans.Answer){anss.push(ans.Answer)} + }); + obj[ans_key]=anss.join(','); + console.log('obj:',obj); + setQuestionsData(obj); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function showQtnDatePicker(qtn,show=false){ + let newqtnIndex=SurveyQuestions.findIndex(q=>q.QuestionId==qtn.QuestionId); + console.log('showQtnDatePicker:',newqtnIndex); + if(newqtnIndex>=0){ + let sq=SurveyQuestions; + let newqtn=sq[newqtnIndex]; + newqtn.showDatePicker=show; + sq[newqtnIndex]=newqtn; + setSurveyQuestions(sq); + if(show==true) setrerenderdata(!rerenderdata); + } + } + + + function setShowQtnKey(qtn,key,show=false){ + if(key!=null && key!=''){ + let newqtnIndex=SurveyQuestions.findIndex(q=>q.QuestionId==qtn.QuestionId); + console.log('setShowQtnKey:',newqtnIndex); + if(newqtnIndex>=0){ + let sq=SurveyQuestions; + let newqtn=sq[newqtnIndex]; + newqtn[key]=show; + sq[newqtnIndex]=newqtn; + setSurveyQuestions(sq); + if(show==true) setrerenderdata(!rerenderdata); + } + } + } + + function onRatingCancel(){ + setShowRating(false); + + } + + function onRatingSave(){ + setShowRating(false); + + let qtn=RatingQtn; + let id_key=qtn.QuestionId+'_AnswerId'; + let ans_key=qtn.QuestionId+'_Answer'; + let rating_key=qtn.QuestionId+'_Rating'; + let ids=[],anss=[]; + RatingOrder.map((item,index)=>{ + ids.push(item.AnswerId); + anss.push(item.Answer); + }) + let obj=QuestionsData; + obj[rating_key]=ids.join(','); + obj[id_key]=0; + obj[ans_key]=anss.join(','); + + console.log(obj); + setQuestionsData(obj); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onRecordCancel(){ + setShowRecorder(false); + } + + function onRecordSave(){ + + let isRecorderPlaying=VRS.RecorderPlayStatus!=null && VRS.RecorderPlayStatus==true; + let isPlayerPlaying=VRS.PlayerPlayStatus!=null && VRS.PlayerPlayStatus==true; + + if(isRecorderPlaying){ + notify('Please stop recording first'); + return; + } + else if(isPlayerPlaying){ + stopPlayer(VRS); + // notify('Please stop playing audio first'); + // return; + } + + setShowRecorder(false); + let qtn=RatingQtn; + let id_key=qtn.QuestionId+'_AnswerId'; + let ans_key=qtn.QuestionId+'_Answer'; + let voiceClip_key=qtn.QuestionId+'_VoiceClip'; + + let obj=QuestionsData; + obj[ans_key]=RecFilePath.filename || ''; + obj[id_key]=0; + obj[voiceClip_key]=RecFilePath; + + setQuestionsData(obj); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + const RippleAnimation = (value,minValue,maxValue,delay) => + Animated.loop( + Animated.sequence([ + Animated.timing(value, { + toValue: maxValue, + duration: 1000, + delay:delay, + useNativeDriver:(Platform.OS=='ios'?false:true), + }), + Animated.timing(value, { + toValue: minValue, + duration: 1000, + delay:delay, + useNativeDriver:(Platform.OS=='ios'?false:true), + }), + ]), + + ).start(); + + const startRecorder = React.useCallback(async (storeData1,qtn,vrStatus) => { + try{ + console.log('startRecorder') + if(audioRecorderPlayer!=null){ + + if(vrStatus['RecorderPlayStatus']==true){ + notify('Already Recording...') + return; + } + else if(vrStatus['PlayerPlayStatus']==true){ + notify('Please stop player first!') + return; + } + + stopPlayer(vrStatus); + + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let commname=storeData1.StoreId+'_'+qtn.QuestionId+'_FeedbackRecording_'+picture_clicked_date+'_'+picture_clicked_time; + let filename=Platform.OS=='ios'?commname+'.m4a':commname+'.mp3'; + + const url=Platform.OS=='ios'?'file://'+common_ImagePath+'Recordings/'+filename:common_ImagePath+'Recordings/'+filename; + const url_dir=common_ImagePath+'Recordings/'; + console.log('write file url:',url); + RNFS.mkdir(url_dir).then((res)=>{ + + RNFS.writeFile(url, '') + .then(async (success) => { + // if(success!=null){ + const path = Platform.select({ + ios: url, + android: url, + }); + + const result = await audioRecorderPlayer.startRecorder(path,AudioSet); + + if(result!=null && result!=''){ + console.log('start recording now'); + vrStatus['RecorderPlayStatus']=true; + setVRS(vrStatus); + setRecFilePath({'path':url,'filename':filename}); + // animate + RippleAnimation(animatedRipple,0,1,0); + RippleAnimation(animatedRipple2,0,1,100); + + audioRecorderPlayer.addRecordBackListener((e) => { + let recordsec=e.currentPosition; + let data={'recordSecs':recordsec,'recordTime':audioRecorderPlayer.mmssss(Math.floor(recordsec))}; + if(vrStatus['RecorderPlayStatus']==true) + { + setRecorderTimer(data); + setHasUnsavedChanges(true); + setVoiceRecorderStatus('Recording... ! Press mic to stop recording'); + } + + console.log('recordsec:',recordsec); + if(recordsec>=60*1000){ + stopRecorder(vrStatus); + notify('Maximum record time limit reached.','LONG'); + } + return; + }); + } + console.log('start recorder:',result); + // } + // else{ + // notify('Something Went Wrong! Cannot open file for recording!'); + // } + + }) + .catch((err) => { + console.log('eerriur1',err.message); + notify('Something Went Wrong! Cannot open file for recording!'); + }); + }) + .catch((err) => { + console.log('eerriur2',err.message); + notify('Something Went Wrong! Cannot open file for recording!'); + }); + + } + } + catch(e){ + console.log('error:',e); + } + + },[]); + + + + + + + const stopRecorder = React.useCallback(async (vrStatus) => { + try{ + console.log('stopRecorder'); + if(audioRecorderPlayer!=null){ + + animatedRipple.setValue(0); + animatedRipple2.setValue(0.5); + const uri = await audioRecorderPlayer.stopRecorder(); + // audioRecorderPlayer.removeRecordBackListener(); + + vrStatus['RecorderPlayStatus']=false; + vrStatus['PlayerPlayStatus']=false; + setPlayerTimer({}); + setVRS({...VRS,vrStatus}); + setVoiceRecorderStatus('Press mic to start recording voice'); + } + } + catch(e){ + console.log('error:',e); + } + + },[]); + + const startPlayer = React.useCallback(async (url,vrStatus1,type='0') => { + try{ + let vrStatus=VRS; + let qtn=RatingQtn; + if(audioRecorderPlayer!=null){ + console.log('startPlayer1',url); + if(vrStatus['PlayerPlayStatus']==true){ + notify('Already Playing...') + return; + } + else if(vrStatus['RecorderPlayStatus']==true){ + notify('Please stop recording first!') + return; + } + else if(url=='' || url==null){ + notify('File not found!') + return; + } + + const result = await audioRecorderPlayer.startPlayer(url); + if(result!=null){ + vrStatus['PlayerPlayStatus']=true; + setVRS(vrStatus); + + audioRecorderPlayer.addPlayBackListener((e) => { + let playDuration=audioRecorderPlayer.mmssss(Math.floor(e.duration)); + let vrs=VRS; + let data={'playerSecs':e.currentPosition,'totalDuration':e.duration,'playDuration':playDuration,'playTime':audioRecorderPlayer.mmssss(Math.floor(e.currentPosition),)}; + let data2={'playerSecs':'0000','totalDuration':e.duration,'playDuration':playDuration,'playTime':"00:00:00"}; + if(vrs['PlayerPlayStatus']==true) + { + setPlayerTimer(e.currentPosition<0?data2:data); + } + if(e.currentPosition<0){ + return ; + } + let wp=e.duration!=null?Math.floor((e.currentPosition/e.duration)* 100):0; + console.log('wp:',wp); + if(wp>=100 || isNaN(wp)){ + stopPlayer(vrs); + } + else if(type=='1' && wp<1){ + pausePlayer(); + } + setProcessing(false); + return; + }); + } + else{ + setProcessing(false); + } + } + } + catch(e){ + console.log('error:',e); + setProcessing(false); + } + + },[]); + + const resumePlayer = React.useCallback(async (url)=>{ + console.log('resume player') + let vrStatus=VRS; + const res=await audioRecorderPlayer.resumePlayer(); + console.log('res:',res); + if(res=='No audio playing'){ + startPlayer(url,vrStatus); + } + vrStatus['PlayerPlayStatus']=true; + setVRS({...VRS,vrStatus}); + },[]); + + + const pausePlayer = React.useCallback(()=>{ + console.log('pause player') + let vrStatus=VRS; + audioRecorderPlayer.pausePlayer(); + vrStatus['PlayerPlayStatus']=false; + setVRS({...VRS,vrStatus}); + },[]); + + const stopPlayer = React.useCallback(async (vrStatus) => { + try{ + console.log('stop player now'); + + if(audioRecorderPlayer!=null){ + const uri = await audioRecorderPlayer.stopPlayer(); + audioRecorderPlayer.removePlayBackListener(); + vrStatus['PlayerPlayStatus']=false; + setVRS({...VRS,vrStatus}); + } + } + catch(e){ + console.log('error:',e); + } + + },[]); + + async function show_recorder(qtn){ + let voiceClip_key=qtn.QuestionId+'_VoiceClip'; + let url=QuestionsData[voiceClip_key]?QuestionsData[voiceClip_key].path :''; + setRatingQtn(qtn); + if((RecorderTimer==null || Object.keys(RecorderTimer).length<=0) && (playerTimer==null || Object.keys(playerTimer).length<=0) && url!=null && url!=''){ + setLoaderTitle('Loading...'); + setProcessing(true); + await startPlayer(url,VRS,'1'); + } + setRecFilePath((QuestionsData[voiceClip_key] || {})); + setShowRecorder(true); + } + + async function onSubmitData(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + function onSaveCancel(){ + setShowAlert(false); + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + // remove old data + let q=`DELETE FROM ${AppTables.FEEDBACK_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('fb data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + + var values=''; + for(var i=0;ii.AnswerId==selansid) + let showImageTag=false; + + let imgallow1=ans_obj!=null && ans_obj['ImageAllow1']!=null?ans_obj.ImageAllow1:false; + let f_imgalloq1=(FQShowCamera=='true' || FQShowCamera==1) || (imgallow1=='true' || imgallow1==1) + + values+=` ('${StoreId}','${d2}','${CategoryId}','${QuestionCode}','${QuestionId}','${QuestionType}','${selans}','${selansid}','${f_imgalloq1}','${imgName1}','${multiops}','${isQtnDisabled}','${d2}') `; + } + + + let add_data=`INSERT INTO ${AppTables.FEEDBACK_DATA} (STORE_ID,VISIT_DATE,CATEGORY_ID,QUESTION_CODE,QUESTION_ID,QUESTION_TYPE,ANSWER,ANSWER_ID,IMAGE_ALLOW1,IMAGE1,MULTI_OPTIONS_IDS,IS_DISABLED,ADDED_DATE) VALUES ${values} `; + + await txn.executeSql(add_data,[],async function (txn2, txnres) { + console.log('surveys added'); + props.set_autoback({'AutoGoToPrev':true}); + notify('Survey updated successfully','SHORT'); + setProcessing(false); + props.navigation.goBack(); + + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot update survey') },); + + + }); + } catch (err) { + console.log(err); + } + } + + async function validate(){ + var isvalid=true; + const QD=QuestionsData; + console.log(SurveyQuestions.length); + for(var i=0;i0){ + for(var j=0;j i==ansss.AnswerId)>=0)){ + showImageTag=true; + } + } + } + } + + console.log('showImageTag',showImageTag,QD[img_key]); + + if(qtn.QuestionType=='Multi choice list' && selansid.length<=0){ + isvalid=false; + notify('Please select options for the required field','SHORT'); + break; + } + else if( checkForAnsKey && (Object.keys(QD).indexOf(ans_key)<0 || (Object.keys(QD).indexOf(ans_key)>=0 && QD[ans_key]===''))){ + console.log('test1'); + isvalid=false; + let msg=( qtn.QuestionType=='Date'?'Please pick a date':(qtn.QuestionType=='Rating'?'Please select rating':'Please fill all details')); + notify(msg,'SHORT'); + break; + } + else if( qtn.QuestionType=='Audio' && (Object.keys(QD).indexOf(voiceClip_key)<0 || (Object.keys(QD).indexOf(voiceClip_key)>=0 && (QD[voiceClip_key]==null || QD[voiceClip_key].filename==null || QD[voiceClip_key].filename=='')))){ + isvalid=false; + notify('Please record audio clip for the required field','SHORT'); + break; + } + else if(Object.keys(QD).indexOf(id_key)<0 || (Object.keys(QD).indexOf(id_key)>=0 && (QD[id_key]==='' || (QD[id_key]===0 && qtn.isDisabled===true) ))){ + + isvalid=false; + notify('Please fill all details','SHORT'); + break; + } + else if(showImageTag && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + isvalid=false; + notify('Please add images','SHORT'); + break; + }else{ + console.log('no condition found'); + } + + } + + return isvalid; + } + + function render_Picker(label_key,value_key,onChange=()=>{},selected_data={}){ + var data=[]; + let qtn=selected_data.qtn || {}; + let isQtnDisabled=qtn.isDisabled!=null && qtn.isDisabled!=''?qtn.isDisabled:false; + let allAnswers=qtn.Answers || []; + + allAnswers.map((item,index)=>{ + let obj={ key: index, label: item[label_key],value:item[value_key] }; + if(selected_data.value==item[label_key]) + obj['component']= {item[label_key]}; + data.push(obj); + }); + + return ( + {onChange(option,qtn) }} + overlayStyle={customStyle.addVisPickerOverlay} + cancelContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + optionStyle={customStyle.addvis_opStyle} + optionTextStyle={customStyle.addvis_opTextStyle} + optionContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + selectedKey={'1'} + disabled={isQtnDisabled} + > + {(selected_data.value!=null && selected_data.value!=''?selected_data.value: '-select-')} + + ) + } + + function renderDatePicker(qtn){ + let qtnn=qtn; + let DateRange=qtn.DateRange; + let maxDate=moment().add(10,'years').format('MM/DD/YYYY'); + let minDate=moment().subtract(10,'years').format('MM/DD/YYYY'); + if(DateRange=='RFD'){ + maxDate=moment().format('MM/DD/YYYY'); + } + else if(DateRange=='RPD'){ + minDate=moment().format('MM/DD/YYYY'); + } + + return ( + {setTextValue(selectedDate,qtnn)}} + maximumDate={new Date(maxDate)} + minimumDate={new Date(minDate)} + /> + ); + } + + function renderItem({ item, drag, isActive }){ + return ( + + + {item.Answer} + + + ); + }; + + function renderRatingView(){ + let qtn=RatingQtn; + let Answers=qtn.Answers; + let id_key=qtn.QuestionId+'_AnswerId'; + let ans_key=qtn.QuestionId+'_Answer'; + let rating_key=qtn.QuestionId+'_Rating'; + // let ratings=QuestionsData[rating_key]!=null?QuestionsData[rating_key].split(','):[]; + + let newarr=RatingOrder; + if(RatingOrder.length<=0){ + newarr=Answers; + } + + return ( + + + Drag Items In Order + Press and hold to drag + {setRatingValue(data)}} + keyExtractor={(item) => item.AnswerId} + renderItem={renderItem} + /> + + {onRatingCancel()}}> + Cancel + + {onRatingSave()}}> + Save + + + + + ) + } + + function renderRecorderView(){ + + let qtn=RatingQtn; + let isRecorderPlaying=VRS.RecorderPlayStatus!=null && VRS.RecorderPlayStatus==true; + let isPlayerPlaying=VRS.PlayerPlayStatus!=null && VRS.PlayerPlayStatus==true; + const scale=animatedRipple.interpolate({ + inputRange:[0,1], + outputRange:[1,1.3], + }); + + const borderColor=animatedRipple.interpolate({ + inputRange:[0,1], + outputRange:['#f5acb4c2','#fce6e9e3'], + }); + + const scale2=animatedRipple2.interpolate({ + inputRange:[0,1], + outputRange:[1,1.5], + }); + + const borderColor2=animatedRipple2.interpolate({ + inputRange:[0,1], + outputRange:['#f5acb4c2','#fce6e9e3'], + }); + + let totalDuration=RecorderTimer.recordSecs!=null?RecorderTimer.recordSecs:playerTimer.totalDuration; + let wp=totalDuration!=null?Math.floor((playerTimer.playerSecs/totalDuration)* 100):0; + let width1=wp<=100?(wp>0?wp+'%':'0%'):'100%'; + if(isNaN(wp)) width1='0%'; + + return ( + + {rerenderView==rerenderView && + + Record Voice Clip + You can record max for 60 secs + {VoiceRecorderStatus} + + + + + + {startRecorder(storeData,qtn,VRS); }}> + + + {isRecorderPlaying && + {stopRecorder(VRS); }}> + + + } + + + + {RecorderTimer.recordTime} + { + (!isRecorderPlaying && RecFilePath.filename!=null && RecFilePath.filename!='') && + + + + + + + {`${(playerTimer.playTime || '00:00:00')} / ${playerTimer.playDuration || RecorderTimer.recordTime}`} + + + + {let url=(Platform.OS=='ios'?'file://':'')+common_ImagePath+'Recordings/'+RecFilePath.filename; (wp<100 && wp>0)? resumePlayer(url):startPlayer(url,VRS); }}> + + + {isPlayerPlaying && { wp<100?pausePlayer():stopPlayer(VRS); }}> + + } + + + } + + + + {onRecordCancel()}}> + Cancel + + {onRecordSave()}}> + Save + + + } + + ) + } + + function _renderSurveyQtns(cat){ + const SurveyQuestions=cat.Questions; + return ( + + { + SurveyQuestions.length>0 && + SurveyQuestions.map((item,index)=>{ + + let qtn=item; + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.QuestionId+'_AnswerId'; + let ans_key=qtn.QuestionId+'_Answer'; + let multi_key=qtn.QuestionId+'_MultiOption'; + let date_key=qtn.QuestionId+'_Date'; + let img_key=qtn.QuestionId+'_ImagePath1'; + let imgname_key=qtn.QuestionId+'_ImageName1'; + let img_key2=qtn.QuestionId+'_ImagePath2'; + let imgname_key2=qtn.QuestionId+'_ImageName2'; + let rating_key=qtn.QuestionId+'_Rating'; + let voiceClip_key=qtn.QuestionId+'_VoiceClip'; + let list_mcdata=[]; + + if(qtn.QuestionType=='Single choice list') + { + selansid=QuestionsData[id_key]!=null ?QuestionsData[id_key] :''; + selanswer=QuestionsData[ans_key]!=null ?QuestionsData[ans_key] :''; + } + else if(qtn.QuestionType=='Multi choice list') + { + + if(qtn.Answers!=null){ + console.log('qtn.Answers:',qtn.Answers.length); + for(var i=0;i0){ + let arr=[]; + for(var i=0;i0){ + for(var i=0;i=0)){ + showImageTag=true; + } + } + } + } + + if(showImageTag){ + selimg=QuestionsData[img_key]!=null && QuestionsData[img_key]!=''?'file://'+QuestionsData[img_key]:''; + } + + return( + + {qtn.Question} + {qtn.QuestionType=='Single choice list' && qtn.Answers && + render_Picker('Answer','AnswerId',onselectionChange,{value:selanswer,qtn:qtn}) + } + {qtn.QuestionType=='Multi choice list' && qtn.Answers && + {console.log('onSelectedItemsChange');setMultiSelectValue(selectedItems,qtn) }} + selectedItems={selansid} + selectText="Pick Items" + searchInputPlaceholderText="Search Items..." + // onChangeInput={ (text)=> console.log(text)} + tagRemoveIconColor={PrimaryTheme.$primary_color} + tagBorderColor={PrimaryTheme.$primary_color} + tagTextColor={PrimaryTheme.$primary_color} + selectedItemTextColor={PrimaryTheme.$primary_color} + selectedItemIconColor={PrimaryTheme.$primary_color} + itemTextColor={PrimaryTheme.$text_color} + displayKey="Answer" + searchInputStyle={{ color: '#CCC' }} + submitButtonColor={PrimaryTheme.$primary_color} + submitButtonText="Submit" + /> + } + { (qtn.QuestionType=='Number' || qtn.QuestionType=='Decimal' || qtn.QuestionType=='Text') && + {setTextValue(val,qtn)}} + autoComplete='off' + /> + } + { + (qtn.QuestionType=='Date') && + + {selansid!=''?selansid:'MM/YYYY'} + {setDateValue(selanswer);showQtnDatePicker(qtn,true)}}> + + + + } + { ((qtn.showDatePicker==true || qtn.showDatePicker=='true') && (qtn.QuestionType=='Date') ) && + renderDatePicker(qtn) + } + { + (qtn.QuestionType=='Rating') && + + {selanswer} + {setRatingQtn(qtn);setShowRating(true);}}> + + + + } + + { + (qtn.QuestionType=='Audio') && + + {selanswer} + {show_recorder(qtn);}}> + + + + } + + { + showImageTag && + + + {openCamera(qtn,'1')}}> + + + + } + + + ) + }) + } + + + ); + } + + + function _renderSurveyView(){ + return ( + + { + let cat=item,s_index=index; + + return ( + + + {cat.Category} + + { _renderSurveyQtns(cat)} + + ) + }} + > + + + + ); + } + + + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + { + _renderSurveyView() + } + + {onSubmitData()}}/> + + + + { showRating==true && + renderRatingView() + } + { showRecorder==true && + renderRecorderView() + } + + ); + } + + +export default connect(mapStateToProps, mapDispatchToProps)(Feedback); \ No newline at end of file diff --git a/src/screens/GateMeeting.js b/src/screens/GateMeeting.js new file mode 100644 index 0000000..c7628e6 --- /dev/null +++ b/src/screens/GateMeeting.js @@ -0,0 +1,507 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,SafeAreaView} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import moment from 'moment'; +import { CustomPicker } from '../components/CustomPicker'; +import cameraImg from '../assets/performics/camera_front_image.svg' + +import CustomHeader from '../components/customHeader'; +import Svg, { SvgUri, SvgXml} from 'react-native-svg'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import * as RNFS from 'react-native-fs'; +import MultiSelect from 'react-native-multiple-select'; +import {notify} from '../components/notify'; +import {get_item} from '../components/localStorage'; +import { common_ImagePath, db, resumeurl} from '../constants/constants'; +import { PrimaryTheme } from '../styles/Themes'; +import CustomCamera from '../components/Camera'; +import { FontAwesome, Ionicons, MaterialCommunityIcons } from '../components/icons'; +import { UploadData2, UploadFormData, validateNumber } from '../controller/functions'; +import { ConfirmSaveAlert } from '../components/alert'; +import GradientButton from '../components/gradientButton'; +import { AppTables } from '../constants/tableConstants'; +import { METHODS, getMethodName } from '../constants/methodNames'; +import { FlatList } from 'react-native'; +import { getImagePOSTData } from '../constants/uploadData'; +import CustomModal from '../components/CustomModal'; + + + +function GateMeeting(props) { + const route = useRoute(); + + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const [showCamera, setShowCamera] = useState(false); + const [formData, setFormData] = useState({}); + const [rerenderdata, setrerenderdata] = useState(0); + + const [processing, setProcessing] = useState(false); + const [gateMeeting,setgateMeeting] = useState([]); + const [discussionPoints,setdiscussionPoints] = useState([]); + + const [EmployeeName,setEmployeeName] = useState([]); + + const [EmployeeID,setEmployeeID] = useState([]); + const [image, setimage] = useState({}); + const [getImageProps,setGetImageProps]= useState({}); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [showRemoveConfirm_M,setshowRemoveConfirm_M]= useState(false); + const [toRemoveId,setToRemoveId]= useState(''); + const [showRAllC_M,setShowRAllC_M]= useState(false); + const [toRemoveItem,setToRemoveItem]= useState({}); + const [AddVisibility, setAddVisibility] = useState([]); + const [showAlert, setShowAlert] = useState(false); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + + const [selectedItems, setSelectedItems] = useState([]); + const d1=new Date(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [nodataFound, setNodataFound] = useState(false); + const [AddVisFormData, setAddVisFormData] = useState({}); + const [currentCheckOutItem, setCurrentCheckOutItem]= useState({}); + const [removedVisitor, setRemovedVisitor]= useState({}); + + const [showCheckOutModal, setShowCheckOutModal]= useState(false); + const [showRemoveVistor, setShowRemoveVistor]= useState(false); + const [DErrorMsg, setDErrorMsg] = useState({}); + + const [showDErrAlert, setshowDErrAlert] = useState(false); + + const d2=moment(d1).format('MM/DD/YYYY'); + const time = moment(d1).format('hh:mm:ss'); + + // const DATA = [ + // { id: EmployeeID, name: MerchandiserName }, + // ]; + + useEffect(() => { + + // getData(); + + const willFocusSubscription = props.navigation.addListener('focus', () => { + + getData(); + }); + + return willFocusSubscription; + }, [ ]); + + + async function getData(){ + setLoaderTitle(ST.Loading+'...'); + setProcessing(true); + + try{ + db.transaction(async function (txn) { + // get inserted audit + let q = `SELECT * FROM ${AppTables.GATE_MEETING} ` + db.transaction(async function (txn) { + txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + // show from local + let gatemeeting=[]; + for(var i=0;i{ + db.transaction(async function (txn) { + // get inserted audit + let q = `SELECT DISCUSSION_POINTS FROM ${AppTables.GATE_MEETING_DISCUSSION} WHERE GATEMEETING_ID='${gateMeeting.UNIQUE_ID}' ` + await db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres2) { + // console.log('txnres4',txnres2.rows.length) + if(txnres2.rows.length>0){ + // show from local + let dp=[]; + for(var i=0;i',data) + dp.push(data.DISCUSSION_POINTS) + + if(i==(txnres2.rows.length-1)) + { + setdiscussionPoints(dp) + setrerenderdata(!rerenderdata); + resolve(dp) + } + } + } + else{ + setrerenderdata(!rerenderdata); + resolve([]) + + } + + },function(txn2,txnerr){console.log(txnerr);resolve([]) }); + }); + + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + return [] + }); + } + + + function showRemoveGateMeetPopUp(data,index){ + setToRemoveItem(data); + setToRemoveId(index); + setshowRemoveConfirm_M(true); + } + + function Remove_DP(){ + let index=toRemoveId; + let data=toRemoveItem; + setLoaderTitle("Remove Gate Meeting..") + setProcessing(true); + setshowRemoveConfirm_M(false); + try{ + let {UNIQUE_ID}=data; + db.transaction(async function (txn) { + // delete data from gate meetting table + let q = `Delete from ${AppTables.GATE_MEETING} WHERE UNIQUE_ID='${UNIQUE_ID}' ` + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log("Removed data from Gate Meeting"); + + // remove data from discussion points + let q2 = `Delete from ${AppTables.GATE_MEETING_DISCUSSION} WHERE GATEMEETING_ID='${UNIQUE_ID}' ` + await txn.executeSql(q2,[],async function (txn2, txnres2) { + console.log("Removed data from Gate Meeting discussion points"); + let alldata=gateMeeting; + alldata.splice(index,1); + setgateMeeting(alldata); + notify("Removed Successfully!") + setProcessing(false); + },function(txn2,txnerr){console.log(txnerr);setProcessing(false); notify("Cannot remove data!")}); + },function(txn2,txnerr){console.log(txnerr); setProcessing(false); notify("Cannot remove data!")}); + + }); + }catch(err){ + console.log(err); + } + + } + + async function uploadGateMeetingData(data,index){ + const url=props.baseurl+getMethodName(METHODS.UPLOADJSON_METHOD); + setLoaderTitle("Uploading Data...") + setProcessing(true); + console.log('gmuploaddata',typeof(data.EMP_ID)) + let empIDs =data.EMP_ID!=null && data.EMP_ID!='' && data.EMP_ID!=undefined ?data.EMP_ID+'':[]; + let employeesArr=empIDs!=null&&empIDs!=''? empIDs.split(',') :[]; + + let obj={ + "MID":0, + "UniqueId":data.UNIQUE_ID, + "UserId":props.UserId, + "VisitDate":d2, + "Time":data.TIME, + "Image":data.IMAGE, + "MerchandiserId":employeesArr, + "DiscussionPoints":data.DISCUSSION_POINTS + } + + let JsonChange=JSON.stringify(obj)?.replace(/'/g, '"') + + let postData={ + "MID":0, + "Keys":"GateMeeting_Sup", + "JsonData":JsonChange, + "UserId":props.UserId, + }; + + console.log('postData',postData) + + let ImageName = data.IMAGE; + let imgPath='file://'+`${common_ImagePath}${ImageName}`; + + await UploadData2(url,postData) + .then(async(res)=>{ + console.log('res:',res); + if(res.UploadJsonResult!=null && res.UploadJsonResult=='Success'){ + + + // uplod images + const url2=(props.imageUploadUrl || URL_IMAGE)+getMethodName (METHODS.UPLOADIMAGES_METHOD); + let upload_status = 'U'; + if(ImageName!='' && ImageName!=null){ + let file={ + uri: imgPath, + type: 'image/jpeg', + name: ImageName, + filetype:'image', + folderName:'SupGateMeetingImages', + } + + let isExists=await RNFS.exists(file.uri).then((res)=>{return res;}); + console.log('isExists file',isExists); + if(isExists==true){ + let fileData=getImagePOSTData(file,d2); + + let isImageUploaded=await UploadFormData(url2,fileData); + console.log('isImageUploaded',isImageUploaded) + if(isImageUploaded.success==false){ + let obj={"ErrorMsg":"!! Network Connection Failed..! Please Connect Internet!!!"} + + upload_status='D' + notify('Cannot upload image!'); + } + } + else{ + notify("Error uploading image! Image does not exists"); + } + } + + let isupdated =updateGateMeetUploadStatus(data.UNIQUE_ID,upload_status); + if(isupdated){ + notify('Data Uploaded Sucessfully!'); + setProcessing(false); + //update status locally + data.UPLOADSTATUS="U"; + let alldata=gateMeeting; + // let GMIndex=alldata.findIndex(i=>i.UNIQUE_ID==data.UNIQUE_ID); + if(index>=0){ + alldata[index]=data; + setgateMeeting(alldata); + setrerenderdata(!rerenderdata) + } + } + else{ + setProcessing(false); + notify("Cannot update upload status!"); + } + + }else{ + setProcessing(false); + notify(ST.Cannotuploaddata); + } + }) + .catch((err)=>{ + console.log(err); + setProcessing(false); + notify(ST.Cannotuploaddata); + }); + + } + async function uploadImageOnly(data,index){ + const url=props.baseurl+getMethodName(METHODS.UPLOADJSON_METHOD); + setLoaderTitle("Uploading Image...") + setProcessing(true); + + let ImageName = data.IMAGE; + let imgPath='file://'+`${common_ImagePath}${ImageName}`; + const url2=(props.imageUploadUrl)+getMethodName (METHODS.UPLOADIMAGES_METHOD); + + let upload_status='U'; + if(ImageName!='' && ImageName!=null){ + let file={ + uri: imgPath, + type: 'image/jpeg', + name: ImageName, + filetype:'image', + folderName:'SupGateMeetingImages', + } + + let isExists=await RNFS.exists(file.uri).then((res)=>{return res;}); + console.log('isExists file',isExists); + if(isExists==true){ + let fileData=getImagePOSTData(file,d2); + + let isImageUploaded=await UploadFormData(url2,fileData); + console.log('isImageUploaded',isImageUploaded) + if(isImageUploaded.success==false){ + upload_status='D' + notify('Cannot upload image!'); + } + } + else{ + notify("Image does not exists!"); + } + } + + let isupdated =updateGateMeetUploadStatus(data.UNIQUE_ID,upload_status); + if(isupdated){ + notify('Data Uploaded Sucessfully!'); + setProcessing(false); + //update status locally + data.UPLOADSTATUS="U"; + let alldata=gateMeeting; + // let GMIndex=alldata.findIndex(i=>i.UNIQUE_ID==data.UNIQUE_ID); + if(index>=0){ + alldata[index]=data; + setgateMeeting(alldata); + setrerenderdata(!rerenderdata) + } + } + else{ + setProcessing(false); + notify("Cannot update upload status!"); + } + + } + async function updateGateMeetUploadStatus(uniqueId,upload_status){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q=`Update ${AppTables.GATE_MEETING} SET UPLOADSTATUS='${upload_status}' WHERE USER_ID='${props.UserId}' AND VISIT_DATE='${d2}' and UNIQUE_ID='${uniqueId}'`; + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('Gate Meeting upload status Updated'); + resolve(true); + },function (txn2, txnerr) { console.log(txnerr);resolve(false); },); + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + } + + + return ( + + + {processing && } + + + {/* {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} */} + + {ConfirmSaveAlert(props,showRemoveConfirm_M,()=>{setshowRemoveConfirm_M(false)},Remove_DP,'Do you really want to remove this Discussion Points?')} + + + + + + + {'Gate Meeting Status'} + { + props?.navigation?.navigate('AddGateMeeting') + }}> + Add + + + + { rerenderdata==rerenderdata && + + {gateMeeting.map((item,index)=>{ + let data = item||''; + // console.log("data.MERCHANDISER_NAME:",data) + let MeetDate=data.VISIT_DATE!=null && data.VISIT_DATE!='' ?data.VISIT_DATE:""; + let MeetDT=data.TIME!=null && data.TIME!=''?MeetDate+" "+data.TIME:MeetDate; + let time2 = MeetDT ? moment(MeetDT, MeetDT.includes('/') + ? "MM/DD/YYYY HH:mm:ss" + : "HH:mm:ss" + ).format("HH:mm:ss") + : ''; + + //let formattedDT=MeetDT!=""?moment(MeetDT).format("DD/MM/YYYY h:mm:ss"):""; + return( + + {data.UPLOADSTATUS!='U' && + {showRemoveGateMeetPopUp(item,index)}}> + + + } + + {'Date & Time :'} + {time2} + + + {'Merchandisers/Promoters :'} + {data.MERCHANDISER_NAME} + + + {'Discussion Point :'} + { + data.DISCUSSION_POINTS.map((item,index)=>{ + return( + {item} + ) + }) + } + + {data.UPLOADSTATUS!='U' && + + {data.UPLOADSTATUS=='D'?uploadImageOnly(item,index) :uploadGateMeetingData(item,index)}}> + {'Upload'} + + + } + + {data.UPLOADSTATUS=='U' && + + + {ST.Uploaded} + + } + + {data.UPLOADSTATUS=='D' && + + + {"Data Uploaded, Image Pending!"} + + } + + {(data.UPLOADSTATUS=='' || data.UPLOADSTATUS==null || data.UPLOADSTATUS==undefined) && + + + {"Data Pending, Image Pending!"} + + } + + + ) + + })} + + } + + + + + ); + } + + + + + + +export default connect(mapStateToProps, mapDispatchToProps)(GateMeeting); \ No newline at end of file diff --git a/src/screens/GeoTag copy.js b/src/screens/GeoTag copy.js new file mode 100644 index 0000000..02a4801 --- /dev/null +++ b/src/screens/GeoTag copy.js @@ -0,0 +1,559 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme, WP } from "../styles/Global"; +import {Image,View,Text,ScrollView,TouchableOpacity,Platform,FlatList} from 'react-native'; +import { connect} from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {marktext1,marktext2, UploadData, UploadData2, UploadFormData} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {db, URL_IMAGE} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {AntDesign, Entypo, EvilIcons} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import {SvgXml} from 'react-native-svg'; +import MapView,{ Marker,AnimatedRegion ,Polyline,PROVIDER_GOOGLE}from 'react-native-maps'; +import { _checkLocationPermission } from '../components/geolocation'; +import Geolocation from '@react-native-community/geolocation'; +import { useRef } from 'react'; +import GradientButton from '../components/gradientButton'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; + +import cameraImg from '../assets/performics/camera_icon.svg' +import { AppTables } from '../constants/tableConstants'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; +import CustomCamera from '../components/Camera'; + +function GeoTag(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const [processing, setProcessing] = useState(false); + + const [storeData, setStoreData] = useState({}); + const [StoreImage, setStoreImage] = useState(''); + const [StoreImgPath, setStoreImgPath] = useState(''); + + const [currentLocation, setCurrentLocation] = useState({}); + const [markerCoordinate, setMarkerCoordinate] = useState(); + const [markerPos, setMarkerPos] = useState({}); + const [markerTitle, setMarkerTitle] = useState(''); + const [markerPlaceText, setMarkerPlaceText] = useState(''); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + + const [showCamera, setShowCamera] = useState(false); + + const MyMap=useRef(null); + const MyMarker=useRef(null); + const isCancelled = useRef(false); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + _getCurrentLocation(); + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + isCancelled.current = true; + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + return; + } + } + + async function _getCurrentLocation() { + const hasPermission=await _checkLocationPermission(); + if(hasPermission==true) + { + Geolocation.getCurrentPosition( + async (position) => { + let loc={lat:position.coords.latitude,lng:position.coords.longitude}; + setMarkerPos(loc); + setMarkerCoordinate(new AnimatedRegion({ latitude:loc.lat, longitude: loc.lng })); + setMarkerTitle('Current Location'); + setMarkerPlaceText(`${loc.lat}, ${loc.lng}`) + setCurrentLocation(loc); + }, + (error) => { + notify(ST.Cannotgetuserposition); + }, + { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + ); + } + else{ + notify(ST.Pleaseallowlocationpermission); + } + } + + async function submitGeoTag(){ + if(validate()){ + setLoaderTitle(ST.UploadingData+'...'); + setProcessing(true); + await InsertGeoTag(); + } + } + + + async function InsertGeoTag(){ + try{ + + await db.transaction(async function (txn) { + let {StoreId}=storeData; + let {lat,lng}=markerPos; + lat=lat; + lng=lng; + console.log('geotag lat:',lat,'lng:',lng); + let status='N'; + let values=` ('${StoreId}','${lat}','${lng}','${status}','${status}','${StoreImgPath}','${d2}') `; + let q=`INSERT INTO ${AppTables.GEOTAG}(STORE_ID,LATITUDE,LONGITUDE,GEO_TAG,STATUS,FRONT_IMAGE,ADDED_DATE) VALUES ${values} `; + + await txn.executeSql(`Delete from ${AppTables.GEOTAG} where STORE_ID='${StoreId}' and ADDED_DATE='${d2}'`,[],async function (txn2, txnres2) { + console.log('old geotag removed'); + await txn.executeSql(q,[],async function (txn2, txnres3) { + console.log('geotag added'); + uploadGeoTagData(); + },function(txn2,txnerr){console.log(txnerr);}); + + },function(txn2,txnerr){console.log(txnerr);}); + + // await txn.executeSql(`Select * from ${AppTables.GEOTAG} where STORE_ID='${StoreId}' and ADDED_DATE='${d2}'`,[],async function (txn2, txnres2) { + // console.log('geotag added'); + // if(txnres2.rows.length>0){ + // console.log('geotag already added'); + // uploadGeoTagData(); + // } + // else{ + // await txn.executeSql(q,[],async function (txn2, txnres3) { + // console.log('geotag added'); + // uploadGeoTagData(); + // },function(txn2,txnerr){console.log(txnerr);}); + // } + + // },function(txn2,txnerr){console.log(txnerr);}); + }); + + } + catch(e){ + console.log(e);setProcessing(false); + } + } + + async function uploadGeoTagData(){ + let {lat,lng}=markerPos; + lat=lat; + lng=lng; + let geotag_obj={ + "STORE_ID":storeData.StoreId, + "VISIT_DATE":d2, + "LATITUDE":lat, + "LONGITUDE":lng, + "FRONT_IMAGE":StoreImage, + }; + let allGeoTags=[geotag_obj]; + let data={ + "MID":"0", + "Keys":"Sup_GeoTag", + "JsonData":JSON.stringify(allGeoTags), + "UserId":(props.UserId || ''), + }; + + var data1 = new FormData(); + data1.append('file', { + uri: StoreImgPath, + type: 'image/jpg', + name: StoreImage, + }); + + let foldername=getFolderName(StoreImage); + data1.append('Foldername',foldername); + data1.append('Path', d2); + + const url=props.baseurl+getMethodName(METHODS.UPLOADJSON_METHOD); + const url1=(props.imageUploadUrl || URL_IMAGE)+getMethodName(METHODS.UPLOADIMAGES_METHOD); + console.log(url,data); + + await UploadData2(url,data) + .then(async(res)=>{ + console.log(res); + + if(res.UploadJsonResult && res.UploadJsonResult.includes('Success')){ + await UpdateGeoTagStatus(); + // Upload Image + + await UploadFormData(url1,data1) + .then(async(res1)=>{ + console.log('res1:',res1); + if(res1.includes('Success')){ + console.log('image uploaded'); + RNFS.unlink(StoreImgPath); + } + }) + .catch((err)=>{ + console.log(err); + }); + } + else{ + setProcessing(false); + notify(ST.Cannotuploadgeotag) + } + }) + .catch((err)=>{ + console.log(err);setProcessing(false); + }); + + } + + function exit(storeData1={}){ + + notify(ST.GeoTagDataUploadedSuccessfully,'LONG'); + setProcessing(false); + // props.navigation.goBack(); + props.navigation.pop();props.navigation.push('StoreCheckin',{storeData:storeData1,'isAdhoc':isAdhocScreen}) + } + + async function UpdateGeoTagStatus(){ + try{ + await db.transaction(async function (txn) { + let {StoreId}=storeData; + let {lat,lng}=markerPos; + lat=lat; + lng=lng; + let status='Y'; + let JcpType=isAdhocScreen==true?'Adhoc_JourneyPlan':'Mapping_JourneyPlan'; + let q=`Update ${AppTables.GEOTAG} set GEO_TAG='${status}',STATUS='${status}' where STORE_ID='${StoreId}' and ADDED_DATE='${d2}'`; + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('geotag update'); + + let q2=`Update ${JcpType} set GeoTag='${status}',Latitude='${lat}',Longitude='${lng}' where StoreId='${StoreId}'`; + await txn.executeSql(q2,[],async function (txn2, txnres2) { + console.log('geotag updated in store'); + // update geotag locally + let stored_new=storeData; + stored_new['GeoTag']='Y'; + stored_new['Latitude']=lat; + stored_new['Longitude']=lng; + setStoreData(stored_new); + + exit(stored_new); + },function(txn2,txnerr){console.log(txnerr);notify(ST.Geotaguploadedbutcannotupdategeotagstatus,'LONG');setProcessing(false);}); + + },function(txn2,txnerr){console.log(txnerr);notify(ST.Geotaguploadedbutcannotupdategeotagstatus,'LONG');setProcessing(false);}); + }); + } + catch(e){ + console.log(e); + notify(ST.Geotaguploadedbutcannotupdategeotagstatus,'LONG');setProcessing(false); + } + } + + function validate(){ + if(markerPos=='' || markerPos==null || markerPos.lat=='' || markerPos.lat==null || markerPos.lng=='' || markerPos.lng==null){ + notify(ST.Pleaseclickstorefrontimage,'SHORT'); + return false; + } + else if(StoreImage=='' || StoreImage==null){ + notify(ST.Pleaseclickstorefrontimage,'SHORT'); + return false; + } + return true; + } + + async function getImage(imgdata){ + + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: Geo Tag'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+storeData.EmpId+'_GeoTag-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + setStoreImage(filename); + // renamefile + let imagePath=`${RNFS.DocumentDirectoryPath}/${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker',uri); + setStoreImgPath(uri); + }) + .catch(err => { + console.log(ST.Errorimagefilewritefailed+'!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(){ + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + + function moveMarkerToPos(e){ + + let coords=e.nativeEvent.coordinate; + console.log('moveMarkerToPos',coords) + + // if(MyMap.current!=null){ + // MyMap.current.animateToRegion({ + // latitude: coords.latitude, + // longitude: coords.longitude, + // latitudeDelta: 0.0922, + // longitudeDelta: 0.0421, + // },1000); + // } + animateCamera(coords); + animateMarkerToRegion(coords); + setMarkerInfo(coords); + let loc={lat:coords.latitude,lng:coords.longitude}; + setMarkerPos(loc); + } + + function animateMarkerToRegion(coords) { + const newCoordinate = coords; + const new_animated_coords=new AnimatedRegion({ latitude:coords.latitude, longitude: coords.longitude }); + if (Platform.OS === 'android') { + if (MyMarker) { + MyMarker.current.animateMarkerToCoordinate(newCoordinate, 1000); + } + } else { + // `useNativeDriver` defaults to false if not passed explicitly + markerCoordinate.timing({ ...newCoordinate, useNativeDriver: false,duration:1000 }).start(); + } + setTimeout(()=>{setMarkerCoordinate(new_animated_coords);},1000); + + } + + async function setMarkerInfo(coords){ + if(MyMap.current!=null){ + MyMap.current.addressForCoordinate(coords) + .then((res)=>{ + console.log('res:',res); + let title=res.name; + let placeText=`${res.subLocality}, ${res.locality}, ${res.administrativeArea} ${res.postalCode}`; + setMarkerTitle(title); + setMarkerPlaceText(placeText); + + }) + } + } + + async function animateCamera(coords) { + if(MyMap.current!=null){ + const camera = await MyMap.current.getCamera(); + // camera.heading = 90; + // camera.pitch = 45; + // camera.altitude = 1000; + // camera.zoom = 1000; + camera.center.latitude = coords.latitude; + camera.center.longitude = coords.longitude; + MyMap.current.animateCamera(camera, { duration: 2000 }); + } + } + + + function _renderMap(){ + const lat =currentLocation.lat?currentLocation.lat:28.579660; + const lng=currentLocation.lng?currentLocation.lng:77.321110; + + if(currentLocation.lat!=null) + { + return ( + + + {console.log('on press')}} + // onRegionChangeComplete={(region,details)=>{console.log('on region change',region)}} + onPress={moveMarkerToPos} + + > + {console.log('on drag end:',e.nativeEvent.coordinate)}} + coordinate={ markerCoordinate} + pinColor={'#ff78b6'} + title={markerTitle} + description={markerPlaceText} + /> + + + {_render_captureImage()} + + ); + } + else{ + return() + } + } + + function _render_captureImage(){ + const isImageAvlbl=StoreImage!='' && StoreImage!=null && StoreImgPath!='' && StoreImgPath!=null; + + return ( + + + + {isImageAvlbl && } + {!isImageAvlbl && } + + {openCamera()}}> + {} + + {ST.ClickStoreFrontImage} + + + + ); + } + + return ( + + {processing && } + + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + { Object.keys(storeData).length>0 && + + + + + + + + {storeData.StoreName} + + + + + + {ST.StoreId+':'} + {storeData.StoreId} + + + {ST.StoreCode+':'} + {storeData.StoreCode} + + + + + {ST.Address+':'} + {storeData.Address} + + + + + + + { + // isCancelled.current==false && + _renderMap() + } + + {submitGeoTag()}}/> + + + + } + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(GeoTag); \ No newline at end of file diff --git a/src/screens/GeoTag.js b/src/screens/GeoTag.js new file mode 100644 index 0000000..c8c0a09 --- /dev/null +++ b/src/screens/GeoTag.js @@ -0,0 +1,673 @@ +import React, { useState, useEffect } from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles, customStyles, GetPageTheme, WP } from "../styles/Global"; +import { Image, View, Text, ScrollView, TouchableOpacity, Platform, FlatList } from 'react-native'; +import { connect } from 'react-redux'; +import { mapStateToProps, mapDispatchToProps } from '../reducers/contextProvider'; +import { notify } from '../components/notify'; +import moment from 'moment'; +import { marktext1, marktext2, UploadData, UploadData2, UploadFormData,fetchProjectConfig } from '../controller/functions'; +import { get_item, set_item, clear_item } from '../components/localStorage'; +import { db, URL_IMAGE } from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import { AntDesign, Entypo, EvilIcons } from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { SvgXml } from 'react-native-svg'; +import MapView, { Marker, AnimatedRegion, Polyline, PROVIDER_GOOGLE } from 'react-native-maps'; +import { _checkLocationPermission } from '../components/geolocation'; +// import Geolocation from '@react-native-community/geolocation'; +import Geolocation from 'react-native-geolocation-service'; +import { useRef } from 'react'; +import GradientButton from '../components/gradientButton'; +import { launchCamera, launchImageLibrary, CameraOptions } from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; + +import cameraImg from '../assets/performics/camera_icon.svg' +import { AppTables } from '../constants/tableConstants'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; +import CustomCamera from '../components/Camera'; + +function GeoTag(props) { + const route = useRoute(); + const ST = props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const [processing, setProcessing] = useState(false); + + const [storeData, setStoreData] = useState({}); + const [StoreImage, setStoreImage] = useState(''); + const [StoreImgPath, setStoreImgPath] = useState(''); + + const [currentLocation, setCurrentLocation] = useState({}); + const [markerCoordinate, setMarkerCoordinate] = useState(); + const [markerPos, setMarkerPos] = useState({}); + const [markerTitle, setMarkerTitle] = useState(''); + const [markerPlaceText, setMarkerPlaceText] = useState(''); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [EmpData, setEmpData] = useState([]); + const [showCamera, setShowCamera] = useState(false); + const [IsSearchedStore, setIsSearchedStore] = useState(false); + const [isDistributor, setIsDistributor] = useState(false); + const [isNPNDScreen, setisNPNDScreen] = useState(false); + + const MyMap = useRef(null); + const MyMarker = useRef(null); + const isCancelled = useRef(false); + const d1 = new Date(); + const d2 = moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + setLoaderTitle(ST.Loading + '...') + _getCurrentLocation(); + let params = props.route.params ? props.route.params : {}; + let isDistributor1 = params.isDistributor != null ? params.isDistributor : false; + let storeData1 = params.storeData || {}; + let empData1 = params.empData || {}; + let isAdhoc = params.isAdhoc || false; + + fetchProjectConfig(props.ManagerAppConfig) + .then(storewisePjp => { + setIsSearchedStore(storewisePjp.StoreSearch); + console.log('storewisePjpGeoTag:', storewisePjp.StoreSearch); + }) + .catch(err => { + console.error('Config error', err); + }); + + + // let IsSearchedStore1 = params.IsSearchedStore != null && params.IsSearchedStore == 1 ? true : false; + let isNPND = params.isNPND != null ? params.isNPND : false; + //console.log('GeoTag params:', IsSearchedStore1); + + setisNPNDScreen(isNPND) + setIsAdhocScreen(isAdhoc); + // setIsSearchedStore(IsSearchedStore1); + setEmpData(empData1); + setStoreData(storeData1); + setIsDistributor(isDistributor1); + + const onBackSubscription = props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + isCancelled.current = true; + props.navigation.removeListener('beforeRemove', onBeforeRemove); + return onBackSubscription; + }; + }, []); + + useEffect(() => { + console.log('show camera changes:', showCamera); + props.navigation.removeListener('beforeRemove', onBeforeRemove); + const onBackSubscription = props.navigation.addListener('beforeRemove', onBeforeRemove); + return onBackSubscription; + }, [showCamera]); + + function onBeforeRemove(e) { + if (showCamera == true) { + e.preventDefault(); + setShowCamera(false); + } + else { + return; + } + } + + async function _getCurrentLocation() { + const hasPermission = await _checkLocationPermission(); + if (hasPermission == true) { + Geolocation.getCurrentPosition( + async (position) => { + let loc = { lat: position.coords.latitude, lng: position.coords.longitude }; + setMarkerPos(loc); + setMarkerCoordinate(new AnimatedRegion({ latitude: loc.lat, longitude: loc.lng })); + setMarkerTitle('Current Location'); + setMarkerPlaceText(`${loc.lat}, ${loc.lng}`) + setCurrentLocation(loc); + }, + (error) => { + notify(ST.Cannotgetuserposition); + }, + { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + ); + } + else { + notify(ST.Pleaseallowlocationpermission); + } + } + + async function submitGeoTag(IsSearchedStore) { + console.log('submitGeoTag called', IsSearchedStore); + if (validate()) { + setLoaderTitle(ST.UploadingData + '...'); + setProcessing(true); + await InsertGeoTag(IsSearchedStore); + } + } + + + async function InsertGeoTag(IsSearchedStore) { + try { + + db.transaction(async function (txn) { + let { StoreId, MerchandiserId } = storeData; + + let { lat, lng } = markerPos; + lat = lat; + lng = lng; + console.log('geotag lat:', lat, 'lng:', lng); + let status = 'N'; + let tb1 = isDistributor ? AppTables.DB_GEOTAG : AppTables.GEOTAG; + let values = '', q = '', delq = ''; + + if (isDistributor) { + values = ` ('${StoreId}','${lat}','${lng}','${status}','${status}','${StoreImgPath}','${d2}') `; + q = `INSERT INTO ${tb1}(STORE_ID,LATITUDE,LONGITUDE,GEO_TAG,STATUS,FRONT_IMAGE,ADDED_DATE) VALUES ${values} `; + delq = `Delete from ${AppTables.DB_GEOTAG} where STORE_ID='${StoreId}' and ADDED_DATE='${d2}'`; + } + else { + values = ` ('${MerchandiserId}','${StoreId}','${lat}','${lng}','${status}','${status}','${StoreImgPath}','${d2}') `; + q = `INSERT INTO ${tb1}(EMP_ID,STORE_ID,LATITUDE,LONGITUDE,GEO_TAG,STATUS,FRONT_IMAGE,ADDED_DATE) VALUES ${values} `; + delq = `Delete from ${AppTables.GEOTAG} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' and ADDED_DATE='${d2}'`; + } + + txn.executeSql(delq, [], async function (txn2, txnres2) { + console.log('old geotag removed'); + txn.executeSql(q, [], async function (txn2, txnres3) { + console.log('geotag added'); + uploadGeoTagData(IsSearchedStore); + }, function (txn2, txnerr) { console.log(txnerr); }); + }, function (txn2, txnerr) { console.log(txnerr); }); + + // await txn.executeSql(`Select * from ${AppTables.GEOTAG} where STORE_ID='${StoreId}' and ADDED_DATE='${d2}'`,[],async function (txn2, txnres2) { + // console.log('geotag added'); + // if(txnres2.rows.length>0){ + // console.log('geotag already added'); + // uploadGeoTagData(); + // } + // else{ + // await txn.executeSql(q,[],async function (txn2, txnres3) { + // console.log('geotag added'); + // uploadGeoTagData(); + // },function(txn2,txnerr){console.log(txnerr);}); + // } + // },function(txn2,txnerr){console.log(txnerr);}); + }); + + } + catch (e) { + console.log(e); setProcessing(false); + } + } + + async function uploadGeoTagData(IsSearchedStore) { + let { lat, lng } = markerPos; + lat = lat; + lng = lng; + let geotag_obj = {}; + if (isDistributor) { + geotag_obj["DISTRIBUTOR_ID"] = storeData.StoreId; + } else { + geotag_obj["STORE_ID"] = storeData.StoreId; + } + geotag_obj["VISIT_DATE"] = d2, + geotag_obj["LATITUDE"] = lat, + geotag_obj["LONGITUDE"] = lng, + geotag_obj["FRONT_IMAGE"] = StoreImage; + + + let allGeoTags = [geotag_obj]; + let data = { + "MID": "0", + "JsonData": JSON.stringify(allGeoTags), + "UserId": (props.UserId || ''), + }; + + if (isDistributor) { + data["Keys"] = "DB_GeoTag"; + } else { + data["Keys"] = "GeoTag"; + } + + var data1 = new FormData(); + data1.append('file', { + uri: StoreImgPath, + type: 'image/jpg', + name: StoreImage, + }); + + let foldername = getFolderName(StoreImage); + data1.append('Foldername', foldername); + data1.append('Path', d2); + + const url = props.baseurl + getMethodName(METHODS.UPLOADJSON_METHOD); + const url1 = (props.imageUploadUrl || URL_IMAGE) + getMethodName(METHODS.UPLOADIMAGES_METHOD); + console.log(url, data); + + await UploadData2(url, data) + .then(async (res) => { + console.log(res); + + if (res.UploadJsonResult && res.UploadJsonResult.includes('Success')) { + await UpdateGeoTagStatus(IsSearchedStore); + // Upload Image + + await UploadFormData(url1, data1) + .then(async (res1) => { + console.log('res1:', res1); + + if (typeof res1 === 'string' && res1.includes('Success')) { + console.log('image uploaded'); + + // image delete + RNFS.unlink(StoreImgPath).catch(() => { }); + + // ✅ VERY IMPORTANT + setProcessing(false); + exit(storeData,IsSearchedStore); + } else { + setProcessing(false); + notify('Image upload failed'); + } + }) + + } + else { + setProcessing(false); + notify(ST.Cannotuploadgeotag) + } + }) + .catch((err) => { + console.log(err); setProcessing(false); + }); + + } + + function exit(storeData1 = {},IsSearchedStore) { + console.log('exit called===>',IsSearchedStore); + + notify(ST.GeoTagDataUploadedSuccessfully, 'LONG'); + setProcessing(false); + // props.navigation.goBack(); + // props.navigation.pop(); + if (isDistributor) { + props.navigation.replace('DistributorCheckIn', { storeData: storeData1, 'isAdhoc': isAdhocScreen, 'isDistributor': isDistributor, 'isNPND': isNPNDScreen }) + } + else { + // props.navigation.replace('StoreCheckin', { storeData: storeData1, 'isAdhoc': isAdhocScreen, 'isDistributor': isDistributor, 'isNPND': isNPNDScreen }) + props.navigation.navigate('StoreCheckin', { storeData: storeData1, empData: EmpData, 'isAdhoc': isAdhocScreen, 'IsSearchedStore': IsSearchedStore, 'isNPND': isNPNDScreen }); + } + } + + async function UpdateGeoTagStatus(IsSearchedStore) { + console.log('UpdateGeoTagStatus called', IsSearchedStore); + try { + db.transaction(async function (txn) { + let { StoreId, MerchandiserId, EmpId } = storeData; + let { lat, lng } = markerPos; + lat = lat; + lng = lng; + let status = 'Y'; + let tb1 = isDistributor ? AppTables.DB_GEOTAG : AppTables.GEOTAG; + let JcpType = ""; + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const configData = (() => { + try { + return typeof props.ManagerAppConfig === "string" + ? JSON.parse(props.ManagerAppConfig) + : props.ManagerAppConfig; + } catch (e) { + return null; + } + })(); + + const configArray = configData?.ManagerAppConfig ?? []; + const currentConfig = configArray.find( + item => item.Designation?.toLowerCase() === loginDetails?.Designation.toLowerCase() + ); + + const storewisePjp = currentConfig?.StorewisePJP; + + console.log("currentConfigGeoTag:", currentConfig); + console.log("storewisePjpGeoTag:", storewisePjp); + console.log("IsSearchedStoreGeoTag:", IsSearchedStore); + + + if (IsSearchedStore) { + JcpType = "Sup_JourneyPlan"; + } + else if (isDistributor) { + JcpType = "Sup_MasterDistributor"; + } + else if (storewisePjp == true) { + JcpType = isAdhocScreen == true ? "Sup_JourneyPlanStorewiseSup_Adhoc" : isNPNDScreen ? "Sup_NPNDStore" : "Sup_JourneyPlanStorewiseSup"; + } + else { + JcpType = isAdhocScreen == true ? "Sup_AdhocJourneyPlan" : isNPNDScreen ? "Sup_NPNDStore" : "Sup_JourneyPlan"; + } + console.log("MerchandiserId----1", tb1); + let q = `Update ${tb1} set GEO_TAG='${status}',STATUS='${status}' where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId || EmpId}' and ADDED_DATE='${d2}'`; + txn.executeSql(q, [], async function (txn2, txnres2) { + console.log('geotag update', q); + + let q2 = `Update ${JcpType} set GeoTag='${status}',Latitude='${lat}',Longitude='${lng}' where ${isDistributor ? 'DistributorId' : 'StoreId'}='${StoreId}'`; + txn.executeSql(q2, [], async function (txn2, txnres2) { + console.log('geotag updated in store'); + // update geotag locally + let stored_new = storeData; + console.log('stored_new before update--:', storeData); + console.log('stored_new before update:', stored_new); + stored_new['GeoTag'] = 'Y'; + stored_new['Latitude'] = lat; + stored_new['Longitude'] = lng; + setStoreData(stored_new); + + exit(stored_new,IsSearchedStore); + }, function (txn2, txnerr) { console.log(txnerr); notify(ST.Geotaguploadedbutcannotupdategeotagstatus, 'LONG'); setProcessing(false); }); + + }, function (txn2, txnerr) { console.log(txnerr); notify(ST.Geotaguploadedbutcannotupdategeotagstatus, 'LONG'); setProcessing(false); }); + }); + } + catch (e) { + console.log(e); + notify(ST.Geotaguploadedbutcannotupdategeotagstatus, 'LONG'); setProcessing(false); + } + } + + function validate() { + if (markerPos == '' || markerPos == null || markerPos.lat == '' || markerPos.lat == null || markerPos.lng == '' || markerPos.lng == null) { + notify(ST.Pleaseclickstorefrontimage, 'SHORT'); + return false; + } + else if (StoreImage == '' || StoreImage == null) { + notify((isDistributor ? 'Please click distributor front image' : ST.Pleaseclickstorefrontimage), 'SHORT'); + return false; + } + return true; + } + + async function getImage(imgdata) { + + if (typeof imgdata == 'object' && imgdata.errorCode == 'camera_unavailable') { + notify(ST.Cameraunavailable); + } + else if (typeof imgdata == 'object' && imgdata.uri != null) { + const img = imgdata; + const imgurl = img.uri, imgWidth = img.width, imgHeight = img.height; + + + let picture_clicked_time = new Date(); + picture_clicked_time = moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1 = picture_clicked_time; + let mark_text2 = ''; + if (isDistributor) { + mark_text2 = 'Distributor Name:' + storeData.StoreName + ' | Distributor Id:' + storeData.StoreId + ' | User Id:' + props.UserId + ' | Image Type: DB Geo Tag' + ' | Date:' + picture_clicked_time; + } + else { + mark_text2 = 'Store Name:' + storeData.StoreName + ' | Store Id:' + storeData.StoreId + ' | User Id:' + props.UserId + ' | Merch Id:' + storeData.MerchandiserId + ' | Image Type: Geo Tag' + ' | Date:' + picture_clicked_time; + } + await marktext1(mark_text1, imgurl) + .then((res) => { + if (res.success) { + let uri = res.uri; + marktext2(mark_text2, uri, imgWidth, imgHeight) + .then((res) => { + if (res.success) { + let picture_clickedd = new Date(); + let picture_clicked_date = moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time = moment(picture_clickedd).format('HHmmss'); + let filename = ''; + if (isDistributor) { + filename = storeData.StoreId + '_' + props.UserId + '_DBGeoTag-' + picture_clicked_date + '_' + picture_clicked_time + '.jpg'; + } + else { + filename = storeData.StoreId + '_' + props.UserId + '_' + storeData.MerchandiserId + '_GeoTag-' + picture_clicked_date + '_' + picture_clicked_time + '.jpg'; + } + setStoreImage(filename); + // renamefile + let imagePath = `${RNFS.DocumentDirectoryPath}/${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri = 'file://' + imagePath; + console.log('image marker', uri); + setStoreImgPath(uri); + }) + .catch(err => { + console.log(ST.Errorimagefilewritefailed + '!!!'); + console.log(err.message, err.code); + }); + + } + else { + if (res.imagenotfound) { + notify(ST.Pleasecaptureaimage); + } + else { + notify(res.error); + } + } + }); + } + else { + if (res.imagenotfound) { + notify(ST.Pleasecaptureaimage); + } + else { + notify(res.error); + } + } + }); + } + } + + async function openCamera() { + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + + function moveMarkerToPos(e) { + + let coords = e.nativeEvent.coordinate; + console.log('moveMarkerToPos', coords) + + // if(MyMap.current!=null){ + // MyMap.current.animateToRegion({ + // latitude: coords.latitude, + // longitude: coords.longitude, + // latitudeDelta: 0.0922, + // longitudeDelta: 0.0421, + // },1000); + // } + animateCamera(coords); + animateMarkerToRegion(coords); + setMarkerInfo(coords); + let loc = { lat: coords.latitude, lng: coords.longitude }; + setMarkerPos(loc); + } + + function animateMarkerToRegion(coords) { + const newCoordinate = coords; + const new_animated_coords = new AnimatedRegion({ latitude: coords.latitude, longitude: coords.longitude }); + if (Platform.OS === 'android') { + if (MyMarker) { + MyMarker.current.animateMarkerToCoordinate(newCoordinate, 1000); + } + } else { + // `useNativeDriver` defaults to false if not passed explicitly + markerCoordinate.timing({ ...newCoordinate, useNativeDriver: false, duration: 1000 }).start(); + } + setTimeout(() => { setMarkerCoordinate(new_animated_coords); }, 1000); + + } + + async function setMarkerInfo(coords) { + if (MyMap.current != null) { + MyMap.current.addressForCoordinate(coords) + .then((res) => { + console.log('res:', res); + let title = res.name; + let placeText = `${res.subLocality}, ${res.locality}, ${res.administrativeArea} ${res.postalCode}`; + setMarkerTitle(title); + setMarkerPlaceText(placeText); + + }) + } + } + + async function animateCamera(coords) { + if (MyMap.current != null) { + const camera = await MyMap.current.getCamera(); + // camera.heading = 90; + // camera.pitch = 45; + // camera.altitude = 1000; + // camera.zoom = 1000; + camera.center.latitude = coords.latitude; + camera.center.longitude = coords.longitude; + MyMap.current.animateCamera(camera, { duration: 2000 }); + } + } + + + function _renderMap() { + const lat = currentLocation.lat ? currentLocation.lat : 28.579660; + const lng = currentLocation.lng ? currentLocation.lng : 77.321110; + + if (currentLocation.lat != null) { + return ( + + + {console.log('on press')}} + // onRegionChangeComplete={(region,details)=>{console.log('on region change',region)}} + onPress={moveMarkerToPos} + + > + { console.log('on drag end:', e.nativeEvent.coordinate) }} + coordinate={markerCoordinate} + pinColor={'#ff78b6'} + title={markerTitle} + description={markerPlaceText} + /> + + + {_render_captureImage()} + + ); + } + else { + return () + } + } + + function _render_captureImage() { + const isImageAvlbl = StoreImage != '' && StoreImage != null && StoreImgPath != '' && StoreImgPath != null; + + return ( + + + + {isImageAvlbl && } + {!isImageAvlbl && } + + { openCamera() }}> + {} + + {(isDistributor ? 'Click distributor front image' : ST.ClickStoreFrontImage)} + + + + ); + } + + return ( + + {processing && } + + { setShowCamera(false); getImage(imgData) }} showCamera={showCamera} onHideCamera={() => { setShowCamera(false); }} /> + + + + {Object.keys(storeData).length > 0 && + + + + + + + + {storeData.StoreName} + + + + + + {ST.StoreId + ':'} + {storeData.StoreId} + + + {ST.StoreCode + ':'} + {storeData.StoreCode} + + + + + {ST.Address + ':'} + {storeData.Address} + + + + + + + { + // isCancelled.current==false && + _renderMap() + } + + { submitGeoTag(IsSearchedStore) }} /> + + + + } + + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(GeoTag); \ No newline at end of file diff --git a/src/screens/GetDb.js b/src/screens/GetDb.js new file mode 100644 index 0000000..56aa9e1 --- /dev/null +++ b/src/screens/GetDb.js @@ -0,0 +1,112 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,DownloadData} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl, db} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign, Feather, FontAwesome, MaterialCommunityIcons} from '../components/icons'; +import { WebView } from 'react-native-webview'; +import CustomLoader from '../components/CustomLoader'; +import NoDataComponent from '../components/NoDataComponent'; +import LinearGradient from 'react-native-linear-gradient'; +// import RNExitApp from 'react-native-exit-app'; +import { ConfirmSaveAlert } from '../components/alert'; +import CustomModal from '../components/CustomModal'; +import { PrimaryTheme } from '../styles/Themes'; +import * as RNFS from 'react-native-fs'; + + +function GetDb(props) { + const route = useRoute(); + + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [mpin, setMpin] = useState(''); + const [processing, setProcessing] = useState(false); + const [isDataFound, setisDataFound] = useState(false); + const [showAlert, setShowAlert] = useState(false); + const [showMPinModal, setShowMPinModal] = useState(false); + + + const [reportData, setReportData] = useState([]); + const [designation, setDesignation] = useState(''); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + + }, []); + + + + + async function showdbfile(){ + // let source='/data/data/com.performicsmanager/databases/'; + let source='/data/data/com.performicsmanager/files/'; + console.log('path:',source); + const items = await RNFS.readDirAssets(source); + console.log('items:',items); + items.forEach(async item => { + if (item.isFile()) { + console.log(`f ${item.path}`); + + const destPath = RNFS.DocumentDirectoryPath + "/Performicsdatabase/" + item.name; + + console.log(`cp ${item.path} ${destPath}`); + await RNFS.copyFileAssets(item.path, destPath); + } else { + console.log(`d ${item.path}/`); + } + }); + const destPath1 =RNFS.DownloadDirectoryPath + "/PerformicsSupervisor.db"; + let dbFile='/data/data/com.performicsmanager/files/PerformicsSupervisor.db'; + RNFS.exists(dbFile) + .then(resn => { + console.log('isExist res:',resn) + RNFS.copyFile(dbFile,destPath1); + }); + } + + + + + + + return ( + + {processing && } + + + + + + + {/* {borderTopLeftRadius:0,borderTopRightRadius:0,} */} + + {showdbfile() }}> + {'OPen Database file'} + + + + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(GetDb); \ No newline at end of file diff --git a/src/screens/GroomingPictures.js b/src/screens/GroomingPictures.js new file mode 100644 index 0000000..eba455d --- /dev/null +++ b/src/screens/GroomingPictures.js @@ -0,0 +1,797 @@ +import React, { useState, useEffect, useRef } from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles, customStyles, GetPageTheme } from "../styles/Global"; +import { + View, Text, ScrollView, TouchableOpacity, + Image, StyleSheet, Platform, Alert, Dimensions +} from 'react-native'; +import { connect } from 'react-redux'; +import moment from 'moment'; +import { get_item } from '../components/localStorage'; +import { notify } from '../components/notify'; +import CustomHeader from '../components/customHeader'; +import CustomLoader from '../components/CustomLoader'; +import CustomDropdown from '../components/CustomDropdown'; +import ModalSelector from 'react-native-modal-selector'; +import { getMethodName, METHODS } from '../constants/methodNames'; +import { mapStateToProps, mapDispatchToProps } from '../reducers/contextProvider'; +import ImageViewer from 'react-native-image-zoom-viewer'; + +// ---------------- Sample Fallback Data ---------------- +const sampleData = [ + { + EmployeeName: "John Doe (Promoter)", + GroomingImages: [ + { id: 1, ImageUrl: "https://portraitpal.ai/wp-content/uploads/2024/10/Linkedin-headshot.jpg" }, + { id: 2, ImageUrl: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSMV9sXUMHZufycMbYSk6IN6u_pnRIADzH2m5E1tnewdd0jk0ltjqFsqSCooqjaa-fNAQQ&usqp=CAU" }, + ], + }, + { + EmployeeName: "Alice Smith (Merchandiser)", + GroomingImages: [ + { id: 1, ImageUrl: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTxctjU21pUENIsGN1F4qY21P7GfdEbhTMp2g&s" }, + ], + }, +]; + +const GroomingPictures = (props) => { + const route = useRoute(); + const modalRefs = useRef({}); + const ST = props.StaticText || {}; + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const [loginData, setLoginData] = useState({}); + + const [processing, setProcessing] = useState(true); + const [grromingImages, setGroomingImages] = useState([]); + const [supervisor, setSupervisor] = useState(""); + const [date, setDate] = useState(''); + const [supervisorList, setSupervisorList] = useState([]); + const [groomingReason, setGroomingReason] = useState([]); + + const [statuses, setStatuses] = useState({}); // {index: "Aprooved" | "Reject" | null} + const [selectedReasons, setSelectedReasons] = useState({}); // {index: reasonText} + const [activeRejectIndex, setActiveRejectIndex] = useState(null); + const [dates, setDates] = useState([]); + const [RejectedItem, setRejectedItem] = useState({}) + + + const [showZoom, setShowZoom] = useState(false); + const [zoomImages, setZoomImages] = useState([]); + const [zoomIndex, setZoomIndex] = useState(0); + const zoomRef = useRef(null); + const [imageHeights, setImageHeights] = useState({}); + + useEffect(() => { + setProcessing(false); + getLoginData(); + }, []); + + useEffect(() => { + downloadGroomingImageAudit(); + getNonGroomingAuditReason(); + getDateCount(); + }, []); + + + + + const openGroomingZoom = (images, activeIndex = 0) => { + const formattedImages = images.map(img => ({ + url: img.ImageUrl, + })); + + setZoomImages(formattedImages); + setShowZoom(true); + setZoomIndex(activeIndex); + + // Optional: jump to tapped image + // setTimeout(() => { + // zoomRef.current?.jumpTo(activeIndex); + // }, 200); + }; + + + const getLoginData = async () => { + const loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + setLoginData(loginDetails); + } + + const downloadGroomingImageAudit = async () => { + try { + setProcessing(true) + let d1 = new Date(); + let formatedDate = moment(d1).format('MM/DD/YYYY'); + const loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url = `${props.baseurl}${getMethodName(METHODS.DOWNLOADJSON_METHOD)}`; + + if (loginDetails?.Designation != 'Supervisor') { + getSupervisorList(); + } + const payload = { + Downloadtype: "Sup_GroomingImageAudit", + Username: loginDetails?.UserId || '', + Param1: supervisor, + Param2: date, + }; + console.log('Download Request:', url, payload); + fetch(url, { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(payload) + }) + .then(async (response) => { + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + const result = await response.json(); + let res = JSON.parse(result) + let grooming = res?.Sup_GroomingImageAudit + setGroomingImages(grooming); + setProcessing(false) + + // console.log('API CALLED =----------->', JSON.stringify(grooming)); + }) + .catch((error) => { + console.error("Error:", error); + setProcessing(false) + + }); + + } catch (error) { + console.error('Error downloading grooming list:', error); + notify("Cannot download grooming list data!"); + setProcessing(false); + return []; + } + } + + const getSupervisorList = async () => { + try { + let d1 = new Date(); + let formatedDate = moment(d1).format('MM/DD/YYYY'); + const loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url = `${props.baseurl}${getMethodName(METHODS.DOWNLOADJSON_METHOD)}`; + const payload = { + Downloadtype: "Sup_TeamList", + Username: loginDetails?.UserId || '', + Param1: 0, + Param2: formatedDate, + }; + console.log('Download Request:', url, payload); + fetch(url, { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(payload) + }) + .then(async (response) => { + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + const result = await response.json(); + let res = JSON.parse(result) + let supList = Array.isArray(res?.Sup_TeamList) ? res.Sup_TeamList : []; + // console.log('supListsupList--->', supList); + let tempData = supList.map(ele => ({ + label: ele.EmployeeName, + value: ele.EmpId + })); + setSupervisorList(tempData) + }) + .catch((error) => { + console.error("Error:", error); + }); + } catch (error) { + console.error('Error downloading grooming list:', error); + notify("Cannot download grooming list data!"); + setProcessing(false); + return []; + } + } + + const getNonGroomingAuditReason = async () => { + try { + let d1 = new Date(); + let formatedDate = moment(d1).format('MM/DD/YYYY'); + const loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url = `${props.baseurl}${getMethodName(METHODS.DOWNLOADJSON_METHOD)}`; + + const payload = { + Downloadtype: "Sup_Master_NonGroomingAuditReason", + Username: loginDetails?.UserId || '', + Param1: 0, + Param2: formatedDate, + }; + console.log('Download Request:', url, payload); + fetch(url, { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(payload) + }) + .then(async (response) => { + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + const result = await response.json(); + let res = JSON.parse(result) + let groomingReason = res?.Sup_Master_NonGroomingAuditReason; + setGroomingReason(groomingReason) + + }) + .catch((error) => { + console.error("Error:", error); + }); + + } catch (error) { + console.error('Error downloading grooming list:', error); + notify("Cannot download grooming list data!"); + setProcessing(false); + return []; + } + } + + const getDateCount = async () => { + try { + let d1 = new Date(); + let formatedDate = moment(d1).format('MM/DD/YYYY'); + const loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url = `${props.baseurl}${getMethodName(METHODS.DOWNLOADJSON_METHOD)}`; + const payload = { + Downloadtype: "Mapping_MenuConfiguration_Sup", + Username: loginDetails?.UserId || '', + Param1: 0, + Param2: formatedDate, + }; + console.log('Download Request:', url, payload); + + const response = await fetch(url, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(payload) + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + const result = await response.json(); + let res = JSON.parse(result); + const groomingFilterDate = res.Mapping_MenuConfiguration_Sup.find( + (item) => item.KPIFieldName === "GroomingAuditDateFilterDays" + ); + if (groomingFilterDate?.KPIFieldEnable === true || groomingFilterDate?.KPIFieldEnable === 'true') { + const count = parseInt(groomingFilterDate.KPIFieldDisplayName, 10); + + // ✅ Generate last N dates from today (Descending Order) + const today = moment(); + const dateArray = []; + + for (let i = 0; i < count; i++) { + const pastDate = moment(today).subtract(i, 'days'); + dateArray.push({ + label: pastDate.format('DD MMM YYYY'), + value: pastDate.format('MM/DD/YYYY'), + }); + } + + // ✅ Keep descending (today → older) and default to today + setDates(dateArray); + setDate(dateArray[0]?.value || ''); + } + + // setGroomingFilterDate(groomingFilterDate); + } catch (error) { + console.error('Error downloading grooming list:', error); + setProcessing(false); + } + }; + + const handleApprove = async (index, item) => { + setProcessing(true) + const loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + let postData = [{ + "UserId": loginDetails?.UserId || '', + "TId": item?.TId, + "AuditStatus": "Aprooved", + "ReasonId": 0 + }] + + let payload = { + "MID": 0, + "Keys": "GroomingPicturesAudit", + "JsonData": JSON.stringify(postData), + "UserId": loginDetails?.UserId || '', + } + const url = `${props.baseurl}${getMethodName(METHODS.UPLOAD_JSON_DIRECT)}`; + console.log('url, payload ---->', url, payload); + + const response = await fetch(url, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(payload) + }); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + const result = await response.json(); + let res = typeof result === 'string' ? JSON.parse(result) : result; + console.log('UPLOAD_JSON_DIRECT --', res); + if (res?.UploadJsonDirectResult == "Success" || res?.UploadJsonDirectResult?.MID == "Success") { + // Alert.alert('', JSON.stringify(res,)) + setProcessing(false) + setStatuses(prev => ({ ...prev, [index]: 'Aprooved' })); + setSelectedReasons(prev => ({ ...prev, [index]: null })); + notify('Approved Successfully') + } else { + setProcessing(false) + } + }; + + const handleReject = (index, item) => { + setRejectedItem(item); + setActiveRejectIndex(index); + setTimeout(() => modalRefs.current[index]?.open(), 100); + }; + + const handleSelectReason = async (index, option) => { + setProcessing(true) + const loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + let postData = [{ + "UserId": loginDetails?.UserId || '', + "TId": RejectedItem?.TId, + "AuditStatus": "Reject", + "ReasonId": option?.ReasonId + }] + + let payload = { + "MID": 0, + "Keys": "GroomingPicturesAudit", + "JsonData": JSON.stringify(postData), + "UserId": loginDetails?.UserId || '', + } + const url = `${props.baseurl}${getMethodName(METHODS.UPLOAD_JSON_DIRECT)}`; + + console.log('url, payload ---->', url, payload); + const response = await fetch(url, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(payload) + }); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + // setProcessing(false) + // return + + + const result = await response.json(); + let res = typeof result === 'string' ? JSON.parse(result) : result; + console.log('Reject wala -->', res); + if (res?.UploadJsonDirectResult == "Success" || res?.UploadJsonDirectResult?.MID == "Success") { + setStatuses(prev => ({ ...prev, [index]: 'Reject' })); + setSelectedReasons(prev => ({ ...prev, [index]: option.Reason })); + setActiveRejectIndex(null); + setProcessing(false) + } else { + setProcessing(false) + } + setProcessing(false) + }; + + const handleReset = async (index, item) => { + setProcessing(true) + const loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + let postData = [{ + "UserId": loginDetails?.UserId || '', + "TId": item?.TId, + "AuditStatus": "Pending", + "ReasonId": 0 + }] + + let payload = { + "MID": 0, + "Keys": "GroomingPicturesAudit", + "JsonData": JSON.stringify(postData), + "UserId": loginDetails?.UserId || '', + } + const url = `${props.baseurl}${getMethodName(METHODS.UPLOAD_JSON_DIRECT)}`; + + console.log('url, payload ---->', url, payload); + const response = await fetch(url, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(payload) + }); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + const result = await response.json(); + let res = typeof result === 'string' ? JSON.parse(result) : result; + if (res?.UploadJsonDirectResult == "Success" || res?.UploadJsonDirectResult?.MID == "Success") { + setStatuses(prev => ({ ...prev, [index]: null })); + setSelectedReasons(prev => ({ ...prev, [index]: null })); + setProcessing(false) + + } else { + Alert.alert('Alert', `${res}`) + setProcessing(false) + } + }; + + const onClickGo = async () => { + try { + let d1 = new Date(); + let formatedDate = moment(d1).format('MM/DD/YYYY'); + const url = `${props.baseurl}${getMethodName(METHODS.DOWNLOADJSON_METHOD)}`; + const payload = { + Downloadtype: "Sup_GroomingImageAudit", + Username: loginData?.UserId || '', + Param1: supervisor, + Param2: date, + }; + console.log('Download Request:--------->', url, payload); + + if (loginData?.Designation !== 'Supervisor') { + if (!supervisor || supervisor == "undefined" || supervisor == null) { + notify('Please Select Supervisor') + return + } + } + fetch(url, { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(payload) + }) + .then(async (response) => { + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + const result = await response.json(); + let res = JSON.parse(result) + let grooming = res?.Sup_GroomingImageAudit + setGroomingImages(grooming); + setProcessing(false); + // console.log('API CALLED =----------->', JSON.stringify(grooming)); + }) + .catch((error) => { + console.error("Error:", error); + }); + + } catch (error) { + console.error('Error downloading grooming list:', error); + setProcessing(false); + return []; + } + }; + + //CONSOLE LOG ================================* + + // console.log('loginData?.Designation=============>', loginData?.Designation); + // console.log('loginDataloginDataloginData----->', loginData?.UserId); + // console.log('grromingImages---------->', grromingImages); + // console.log('PageTheme---------->', PageTheme); + + + //=========================================* + + return ( + + {processing && } + + + + {/* Filters */} + + + {/* {grromingImages && grromingImages.length > 0 ? */} + <> + + + {loginData?.Designation === "Supervisor" ? + + {loginData?.UserId} + + : + + + setSupervisor(item.value)} + containerStyle={styles.yearDropDown} + /> + + } + + + + setDate(item.value)} + containerStyle={styles.yearDropDown} + /> + + + + + onClickGo()} style={styles.goButton}> + Go + + + + {/* : null + } */} + + + {/* Merchandiser Image Cards */} + + {grromingImages && grromingImages.length > 0 ? ( + grromingImages.map((item, index) => ( + + {item?.EmployeeName} + + + {item?.GroomingImages?.map((imgObj, i) => ( + + openGroomingZoom(item?.GroomingImages, index)}> + { + const { width, height } = nativeEvent.source; + const screenWidth = Dimensions.get('window').width - 40; // adjust padding + const scaledHeight = (height / width) * screenWidth; + + setImageHeights(prev => ({ + ...prev, + [`${index}-${i}`]: scaledHeight, + })); + }} + + /> + + {statuses[index] === 'Aprooved' && ( + openGroomingZoom(item.GroomingImages, index)}> + + + )} + + {statuses[index] === 'Reject' && ( + openGroomingZoom(item.GroomingImages, index)}> + + + )} + + ))} + + + + {/* Rejection Reason */} + {selectedReasons[index] && ( + + + Reason: {selectedReasons[index]} + + + )} + + {/* Action Buttons */} + {statuses[index] === null || statuses[index] === undefined ? ( + + handleApprove(index, item)} + > + Approve + + + handleReject(index, item)} + > + Reject + + + ) : ( + handleReset(index, item)} + > + Reset + + )} + + {/* Modal Selector for Rejection */} + {activeRejectIndex === index && ( + (modalRefs.current[index] = ref)} + data={groomingReason?.map((r, i) => ({ + key: i + 1, + label: r.Reason, + Reason: r.Reason, + ReasonId: r.ReasonId + }))} + onChange={(option) => handleSelectReason(index, option)} + animationType="slide" + optionTextStyle={{ color: '#000' }} + cancelText="Cancel" + cancelStyle={{ backgroundColor: '#f8f8f8' }} + cancelTextStyle={{ color: 'red', fontWeight: 'bold' }} + customSelector={<>} + /> + )} + + )) + ) : ( + + + No Grooming Images to Audit + + )} + + + + {showZoom && ( + + setShowZoom(false)} + renderHeader={() => ( + + setShowZoom(false)}> + + + + )} + renderIndicator={() => null} + /> + + )} + + ); +}; + +const styles = StyleSheet.create({ + scrollView: { flex: 1 }, + content: { padding: 10 }, + zoomWrapper: { + position: 'absolute', + top: 0, + left: 0, + right: 0, + bottom: 0, + backgroundColor: '#000', + zIndex: 10000, + }, + zoomHeader: { + height: 20, + paddingHorizontal: 15, + alignSelf: 'flex-start', + marginTop: 10 + }, + zoomClose: { + color: '#fff', + fontSize: 18, + }, + goButton: { + backgroundColor: '#00968e', + width: 150, + padding: 10, + borderRadius: 8, + alignItems: 'center', + }, + goButtonText: { + color: '#fff', + fontSize: 16, + fontWeight: '600', + }, + merchSection: { + // backgroundColor: '#af5656ff', + padding: 0, + borderRadius: 8, + marginBottom: 15, + // elevation: 3, + // borderWidth: 1, + // borderColor: '#ddd', + }, + merchName: { + color: '#000', + fontSize: 16, + fontWeight: 'bold', + marginBottom: 12, + }, + imageBox: { padding: 8 }, + image: { + width: '100%', + // borderRadius: 15, + resizeMode: 'contain', + }, + overlayIcon: { + position: 'absolute', + top: 10, + right: 15, + width: 28, + height: 28, + }, + buttonRow: { + flexDirection: 'row', + justifyContent: 'space-around', + marginTop: 10, + }, + actionButton: { + flex: 1, + padding: 12, + borderRadius: 6, + marginHorizontal: 4, + alignItems: 'center', + }, + approveButton: { backgroundColor: '#00968e' }, + rejectButton: { backgroundColor: '#dc3545' }, + buttonText: { color: '#fff', fontSize: 16, fontWeight: '600' }, + reasonBox: { + backgroundColor: '#ffeaea', + padding: 8, + borderRadius: 6, + marginTop: 10, + }, + reasonText: { color: '#dc3545', fontWeight: '600' }, + resetBtn: { + backgroundColor: 'gray', + padding: 12, + borderRadius: 8, + alignItems: 'center', + marginTop: 10, + }, + supDropDown: { + height: 44, + width: '48%', + borderWidth: 1, + borderColor: '#ccc', + borderRadius: 8, + paddingHorizontal: 10, + justifyContent: 'center' + }, + NoDataText: { + marginTop: 15, + color: 'gray', + fontWeight: '500', + fontSize: 17, + textAlign: 'center' + } +}); + +export default connect(mapStateToProps, mapDispatchToProps)(GroomingPictures); diff --git a/src/screens/HR.js b/src/screens/HR.js new file mode 100644 index 0000000..db846fc --- /dev/null +++ b/src/screens/HR.js @@ -0,0 +1,1002 @@ +import { View, Text, TextInput,TouchableOpacity, NativeModules, Icon, Image } from 'react-native' +import React,{useState,useEffect} from 'react' +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {connect} from 'react-redux' +import CustomHeader from '../components/customHeader'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import DrawerHeader from '../components/drawerHeader'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import GradientButton from '../components/gradientButton'; +import { CustomPicker } from '../components/CustomPicker'; +import { ScrollView } from 'react-native-gesture-handler'; +import Svg, { SvgUri, SvgXml} from 'react-native-svg'; +import add_icon from '../assets/performics/add_image.svg'; +import camera_Icon from '../assets/performics/camera_icon.svg'; +import camera_IconTick from '../assets/performics/camera_icon.svg'; +// import DocumentPicker , { types } from '@react-native-documents/picker'; +import { pick } from '@react-native-documents/picker'; +import { common_ImagePath, db, resumeurl} from '../constants/constants'; +import { ConfirmSaveAlert } from '../components/alert'; +import { AppTables } from '../constants/tableConstants'; +import {notify} from '../components/notify'; +import CustomCamera from '../components/Camera'; +import moment from 'moment'; +import cameraImg from '../assets/performics/camera_front_image.svg' +import { MaterialCommunityIcons } from '../components/icons'; +import {marktext1,marktext2, UploadData, UploadData2, UploadFormData} from '../controller/functions'; +import { getMethodName, METHODS } from '../constants/methodNames'; +import * as mime from 'mime'; +import * as RNFS from 'react-native-fs'; +import {testurl} from '../constants/constants'; +import {getDownloadJson,DownloadData} from '../controller/functions'; +import {get_item} from '../components/localStorage'; +import { Props } from 'react-native-image-zoom-viewer/built/image-viewer.type'; + + + + +function HR(props) { + + const route = useRoute(); + + const [currentItem, setcurrentItem] = useState({}); + + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [formData, setFormData] = useState({}); + const [rerenderdata, setrerenderdata] = useState(0); + const [datas,setDatas] = useState([]); + + const [expdata,setexpData] = useState([]); + const [singleFile, setSingleFile] = useState({}); + const [showAlert, setShowAlert] = useState(false); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + const [showCamera, setShowCamera] = useState(false); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [hrImage, setHrImage] = useState({}); + + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [getImageProps,setGetImageProps]= useState({}); + const [resumeData, setresumeData] = useState([]); + const [dowloadedCount, setDowloadedCount] = useState(-1); + const [Position,setPosition] = useState([]); + const [Education,setEducation] = useState([]); + + const [processing, setProcessing] = useState(true); + // Position = [ + // { + // positionName: 'Merchandiser', + // positionID: 1, + + // }, + // { + // positionName: 'Supervisor', + // positionID: 2, + + // }, + // ]; + + // Education = [ + // { + // educationName: '10th', + // educationID: 1, + + // }, + // { + // educationName: '12th', + // educationID: 2, + + // }, + // { + // educationName: 'Graduation', + // educationID: 3, + + // }, + // { + // educationName: 'Post-Graduation', + // educationID: 4, + + // }, + // ]; + + + useEffect(() => { + let params = props.route.params !=null?props.route.params:{}; + let currentitem1 = params.imagedesc!=null?params.imagedesc:{}; + console.log("Currentitem1",currentitem1); + setcurrentItem(currentitem1) + downloaddatahr(); + + const onremoveSubscription=props.navigation.addListener('beforeRemove', onBeforeRemove); + + + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + return onremoveSubscription; + + } + // viewFormData(); + }, [resumeData]); + + useEffect(() => { + + + props.navigation.removeListener('beforeRemove', onBeforeRemove); + const onremoveSubscription=props.navigation.addListener('beforeRemove', onBeforeRemove); + return onremoveSubscription; + +}, [hasUnsavedChanges]); + + +function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } +} + +function onRemoveScreen(e){ + Alert.alert( + "", + "Do you really want to exit the screen?", + [ + { + text: "Cancel", + onPress: () => {}, + style: "cancel" + }, + { text: "OK", onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); +} + + +function onselectionChange(option,keyLbl,keyVal,otherData){ + + let data=formData; + data[keyVal]=option.value; + data[keyLbl]=option.label; + // setHasUnsavedChanges(true); + setFormData(data); + setrerenderdata(!rerenderdata); + +} + +function onTextChange(key, val,type=''){ + + let data=formData; + data[key]=val; + // setHasUnsavedChanges(true); + setFormData(data); + setrerenderdata(!rerenderdata); + +} + +function explistData(){ + let arraylistdata = formData.experience; + console.log('arraylistdata',arraylistdata) + setexpData(arraylistdata); +} + + +const selectOneFile = async () => { + //Opening Document Picker for selection of one file + console.log('selectOneFile'); + try { + + const res = await pick({ + presentationStyle: 'fullScreen', + type: [ + 'public.image', // images (JPG/PNG) + 'com.adobe.pdf' // PDFs + ], + }); + + console.log('res : ' + JSON.stringify(res)); + console.log('URI : ' + res[0].uri); + console.log('Type : ' + res[0].type); + console.log('File Name : ' + res[0].name); + console.log('File Size : ' + res[0].size); + + let filepath=res[0].uri; + let picture_selected_time=new Date(); + picture_selected_time=moment(picture_selected_time).format('DDMMYYYYHHmmss') + let filetype=res[0].type; + let name_ext='';//name_arr[name_arr.length-1]; + if(filetype=='image/png'){ + name_ext='png'; + } + else if(filetype=='image/jpg' || filetype=='image/jpeg'){ + name_ext='jpg'; + } + else if(filetype=='application/pdf'){ + name_ext='pdf'; + } + + + + let filename = 'Resumefile_'+ props.UserId + picture_selected_time+'.'+name_ext; + let nfileP='file://'+`${common_ImagePath}${filename}`; + + + RNFS.moveFile(filepath,nfileP) + .then(resn => { + let obj={filePath: nfileP,fileName:filename,filetype:filetype} + setSingleFile(obj); + }) + .catch(err => { + console.log('ERROR: on file store!'); + console.log(err.message, err.code); + }); + + + }catch (err) { + console.log('Error: ' + JSON.stringify(err)); + // if (DocumentPicker.isCancel(err)) { + // //If user canceled the document selection + // alert('Canceled from single doc picker'); + // } else { + + // alert('Unknown Error: ' + JSON.stringify(err)); + // throw err; + // } + } + }; + +function onSaveCancel(){ + setShowAlert(false); +} + +async function onSubmitData(){ + + let isvalid=await validate(); + + if(isvalid){ + console.log('isvalidvalue',isvalid); + setShowAlert(true); + } +} + +async function saveData(){ + console.log() + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + + try { + + await db.transaction(async function (txn) { + let values=''; + let status='N'; + let uniqueId='R'+props.UserId+moment().format('DDMMYYYYHHmmss')+(Math.floor(Math.random()*1000)+1); + values =` ('${uniqueId}','${props.UserId}','${formData.name}','${formData.mobileno}','${formData.locality}','${formData.DesignationName}','${formData.project}','${formData.agency}','${formData.experience}','${formData.Qualification_Name}','${formData.store}','${(singleFile.fileName || '')}','${(singleFile.filetype || '')}','${(hrImage.Image1Name || '')}','${(hrImage.Image2Name || '')}','${d2}','${status}') `; + let add_data=`INSERT INTO ${AppTables.RESUME_DATA} (UID,EMP_ID,NAME,MOBILE_NO,LOCALITY,POSITION,PROJECT,AGENCY,EXPERIENCE,EDUCATION,STORE,RESUME_FILE,TYPE,IMAGE1,IMAGE2,ADDED_DATE,STATUS) VALUES ${values} `; + + // await txn.executeSql(`Select * From ${AppTables.RESUME_DATA} where EMP_ID='${props.UserId}' and ADDED_DATE='${d2}' `,[],async function (txn2, txnres) { + // console.log('old geotag removed'); + // console.log('values:',values); + await txn.executeSql(add_data,[],async function (txn2, txnres) { + console.log('av added'); + notify('HR data added successfully','SHORT'); + allUploadData(uniqueId); + // setProcessing(false); + // props.navigation.goBack(); + }, + function (txn2, txnerr){ console.log(txnerr); + // setProcessing(false); + notify('Cannot add resume data') + }); + // }); + + }); + } catch (err) { + console.log(err); + } +} + +async function validate(){ + let isValid=true; + if (!formData.name) { + alert('Please enter Name'); + isValid=false; + } + else if (!formData.mobileno) { + alert('Please enter Mobile No.'); + isValid=false; + } + else if (!formData.locality) { + alert('Please enter Locality'); + isValid=false; + } + else if (!formData.DesignationName) { + alert('Please enter Position'); + isValid=false; + } + else if (!formData.project) { + alert('Please enter Project'); + isValid=false; + } + else if (!formData.agency) { + alert('Please enter Agency'); + isValid=false; + } + else if (!formData.experience) { + alert('Please enter Experience'); + isValid=false; + } + else if (!formData.Qualification_Name) { + alert('Please enter Education'); + isValid=false; + } + else if (!formData.store) { + alert('Please enter Store'); + isValid=false; + } + + console.log('isValid:',isValid); + return isValid; +} + + +async function getPostData(uniqueId=''){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let q2=` SELECT * FROM ${AppTables.RESUME_DATA} WHERE UID='${uniqueId}' `; + let resumeData={},myresumeObj={}; + let Allfiles = []; + + await txn.executeSql(q2,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + for(var i=0;i{ + console.log(err); + }); + +} + +async function allUploadData(uniqueId=''){ + console.log('getUploadData'); + let allResumData=await getPostData(uniqueId); + let PostData1=allResumData.PostData || {}; + let Allfiles=allResumData.Allfiles || []; + + const url=resumeurl+getMethodName(METHODS.UPLOADJSON_METHOD); + console.log('url: ',url,PostData1); + + + await UploadData2(url,PostData1) + .then(async(res)=>{ + console.log('resultupload',res); + // res={UploadJsonResult:'Success'}; + if(res.UploadJsonResult && res.UploadJsonResult.includes('Success')){ + let isupdated=await UpdateResumeStatus(uniqueId); + console.log('isStatus Updated:',isupdated); + // Upload Image + let isImageUploaded=await uploadImages(Allfiles); + console.log('isImageUploaded:',isImageUploaded); + setProcessing(false); + if(isImageUploaded){ + notify('All resume data uploaded successfully!'); + props.navigation.goBack(); + } + else{ + notify('Data uploaded but cannot upload files and images!'); + } + } + else{ + setProcessing(false); + notify('Error while uploading resume data'); + } + + }) + + + +} + +async function uploadImages(Allfiles=[]){ + let uploadFileCount=0; + console.log('Allfile in uploadImages ',Allfiles); + const url1=('https://hrm.parinaam.in/webservice/Imageupload.asmx/')+getMethodName(METHODS.UPLOADIMAGES_METHOD) + console.log('url1:',url1); + + let isAllUploaded=false; + return await new Promise.all( + Allfiles.map(async(file,index)=>{ + console.log('file:',file.uri); + let actualfilepath='file://'+file.uri; + console.log('actualfilepath',actualfilepath) + let isExists=await RNFS.exists(actualfilepath).then((res)=>{return res;}); + console.log('isExists file',index,isExists,actualfilepath); + let postData=new FormData(); + postData.append('file', { + uri: actualfilepath, + type: file.type,//mime.getType(actualfilepath), + name: file.name, + }); + + postData.append('Foldername',file.folderName); + + console.log("url1",url1) + + console.log("postdataimage",postData); + return await UploadFormData(url1,postData) + .then(async(res1)=>{ + console.log('res1:',res1); + if(res1.includes('Success')){ + uploadFileCount++; + RNFS.unlink(actualfilepath); + return true; + }else{ + return true; + } + }) + .catch((err)=>{ + console.log(err); + return false; + }); + + + + }) + ).then((val)=>{ + console.log('onall files return :',val); + if(Allfiles.length==uploadFileCount){ + return true; + } + else{ + return false; + } + }).catch((err)=>{ + console.log('error',err); + return false; + }); + + + +} + + + async function UpdateResumeStatus(uniqueId=''){ + + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + + let status='Y'; + // let JcpType=isAdhocScreen==true?'Sup_AdhocJourneyPlan':'Sup_JourneyPlan'; + let q=`Update ${AppTables.RESUME_DATA} set STATUS='${status}' where UID='${uniqueId}'`; + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('resume update'); + resolve(true); + + },function(txn2,txnerr){y + notify('Error while updating resume status'); + console.log(txnerr); + resolve(false); + }); + }); + }).catch((err)=>{ + console.log(err); + notify('Error while updating resume status'); + return false; + }); + +} + + +// async function getImage(imgdata){ +// let type=getImageProps.type || ''; + + +// if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ +// notify('Camera unavailable'); +// } +// else if(typeof imgdata =='object' && imgdata.uri!=null){ +// const img=imgdata; +// const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; +// let picture_clicked_time=new Date(); +// picture_clicked_time=moment(picture_clicked_time).format('DDMMYYYYHHmmss') +// let filename='Resume'+(props.UserId || '')+picture_clicked_time+'.jpg'; + +// let imagePath='file://'+`${common_ImagePath}${filename}`; + + +// RNFS.moveFile(imgurl,imagePath) +// .then(resn => { +// let data=image; +// if(type=='1'){ +// data['Image1Path']=imagePath; +// data['Image1Name']=filename; +// } +// else{ +// data['Image2Path']=imagePath; +// data['Image2Name']=filename; +// } + +// console.log('data:',data); +// setimage(data); +// }) +// .catch(err => { +// console.log('ERROR: image file write failed!!!'); +// console.log(err.message, err.code); +// }); + + + +// } +// } + + +async function getImage(imgdata){ + let type=getImageProps.type || ''; + + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + + const mark_text2=' Name:'+formData.name+' | Image Type: Resume'+' | Date:'+picture_clicked_time; + + + console.log('imgurl marktext1:',mark_text2); + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth, imgHeight) + .then((res)=>{ + + if(res.success){ + let picture_clickedd=new Date(); + // let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename='Resume'+(formData.name || '')+picture_clicked_time+'.jpg'; + let alldata=hrImage; + + let imagePath='file://'+`${common_ImagePath}${filename}`; + RNFS.moveFile(res.uri,imagePath) + .then(resn => { + if(type=='1'){ + alldata['Image1Path']=imagePath; + alldata['Image1Name']=filename; + setHrImage(alldata); + setrerenderdata(!rerenderdata); + + } + else{ + alldata['Image2Path']=imagePath; + alldata['Image2Name']=filename; + setHrImage(alldata); + setrerenderdata(!rerenderdata); + + } + + + + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + + }); + + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); +} +} + +async function openCamera(type='1'){ + setGetImageProps({type:type}); + setShowCamera(true); +} + +async function downloaddatahr(){ + let token = await get_item('loginToken'); + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + + const data={Downloadtype: 'Position_Master',username: loginDetails.UserId,empid: '',token: token,}; + const url=resumeurl+getMethodName(METHODS.DOWNLOADJSON_METHOD); + console.log('res',data) + + //download position data + + await getDownloadJson(url,data) + .then((res)=>{ + if(res.Position_Master){ + + let dataarr=res.Position_Master?res.Position_Master:[]; + setPosition(dataarr); + downloaddatahq(); + // call education + setProcessing(false); + } + }) + .catch((err)=>{ + setProcessing(false); + notify('Not data downloaded..!','SHORT'); + console.log('Position_Master not download data...!',err); + }); + + +} + +async function downloaddatahq(){ + + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + + const data={Downloadtype:"Qualification_Master",username:loginDetails.UserId,empid:'',}; + const url=resumeurl+getMethodName(METHODS.DOWNLOADJSON_METHOD); + + // + await getDownloadJson(url,data) + .then((res)=>{ + if(res.Qualification_Master){ + let dataarr=res.Qualification_Master?res.Qualification_Master:[]; + setEducation(dataarr); + setProcessing(false); + } + }) + .catch((err)=>{ + setProcessing(false); + console.log('Position_Master not download data...!',err); + }); + + +} +// console.log('imagePath.Image1Path',imagePath.Image1Path) +// console.log('imagePath.Image2Path',imagePath.Image2Path) + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + + + + + + {props.navigation.navigate('ViewListData')}}> + View List + + + + + + + + { rerenderdata==rerenderdata && + + + Name + + + {onTextChange('name',val)}} + autoComplete='off' + /> + + + + + + + Mobile No. + + {onTextChange('mobileno',val)}} + autoComplete='off'/> + + + + + Locality + + {onTextChange('locality',val)}} + autoComplete='off' + /> + + + + + {'Position'} + {CustomPicker(props,Position,'DesignationName','DesignationId','DesignationName','DesignationId',onselectionChange,{value:formData.DesignationName,otherData:{}})} + + + + + Project + + {onTextChange('project',val)}} + autoComplete='off' + /> + + + + + Agency + + {onTextChange('agency',val)}} + autoComplete='off' + /> + + + + + + Experience + + {onTextChange('experience',val)}} + autoComplete='off' + /> + + + + + + + {'Highest Qualification'} + {CustomPicker(props,Education,'Qualification_Name','Qualification_Id','Qualification_Name','Qualification_Id',onselectionChange,{value:formData.Qualification_Name,otherData:{}})} + + + + + + Store + + + {onTextChange('store',val)}} + autoComplete='off' + /> + + + + + Upload PDF/Images + + {singleFile.fileName!=null ? singleFile.fileName: ''} + + + + + + + + + Photo of CV + + + { (hrImage.Image1Path=='' || hrImage.Image1Path==null) && + {{openCamera('1')}}}> + + + } + { + // console.log('imagePath.Image1Path',imagePath.Image2Path) + + (hrImage.Image1Path!='' && hrImage.Image1Path!=null) && + + + + {{openCamera('1')}}}> + + + + } + + + + + { (hrImage.Image2Path=='' || hrImage.Image2Path==null) && + {{openCamera('2')}}}> + + + } + { (hrImage.Image2Path!='' && hrImage.Image2Path!=null) && + + + {{openCamera('1')}}}> + + + + } + + + + + + + + } + + + + {onSubmitData()}}/> + + + + + + + + ) +} + +export default connect(mapStateToProps, mapDispatchToProps)(HR) \ No newline at end of file diff --git a/src/screens/ImageAudit copy.js b/src/screens/ImageAudit copy.js new file mode 100644 index 0000000..b99c59d --- /dev/null +++ b/src/screens/ImageAudit copy.js @@ -0,0 +1,1847 @@ +import React, { useState, useEffect, memo, useRef, useCallback, useMemo } from 'react'; +import { useRoute } from '@react-navigation/native'; +import { View, Text, TouchableOpacity, Image, FlatList, Platform, ScrollView, TextInput } from 'react-native'; +import { connect } from 'react-redux'; +import moment from 'moment'; +import Container from '../components/container'; +import CustomLoader from '../components/CustomLoader'; +import CustomHeader from '../components/customHeader'; +import NoDataComponent from '../components/NoDataComponent'; +import LinearGradient from 'react-native-linear-gradient'; +import { get_item } from '../components/localStorage'; +import { notify } from '../components/notify'; +import { globalStyles, customStyles, GetPageTheme } from "../styles/Global"; +import { getDownloadJson1, UploadData } from '../controller/functions'; +import { METHODS, getMethodName } from '../constants/methodNames'; +import { SvgXml } from 'react-native-svg'; +import { AppTables } from '../constants/tableConstants'; +import CheckBox from '@react-native-community/checkbox'; +import { mapDispatchToProps, mapStateToProps } from '../reducers/contextProvider'; +import { db } from '../constants/constants'; +import Animated from 'react-native-reanimated'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import { Entypo, Fontisto, MaterialCommunityIcons } from '../components/icons'; +import MultiSelect from 'react-native-multiple-select'; +import ModalSelector from 'react-native-modal-selector'; +import { PrimaryTheme } from '../styles/Themes'; +import GradientButton from '../components/gradientButton'; +import { ConfirmSaveAlert } from '../components/alert'; + + + +const ImageAudit = (props) => { + const route = useRoute(); + const { DarkMode, baseurl, StaticText: ST = {} } = props; + const PageTheme = GetPageTheme(DarkMode, route.name); + const customStyle = customStyles(DarkMode, route.name); + + const timerRef = useRef(null); + + const [processing, setProcessing] = useState(false); + const [loaderTitle, setLoaderTitle] = useState(); + const [isDataFound, setIsDataFound] = useState(false); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata1, setrerenderdata1]= useState(true); + + const storeData = route?.params?.imageauditstoreData; + + // console.log(storeData?.MID, "MIDDD") + + const [data , setData] = useState([]); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + const [SurveyQuestions, setSurveyQuestions]= useState([]); + const [QuestionsData,setQuestionsData]=useState({}); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [showAlert, setShowAlert] = useState(false); + + + + // zoom image + + const zoomView=useRef(null); + const Show_zoomImageRef=useRef(false); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [refImageIndex, setrefImageIndex] = useState(0); + + + function UpdateShow_zoomImageRef(val) { + Show_zoomImageRef.current = val; + setShow_zoomImage(val); + } + + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + // setStoreData(storeData1); + + setLoaderTitle(ST.Loading +'...'); + get_data(); + }, []); + + const _renderHeader = useCallback((currentIndex) => { + return ( + + {`${(currentIndex + 1)}/${zoomImageUrl.length}`} + UpdateShow_zoomImageRef(false)}> + + + + ); +}, [zoomImageUrl.length, customStyle.album_ZOOM_topBar, customStyle.album_ZOOM_indicator, customStyle.album_ZOOM_backBtn]); + + + + + +async function get_data() { + setProcessing(true); + + let mainQuery = `SELECT DISTINCT MenuId, MID, Menu FROM Sup_ImageAuditKPIImages WHERE MID = '${storeData?.MID}'`; + console.log("mainQuery", mainQuery); + + let fetchedData = []; // Declare fetchedData outside the loop + + try { + db.transaction(async tx => { + tx.executeSql( + mainQuery, + [], + (tx, results) => { + let rows = results.rows; + + // Loop through the results of the main query + let promises = []; + for (let i = 0; i < rows.length; i++) { + let item = rows.item(i); + + // Define the defQuery based on MenuId + let defQuery = `SELECT DISTINCT DefName, DefId, MID ,MenuId FROM Sup_ImageAuditKPIImages WHERE MID = '${item.MID}' AND MenuId = '${item.MenuId}'`; + console.log("defQuery---", defQuery); + + // Execute the defQuery within the loop + promises.push(new Promise((resolve, reject) => { + tx.executeSql( + defQuery, + [], + (tx, defResults) => { + let defRows = defResults.rows; + let defArray = []; + + // Loop through the results of the defQuery + let defPromises = []; + for (let j = 0; j < defRows.length; j++) { + let defItem = defRows.item(j); + + console.log("defItem---------", defItem); + + // Define the imageQuery based on DefId + + + let selectlist = ` DISTINCT S.KPIImageId, S.QuestionImageId, S.DefId, S.DefName, S.BaseUrl, S.ImageName, S.Image1, S.Image2, IFNULL(T.pictureokay, 0) AS pictureokay, IFNULL(T.pictureokay2, 0) AS pictureokay2`; + + let join2 = ` LEFT JOIN (SELECT * FROM IMAGE_AUDIT_HDR_DATA WHERE DefId = '${defItem.DefId}' AND MID = '${defItem.MID}' AND MenuId = '${defItem.MenuId}') AS T ON T.DefId = S.DefId and T.QuestionImageId = S.QuestionImageId`; + + let imageQuery = `SELECT ${selectlist} FROM Sup_ImageAuditKPIImages S ${join2} WHERE S.DefId = '${defItem.DefId}' AND S.MID = '${defItem.MID}' `; + + // let imageQuery = `SELECT DISTINCT KPIImageId, QuestionImageId, DefId, DefName, BaseUrl, ImageName, Image1, Image2 FROM Sup_ImageAuditKPIImages WHERE DefId = '${defItem.DefId}' AND MID = '${defItem.MID}'`; + + console.log("imageQuery---", imageQuery); + + // Execute the imageQuery within the loop + defPromises.push(new Promise((resolve, reject) => { + tx.executeSql( + imageQuery, + [], + async (tx, imageResults) => { + let imageRows = imageResults.rows; + let images1Array = []; + let images2Array = []; + + // Loop through the results of the imageQuery + for (let k = 0; k < imageRows.length; k++) { + let imageItem = imageRows.item(k); + + // console.log(imageItem,"imageItemimageItem--------") + + let all_scat_qtns =[] ; //await getSurveyQtns(item); + // console.log('all_scat_qtns:', all_scat_qtns.length); + imageItem['Questions'] = all_scat_qtns; + + let pictureOkayValue = imageItem.pictureokay; + let pictureOkayValue2 = imageItem.pictureokay2; + + let statusValue = imageItem.STATUS; + + images1Array.push({ + KPIImageId: imageItem.KPIImageId, + QuestionImageId: imageItem.QuestionImageId, + BaseUrl: imageItem.BaseUrl, + ImageName: imageItem.ImageName, + pictureokay : pictureOkayValue, + pictureokay2 : pictureOkayValue2, + STATUS: statusValue, + Image1: imageItem.Image1, + Image2: imageItem.Image2, + Questions1: all_scat_qtns, + Questions2: all_scat_qtns + }); + + // if (imageItem.Image2) { // Check if Image2 is not an empty string + // images2Array.push({ + // KPIImageId: imageItem.KPIImageId, + // QuestionImageId: imageItem.QuestionImageId, + // BaseUrl: imageItem.BaseUrl, + // ImageName: imageItem.ImageName, + // pictureokay2 : pictureOkayValue2, + // STATUS: statusValue, + // Image2: imageItem.Image2, + // Questions: all_scat_qtns + // }); + // } + } + + // Add imagesArray to the corresponding defItem + defArray.push({ + DefName: defItem.DefName, + DefId: defItem.DefId, + Images: images1Array + }); + + resolve(); + }, + (tx, error) => { + console.error("Failed to execute imageQuery", error); + reject(error); + } + ); + })); + } + + // Wait for all image queries to resolve + Promise.all(defPromises).then(() => { + fetchedData.push({ + MenuId: item.MenuId, + MID: item.MID, + Menu: item.Menu, + DefData: defArray, + }); + resolve(); + }).catch(reject); + }, + (tx, error) => { + console.error("Failed to execute defQuery", error); + reject(error); + } + ); + })); + } + + // Wait for all def queries to resolve + Promise.all(promises).then(() => { + // Update the state with the fetched data + setData(fetchedData); + setProcessing(false); + // console.log('Updated Data with Images:', JSON.stringify(fetchedData)); + }).catch(error => { + setProcessing(false); + console.error("An error occurred while fetching data:", error); + }); + }, + (tx, error) => { + setProcessing(false); + console.error("Failed to execute main query", error); + } + ); + }); + } catch (error) { + setProcessing(false); + console.error("An error occurred while fetching data:", error); + } +} + + +async function getAnswers(qtn,storeData){ +// console.log(qtn , "Questiondata---------"); + + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + // get inserted audit + let selectlist=` DISTINCT T.AIAnswerName,T.AIAnswerId`; + + let q2=`Select ${selectlist} FROM Sup_ImageAuditKPIQuestion T WHERE T.AIQuestionId='${qtn.AIQuestionId}' ORDER BY T.AIASequence `; + + await txn.executeSql(q2,[],async function (txn2, txnres) { + // console.log('answers len',txnres.rows.length); + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return {'Answers':val,'Success':true}; + }).catch((err)=>{ + console.log(err); + return {'Success':false,'Error':err} + }); + } + + + + async function getSurveyQtns(item){ + + return new Promise((resolve,reject)=>{ + try { + let {StoreId,MerchandiserId}=storeData; + + let {MID}= item; + + db.transaction(async function (txn) { + + // get inserted audit + let selectlist=` DISTINCT T.AIMaximumChar as MaxLength,T.AIMinimumChar as MinLength,T.AILengthValidationRequired as LengthValidation,T.AIDateRangeMax as DateRangeMax,T.AIDateRangeMin as DateRangeMin,T.AIDefaultQuestionEnable as QEnable,T.AIQuestionName as Question,T.AIQuestionId as QuestionId, T.QuestionType as QuestionType,T1.ANSWER As AIAnswerName, T1.ANSWER_ID as AIAnswerId,T1.MULTI_OPTIONS_IDS as multi_op_ids,T1.IS_DISABLED as isDisabled `; + + let join2=` Left outer join ${AppTables.IMAGE_AUDIT_QUESTION} T1 on T1.MID=${MID} And T.AIQuestionId=T1.QUESTION_ID`; + let q2=`Select ${selectlist} FROM Sup_ImageAuditKPIQuestion T ${join2} WHERE T1.STORE_ID='${StoreId}' AND T1.VISIT_DATE= '${d2}' `; + q2+=` ORDER BY T.AIQuestionSequence `; + + console.log(q2, "QueryQuestiondata") + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('getSurveyData len',txnres.rows.length); + if(txnres.rows.length>0){ + let arr=[]; + var QD=QuestionsData; + for(var i=0;i0){ + for(var k=0;k=0)){ + showImageTag=true; + } + + if(qtn.QuestionType=='Single choice list' && (isandImgAl2 && ansss.AIAnswerId==selansid)){ + showImageTag2=true; + } + else if(qtn.QuestionType=='Multi choice list' && (isandImgAl2 && selansid.indexOf(ansss.AIAnswerId)>=0)){ + showImageTag2=true; + } + + } + } + } + + if(showImageTag){ + let imgPath=data.Image1!=''?((Platform.OS=='ios'?'file://':'')+common_ImagePath+data.Image1):''; + QD[imgname_key]=data.Image1; + QD[img_key]=imgPath; + } + + if(showImageTag2){ + let imgPath=data.Image2!=''?((Platform.OS=='ios'?'file://':'')+common_ImagePath+data.Image2):''; + QD[imgname_key2]=data.Image2; + QD[img_key2]=imgPath; + } + + if(qtn.QuestionType=='Audio'){ + let voicefile_path=(Platform.OS=='ios'?'file://':'')+common_ImagePath+'Recordings/'+data.Answer; + QD[voiceClip_key]={'path':voicefile_path,'filename':data.Answer}; + } + + if(qtn.QuestionType=='Date'){ + let dayonly=moment().format('DD'); + let actual_date=data.Answer?data.Answer.split('/'):[]; + let month=actual_date[0],year=actual_date[1]; + let fulldate=month+'/'+dayonly+'/'+year; + QD[date_key]=fulldate; + + } + arr.push(data); + if(i==txnres.rows.length-1){ + // setQuestionsData(QD); + resolve(arr); + // setSurveyQuestions(arr); + // setProcessing(false); + } + } + } + else{ + let sl=` DISTINCT T.AIMaximumChar,T.AIMinimumChar,T.AILengthValidationRequired,T.AIQuestionName,T.AIQuestionId,T.QuestionType,T.AIDateRangeMax,T.AIDateRangeMin,T.AIDefaultQuestionEnable as QEnable`; + let q=` SELECT ${sl} FROM Sup_ImageAuditKPIQuestion T `; + q+=` order by T.AIQuestionSequence `; + + // WHERE T.SurveyId='${SurveyId}' and T.SubCategoryId='${SubCategoryId}' + + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('Surveys:',txnres2.rows.length) + let arr=[]; + if(txnres2.rows.length>0){ + for(var i=0;i { + + const handleCheckBoxChange = (newValue) => { + onPictureOkayChange(newValue ? 1 : 0); + }; + + + return ( + + + {image.ImageName} + + + + { + setZoomImageUrl([{ url: image.BaseUrl + '/' + image.Image1 }]); + setrefImageIndex(0); + UpdateShow_zoomImageRef(true); + }}> + + + + + + + + + + + Picture OK + + + + + + + ); +}); + +const RenderImageItem2 = React.memo(({ image, pictureokay, onPictureOkayChange }) => { + + console.log("pictureokay2",pictureokay) + + const handleCheckBoxChange = (newValue) => { + onPictureOkayChange(newValue ? 1 : 0); + }; + + return ( + + + {image.ImageName} + + + { + setZoomImageUrl([{ url: image.BaseUrl + '/' + image.Image2 }]); + setrefImageIndex(0); + UpdateShow_zoomImageRef(true); + }}> + + + + + + + + + + + + Picture OK + + + + + ); +}); + +// const ImageAuditItem = React.memo(({ item }) => { +// const imageKeys = item?.DefData[0].Images[0] || []; + +// // console.log("Helloooitem--------",imageKeys) +// const image1 = imageKeys.Image1; +// const image2 = imageKeys.Image2; + +// console.log('Image1:', image1); +// console.log('Image2:', image2); + +// // If you need to dynamically access keys starting with 'Image' +// const dynamicImageKeys = Object.keys(imageKeys).filter(key => key.startsWith('Image')); +// const dynamicImageValues = dynamicImageKeys.map(key => imageKeys[key]); + +// console.log('Dynamic Image Keys:', dynamicImageKeys); +// console.log('Dynamic Image Values:', dynamicImageValues); + +// const imageKey1 = dynamicImageKeys[1] || 'IMAGE 1'; +// const imageKey2 = dynamicImageKeys[2] || 'IMAGE 2'; + +// // const handleSetPictureOkay = (defId,Image1,Image2, imageId, kpiId, value) => { +// // console.log("Received update for:", { defId,Image1,Image2, imageId,kpiId, value }); + +// // let uniqueIdImage1 = ""; +// // let uniqueIdImage2 = ""; +// // if(Image1!=null && Image1!=''){ +// // uniqueIdImage1 = `${imageId}${kpiId}${Image1}`; +// // } + +// // if(Image2!=null && Image2!=''){ +// // uniqueIdImage2 = `${imageId}${kpiId}${Image2}`; +// // } + +// // console.log(uniqueIdImage1 , "uniqueId====",uniqueIdImage2) + +// // setData(prevState => { +// // const newState = JSON.parse(JSON.stringify(prevState)); + +// // const defDataIndex = newState.findIndex(item => +// // item.DefData.some(def => def.DefId === defId) +// // ); + +// // if (defDataIndex !== -1) { +// // const defData = newState[defDataIndex].DefData; +// // const defIndex = defData.findIndex(def => def.DefId === defId); + +// // if (defIndex !== -1) { +// // const images = defData[defIndex].Images; + +// // // Update pictureokay for Images1 +// // const image1Index = images.Images1.findIndex(image => `${image.QuestionImageId}${image.KPIImageId}${image.Image1}` == uniqueIdImage1); +// // if (image1Index !== -1) { +// // console.log(`Updating Images1 for ${uniqueIdImage1} with value ${value}`); +// // images.Images1[image1Index].pictureokay = value; +// // } else { +// // console.log(`No matching image in Images1 for ${uniqueIdImage1}`); +// // } + +// // // Update pictureokay for Images2 +// // const image2Index = images.Images2?.findIndex(image => `${image.QuestionImageId}${image.KPIImageId}${image.Image2}`== uniqueIdImage2); +// // if (image2Index !== -1) { +// // console.log(`Updating Images2 for ${uniqueIdImage2} with value ${value}`); +// // images.Images2[image2Index].pictureokay2 = value; +// // } else { +// // console.log(`No matching image in Images2 for ${uniqueIdImage2}`); +// // } +// // } +// // } + +// // return newState; +// // }); +// // }; + + +// const handleSetPictureOkay = (defId, image1, image2, questionImageId, kpiImageId, value) => { +// console.log('Handling pictureokay update:', { defId, image1, image2, questionImageId, kpiImageId, value }); + +// setData((prevData) => { +// console.log('Previous Data:', JSON.stringify(prevData)); + +// const updatedData = prevData.map((defItem) => { +// if (defItem.DefId === defId) { +// return { +// ...defItem, +// Images: defItem.Images.map((img) => { +// if (img.QuestionImageId === questionImageId && img.KPIImageId === kpiImageId) { +// const updatedImg = { +// ...img, +// pictureokay: image1 === img.Image1 ? value : img.pictureokay, +// pictureokay2: image2 === img.Image2 ? value : img.pictureokay2, +// }; +// console.log('Updated Image:', updatedImg); +// return updatedImg; +// } +// return img; +// }), +// }; +// } +// return defItem; +// }); + +// console.log('Updated Data:', JSON.stringify(updatedData)); +// return updatedData; +// }); +// }; + + +// return ( +// +// +// +// +// +// {item?.Menu || 'No Menu'} +// +// +// + +// {/* Render the list of DefData */} +// def.DefId.toString()} +// ItemSeparatorComponent={} +// renderItem={({ item: def }) => ( +// <> +// + +// +// +// {def.DefName || 'No DefName'} +// +// +// {console.log(def?.Images, "def?.Images")} +// {/* Render the list of images for Images1 */} +// {def?.Images && ( +// <> +// +// +// {imageKey1} +// +// +// +// )} +// generateUniqueId(image.QuestionImageId, image.KPIImageId, image.Image1)} +// renderItem={({ item: image }) => ( +// handleSetPictureOkay(def.DefId,image.Image1,image.Image2 ?? '',image.QuestionImageId, image.KPIImageId, value)} +// /> +// )} +// // initialNumToRender={3} +// // maxToRenderPerBatch={5} +// // windowSize={5} +// // removeClippedSubviews={false} +// // getItemLayout={(data, index) => ({ +// // length: 170, +// // offset: 170 * index, +// // index, +// // })} +// /> + + +// {/* Render the list of images for Images2 */} +// {def?.Images?.Images2 && def.Images.Images2.length > 0 && ( +// <> +// +// +// {imageKey2} +// +// +// +// )} +// generateUniqueId(image.QuestionImageId, image.KPIImageId, image.Image2)} +// renderItem={({ item: image }) => ( +// handleSetPictureOkay(def.DefId,image.Image1 ?? '',image.Image2, image.QuestionImageId, image.KPIImageId, value)} + +// /> +// )} +// // initialNumToRender={3} +// // maxToRenderPerBatch={5} +// // windowSize={5} +// // removeClippedSubviews={false} +// // getItemLayout={(data, index) => ({ +// // length: 170, +// // offset: 170 * index, +// // index, +// // })} +// /> + +// +// )} +// // initialNumToRender={2} +// // maxToRenderPerBatch={5} +// // windowSize={5} +// // removeClippedSubviews={false} +// // getItemLayout={(data, index) => ({ +// // length: 220, +// // offset: 220 * index, +// // index, +// // })} +// /> +// +// +// ); +// }); + + +const ImageAuditItem = React.memo(({ item }) => { + +const imageKeys = item?.DefData?.[0]?.Images?.[0] || {}; + + // Filter keys that start with 'Image' + const dynamicImageKeys = Object.keys(imageKeys).filter(key => key.startsWith('Image')); + + // Use the first and second dynamic image keys if they exist, otherwise use defaults + const imageKey1 = dynamicImageKeys[1] || 'IMAGE 1'; + const imageKey2 = dynamicImageKeys[2] || 'IMAGE 2'; + +const handleSetPictureOkay = (defId, imagePath, imageId, kpiId, value, imageType) => { + console.log("Received update for:", { defId, imagePath, imageId, kpiId, value, imageType }); + + let uniqueId = ""; + if (imagePath != null && imagePath != '') { + uniqueId = `${imageId}${kpiId}${imagePath}`; + } + + console.log(uniqueId, "uniqueId===="); + + setData(prevState => { + const newState = JSON.parse(JSON.stringify(prevState)); + + const defDataIndex = newState.findIndex(item => + item.DefData.some(def => def.DefId === defId) + ); + + if (defDataIndex !== -1) { + const defData = newState[defDataIndex].DefData; + const defIndex = defData.findIndex(def => def.DefId === defId); + + if (defIndex !== -1) { + const images = defData[defIndex].Images; + console.log("images------", images); + + // Handle Image1 or Image2 based on the imageType parameter + if (imageType === "Image1") { + const imageIndex = images.findIndex(image => `${image.QuestionImageId}${image.KPIImageId}${image.Image1}` == uniqueId); + if (imageIndex !== -1) { + console.log(`Updating Image1 for ${uniqueId} with value ${value}`); + images[imageIndex].pictureokay = value; + } else { + console.log(`No matching image in Image1 for ${uniqueId}`); + } + } else if (imageType === "Image2") { + const imageIndex = images.findIndex(image => `${image.QuestionImageId}${image.KPIImageId}${image.Image2}` == uniqueId); + if (imageIndex !== -1) { + console.log(`Updating Image2 for ${uniqueId} with value ${value}`); + images[imageIndex].pictureokay2 = value; + } else { + console.log(`No matching image in Image2 for ${uniqueId}`); + } + } + } + } + + return newState; + }); +}; + + + return ( + + + + + + {item?.Menu || 'No Menu'} + + + + + def.DefId.toString()} + ItemSeparatorComponent={} + renderItem={({ item: def }) => ( + <> + + + + + {def.DefName || 'No DefName'} + + + + ( + + {/* Render Image1 View */} + {image.Image1 && ( + <> + + + {imageKey1} + + + + )} + + {image.Image1 && ( + handleSetPictureOkay(def.DefId, image.Image1, image.QuestionImageId, image.KPIImageId, value, "Image1")} + /> + )} + + {/* Render Image2 View */} + + {image.Image2 && ( + <> + + + {imageKey2} + + + + )} + {image.Image2 && ( + handleSetPictureOkay(def.DefId, image.Image2, image.QuestionImageId, image.KPIImageId, value, "Image2")} + /> + )} + + )} + /> + + )} + /> + + + ); +}); + + + + + +function render_Picker(label_key,value_key,onChange=()=>{},selected_data={}){ + var data=[]; + + // console.log(selected_data , "selected_data") + + let qtn=selected_data.qtn || {}; + let image=selected_data.image || ''; + + let isQtnDisabled=qtn.isDisabled!=null && qtn.isDisabled!=''?qtn.isDisabled:false; + + let allAnswers=qtn.Answers || []; + + // console.log(qtn , "selectanswerpicker", isQtnDisabled, "isQtnDisabled"); + + allAnswers.map((item,index)=>{ + let obj={ key: index, label: item[label_key],value:item[value_key] }; + if(selected_data.value==item[label_key]) + obj['component']= {item[label_key]}; + data.push(obj); + }); + + return ( + {onChange(option,qtn,image) }} + overlayStyle={customStyle.addVisPickerOverlay} + cancelContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + optionStyle={customStyle.addvis_opStyle} + optionTextStyle={customStyle.addvis_opTextStyle} + optionContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + selectedKey={'1'} + disabled={isQtnDisabled} + cancelText={ST.Cancel} + > + {(selected_data.value!=null && selected_data.value!=''?selected_data.value: '-select-')} + + ) +} + +async function disableQtns(sqtns,DQtns,data,isreturn=false){ + + if(DQtns.length>0){ + new Promise.all( + DQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.AIQuestionId==qid) || {}; + console.log('sqtns qid',qid,s_qtnindex) + let s_qtn=s_qtnindex>=0?sqtns[s_qtnindex]:{}; + if(s_qtnindex>=0){ + console.log('sqtns not found',s_qtnindex) + s_qtn['isDisabled']=true + sqtns[s_qtnindex]=s_qtn; + let id_key=s_qtn.AIQuestionId+'_AnswerId'; + let ans_key=s_qtn.AIQuestionId+'_Answer'; + data[id_key]=0; + data[ans_key]=''; + } + return false + }) + ).then(async (val)=>{ + setSurveyQuestions(sqtns); + setQuestionsData(data); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + }) + } +} + +async function enableQtns(sqtns,EQtns,DQtns,data){ + new Promise.all( + EQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.AIQuestionId==qid) || {}; + let s_qtn=s_qtnindex>=0?sqtns[s_qtnindex]:{}; + if(s_qtnindex>=0){ + s_qtn['isDisabled']=false + sqtns[s_qtnindex]=s_qtn; + } + return false + }) + ).then(async (val)=>{ + if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data) + } + else{ + setSurveyQuestions(sqtns); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + }) +} + + +function onselectionChange(option,qtn,image){ + + // console.log(qtn , "QTNNNNN11111----"); + // console.log(image?.QuestionImageId , "image.QuestionImageIdddd"); + + let data=QuestionsData; + let id_key=qtn.AIQuestionId+'_AnswerId'+ image?.QuestionImageId; + + + let ans_key=qtn.AIQuestionId+'_Answer' + image?.QuestionImageId; + data[id_key]=option.value; + data[ans_key]=option.label; + + setQuestionsData(data); + + let aq_ans=qtn.Answers!=null?qtn.Answers:[]; + let ans_obj=aq_ans.find(i=>i.AIAnswerId==option.value) || {}; + let EQtns=ans_obj.EnableQuestion!=null && ans_obj.EnableQuestion!=''?ans_obj.EnableQuestion.replace(' ','').split(','):[]; + let DQtns=ans_obj.DisableQuestion!=null && ans_obj.DisableQuestion!=''?ans_obj.DisableQuestion.replace(' ','').split(','):[]; + + console.log('EQtns:',EQtns,DQtns); + let sqtns=SurveyQuestions + if(EQtns.length>0){ + enableQtns(sqtns,EQtns,DQtns,data) + } + else if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data) + } + else{ + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + +} + +function setTextValue(value,qtn, image) { + let id_key=qtn.AIQuestionId+'_AnswerId'+ image.QuestionImageId; + let ans_key=qtn.AIQuestionId+'_Answer'+ image.QuestionImageId; + + let obj=QuestionsData; + if(qtn.QuestionType=='Date' ){ + let date_key=qtn.AIQuestionId+'_Date'; + let d=value!=null?new Date(value):new Date(); + let mfdate=moment(d).format('MM/YYYY'); + showQtnDatePicker(qtn,false); + obj[id_key]=0; + obj[ans_key]=mfdate; + obj[date_key]=moment(d).format('MM/DD/YYYY'); + } + else{ + obj[id_key]=0; + obj[ans_key]=value; + } + console.log(value,obj); + setQuestionsData(obj); + // setHasUnsavedChanges(true); + // setrerenderdata1(!rerenderdata1); + if(timerRef?.current){ + clearTimeout(timerRef.current) + } + + // timerRef.current= setTimeout(()=>{ + setHasUnsavedChanges(true); + setrerenderdata1(!rerenderdata1); + // },1000) + +} + + + + +async function setMultiSelectValue(selectedItems=[],qtn, image) { + + console.log('setMultiSelectValue',selectedItems); + let id_key=qtn.AIQuestionId+'_AnswerId'+ image.QuestionImageId; + let ans_key=qtn.AIQuestionId+'_Answer'+ image.QuestionImageId; + let multi_key=qtn.AIQuestionId+'_MultiOption'+ image.QuestionImageId; + let obj=QuestionsData; + obj[id_key]=0; + obj[multi_key]=selectedItems.join(','); + let anss=[]; + selectedItems.map((itemValue)=>{ + let ans = qtn.Answers.find(c1 => c1.AIAnswerId == itemValue); + if(ans.AIAnswerName){anss.push(ans.AIAnswerName)} + }); + obj[ans_key]=anss.join(','); + console.log('obj:',obj); + setQuestionsData(obj); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); +} + + +const RenderItem = React.memo(({ item: qtn, index,image,QuestionsData }) => { + console.log("index------",index) + let selansid = '', + selanswer = '', + selimg = '', + selimg2 = '', + showImageTag = false, + showImageTag2 = false; + let id_key = qtn.AIQuestionId + '_AnswerId' + image.QuestionImageId; + let ans_key = qtn.AIQuestionId + '_Answer' + image.QuestionImageId; + let multi_key = qtn.AIQuestionId + '_MultiOption' + image.QuestionImageId; + let date_key = qtn.AIQuestionId + '_Date' + image.QuestionImageId; + let img_key = qtn.AIQuestionId + '_ImagePath1' + image.QuestionImageId; + let imgname_key = qtn.AIQuestionId + '_ImageName1' + image.QuestionImageId; + let img_key2 = qtn.AIQuestionId + '_ImagePath2' + image.QuestionImageId; + let imgname_key2 = qtn.AIQuestionId + '_ImageName2' + image.QuestionImageId; + let rating_key = qtn.AIQuestionId + '_Rating' + image.QuestionImageId; + let voiceClip_key = qtn.AIQuestionId + '_VoiceClip' + image.QuestionImageId; + let list_mcdata = []; + + if (qtn.QuestionType == 'Single choice list') { + selansid = QuestionsData[id_key] != null ? QuestionsData[id_key] : ''; + selanswer = QuestionsData[ans_key] != null ? QuestionsData[ans_key] : ''; + } else if (qtn.QuestionType == 'Multi choice list') { + if (qtn.Answers != null) { + for (var i = 0; i < qtn.Answers.length; i++) { + let obj = { + AIAnswerId: parseInt(qtn.Answers[i].AIAnswerId), + AIAnswerName: qtn.Answers[i].AIAnswerName, + }; + list_mcdata.push(obj); + } + } + selansid = QuestionsData[multi_key] != null && QuestionsData[multi_key] != '' ? QuestionsData[multi_key].split(',') : []; + if (selansid != null && selansid.length > 0) { + let arr = []; + for (var i = 0; i < selansid.length; i++) { + arr.push(parseInt(selansid[i])); + } + selansid = arr; + } + } else if (qtn.QuestionType == 'Number' || qtn.QuestionType == 'Text' || qtn.QuestionType == 'Decimal' || qtn.QuestionType == 'Date') { + console.log("QuestionsData---------",QuestionsData) + selansid = QuestionsData[ans_key]; + selanswer = (qtn.QuestionType == 'Date') ? QuestionsData[date_key] || moment().format('MM/DD/YYYY') : ''; + showImageTag = (qtn.QuestionImageAllow == true || qtn.QuestionImageAllow == 'true' || qtn.QuestionImageAllow == 1); + showImageTag2 = false; + } else if (qtn.QuestionType == 'Rating') { + selanswer = QuestionsData[ans_key] ? QuestionsData[ans_key] : ''; + } else if (qtn.QuestionType == 'Audio') { + selansid = QuestionsData[ans_key] ? QuestionsData[ans_key] : ''; + selanswer=QuestionsData[voiceClip_key]?(QuestionsData[voiceClip_key].filename || ''):''; + + } + + if (qtn.QuestionType == 'Single choice list' || qtn.QuestionType == 'Multi choice list') { + if (qtn.Answers && qtn.Answers.length > 0) { + for (var i = 0; i < qtn.Answers.length; i++) { + let ansss = qtn.Answers[i]; + let isandImgAl = ansss.ImageAllow1 == true || ansss.ImageAllow1 == 'true' || ansss.ImageAllow1 == 1; + let isandImgAl2 = ansss.ImageAllow2 == true || ansss.ImageAllow2 == 'true' || ansss.ImageAllow2 == 1; + + if (qtn.QuestionType == 'Single choice list' && isandImgAl && ansss.AIAnswerId == selansid) { + showImageTag = true; + } else if (qtn.QuestionType == 'Multi choice list' && isandImgAl && selansid.indexOf(ansss.AIAnswerId) >= 0) { + showImageTag = true; + } + + if (qtn.QuestionType == 'Single choice list' && isandImgAl2 && ansss.AIAnswerId == selansid) { + showImageTag2 = true; + } else if (qtn.QuestionType == 'Multi choice list' && isandImgAl2 && selansid.indexOf(ansss.AIAnswerId) >= 0) { + showImageTag2 = true; + } + } + } + } + +let isDisabled = qtn.isDisabled != null ? qtn.isDisabled : false; + +if (isDisabled == true) { + return ; + } else { + return ( + + {qtn.AIQuestionName} + {qtn.QuestionType == 'Single choice list' && qtn.Answers && render_Picker('AIAnswerName', 'AIAnswerId', onselectionChange, { value: selanswer, qtn, image })} + {qtn.QuestionType == 'Multi choice list' && qtn.Answers && ( + { + console.log('onSelectedItemsChange'); + setMultiSelectValue(selectedItems, qtn, image); + }} + selectedItems={selansid} + selectText="Pick Items" + searchInputPlaceholderText="Search Items..." + tagRemoveIconColor={PrimaryTheme.$primary_color} + tagBorderColor={PrimaryTheme.$primary_color} + tagTextColor={PrimaryTheme.$primary_color} + selectedItemTextColor={PrimaryTheme.$primary_color} + selectedItemIconColor={PrimaryTheme.$primary_color} + tagContainerStyle={{ height: 30, width: '100%', paddingVertical: 5 }} + styleTextTag={{ fontSize: 14 }} + itemTextColor={PrimaryTheme.$text_color} + displayKey="AIAnswerName" + searchInputStyle={{ color: '#CCC' }} + submitButtonColor={PrimaryTheme.$primary_color} + submitButtonText="Submit" + /> + )} + {(qtn.QuestionType == 'Number' || qtn.QuestionType == 'Decimal' || qtn.QuestionType == 'Text') && ( + { + console.log("val------",val) + setTextValue(val, qtn, image); + }} + autoComplete="off" + /> + )} + {qtn.QuestionType == 'Date' && ( + + {selansid != '' ? selansid : 'MM/YYYY'} + { + // setDateValue(selanswer); + showQtnDatePicker(qtn, true); + }}> + + + + )} + {qtn.QuestionType == 'Rating' && ( + + {selanswer} + { + setRatingQtn(qtn); + setShowRating(true); + }}> + + + + )} + {qtn.QuestionType == 'Audio' && ( + + {selanswer} + { + show_recorder(qtn); + }}> + + + + )} + + ); + } +}); + + +const RenderSurveyQtns= React.memo(({image,QuestionsData})=> { + const SurveyQuestions = image?.Questions; + // console.log("SurveyQuestions----",SurveyQuestions?.length) + + + return ( + } + keyExtractor={(item, index) => item.AIQuestionId.toString()} + contentContainerStyle={customStyle.SVn_GroupViewList} + /> + ); +}) + + +async function validate(){ + + var isvalid=true; + const QD=QuestionsData; + console.log(SurveyQuestions.length); + for(var i=0;i=0 && QD[ans_key]===''))){ + isvalid=false; + let msg=( qtn.QuestionType=='Date'?ST.Pleasepickadate:(qtn.QuestionType=='Rating'?ST.Pleaseselectrating:ST.Pleasefillalldetails)); + notify(msg,'SHORT'); + break; + } + else if( qtn.QuestionType=='Audio' && (Object.keys(QD).indexOf(voiceClip_key)<0 || (Object.keys(QD).indexOf(voiceClip_key)>=0 && (QD[voiceClip_key]==null || QD[voiceClip_key].filename==null || QD[voiceClip_key].filename=='')))){ + isvalid=false; + notify(ST.Pleaserecordaudioclipfortherequiredfield,'SHORT'); + break; + } + else if(Object.keys(QD).indexOf(id_key)<0 || (Object.keys(QD).indexOf(id_key)>=0 && (QD[id_key]===''))){ + isvalid=false; + notify(ST.Pleasefillalldetails,'SHORT'); + console.log(QD[id_key],QD,id_key) + break; + } + else if(isImgAllowed && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + isvalid=false; + notify(ST.Pleaseaddimages,'SHORT'); + break; + }else{ + console.log('no condition found'); + } + + if((qtn.QuestionType=='Single choice list' || qtn.QuestionType=='Multi choice list' )){ + if (qtn.Answers && qtn.Answers.length>0){ + for(var j=0;j=0)){ + showImageTag=true; + } + + let isandImgAl2=(ansss.ImageAllow2==true || ansss.ImageAllow2=='true' || ansss.ImageAllow2==1); + if(qtn.QuestionType=='Single choice list' && (isandImgAl2 && ansss.AnswerId==selansid)){ + showImageTag2=true; + } + else if(qtn.QuestionType=='Multi choice list' && (isandImgAl2 && selansid.indexOf(ansss.AnswerId)>=0)){ + showImageTag2=true; + } + } + } + } + + } + } + + return isvalid; +} + +async function onSubmitData(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } +} + +function onSaveCancel(){ + setShowAlert(false); +} + + +async function saveData(UploadStatus) { + + console.log(UploadStatus, "UploadStatus") + + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + try { + let { StoreId } = storeData; + + await db.transaction(async function (txn) { + let q1 = `DELETE FROM ${AppTables.IMAGE_AUDIT_HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + let q2 = `DELETE FROM ${AppTables.IMAGE_AUDIT_QUESTION} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // Remove old data + await txn.executeSql(q1, [], async function (txn2, txnres) { + console.log('Image audit header data deleted'); + }, function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q2, [], async function (txn2, txnres) { + console.log('Image audit questions deleted'); + }, function (txn2, txnerr) { console.log(txnerr); },); + + insertData(UploadStatus); + }); + } catch (err) { + console.log(err); + } +} + + +// async function insertData(UploadStatus) { +// try { +// let { StoreId } = storeData; + +// await db.transaction(async function (txn) { +// var headerValues = ''; +// var imageValues = ''; + +// for (var i = 0; i < data.length; i++) { +// let { MID, MenuId, Menu, DefData } = data[i]; + +// let ImageHeaderId = 'IMAGEAUDIT' + i + MID + moment().format('MMDDYYYYHHmmss'); + +// for (var j = 0; j < DefData.length; j++) { +// let { DefId, DefName, Images } = DefData[j]; + +// // Iterate over the Images array (handling both Image1 and Image2 together) +// for (let k = 0; k < Images.length; k++) { +// let image = Images[k]; + +// let pictureokay = image.pictureokay ? 1 : 0; // for Image1 checkbox +// let pictureokay2 = image.pictureokay2 ? 1 : 0; // for Image2 checkbox + +// let statusChange = image.STATUS == "U" ? "U" : UploadStatus; + +// // Insert header data for both Image1 and Image2 +// headerValues += headerValues !== '' ? ' , ' : ''; +// headerValues += `('${StoreId}','${d2}','${ImageHeaderId}', '${MID}', '${MenuId}', '${Menu}', '${image.KPIImageId}', '${image.QuestionImageId}', '${DefId}', '${DefName}', '${image.ImageName}', '${image.Image1 || ''}', '${image.Image2 || ''}', '${image.BaseUrl}', '${pictureokay || 0}', '${pictureokay2 || 0}', '${statusChange}')`; + +// // Prepare image data for Questions (for both Image1 and Image2) +// imageValues += imageValues !== '' ? ' , ' : ''; +// imageValues += `('${ImageHeaderId}', '${StoreId}', '${d2}', '${MID}', '${image.QuestionImageId}', '${image.QuestionType}', '${image.Image1 || ''}', '${image.KPIImageId}', '', 0, '${d2}')`; + +// // if (image.Image2) { +// // imageValues += imageValues !== '' ? ' , ' : ''; +// // imageValues += `('${ImageHeaderId}', '${StoreId}', '${d2}', '${MID}', '${image.QuestionImageId}', '${image.QuestionType}', '${image.Image2 || ''}', '${image.KPIImageId}', '', 0, '${d2}')`; +// // } +// } +// } +// } + +// let addHeaderData = `INSERT INTO ${AppTables.IMAGE_AUDIT_HDR_DATA} +// (STORE_ID, VISIT_DATE, IMAGE_HEADER_ID, MID, MenuId, Menu, KPIImageId, QuestionImageId, DefId, DefName, ImageName, Image1, Image2, BaseUrl, pictureokay, pictureokay2, STATUS) +// VALUES ${headerValues}`; + +// console.log("HEADER_VALUES---", headerValues); + +// let addImagesData = `INSERT INTO ${AppTables.IMAGE_AUDIT_QUESTION} +// (STORE_ID, VISIT_DATE, MID, QUESTION_ID, QUESTION_TYPE, ANSWER, ANSWER_ID, MULTI_OPTIONS_IDS, IS_DISABLED, ADDED_DATE) +// VALUES ${imageValues}`; + +// await txn.executeSql(addHeaderData, [], async function (txn2, txnres) { +// console.log('Image header data added'); +// notify('Data saved successfully'); +// setProcessing(false); + +// // Uncomment if needed for image data insertion +// // await txn.executeSql(addImagesData, [], async function (txn2, txnres) { +// // console.log('Image data added successfully'); +// // notify('Data saved successfully'); +// // setProcessing(false); +// // props.navigation.goBack(); +// // }, function (txn2, txnerr) { +// // console.log(txnerr); +// // setProcessing(false); +// // notify('Error saving image data'); +// // }); + +// }, function (txn2, txnerr) { +// console.log(txnerr); +// setProcessing(false); +// notify('Error saving image header data'); +// }); +// }); +// } catch (err) { +// console.log(err); +// setProcessing(false); +// } +// } + + +async function insertData(UploadStatus) { + try { + let { StoreId } = storeData; + + await db.transaction(async function (txn) { + var headerValues = ''; + var imageValues = ''; + + for (var i = 0; i < data.length; i++) { + let { MID, MenuId, Menu, DefData } = data[i]; + + let ImageHeaderId = 'IMAGEAUDIT' + i + MID + moment().format('MMDDYYYYHHmmss'); + + for (var j = 0; j < DefData.length; j++) { + let { DefId, DefName, Images } = DefData[j]; + + // Iterate over the Images array (handling both Image1 and Image2 separately) + for (let k = 0; k < Images?.length; k++) { + let image = Images[k]; + + // Check if Image1 or Image2 are selected + let pictureokay = image.pictureokay ? 1 : 0; // for Image1 checkbox + let pictureokay2 = image.pictureokay2 ? 1 : 0; // for Image2 checkbox + + let statusChange = image.STATUS == "U" ? "U" : UploadStatus; + + // Only insert data if Image1 or Image2 is selected (avoid duplicates) + // if (pictureokay || pictureokay2) { + headerValues += headerValues !== '' ? ' , ' : ''; + headerValues += `('${StoreId}','${d2}','${ImageHeaderId}', '${MID}', '${MenuId}', '${Menu}', '${image.KPIImageId}', '${image.QuestionImageId}', '${DefId}', '${DefName}', '${image.ImageName}', '${image.Image1 || ''}', '${image.Image2 || ''}', '${image.BaseUrl}', '${pictureokay}', '${pictureokay2}', '${statusChange}')`; + // } + + // Insert only if Image1 or Image2 is selected (avoid duplicates) + // if (pictureokay || pictureokay2) { + // imageValues += imageValues !== '' ? ' , ' : ''; + // imageValues += `('${ImageHeaderId}', '${StoreId}', '${d2}', '${MID}', '${image.QuestionImageId}', '${image.QuestionType}', '${pictureokay ? image.Image1 || '' : ''}', '${image.KPIImageId}', '', 0, '${d2}')`; + // } + } + } + } + + if (headerValues !== '') { + let addHeaderData = `INSERT INTO ${AppTables.IMAGE_AUDIT_HDR_DATA} + (STORE_ID, VISIT_DATE, IMAGE_HEADER_ID, MID, MenuId, Menu, KPIImageId, QuestionImageId, DefId, DefName, ImageName, Image1, Image2, BaseUrl, pictureokay, pictureokay2, STATUS) + VALUES ${headerValues}`; + + console.log("HEADER_VALUES---", headerValues); + + await txn.executeSql(addHeaderData, [], async function (txn2, txnres) { + console.log('Image header data added'); + notify('Data saved successfully'); + setProcessing(false); + + // Uncomment if needed for image data insertion + // if (imageValues !== '') { + // let addImagesData = `INSERT INTO ${AppTables.IMAGE_AUDIT_QUESTION} + // (STORE_ID, VISIT_DATE, MID, QUESTION_ID, QUESTION_TYPE, ANSWER, ANSWER_ID, MULTI_OPTIONS_IDS, IS_DISABLED, ADDED_DATE) + // VALUES ${imageValues}`; + + // await txn.executeSql(addImagesData, [], async function (txn2, txnres) { + // console.log('Image data added successfully'); + // notify('Data saved successfully'); + // setProcessing(false); + // }, function (txn2, txnerr) { + // console.log(txnerr); + // setProcessing(false); + // notify('Error saving image data'); + // }); + // } + }, function (txn2, txnerr) { + console.log(txnerr); + setProcessing(false); + notify('Error saving image header data'); + }); + } + }); + } catch (err) { + console.log(err); + setProcessing(false); + } +} + + + + + + +async function upload_Status() { + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + // await saveData("P"); + + setLoaderTitle('Uploading Data...'); + + let storeInfo = data; + + let arr = []; + + // storeInfo?.map((item, i) => { + // let itemObj = item; + // if (item.Status !== "U") { + // delete itemObj.ImagePath; + // arr.push(itemObj); + // return itemObj; + // } + // }); + + storeInfo?.map((item, i) => { + let itemObj = item; + if (item.Status !== "U") { + let Images=[]; + console.log("item-----",item) + let rsData= item.DefData.map(item3=>{ + + item3?.Images.map(item2=>{ + let obj={KPIImageId:item2.KPIImageId, + QuestionImageId: item2.QuestionImageId + } + Images.push({...obj,imageType:"Image1",Questions1:item2.Questions1, + pictureokay:item2.pictureokay, + }) + Images.push({...obj,imageType:"Image2",Questions2:item2.Questions2, + pictureokay:item2.pictureokay2, + }) + }) + return item3["Images"]=Images + }) + itemObj["DefData"]=rsData + arr.push(itemObj); + console.log("itemObj-",itemObj) + return itemObj; + } + }); + + console.log(JSON.stringify(arr), "postDATAAAA----------") + + let postData = { + "MID": storeData?.MID, + "Keys": "Image_Audit_Info", + "JsonData": JSON.stringify(arr), + "UserId": props.UserId, + }; + + console.log("image audit infooo-------------ad", data); + + const url = props.baseurl + getMethodName(METHODS.UPLOADJSON_METHOD); + + console.log(url, postData, 'url and postDaata...'); + + await UploadData(url, postData) + .then(async (res) => { + console.log('res: 12', res); + if (res?.UploadJsonResult == "Success") { + // await saveData("U"); + // get_data(); + setProcessing(false); + } else { + setProcessing(false); + } + }) + .catch((err) => { + console.log(err); + setProcessing(false); + }); +} + + + +// console.log(JSON.stringify(data), "data---------///") + + + return ( + + {processing && } + + + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,upload_Status)} + + {!processing && <> + + + {!props.isDataDownloaded && } + + + + + + + + {storeData?.StoreName} + + {storeData?.StoreType} + + + + + + + {ST.StoreId+':'} + {storeData?.StoreId} + + + {ST.Address+':'} + {storeData?.Address} + + + + + + + + + { + + } + + /> + + } + + + + + + + + {show_zoomImage && + + null} + /> + + } + + + {onSubmitData()}}/> + + } + + + ); +}; + +export default connect(mapStateToProps, mapDispatchToProps)(ImageAudit); diff --git a/src/screens/ImageAudit.js b/src/screens/ImageAudit.js new file mode 100644 index 0000000..60a90af --- /dev/null +++ b/src/screens/ImageAudit.js @@ -0,0 +1,1705 @@ +import React, { useState, useEffect, memo, useRef, useCallback, useMemo } from 'react'; +import { useRoute } from '@react-navigation/native'; +import { View, Text, TouchableOpacity, Image, FlatList, Platform, ScrollView, TextInput } from 'react-native'; +import { connect } from 'react-redux'; +import moment from 'moment'; +import Container from '../components/container'; +import CustomLoader from '../components/CustomLoader'; +import CustomHeader from '../components/customHeader'; +import NoDataComponent from '../components/NoDataComponent'; +import LinearGradient from 'react-native-linear-gradient'; +import { get_item } from '../components/localStorage'; +import { notify } from '../components/notify'; +import { globalStyles, customStyles, GetPageTheme } from "../styles/Global"; +import { getDownloadJson1, UploadData } from '../controller/functions'; +import { METHODS, getMethodName } from '../constants/methodNames'; +import { SvgXml } from 'react-native-svg'; +import { AppTables } from '../constants/tableConstants'; +import CheckBox from '@react-native-community/checkbox'; +import { mapDispatchToProps, mapStateToProps } from '../reducers/contextProvider'; +import { db } from '../constants/constants'; +import Animated from 'react-native-reanimated'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import { Entypo, Fontisto, MaterialCommunityIcons } from '../components/icons'; +import MultiSelect from 'react-native-multiple-select'; +import ModalSelector from 'react-native-modal-selector'; +import { PrimaryTheme } from '../styles/Themes'; +import GradientButton from '../components/gradientButton'; +import { ConfirmSaveAlert } from '../components/alert'; + + +const ImageAudit = (props) => { + const route = useRoute(); + const { DarkMode, baseurl, StaticText: ST = {} } = props; + const PageTheme = GetPageTheme(DarkMode, route.name); + const customStyle = customStyles(DarkMode, route.name); + + const timerRef = useRef(null); + + const [processing, setProcessing] = useState(false); + const [loaderTitle, setLoaderTitle] = useState(); + const [isDataFound, setIsDataFound] = useState(false); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata1, setrerenderdata1]= useState(true); + + const storeData = route?.params?.imageauditstoreData; + let selectedDate = route?.params?.selectedDate ; + selectedDate = moment(selectedDate).format('MM/DD/YYYY'); + + console.log("selectedDate", selectedDate) ; + + // console.log(storeData?.MID, "MIDDD") + + const [dataInfo , setDataInfo] = useState([]); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + const [SurveyQuestions, setSurveyQuestions]= useState([]); + const [QuestionsData,setQuestionsData]=useState({}); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [showAlert, setShowAlert] = useState(false); + + + + // zoom image + + const zoomView=useRef(null); + const Show_zoomImageRef=useRef(false); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [refImageIndex, setrefImageIndex] = useState(0); + + + function UpdateShow_zoomImageRef(val) { + Show_zoomImageRef.current = val; + setShow_zoomImage(val); + } + + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + // setStoreData(storeData1); + + setLoaderTitle(ST.Loading +'...'); + if(selectedDate != null && selectedDate != undefined){ + console.log("Anitaaa") + getDataselectedDate(); + } else { + get_data(); + } + }, []); + + const _renderHeader = useCallback((currentIndex) => { + return ( + + {`${(currentIndex + 1)}/${zoomImageUrl.length}`} + UpdateShow_zoomImageRef(false)}> + + + + ); +}, [zoomImageUrl.length, customStyle.album_ZOOM_topBar, customStyle.album_ZOOM_indicator, customStyle.album_ZOOM_backBtn]); + + +// date wise + // async function getDataselectedDate(){ + // setProcessing(true) + // try { + + // let allImageAuditStoreImageData= await DownloadImageAuditImageList(); + // console.log('allImageAuditStoreImageData-------------------',allImageAuditStoreImageData); + // if(allImageAuditStoreImageData?.length>0){ + // console.log("allImageAuditStoreImageData--",allImageAuditStoreImageData) + // setProcessing(false); + // } + // else{ + // notify(ST.Nodatafound); + // setProcessing(false); + // } + + // } catch (err) { + // setProcessing(false); + // console.log(err); + // } + // } + + async function getDataselectedDate() { + + setProcessing(true); + try { + let allImageAuditStoreImageData = await DownloadImageAuditImageList(); + console.log('allImageAuditStoreImageData:', allImageAuditStoreImageData); + + if (allImageAuditStoreImageData?.length > 0) { + await InsertDownloadImageKPIData(allImageAuditStoreImageData); + // Fetch the updated local data + get_data(); + } else { + notify(ST.Nodatafound); + } + } catch (err) { + console.log(err); + } finally { + setProcessing(false); + } +} + + async function InsertDownloadImageKPIData(imageKPIArr){ + console.log("insert download posSale called"); + return new Promise((resolve,reject)=>{ + + var values=[],sql_stmnt='',all_vals=''; + let d1=new Date(); + let tbname='Sup_ImageAuditKPIImages'; + let storeId = storeData.StoreId; + let MID = storeData.MID; + let q=`Delete from ${tbname} where MID='${MID}' `; + + imageKPIArr = imageKPIArr ? imageKPIArr : []; + + console.log("imageKPIArr", imageKPIArr) + + imageKPIArr?.map((data_obj)=>{ + let {MID ,MenuId,Menu,KPIImageId,QuestionImageId,DefId,DefName,BaseUrl,ImageName,Image1,Image2}=data_obj; + values.push(` ('${MID || ''}', '${MenuId || ''}', '${Menu || ''}', '${KPIImageId || ''}','${QuestionImageId || ''}', '${DefId || ''}', '${DefName || ''}', '${BaseUrl || ''}','${ImageName || ''}', '${Image1 || ''}', '${Image2 || ''}')`); + }); + all_vals=values.join(','); + sql_stmnt=`INSERT INTO ${tbname}(MID,MenuId,Menu,KPIImageId,QuestionImageId,DefId,DefName,BaseUrl,ImageName,Image1,Image2) + values ${all_vals}`; + + db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres4) { + console.log('removeddata'); + await txn.executeSql(sql_stmnt,[],async function (txn2, txnres2) { + resolve(true); + },function(txn2,txnerr){ console.log(txnerr);resolve(false);}); + },function(txn2,txnerr){console.log(txnerr);resolve(false);}); + }) + }).catch((err)=>{ + console.log(err); + return false; + }) + + } + + + async function DownloadImageAuditImageList(){ + let downloadKey="Sup_ImageAuditKPIImages"; + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url=props.baseurl+getMethodName(METHODS.DOWNLOADJSON_METHOD); + let data={ + Downloadtype:downloadKey, + Username: loginDetails.UserId, + Param1: selectedDate, + Param2: '', + }; + + console.log(url,data); + return await getDownloadJson1(url,data) + .then(async(res)=>{ + if (res[downloadKey]) { + let data_arr = res[downloadKey] || []; + return data_arr; + } + else{ + return []; + } + }) + .catch((err)=>{ + console.log('onPage Image Audit error',err); + return []; + }); + } + +// end + +async function get_data() { + setProcessing(true); + + let mainQuery = `SELECT DISTINCT MenuId, MID, Menu FROM Sup_ImageAuditKPIImages WHERE MID = '${storeData?.MID}'`; + console.log("mainQuery", mainQuery); + + let fetchedData = []; // Declare fetchedData outside the loop + + try { + db.transaction(async tx => { + tx.executeSql( + mainQuery, + [], + (tx, results) => { + let rows = results.rows; + + // Loop through the results of the main query + let promises = []; + for (let i = 0; i < rows.length; i++) { + let item = rows.item(i); + + // Define the defQuery based on MenuId + let defQuery = `SELECT DISTINCT DefName, DefId, MID ,MenuId FROM Sup_ImageAuditKPIImages WHERE MID = '${item.MID}' AND MenuId = '${item.MenuId}'`; + console.log("defQuery---", defQuery); + + // Execute the defQuery within the loop + promises.push(new Promise((resolve, reject) => { + tx.executeSql( + defQuery, + [], + (tx, defResults) => { + let defRows = defResults.rows; + let defArray = []; + + // Loop through the results of the defQuery + let defPromises = []; + for (let j = 0; j < defRows.length; j++) { + let defItem = defRows.item(j); + + console.log("defItem---------", defItem); + + // Define the imageQuery based on DefId + + + let selectlist = ` DISTINCT S.KPIImageId, S.QuestionImageId, S.DefId, S.DefName, S.BaseUrl, S.ImageName, S.Image1, S.Image2, IFNULL(T.pictureokay, 0) AS pictureokay, IFNULL(T.pictureokay2, 0) AS pictureokay2`; + + let join2 = ` LEFT JOIN (SELECT * FROM IMAGE_AUDIT_HDR_DATA WHERE DefId = '${defItem.DefId}' AND MID = '${defItem.MID}' AND MenuId = '${defItem.MenuId}') AS T ON T.DefId = S.DefId and T.QuestionImageId = S.QuestionImageId`; + + let imageQuery = `SELECT ${selectlist} FROM Sup_ImageAuditKPIImages S ${join2} WHERE S.DefId = '${defItem.DefId}' AND S.MID = '${defItem.MID}' `; + + // let imageQuery = `SELECT DISTINCT KPIImageId, QuestionImageId, DefId, DefName, BaseUrl, ImageName, Image1, Image2 FROM Sup_ImageAuditKPIImages WHERE DefId = '${defItem.DefId}' AND MID = '${defItem.MID}'`; + + console.log("imageQuery---", imageQuery); + + // Execute the imageQuery within the loop + defPromises.push(new Promise((resolve, reject) => { + tx.executeSql( + imageQuery, + [], + async (tx, imageResults) => { + let imageRows = imageResults.rows; + let images1Array = []; + let images2Array = []; + + // Loop through the results of the imageQuery + for (let k = 0; k < imageRows.length; k++) { + let imageItem = imageRows.item(k); + + // console.log(imageItem,"imageItemimageItem--------") + + let all_scat_qtns =[] ; //await getSurveyQtns(item); + // console.log('all_scat_qtns:', all_scat_qtns.length); + imageItem['Questions'] = all_scat_qtns; + + let pictureOkayValue = imageItem.pictureokay; + let pictureOkayValue2 = imageItem.pictureokay2; + + let statusValue = imageItem.STATUS; + + images1Array.push({ + KPIImageId: imageItem.KPIImageId, + QuestionImageId: imageItem.QuestionImageId, + BaseUrl: imageItem.BaseUrl, + ImageName: imageItem.ImageName, + pictureokay : pictureOkayValue, + pictureokay2 : pictureOkayValue2, + // STATUS: statusValue, + Image1: imageItem.Image1, + Image2: imageItem.Image2, + Questions1: all_scat_qtns, + Questions2: all_scat_qtns + }); + + // if (imageItem.Image2) { // Check if Image2 is not an empty string + // images2Array.push({ + // KPIImageId: imageItem.KPIImageId, + // QuestionImageId: imageItem.QuestionImageId, + // BaseUrl: imageItem.BaseUrl, + // ImageName: imageItem.ImageName, + // pictureokay2 : pictureOkayValue2, + // STATUS: statusValue, + // Image2: imageItem.Image2, + // Questions: all_scat_qtns + // }); + // } + } + + // Add imagesArray to the corresponding defItem + defArray.push({ + DefName: defItem.DefName, + DefId: defItem.DefId, + Images: images1Array + }); + + resolve(); + }, + (tx, error) => { + console.error("Failed to execute imageQuery", error); + reject(error); + } + ); + })); + } + + // Wait for all image queries to resolve + Promise.all(defPromises).then(() => { + fetchedData.push({ + MenuId: item.MenuId, + MID: item.MID, + Menu: item.Menu, + DefData: defArray, + }); + resolve(); + }).catch(reject); + }, + (tx, error) => { + console.error("Failed to execute defQuery", error); + reject(error); + } + ); + })); + } + + // Wait for all def queries to resolve + Promise.all(promises).then(() => { + // Update the state with the fetched data + setDataInfo(fetchedData); + setProcessing(false); + // console.log('Updated Data with Images:', JSON.stringify(fetchedData)); + }).catch(error => { + setProcessing(false); + console.error("An error occurred while fetching data:", error); + }); + }, + (tx, error) => { + setProcessing(false); + console.error("Failed to execute main query", error); + } + ); + }); + } catch (error) { + setProcessing(false); + console.error("An error occurred while fetching data:", error); + } +} + + +async function getAnswers(qtn,storeData){ +// console.log(qtn , "Questiondata---------"); + + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + // get inserted audit + let selectlist=` DISTINCT T.AIAnswerName,T.AIAnswerId`; + + let q2=`Select ${selectlist} FROM Sup_ImageAuditKPIQuestion T WHERE T.AIQuestionId='${qtn.AIQuestionId}' ORDER BY T.AIASequence `; + + await txn.executeSql(q2,[],async function (txn2, txnres) { + // console.log('answers len',txnres.rows.length); + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return {'Answers':val,'Success':true}; + }).catch((err)=>{ + console.log(err); + return {'Success':false,'Error':err} + }); + } + + + + async function getSurveyQtns(item){ + + return new Promise((resolve,reject)=>{ + try { + let {StoreId,MerchandiserId}=storeData; + + let {MID}= item; + + db.transaction(async function (txn) { + + // get inserted audit + let selectlist=` DISTINCT T.AIMaximumChar as MaxLength,T.AIMinimumChar as MinLength,T.AILengthValidationRequired as LengthValidation,T.AIDateRangeMax as DateRangeMax,T.AIDateRangeMin as DateRangeMin,T.AIDefaultQuestionEnable as QEnable,T.AIQuestionName as Question,T.AIQuestionId as QuestionId, T.QuestionType as QuestionType,T1.ANSWER As AIAnswerName, T1.ANSWER_ID as AIAnswerId,T1.MULTI_OPTIONS_IDS as multi_op_ids,T1.IS_DISABLED as isDisabled `; + + let join2=` Left outer join ${AppTables.IMAGE_AUDIT_QUESTION} T1 on T1.MID=${MID} And T.AIQuestionId=T1.QUESTION_ID`; + let q2=`Select ${selectlist} FROM Sup_ImageAuditKPIQuestion T ${join2} WHERE T1.STORE_ID='${StoreId}' AND T1.VISIT_DATE= '${d2}' `; + q2+=` ORDER BY T.AIQuestionSequence `; + + console.log(q2, "QueryQuestiondata") + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('getSurveyData len',txnres.rows.length); + if(txnres.rows.length>0){ + let arr=[]; + var QD=QuestionsData; + for(var i=0;i0){ + for(var k=0;k=0)){ + showImageTag=true; + } + + if(qtn.QuestionType=='Single choice list' && (isandImgAl2 && ansss.AIAnswerId==selansid)){ + showImageTag2=true; + } + else if(qtn.QuestionType=='Multi choice list' && (isandImgAl2 && selansid.indexOf(ansss.AIAnswerId)>=0)){ + showImageTag2=true; + } + + } + } + } + + if(showImageTag){ + let imgPath=data.Image1!=''?((Platform.OS=='ios'?'file://':'')+common_ImagePath+data.Image1):''; + QD[imgname_key]=data.Image1; + QD[img_key]=imgPath; + } + + if(showImageTag2){ + let imgPath=data.Image2!=''?((Platform.OS=='ios'?'file://':'')+common_ImagePath+data.Image2):''; + QD[imgname_key2]=data.Image2; + QD[img_key2]=imgPath; + } + + if(qtn.QuestionType=='Audio'){ + let voicefile_path=(Platform.OS=='ios'?'file://':'')+common_ImagePath+'Recordings/'+data.Answer; + QD[voiceClip_key]={'path':voicefile_path,'filename':data.Answer}; + } + + if(qtn.QuestionType=='Date'){ + let dayonly=moment().format('DD'); + let actual_date=data.Answer?data.Answer.split('/'):[]; + let month=actual_date[0],year=actual_date[1]; + let fulldate=month+'/'+dayonly+'/'+year; + QD[date_key]=fulldate; + + } + arr.push(data); + if(i==txnres.rows.length-1){ + // setQuestionsData(QD); + resolve(arr); + // setSurveyQuestions(arr); + // setProcessing(false); + } + } + } + else{ + let sl=` DISTINCT T.AIMaximumChar,T.AIMinimumChar,T.AILengthValidationRequired,T.AIQuestionName,T.AIQuestionId,T.QuestionType,T.AIDateRangeMax,T.AIDateRangeMin,T.AIDefaultQuestionEnable as QEnable`; + let q=` SELECT ${sl} FROM Sup_ImageAuditKPIQuestion T `; + q+=` order by T.AIQuestionSequence `; + + // WHERE T.SurveyId='${SurveyId}' and T.SubCategoryId='${SubCategoryId}' + + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('Surveys:',txnres2.rows.length) + let arr=[]; + if(txnres2.rows.length>0){ + for(var i=0;i { + + const handleCheckBoxChange = (newValue) => { + onPictureOkayChange(newValue ? 1 : 0); + }; + + + return ( + + + {image.ImageName} + + + + { + setZoomImageUrl([{ url: image.BaseUrl + '/' + image.Image1 }]); + setrefImageIndex(0); + UpdateShow_zoomImageRef(true); + }}> + + + + + + + + + + + Picture OK + + + + + + + ); +}); + +const RenderImageItem2 = React.memo(({ image, pictureokay, onPictureOkayChange }) => { + + // console.log("pictureokay2",pictureokay) + + const handleCheckBoxChange = (newValue) => { + onPictureOkayChange(newValue ? 1 : 0); + }; + + return ( + + + {image.ImageName} + + + { + setZoomImageUrl([{ url: image.BaseUrl + '/' + image.Image2 }]); + setrefImageIndex(0); + UpdateShow_zoomImageRef(true); + }}> + + + + + + + + + + + + Picture OK + + + + + ); +}); + +const ImageAuditItem = React.memo(({ item }) => { + +const imageKeys = item?.DefData?.[0]?.Images?.[0] || {}; + + // Filter keys that start with 'Image' + const dynamicImageKeys = Object.keys(imageKeys).filter(key => key.startsWith('Image')); + + // Use the first and second dynamic image keys if they exist, otherwise use defaults + const imageKey1 = dynamicImageKeys[1] || 'IMAGE 1'; + const imageKey2 = dynamicImageKeys[2] || 'IMAGE 2'; + +const handleSetPictureOkay = (defId, imagePath, imageId, kpiId, value, imageType) => { + console.log("Received update for:", { defId, imagePath, imageId, kpiId, value, imageType }); + + let uniqueId = ""; + if (imagePath != null && imagePath != '') { + uniqueId = `${imageId}${kpiId}${imagePath}`; + } + + console.log(uniqueId, "uniqueId===="); + + setDataInfo(prevState => { + const newState = JSON.parse(JSON.stringify(prevState)); + + const defDataIndex = newState.findIndex(item => + item.DefData.some(def => def.DefId === defId) + ); + + if (defDataIndex !== -1) { + const defData = newState[defDataIndex].DefData; + const defIndex = defData.findIndex(def => def.DefId === defId); + + if (defIndex !== -1) { + const images = defData[defIndex].Images; + console.log("images------", images); + + // Handle Image1 or Image2 based on the imageType parameter + if (imageType === "Image1") { + const imageIndex = images.findIndex(image => `${image.QuestionImageId}${image.KPIImageId}${image.Image1}` == uniqueId); + if (imageIndex !== -1) { + console.log(`Updating Image1 for ${uniqueId} with value ${value}`); + images[imageIndex].pictureokay = value; + } else { + console.log(`No matching image in Image1 for ${uniqueId}`); + } + } else if (imageType === "Image2") { + const imageIndex = images.findIndex(image => `${image.QuestionImageId}${image.KPIImageId}${image.Image2}` == uniqueId); + if (imageIndex !== -1) { + console.log(`Updating Image2 for ${uniqueId} with value ${value}`); + images[imageIndex].pictureokay2 = value; + } else { + console.log(`No matching image in Image2 for ${uniqueId}`); + } + } + } + } + + return newState; + }); +}; + + + return ( + + + + + + {item?.Menu || 'No Menu'} + + + + + def.DefId.toString()} + keyExtractor={(_, index) => index.toString()} + ItemSeparatorComponent={} + renderItem={({ item: def }) => ( + <> + + + + + {def.DefName || 'No DefName'} + + + + ( + + {/* Render Image1 View */} + {image.Image1 && ( + <> + + + {imageKey1} + + + + )} + + {image.Image1 && ( + handleSetPictureOkay(def.DefId, image.Image1, image.QuestionImageId, image.KPIImageId, value, "Image1")} + /> + )} + + {/* Render Image2 View */} + + {image.Image2 && ( + <> + + + {imageKey2} + + + + )} + {image.Image2 && ( + handleSetPictureOkay(def.DefId, image.Image2, image.QuestionImageId, image.KPIImageId, value, "Image2")} + /> + )} + + )} + /> + + )} + /> + + + ); +}); + + + + + +function render_Picker(label_key,value_key,onChange=()=>{},selected_data={}){ + var data=[]; + + // console.log(selected_data , "selected_data") + + let qtn=selected_data.qtn || {}; + let image=selected_data.image || ''; + + let isQtnDisabled=qtn.isDisabled!=null && qtn.isDisabled!=''?qtn.isDisabled:false; + + let allAnswers=qtn.Answers || []; + + // console.log(qtn , "selectanswerpicker", isQtnDisabled, "isQtnDisabled"); + + allAnswers.map((item,index)=>{ + let obj={ key: index, label: item[label_key],value:item[value_key] }; + if(selected_data.value==item[label_key]) + obj['component']= {item[label_key]}; + data.push(obj); + }); + + return ( + {onChange(option,qtn,image) }} + overlayStyle={customStyle.addVisPickerOverlay} + cancelContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + optionStyle={customStyle.addvis_opStyle} + optionTextStyle={customStyle.addvis_opTextStyle} + optionContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + selectedKey={'1'} + disabled={isQtnDisabled} + cancelText={ST.Cancel} + > + {(selected_data.value!=null && selected_data.value!=''?selected_data.value: '-select-')} + + ) +} + +async function disableQtns(sqtns,DQtns,data,isreturn=false){ + + if(DQtns.length>0){ + new Promise.all( + DQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.AIQuestionId==qid) || {}; + console.log('sqtns qid',qid,s_qtnindex) + let s_qtn=s_qtnindex>=0?sqtns[s_qtnindex]:{}; + if(s_qtnindex>=0){ + console.log('sqtns not found',s_qtnindex) + s_qtn['isDisabled']=true + sqtns[s_qtnindex]=s_qtn; + let id_key=s_qtn.AIQuestionId+'_AnswerId'; + let ans_key=s_qtn.AIQuestionId+'_Answer'; + data[id_key]=0; + data[ans_key]=''; + } + return false + }) + ).then(async (val)=>{ + setSurveyQuestions(sqtns); + setQuestionsData(data); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + }) + } +} + +async function enableQtns(sqtns,EQtns,DQtns,data){ + new Promise.all( + EQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.AIQuestionId==qid) || {}; + let s_qtn=s_qtnindex>=0?sqtns[s_qtnindex]:{}; + if(s_qtnindex>=0){ + s_qtn['isDisabled']=false + sqtns[s_qtnindex]=s_qtn; + } + return false + }) + ).then(async (val)=>{ + if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data) + } + else{ + setSurveyQuestions(sqtns); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + }) +} + + +function onselectionChange(option,qtn,image){ + + // console.log(qtn , "QTNNNNN11111----"); + // console.log(image?.QuestionImageId , "image.QuestionImageIdddd"); + + let data=QuestionsData; + let id_key=qtn.AIQuestionId+'_AnswerId'+ image?.QuestionImageId; + + + let ans_key=qtn.AIQuestionId+'_Answer' + image?.QuestionImageId; + data[id_key]=option.value; + data[ans_key]=option.label; + + setQuestionsData(data); + + let aq_ans=qtn.Answers!=null?qtn.Answers:[]; + let ans_obj=aq_ans.find(i=>i.AIAnswerId==option.value) || {}; + let EQtns=ans_obj.EnableQuestion!=null && ans_obj.EnableQuestion!=''?ans_obj.EnableQuestion.replace(' ','').split(','):[]; + let DQtns=ans_obj.DisableQuestion!=null && ans_obj.DisableQuestion!=''?ans_obj.DisableQuestion.replace(' ','').split(','):[]; + + console.log('EQtns:',EQtns,DQtns); + let sqtns=SurveyQuestions + if(EQtns.length>0){ + enableQtns(sqtns,EQtns,DQtns,data) + } + else if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data) + } + else{ + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + +} + +function setTextValue(value,qtn, image) { + let id_key=qtn.AIQuestionId+'_AnswerId'+ image.QuestionImageId; + let ans_key=qtn.AIQuestionId+'_Answer'+ image.QuestionImageId; + + let obj=QuestionsData; + if(qtn.QuestionType=='Date' ){ + let date_key=qtn.AIQuestionId+'_Date'; + let d=value!=null?new Date(value):new Date(); + let mfdate=moment(d).format('MM/YYYY'); + showQtnDatePicker(qtn,false); + obj[id_key]=0; + obj[ans_key]=mfdate; + obj[date_key]=moment(d).format('MM/DD/YYYY'); + } + else{ + obj[id_key]=0; + obj[ans_key]=value; + } + console.log(value,obj); + setQuestionsData(obj); + // setHasUnsavedChanges(true); + // setrerenderdata1(!rerenderdata1); + if(timerRef?.current){ + clearTimeout(timerRef.current) + } + + // timerRef.current= setTimeout(()=>{ + setHasUnsavedChanges(true); + setrerenderdata1(!rerenderdata1); + // },1000) + +} + + + + +async function setMultiSelectValue(selectedItems=[],qtn, image) { + + console.log('setMultiSelectValue',selectedItems); + let id_key=qtn.AIQuestionId+'_AnswerId'+ image.QuestionImageId; + let ans_key=qtn.AIQuestionId+'_Answer'+ image.QuestionImageId; + let multi_key=qtn.AIQuestionId+'_MultiOption'+ image.QuestionImageId; + let obj=QuestionsData; + obj[id_key]=0; + obj[multi_key]=selectedItems.join(','); + let anss=[]; + selectedItems.map((itemValue)=>{ + let ans = qtn.Answers.find(c1 => c1.AIAnswerId == itemValue); + if(ans.AIAnswerName){anss.push(ans.AIAnswerName)} + }); + obj[ans_key]=anss.join(','); + console.log('obj:',obj); + setQuestionsData(obj); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); +} + + +const RenderItem = React.memo(({ item: qtn, index,image,QuestionsData }) => { + console.log("index------",index) + let selansid = '', + selanswer = '', + selimg = '', + selimg2 = '', + showImageTag = false, + showImageTag2 = false; + let id_key = qtn.AIQuestionId + '_AnswerId' + image.QuestionImageId; + let ans_key = qtn.AIQuestionId + '_Answer' + image.QuestionImageId; + let multi_key = qtn.AIQuestionId + '_MultiOption' + image.QuestionImageId; + let date_key = qtn.AIQuestionId + '_Date' + image.QuestionImageId; + let img_key = qtn.AIQuestionId + '_ImagePath1' + image.QuestionImageId; + let imgname_key = qtn.AIQuestionId + '_ImageName1' + image.QuestionImageId; + let img_key2 = qtn.AIQuestionId + '_ImagePath2' + image.QuestionImageId; + let imgname_key2 = qtn.AIQuestionId + '_ImageName2' + image.QuestionImageId; + let rating_key = qtn.AIQuestionId + '_Rating' + image.QuestionImageId; + let voiceClip_key = qtn.AIQuestionId + '_VoiceClip' + image.QuestionImageId; + let list_mcdata = []; + + if (qtn.QuestionType == 'Single choice list') { + selansid = QuestionsData[id_key] != null ? QuestionsData[id_key] : ''; + selanswer = QuestionsData[ans_key] != null ? QuestionsData[ans_key] : ''; + } else if (qtn.QuestionType == 'Multi choice list') { + if (qtn.Answers != null) { + for (var i = 0; i < qtn.Answers.length; i++) { + let obj = { + AIAnswerId: parseInt(qtn.Answers[i].AIAnswerId), + AIAnswerName: qtn.Answers[i].AIAnswerName, + }; + list_mcdata.push(obj); + } + } + selansid = QuestionsData[multi_key] != null && QuestionsData[multi_key] != '' ? QuestionsData[multi_key].split(',') : []; + if (selansid != null && selansid.length > 0) { + let arr = []; + for (var i = 0; i < selansid.length; i++) { + arr.push(parseInt(selansid[i])); + } + selansid = arr; + } + } else if (qtn.QuestionType == 'Number' || qtn.QuestionType == 'Text' || qtn.QuestionType == 'Decimal' || qtn.QuestionType == 'Date') { + console.log("QuestionsData---------",QuestionsData) + selansid = QuestionsData[ans_key]; + selanswer = (qtn.QuestionType == 'Date') ? QuestionsData[date_key] || moment().format('MM/DD/YYYY') : ''; + showImageTag = (qtn.QuestionImageAllow == true || qtn.QuestionImageAllow == 'true' || qtn.QuestionImageAllow == 1); + showImageTag2 = false; + } else if (qtn.QuestionType == 'Rating') { + selanswer = QuestionsData[ans_key] ? QuestionsData[ans_key] : ''; + } else if (qtn.QuestionType == 'Audio') { + selansid = QuestionsData[ans_key] ? QuestionsData[ans_key] : ''; + selanswer=QuestionsData[voiceClip_key]?(QuestionsData[voiceClip_key].filename || ''):''; + + } + + if (qtn.QuestionType == 'Single choice list' || qtn.QuestionType == 'Multi choice list') { + if (qtn.Answers && qtn.Answers.length > 0) { + for (var i = 0; i < qtn.Answers.length; i++) { + let ansss = qtn.Answers[i]; + let isandImgAl = ansss.ImageAllow1 == true || ansss.ImageAllow1 == 'true' || ansss.ImageAllow1 == 1; + let isandImgAl2 = ansss.ImageAllow2 == true || ansss.ImageAllow2 == 'true' || ansss.ImageAllow2 == 1; + + if (qtn.QuestionType == 'Single choice list' && isandImgAl && ansss.AIAnswerId == selansid) { + showImageTag = true; + } else if (qtn.QuestionType == 'Multi choice list' && isandImgAl && selansid.indexOf(ansss.AIAnswerId) >= 0) { + showImageTag = true; + } + + if (qtn.QuestionType == 'Single choice list' && isandImgAl2 && ansss.AIAnswerId == selansid) { + showImageTag2 = true; + } else if (qtn.QuestionType == 'Multi choice list' && isandImgAl2 && selansid.indexOf(ansss.AIAnswerId) >= 0) { + showImageTag2 = true; + } + } + } + } + +let isDisabled = qtn.isDisabled != null ? qtn.isDisabled : false; + +if (isDisabled == true) { + return ; + } else { + return ( + + {qtn.AIQuestionName} + {qtn.QuestionType == 'Single choice list' && qtn.Answers && render_Picker('AIAnswerName', 'AIAnswerId', onselectionChange, { value: selanswer, qtn, image })} + {qtn.QuestionType == 'Multi choice list' && qtn.Answers && ( + { + console.log('onSelectedItemsChange'); + setMultiSelectValue(selectedItems, qtn, image); + }} + selectedItems={selansid} + selectText="Pick Items" + searchInputPlaceholderText="Search Items..." + tagRemoveIconColor={PrimaryTheme.$primary_color} + tagBorderColor={PrimaryTheme.$primary_color} + tagTextColor={PrimaryTheme.$primary_color} + selectedItemTextColor={PrimaryTheme.$primary_color} + selectedItemIconColor={PrimaryTheme.$primary_color} + tagContainerStyle={{ height: 30, width: '100%', paddingVertical: 5 }} + styleTextTag={{ fontSize: 14 }} + itemTextColor={PrimaryTheme.$text_color} + displayKey="AIAnswerName" + searchInputStyle={{ color: '#CCC' }} + submitButtonColor={PrimaryTheme.$primary_color} + submitButtonText="Submit" + /> + )} + {(qtn.QuestionType == 'Number' || qtn.QuestionType == 'Decimal' || qtn.QuestionType == 'Text') && ( + { + console.log("val------",val) + setTextValue(val, qtn, image); + }} + autoComplete="off" + /> + )} + {qtn.QuestionType == 'Date' && ( + + {selansid != '' ? selansid : 'MM/YYYY'} + { + // setDateValue(selanswer); + showQtnDatePicker(qtn, true); + }}> + + + + )} + {qtn.QuestionType == 'Rating' && ( + + {selanswer} + { + setRatingQtn(qtn); + setShowRating(true); + }}> + + + + )} + {qtn.QuestionType == 'Audio' && ( + + {selanswer} + { + show_recorder(qtn); + }}> + + + + )} + + ); + } +}); + + +const RenderSurveyQtns= React.memo(({image,QuestionsData})=> { + const SurveyQuestions = image?.Questions; + // console.log("SurveyQuestions----",SurveyQuestions?.length) + + + return ( + } + keyExtractor={(item, index) => item.AIQuestionId.toString()} + contentContainerStyle={customStyle.SVn_GroupViewList} + /> + ); +}) + + +async function validate(){ + + var isvalid=true; + const QD=QuestionsData; + console.log(SurveyQuestions.length); + for(var i=0;i=0 && QD[ans_key]===''))){ + isvalid=false; + let msg=( qtn.QuestionType=='Date'?ST.Pleasepickadate:(qtn.QuestionType=='Rating'?ST.Pleaseselectrating:ST.Pleasefillalldetails)); + notify(msg,'SHORT'); + break; + } + else if( qtn.QuestionType=='Audio' && (Object.keys(QD).indexOf(voiceClip_key)<0 || (Object.keys(QD).indexOf(voiceClip_key)>=0 && (QD[voiceClip_key]==null || QD[voiceClip_key].filename==null || QD[voiceClip_key].filename=='')))){ + isvalid=false; + notify(ST.Pleaserecordaudioclipfortherequiredfield,'SHORT'); + break; + } + else if(Object.keys(QD).indexOf(id_key)<0 || (Object.keys(QD).indexOf(id_key)>=0 && (QD[id_key]===''))){ + isvalid=false; + notify(ST.Pleasefillalldetails,'SHORT'); + console.log(QD[id_key],QD,id_key) + break; + } + else if(isImgAllowed && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + isvalid=false; + notify(ST.Pleaseaddimages,'SHORT'); + break; + }else{ + console.log('no condition found'); + } + + if((qtn.QuestionType=='Single choice list' || qtn.QuestionType=='Multi choice list' )){ + if (qtn.Answers && qtn.Answers.length>0){ + for(var j=0;j=0)){ + showImageTag=true; + } + + let isandImgAl2=(ansss.ImageAllow2==true || ansss.ImageAllow2=='true' || ansss.ImageAllow2==1); + if(qtn.QuestionType=='Single choice list' && (isandImgAl2 && ansss.AnswerId==selansid)){ + showImageTag2=true; + } + else if(qtn.QuestionType=='Multi choice list' && (isandImgAl2 && selansid.indexOf(ansss.AnswerId)>=0)){ + showImageTag2=true; + } + } + } + } + + } + } + + return isvalid; +} + +async function onSubmitData(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } +} + +function onSaveCancel(){ + setShowAlert(false); +} + + +async function saveData(UploadStatus) { + + console.log(UploadStatus, "UploadStatus") + + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + try { + let { StoreId } = storeData; + + await db.transaction(async function (txn) { + let q1 = `DELETE FROM ${AppTables.IMAGE_AUDIT_HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + let q2 = `DELETE FROM ${AppTables.IMAGE_AUDIT_QUESTION} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // Remove old data + await txn.executeSql(q1, [], async function (txn2, txnres) { + console.log('Image audit header data deleted'); + }, function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q2, [], async function (txn2, txnres) { + console.log('Image audit questions deleted'); + }, function (txn2, txnerr) { console.log(txnerr); },); + + await insertData(UploadStatus); + }); + } catch (err) { + console.log(err); + } +} + + +async function insertData(UploadStatus) { + try { + let { StoreId } = storeData; + + await db.transaction(async function (txn) { + var headerValues = ''; + var imageValues = ''; + + console.log("data-------OF INFOooo",JSON.stringify(dataInfo)) + for (var i = 0; i < dataInfo.length; i++) { + let { MID, MenuId, Menu, DefData } = dataInfo[i]; + + let ImageHeaderId = 'IMAGEAUDIT' + i + MID + moment().format('MMDDYYYYHHmmss'); + + for (var j = 0; j < DefData.length; j++) { + let { DefId, DefName, Images } = DefData[j]; + + // Iterate over the Images array (handling both Image1 and Image2 separately) + for (let k = 0; k < Images?.length; k++) { + let image = Images[k]; + + // Check if Image1 or Image2 are selected + let pictureokay = image.pictureokay ? 1 : 0; // for Image1 checkbox + let pictureokay2 = image.pictureokay2 ? 1 : 0; // for Image2 checkbox + + let statusChange = image.STATUS == "U" ? "U" : UploadStatus; + + // Only insert data if Image1 or Image2 is selected (avoid duplicates) + // if (pictureokay || pictureokay2) { + headerValues += headerValues !== '' ? ' , ' : ''; + headerValues += `('${StoreId}','${d2}','${ImageHeaderId}', '${MID}', '${MenuId}', '${Menu}', '${image.KPIImageId}', '${image.QuestionImageId}', '${DefId}', '${DefName}', '${image.ImageName || ''}', '${image.Image1 || ''}', '${image.Image2 || ''}', '${image.BaseUrl || ''}', '${pictureokay}', '${pictureokay2}', '${statusChange}')`; + // } + + // Insert only if Image1 or Image2 is selected (avoid duplicates) + // if (pictureokay || pictureokay2) { + // imageValues += imageValues !== '' ? ' , ' : ''; + // imageValues += `('${ImageHeaderId}', '${StoreId}', '${d2}', '${MID}', '${image.QuestionImageId}', '${image.QuestionType}', '${pictureokay ? image.Image1 || '' : ''}', '${image.KPIImageId}', '', 0, '${d2}')`; + // } + } + } + } + + if (headerValues !== '') { + let addHeaderData = `INSERT INTO ${AppTables.IMAGE_AUDIT_HDR_DATA} + (STORE_ID, VISIT_DATE, IMAGE_HEADER_ID, MID, MenuId, Menu, KPIImageId, QuestionImageId, DefId, DefName, ImageName, Image1, Image2, BaseUrl, pictureokay, pictureokay2, STATUS) + VALUES ${headerValues}`; + + console.log("HEADER_VALUES---", headerValues); + + await txn.executeSql(addHeaderData, [], async function (txn2, txnres) { + console.log('Image header data added'); + notify('Data saved successfully'); + setProcessing(false); + + if(UploadStatus == "U") { + props.navigation.goBack(); + + } + + + // Uncomment if needed for image data insertion + // if (imageValues !== '') { + // let addImagesData = `INSERT INTO ${AppTables.IMAGE_AUDIT_QUESTION} + // (STORE_ID, VISIT_DATE, MID, QUESTION_ID, QUESTION_TYPE, ANSWER, ANSWER_ID, MULTI_OPTIONS_IDS, IS_DISABLED, ADDED_DATE) + // VALUES ${imageValues}`; + + // await txn.executeSql(addImagesData, [], async function (txn2, txnres) { + // console.log('Image data added successfully'); + // notify('Data saved successfully'); + // setProcessing(false); + // }, function (txn2, txnerr) { + // console.log(txnerr); + // setProcessing(false); + // notify('Error saving image data'); + // }); + // } + }, function (txn2, txnerr) { + console.log(txnerr); + setProcessing(false); + notify('Error saving image header data'); + }); + } + }); + } catch (err) { + console.log(err); + setProcessing(false); + } +} + +async function upload_Status() { + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + await saveData("P"); + + setLoaderTitle('Uploading Data...'); + + let storeInfo = dataInfo; + + let arr = []; + + + // Create a shallow copy or filtered version of dataInfo + let filteredStoreInfo = dataInfo.map(item => { + let filteredDefData = item.DefData.map(defItem => { + // Include all images, setting pictureokay/pictureokay2 to 0 if not already set + let allImages = defItem.Images.map(image => ({ + ...image, + pictureokay: image.pictureokay ? image.pictureokay : 0, + pictureokay2: image.pictureokay2 ? image.pictureokay2 : 0, + })); + + return { + ...defItem, + Images: allImages + }; + }); + + return { + ...item, + DefData: filteredDefData + }; + }); + + // Filter out any entries where Images is empty + filteredStoreInfo = filteredStoreInfo.filter(item => item.DefData.some(defItem => defItem.Images.length > 0)); + + + await filteredStoreInfo.map((item, i) => { + let itemObj2 = item; + + if (item.Status !== "U") { + let rsData = item.DefData.map(item3 => { + let Images = []; + + item3?.Images.map(item2 => { + let obj = { + KPIImageId: item2.KPIImageId, + QuestionImageId: item2.QuestionImageId + }; + + if (item2?.Image1) { + Images.push({ + ...obj, + imageType: "Image1", + Questions: item2.Questions1, + Image: item2?.Image1, + pictureokay: item2.pictureokay + }); + } + + if (item2?.Image2) { + Images.push({ + ...obj, + imageType: "Image2", + Questions: item2.Questions2, + Image: item2?.Image2, + pictureokay: item2.pictureokay2 + }); + } + }); + + item3["Images"] = Images; + return item3; + }); + + itemObj2["UserId"] = props.UserId; + itemObj2["DefData"] = rsData; + arr.push(itemObj2); + } + }); + + console.log("Filtered Data to Upload:", JSON.stringify(arr)); + + console.log(JSON.stringify(arr), "postDATAAAA----------") + + let postData = { + "MID": storeData?.MID, + "Keys": "Sup_Image_Audit_Info", + "JsonData": JSON.stringify(arr), + "UserId": props.UserId, + }; + + // console.log("image audit infooo-------------ad", dataInfo); + + const url = props.baseurl + getMethodName(METHODS.UPLOADJSON_METHOD); + + // console.log(url, postData, 'url and postDaata...'); + + await UploadData(url, postData) + .then(async (res) => { + console.log('res: 12', res); + if (res?.UploadJsonResult == "Success") { + await saveData("U"); + // get_data(); + setProcessing(false); + } else { + setProcessing(false); + } + }) + .catch((err) => { + console.log(err); + setProcessing(false); + }); + +} + + + +// console.log(JSON.stringify(dataInfo), "data---------///") + + + return ( + + {processing && } + + + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,upload_Status)} + + {!processing && <> + + + {!props.isDataDownloaded && } + + + + + + + + {storeData?.StoreName} + + {storeData?.StoreType} + + + + + + + {ST.StoreId+':'} + {storeData?.StoreId} + + + {ST.Address+':'} + {storeData?.Address} + + + + + + + + + { + + } + + /> + + } + + + + + + + + {show_zoomImage && + + null} + /> + + } + + + {onSubmitData()}}/> + + } + + + ); +}; + +export default connect(mapStateToProps, mapDispatchToProps)(ImageAudit); diff --git a/src/screens/ImageAuditStoreList copy.js b/src/screens/ImageAuditStoreList copy.js new file mode 100644 index 0000000..ce57e9d --- /dev/null +++ b/src/screens/ImageAuditStoreList copy.js @@ -0,0 +1,214 @@ +import React,{useState,useEffect, memo, useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,TouchableHighlight,Platform,PermissionsAndroid,FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,AddStore, checkRange, UploadData2, UploadData, UpdateStoreStatus, getKPIS, marktext1, marktext2, UploadFormData, getDownloadJson1} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, AppVersion} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign, Entypo, EvilIcons, Feather, FontAwesome, Fontisto, Ionicons, MaterialCommunityIcons} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import NoDataComponent from '../components/NoDataComponent'; +import {SvgXml} from 'react-native-svg'; +import MapIcon from '../assets/performics/map_icon.svg'; +import CustomModal from '../components/CustomModal'; +import { AppTables } from '../constants/tableConstants'; +import { _checkLocationPermission } from '../components/geolocation'; +import { getMethodName, METHODS } from '../constants/methodNames'; + + +function ImageAuditStoreList(props) { + const route = useRoute(); + + const ST=props.StaticText || {}; + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + + const [processing, setProcessing] = useState(false); + const [loaderTitle, setLoaderTitle] = useState(); + const [isDataFound, setisDataFound] = useState(false); + + const [addstoreinfo, setAddStoreInfo] = useState([]); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(()=>{ + getData(); + setLoaderTitle(ST.Loading+'...'); + },[]) + + + async function getData(){ + setProcessing(true) + try { + + let allImageAuditStoreListData= await DownloadImageAuditStoreList(); + console.log('allImageAuditStoreListData',allImageAuditStoreListData); + if(allImageAuditStoreListData.length>0){ + setAddStoreInfo(allImageAuditStoreListData); + setProcessing(false); + setisDataFound(true); + } + else{ + notify(ST.Nodatafound); + setProcessing(false); + } + + } catch (err) { + setProcessing(false); + console.log(err); + } + } + + async function DownloadImageAuditStoreList(){ + let downloadKey="Sup_ImageAuditStoreList"; + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url=props.baseurl+getMethodName(METHODS.DOWNLOADJSON_METHOD); + let data={ + Downloadtype:downloadKey, + Username: loginDetails.UserId, + Param1: '', + Param2: '', + }; + + console.log(url,data); + return await getDownloadJson1(url,data) + .then(async(res)=>{ + if (res[downloadKey]) { + let data_arr = res[downloadKey] || []; + return data_arr; + } + else{ + return []; + } + }) + .catch((err)=>{ + console.log('onPage Team error',err); + return []; + }); + } + + + const StoreItem=memo((props)=>{ + const route = useRoute(); + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const item=props.item; + const ST=props.StaticText || {}; + + console.log(item, "itemss---------->>>>>") + + return( + + + + + {item.StoreName} + + + + + + {ST.StoreId+':'} + {item.StoreId} + + + {ST.StoreType+':'} + {item.StoreType} + + + + + + + {ST.Address+':'} + {item.Address} + + + {ST.CityName+':'} + {item.CityName} + + + + + + + {ST.CoveredBy+':'} + {item.CoveredBy} + + + + { + + {}}> + + {'Audit'} + + + } + + + + + ); + }); + + + return ( + + {processing && } + + + + + { !props.isDataDownloaded && } + + { isDataFound==false && + + {ST.NoDataAvailable} + + } + { addstoreinfo.length> 0 && + + { + return( + + ); + }} + /> + + } + + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(ImageAuditStoreList); \ No newline at end of file diff --git a/src/screens/ImageAuditStoreList.js b/src/screens/ImageAuditStoreList.js new file mode 100644 index 0000000..c048be0 --- /dev/null +++ b/src/screens/ImageAuditStoreList.js @@ -0,0 +1,371 @@ +import React, { useState, useEffect, memo } from 'react'; +import { useIsFocused, useRoute } from '@react-navigation/native'; +import { View, Text, TouchableOpacity, Image, FlatList, Platform } from 'react-native'; +import { connect } from 'react-redux'; +import moment from 'moment'; +import Container from '../components/container'; +import CustomLoader from '../components/CustomLoader'; +import CustomHeader from '../components/customHeader'; +import NoDataComponent from '../components/NoDataComponent'; +import LinearGradient from 'react-native-linear-gradient'; +import { get_item } from '../components/localStorage'; +import { notify } from '../components/notify'; +import { globalStyles, customStyles, GetPageTheme } from "../styles/Global"; +import { getDownloadJson1 } from '../controller/functions'; +import { METHODS, getMethodName } from '../constants/methodNames'; +import { SvgXml } from 'react-native-svg'; +import { AppTables } from '../constants/tableConstants'; +import { mapDispatchToProps, mapStateToProps } from '../reducers/contextProvider'; +import { db } from '../constants/constants'; +import { Fontisto, Ionicons } from '../components/icons'; +import DateTimePickerModal from 'react-native-modal-datetime-picker' + +const ImageAuditStoreList = (props) => { + const route = useRoute(); + const { DarkMode, baseurl, StaticText: ST = {} } = props; + const PageTheme = GetPageTheme(DarkMode, route.name); + const customStyle = customStyles(DarkMode, route.name); + + const [processing, setProcessing] = useState(false); + const [loaderTitle, setLoaderTitle] = useState(); + const [isDataFound, setIsDataFound] = useState(false); + const [addStoreInfo, setAddStoreInfo] = useState([]); + const [addStoreInfodatewise, setAddStoreInfoDateWise] = useState([]); + + const [localimagedata, setHdrData] = useState([]); + + const [isDatePickerVisible, setDatePickerVisibility] = useState(false); + const [selectedDate, setSelectedDate] = useState(null); + + const isFocused = useIsFocused(); + + useEffect(() => { + setLoaderTitle(ST.Loading +'...'); + Get_data(); + }, [isFocused]); + + const showDatePicker = () => { + setDatePickerVisibility(true); + }; + + const hideDatePicker = () => { + setDatePickerVisibility(false); + }; + + const handleConfirm = (date) => { + setSelectedDate(date); // Save the selected date in state + hideDatePicker(); + }; + + + async function getDataselectedDate(date){ + const date1 = moment(date).format('MM/DD/YYYY'); + setProcessing(true) + try { + + let allImageAuditStoreListData= await DownloadImageAuditStoreList(date1); + // console.log('allImageAuditStoreListData-------------------',allImageAuditStoreListData); + if(allImageAuditStoreListData?.length>0){ + console.log("localimagedata--",localimagedata) + + let res=allImageAuditStoreListData?.map((item)=>{ + console.log("res------12------",item) + let objVal=localimagedata?.find((val)=>val.MID==item.MID && val.STORE_ID==item.StoreId ) + console.log("res------12-----objVal-",objVal) + if(objVal && (Object?.keys(objVal)?.length>0)){ + console.log("res------12-----objVal3-") + return {...item,...objVal }; + }else{ + return item ; + } + }) + + console.log("res------------",res) + setAddStoreInfo(res||[]); + setProcessing(false); + } + else{ + notify(ST.Nodatafound); + setProcessing(false); + } + + } catch (err) { + setProcessing(false); + console.log(err); + } + } + + async function DownloadImageAuditStoreList(date1){ + let downloadKey="Sup_ImageAuditStoreList"; + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url=props.baseurl+getMethodName(METHODS.DOWNLOADJSON_METHOD); + let data={ + Downloadtype:downloadKey, + Username: loginDetails.UserId, + Param1: date1, + Param2: '', + }; + + console.log(url,data); + return await getDownloadJson1(url,data) + .then(async(res)=>{ + if (res[downloadKey]) { + let data_arr = res[downloadKey] || []; + return data_arr; + } + else{ + return []; + } + }) + .catch((err)=>{ + console.log('onPage Team error',err); + return []; + }); + } + + async function Get_data() { + setProcessing(true); + try { + await db.transaction(async (txn) => { + let query1 = ` + SELECT DISTINCT s.*, IFNULL(h.Status , '') AS STATUS + FROM Sup_ImageAuditStoreList s + LEFT JOIN IMAGE_AUDIT_HDR_DATA h + ON s.MID = h.MID AND s.StoreId = h.STORE_ID; + `; + + let query2 = `SELECT * FROM IMAGE_AUDIT_HDR_DATA`; + + console.log(query1, "query1"); + console.log(query2, "query2"); + + // First Query Execution + txn.executeSql(query1, [], (txn, result) => { + if (result.rows.length > 0) { + let arr = []; + for (let i = 0; i < result.rows.length; i++) { + let data = result.rows.item(i); + arr.push(data); + } + setAddStoreInfo(arr); + setIsDataFound(true); + setrerenderdata(prevState => !prevState); + } + }, (error) => { + console.log("Error while executing query1: ", error); + }); + + // Second Query Execution + txn.executeSql(query2, [], (txn, result) => { + if (result.rows.length > 0) { + let hdrData = []; + for (let i = 0; i < result.rows.length; i++) { + let data = result.rows.item(i); + hdrData.push(data); + } + setHdrData(hdrData); // Store the data in a new state + } + }, (error) => { + console.log("Error while executing query2: ", error); + }); + + setProcessing(false); // Mark processing as false after executing both queries + }); + } catch (err) { + console.log("Error in Get_data function: ", err); + setProcessing(false); + } + } + + + + async function Get_Status() { + setProcessing(true); + try { + + await db.transaction(async (txn) => { + let query = `SELECT DISTINCT s.MID, s.StoreId, h.Status FROM Sup_ImageAuditStoreList s + LEFT JOIN IMAGE_AUDIT_HDR_DATA h ON s.MID = h.MID AND s.StoreId = h.STORE_ID;` ; + + console.log(query , "query") + + txn.executeSql(query, [], (txn, result) => { + + if (result.rows.length > 0) { + let arr = []; + for (let i = 0; i < result.rows.length; i++) { + let data = result.rows.item(i); + arr.push(data); + } + // setAddStoreInfo(arr); + // console.log(arr, "STTATTSTSUUUSS") + + setProcessing(false); + // console.log(arr, "Image Audit Store list data statuss........"); + // setrerenderdata(prevState => !prevState); + } else{ + setProcessing(false); + } + }, (error) => { + setProcessing(false); + console.log("Error while executing SQL: ", error); + }); + }); + } catch (err) { + console.log("Error in Get_data function: ", err); + setProcessing(false); + } + } + + const StoreItem = memo(({ item }) => ( + { + if (item.STATUS !== 'U') { + props.navigation.navigate('ImageAudit', {imageauditstoreData: item , selectedDate : selectedDate}); + } + }} + > + + + + {item.StoreName} + + + + + + {`${ST.StoreId}:`} + {item.StoreId} + + + {`${ST.StoreType}:`} + {item.StoreType} + + + + + + + {`${ST.Address}:`} + {item.Address} + + + {`${ST.CityName}:`} + {item.CityName} + + + + + + + {`${ST.CoveredBy}:`} + {item.CoveredBy} + + + + + + + { + if (item.STATUS !== 'U') { + props.navigation.navigate('ImageAudit', {imageauditstoreData: item , selectedDate : selectedDate}); + } + }} + > + + {'Audit'} + + + { item.STATUS=="P" && + + {"Upload Pending"} + + } + + { item.STATUS=="U" && + + + {ST.Uploaded} + + } + + + + + + + + )); + + let minDate = new Date(); + minDate.setDate(minDate.getDate() - 7); + + console.log(addStoreInfo , "addStoreInfo") + + return ( + + {processing && } + + + + + + + + Select Date + + + + + + + {selectedDate && (Selected Date: {moment(selectedDate).format('MM/DD/YYYY')})} + + + {selectedDate && + {getDataselectedDate(selectedDate)}}> + Go + + } + + + {!props.isDataDownloaded && } + + {!isDataFound && ( + + {ST.NoDataAvailable} + + )} + + {addStoreInfo?.length > 0 && ( + + } + /> + + )} + + + + + ); +}; + +export default connect(mapStateToProps, mapDispatchToProps)(ImageAuditStoreList); diff --git a/src/screens/Login.js b/src/screens/Login.js new file mode 100644 index 0000000..4c83356 --- /dev/null +++ b/src/screens/Login.js @@ -0,0 +1,390 @@ +import React, { useState, useEffect, useRef } from 'react'; +import Container from '../components/container'; +import { SafeAreaView } from 'react-native-safe-area-context' +import { useRoute } from '@react-navigation/native'; +import CustomButton from '../components/customButton'; +import { globalStyles, customStyles, GetPageTheme } from "../styles/Global"; +import { StatusBar, Image, KeyboardAvoidingView, TextInput, View, Text, ScrollView, TouchableOpacity, Platform, PermissionsAndroid, Animated, Keyboard } from 'react-native'; +import { ReactReduxContext, connect, useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps, mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import { notify } from '../components/notify'; +import moment from 'moment'; +import { login, RestoreProjectInProps } from '../controller/functions'; +import { get_item, set_item, clear_item } from '../components/localStorage'; +import { version, sloganline, appname, copyrightText, baseurl, logoImage } from '../constants/constants'; +import { METHODS, getMethodName } from '../constants/methodNames'; +import { MaterialCommunityIcons } from '../components/icons'; +// import { TouchableOpacity } from 'react-native-gesture-handler'; + +// import Geolocation from '@react-native-community/geolocation' + +import Geolocation from 'react-native-geolocation-service'; + +import { requestMultiplePerms, _checkLocationPermission, checkPermissions } from '../components/geolocation'; +import DeviceInfo from 'react-native-device-info'; +import SplashScreen from 'react-native-splash-screen'; +import CustomLoader from '../components/CustomLoader'; +import { SvgUri, SvgXml } from 'react-native-svg'; +import GradientButton from '../components/gradientButton'; +import { Ionicons } from '../components/icons'; + +import Graphic1 from '../assets/performics/login.svg'; + +import Text_eng from '../constants/Text_eng.json'; +import Text_thai from '../constants/Text_thai.json'; + + +function Login(props) { + + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const globalStyle = globalStyles(props.DarkMode, route.name); + + const [state, setState] = useState({ username: '', password: '', showPass: false, location: { lat: '', lng: '' } }); + const [processing, setProcessing] = useState(false); + const animatedEffects = useRef(new Animated.Value(0)).current; + + useEffect(() => { + SplashScreen.hide(); + requestMultiplePerms(); // check for permissions + RestoreProjectInProps(props); + + const keyboardDidShowListener = Keyboard.addListener( + 'keyboardDidShow', + () => { + + + Animated.timing(animatedEffects, { + toValue: 1, + duration: 400, + useNativeDriver: (Platform.OS == 'ios' ? false : true), + }).start(); + } + ); + const keyboardDidHideListener = Keyboard.addListener( + 'keyboardDidHide', + () => { + + Animated.timing(animatedEffects, { + toValue: 0, + duration: 400, + useNativeDriver: (Platform.OS == 'ios' ? false : true), + }).start(); + } + ); + return () => { + keyboardDidHideListener.remove(); + keyboardDidShowListener.remove(); + }; + }, []); + + + + + + // async function _getCurrentLocation() { + // const hasPermission = await _checkLocationPermission(); + // console.log("hasPermission", hasPermission); + // if (hasPermission == true) { + // let ssss = Geolocation.getCurrentPosition(); + + // console.log('Geolocation==>', ssss); + + // Geolocation.getCurrentPosition( + // async (position) => { + // let loc = { lat: position.coords.latitude, lng: position.coords.longitude }; + // setState({ ...state, location: loc }); + // await userlogin(loc); + // }, + // (error) => { + // notify('Cannot get user position', error); + // }, + // { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + // ); + // } + // else { + // notify('Please allow location permission to login'); + // } + // } + +async function _getCurrentLocation() { + try { + const hasPermission = await _checkLocationPermission(); + console.log("Location Permission:", hasPermission); + + if (!hasPermission) { + notify("Please allow location permission to login"); + return; + } + + console.log("Fetching current location..."); + + Geolocation.getCurrentPosition( + async (position) => { + console.log('User Location:', position); + + const loc = { + lat: position.coords.latitude, + lng: position.coords.longitude + }; + + setState({ ...state, location: loc }); + + await userlogin(loc); + }, + (error) => { + console.log("Location Error:", error); + notify("Cannot get user position"); + }, + { + enableHighAccuracy: true, + timeout: 15000, + maximumAge: 0, + forceRequestLocation: true, + showLocationDialog: true, + } + ); + } catch (err) { + console.log("Location Exception:", err); + notify("Unable to fetch location"); + } +} + + + + + + const userlogin = async (loc) => { + const { username, password } = state; + + if (validate()) { + setProcessing(true); + clear_item('islogin'); clear_item('loginToken'); clear_item('loginOfDays'); + clear_item('login_credentials'); clear_item('loginInfo'); + + let params = props.route.params ? props.route.params : {}; + let forgotMpin = params.forgotMpin || ''; + + const todate = new Date(); + const today = moment(todate).format("HH:mm:ss"); + let manufacturer = await DeviceInfo.getManufacturer(); + let model = await DeviceInfo.getDeviceName(); + let os = await DeviceInfo.getSystemVersion(); + let imeiNo1 = await DeviceInfo.getAndroidId(); + + const data = { un: username, pass: password, Intime: today, lat: loc.lat, lng: loc.lng, manufacturer: manufacturer, model: model, os: os, imeiNo1: imeiNo1, imeiNo2: imeiNo1 }; + const method_name = getMethodName(METHODS.LOGIN_METHOD); + const url = (props.baseurl || baseurl) + method_name; + console.log(url, data) + await login(url, data) + .then(async (res) => { + + setProcessing(false); + + if (res.networkErr && res.error) { + notify('Please connect to internet-' + res.error, 'SHORT'); + } + else if (!res.false && res.error) { + notify(res.error, 'SHORT'); + } + else if (res.UserId) { + notify('Login Success', 'SHORT'); + if (forgotMpin == '1') { + clear_item('mpin'); // clear mpin; + } + //set login info in global reducer + const pdata = { islogin: true, UserId: res.UserId, SecurityToken: '', sessionData: res }; + props.set_session(pdata); + let country = res.CountryId != null ? res.CountryId + '' : ''; + + //set login info in encryted local storage + set_item('islogin', 'done'); + let credentials = { 'un': username, 'pass': password }; + set_item('login_credentials', JSON.stringify(credentials)); + set_item('UserCountry', country); + set_item('loginToken', res.UserId); + set_item('loginInfo', JSON.stringify(res)); + + let lngJson = country == '2' ? Text_thai : Text_eng; + props.setStaticText(lngJson) + + // open login screen + let routename = 'Mpin'; + // let mpin=await get_item('mpin'); + // if(mpin!='' && mpin!=null && mpin!=undefined){ + // routename='NoticeBoard'; + // } + props.navigation.reset({ index: 0, routes: [{ name: routename }], }); + } + else { + notify('Cannot login! Something went wrong', 'SHORT'); + } + }) + .catch((err) => { + setProcessing(false); + console.log('onPage Login error1', err); + }); + } + + } + + const validate = () => { + const { username, password } = state; + if (username.trim().length == 0) { + notify('Please enter username', 'SHORT'); + return false; + } + + if (password.trim().length == 0) { + notify('Please enter password', 'SHORT'); + return false; + } + + return true; + } + + const showPassword = () => { + const { showPass } = state; + setState({ ...state, showPass: !showPass }); + } + + function _renderAnimPart() { + let cl_scale = 1, cl_ty = 0, pl_scale = 1, illus_scale = 1, illus_ty = 0, formty = 0; + if (animatedEffects != null) { + pl_scale = animatedEffects.interpolate({ + inputRange: [0, 1], + outputRange: [1, 0.7], + }); + cl_scale = animatedEffects.interpolate({ + inputRange: [0, 1], + outputRange: [1, 0.6], + }); + cl_ty = animatedEffects.interpolate({ + inputRange: [0, 1], + outputRange: [0, -40], + }); + illus_scale = animatedEffects.interpolate({ + inputRange: [0, 1], + outputRange: [1, 0.5], + }); + illus_ty = animatedEffects.interpolate({ + inputRange: [0, 1], + outputRange: [0, -160], + }); + formty = animatedEffects.interpolate({ + inputRange: [0, 1], + outputRange: [0, -130], + }); + } + + return ( + + + + + {props.companylogo != null && props.companylogo != '' && } + {/* */} + + + + + + Hey There + Login to your account + + + setState({ ...state, username: val })} + autoComplete='off' + /> + + + + setState({ ...state, password: val })} + onSubmitEditing={(val) => { _getCurrentLocation(); }} + autoComplete='off' + /> + + + {state.showPass && } + {!state.showPass && } + + + + + + + + + + + ) + } + + + + return ( + + {processing && } + + + {_renderAnimPart()} + + + + + { _getCurrentLocation(); }} /> + + {version} + {copyrightText} + + + + + ); +} + +export default connect(mapStateToProps, mapDispatchToProps)(Login) \ No newline at end of file diff --git a/src/screens/MiddayStock.js b/src/screens/MiddayStock.js new file mode 100644 index 0000000..a8ae30f --- /dev/null +++ b/src/screens/MiddayStock.js @@ -0,0 +1,482 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, KeyboardAvoidingView} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,getKPIFields,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; + +function MiddayStock(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [brandData, setBrandData] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + + const [SKUStockData, setSKUStockData] = useState([]); + const [showAlert, setShowAlert] = useState(false); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [KPIFields, setKPIFields] = useState([]); + + const inputRefs = useRef({}); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + function onBeforeRemove(e){ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + function onRemoveScreen(e){ + Alert.alert( + "", + "Do you really want to exit the screen?", + [ + { + text: "Cancel", + onPress: () => {}, + style: "cancel" + }, + { text: "OK", onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + async function getData(storeData1,menu1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + let allCats=[]; + + let AllKPIFields=await getKPIFields(menu1); + setKPIFields(AllKPIFields); + + await db.transaction(async function (txn) { + + let join=' INNER join Product_Master p on c.CategoryId=p.CategoryId '; + let join2=' INNER join Mapping_ProductAssortment mp on p.ProductId=mp.ProductId '; + let q=`SELECT DISTINCT c.CategoryId,c.CategoryName,mp.MSL from Master_Category c ${join} ${join2} where mp.StateId='${StateId}' and mp.ChainId='${ChainId}' and mp.StoreTypeId='${StoreTypeId}' order by p.CategorySequence`; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i { + + let join=` inner join Mapping_ProductAssortment m on p.ProductId=m.ProductId `; + let join2=` inner join Master_Category mc on mc.CategoryId=p.CategoryId `; + let sku_q2=`select distinct p.ProductName,p.ProductId,p.BrandName,p.BrandId,m.MSL from Product_Master p ${join} ${join2} where m.ChainId='${ChainId}' and m.StateId='${StateId}' and m.StoreTypeId='${StoreTypeId}' and p.CategoryId='${item.CategoryId}' and CompanyId='1' order by p.ProductSequence`; + + let seletlist=`PRODUCT as ProductName,PRODUCT_ID as ProductId,BRAND as BrandName,BRAND_ID as BrandId,MSL,OPENING_STOCK,MIDDAY_STOCK,CLOSING_STOCK,EXPIRY_ISOPEN,EXPIRY_STK`; + let sku_q=`SELECT ${seletlist} FROM ${AppTables.STOCK_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' and CATEGORY_ID='${item.CategoryId}' `; + + return await txn.executeSql(sku_q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i0){ + let arr=[]; + for(var i=0;i0){ + let sku1=skulist1[0]; + let refIn1=inputRefs.current['input1_'+cat1.CategoryId+'_'+sku1.ProductId]; + console.log('move to next cat refIn1:','input1_'+cat1.CategoryId+'_'+sku1.ProductId) + refIn1.focus(); + } + } + } + else{ + // move to next subcategory + let sku1=skulist[sku_index+1]; + let refIn1=inputRefs.current['input1_'+cat.CategoryId+'_'+sku1.ProductId]; + refIn1.focus(); + } + + } + + async function submitOpeningStock(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + let q=`SELECT DISTINCT KEY_ID,CATEGORY_ID FROM ${AppTables.INSERT_OPENINGHEADER_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}'` + await txn.executeSql(q,[],async function (txn2, txnres) { + + if(txnres.rows.length>0){ + for(var i=0;i0){ + for(var j=0;jci.CategoryId==catdata.CATEGORY_ID && ci.ProductId==skuData.PRODUCT_ID); + let thisCatSkuData=thisCatSkuData_i>=0?(SKUStockData[thisCatSkuData_i] || {}):{}; + let md_Stock=thisCatSkuData.MiddayStock!=null && thisCatSkuData.MiddayStock!=''?thisCatSkuData.MiddayStock:'0'; + + let new_q=`UPDATE ${AppTables.STOCK_DATA} SET MIDDAY_STOCK='${md_Stock}' WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' and CATEGORY_ID='${catdata.CATEGORY_ID}' and PRODUCT_ID='${skuData.PRODUCT_ID}' `; + + await txn.executeSql(new_q,[],async function (txn2, txnres3) { + console.log('updated midday stock',md_Stock); + if(c_index==txnres.rows.length-1 && p_index==txnres2.rows.length-1){ + afterUpdate(); + } + },function (txn2, txnerr) { console.log(txnerr);notify('Oops! Error occur while updating Midday-Stock') },); + } + }else{ + if(c_index==txnres.rows.length-1){ + setProcessing(false); + } + } + },function (txn2, txnerr) { console.log(txnerr); },); + } + } + else{ + setProcessing(false); + } + },function (txn2, txnerr) { console.log(txnerr); },); + + }); + } catch (err) { + console.log(err); + } + } + + async function afterUpdate(){ + setProcessing(false); + notify('Midday-Stock updated successfully'); + props.navigation.goBack(); + } + + + async function validate(){ + let isValid=true; + var i=0,j=0; + + let isMdStockMandIndex=KPIFields.findIndex(i=>i.KPIFieldName=='MidDayStockMandatory') + let isMdStockMandKPIObj=isMdStockMandIndex>=0?KPIFields[isMdStockMandIndex]:{}; + let isMdStockMandEnable=isMdStockMandIndex>=0?isMdStockMandKPIObj['KPIFieldEnable']:true; + + await Promise.all( + brandData.map(async (item,index) => { + if(isValid){ + let catId=item.CategoryId; + + let skulist=item.skulist || []; + if(skulist.length>0){ + await Promise.all( + skulist.map(async (skuItem,skuIndex) => { + if(isValid){ + let skuData=SKUStockData.find(ci=>ci.CategoryId==item.CategoryId && ci.ProductId==skuItem.ProductId ) || {}; + if((isMdStockMandEnable==1 || isMdStockMandEnable=='true') && skuData.MiddayStock!==0 && (skuData.MiddayStock==null || skuData.MiddayStock=='')){ + notify('Please enter Midday-Stock for '+skuItem.ProductName,'SHORT'); + isValid=false; + }else{ + + } + } + }) + ); + } + } + }) + ); + + console.log('isValid:',isValid); + return isValid; + } + + function onStockValChange(item,skuItem,val,key){ + if(!isNaN(val)){ + if(val.includes('.')){ + notify('Please enter whole numbers only','SHORT'); + return; + } + } + + let allSKUData=SKUStockData; + let defData={'CategoryId':item.CategoryId,'ProductId':skuItem.ProductId}; + const skud_index=allSKUData.findIndex(i=>i.CategoryId==item.CategoryId && i.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + skud[key]=val; + + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function _render_Alert(){ + return ( + + + {setShowAlert(false)}}> + Cancel + + {saveData()}}> + Yes + + + + ) + } + + return ( + + {processing && } + + {_render_Alert()} + + + { Object.keys(storeData).length>0 && + + + { + const cat=item; + const catIndex=index; + return( + + + + {item.CategoryName} + + + + + {{ + const skus=item; + const sku_index=index; + let thisCatSkuData_i=SKUStockData.findIndex(i=>i.CategoryId==cat.CategoryId && i.ProductId==skus.ProductId); + let thisCatSkuData=thisCatSkuData_i>=0?(SKUStockData[thisCatSkuData_i] || {}):{}; + let md_Stock=thisCatSkuData.MiddayStock!=null?thisCatSkuData.MiddayStock:''; + + return( + + {skus.ProductName} + + + Opening Stock : + {skus.OPENING_STOCK} + + + + + + Midday Stock + {inputRefs.current['input1_'+cat.CategoryId+'_'+skus.ProductId]=reff;}} + style={[customStyle.openStk_prd_inputStyle,customStyle.openStk_prd_flex_inputStyle]} + placeholder="" + placeholderTextColor={PageTheme.$placeholder_color} + value={(md_Stock!=null?md_Stock+'':'')} + keyboardType='number-pad' + onSubmitEditing={()=>{focusToNext(cat,parseInt(catIndex),skus,parseInt(sku_index),'1')}} + onChangeText={(val)=>{ onStockValChange(cat,skus,val,'MiddayStock')}} + autoComplete='off' + /> + + + + + ) + }}/> + } + + + ); + }} + /> + + } + + {submitOpeningStock()}}/> + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(MiddayStock); \ No newline at end of file diff --git a/src/screens/Mpin.js b/src/screens/Mpin.js new file mode 100644 index 0000000..e17b565 --- /dev/null +++ b/src/screens/Mpin.js @@ -0,0 +1,784 @@ +import React,{useState,useEffect, useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +// import CustomInput from '../components/customInput'; +import CustomButton from '../components/customButton'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,KeyboardAvoidingView, Keyboard, Animated, Linking} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {requestMultiplePerms,_checkLocationPermission} from '../components/geolocation'; +import OtpInputs from 'react-native-otp-inputs'; +import SplashScreen from 'react-native-splash-screen'; +import { SvgUri, SvgXml} from 'react-native-svg'; +import {version,copyrightText,baseurl,logoImage,db, AppVersion,DevType} from '../constants/constants'; +import {METHODS,getMethodName} from '../constants/methodNames'; +import GradientButton from '../components/gradientButton'; +import { Ionicons } from '../components/icons'; +import * as RNFS from "react-native-fs"; +import RNApkInstaller from "@dominicvonk/react-native-apk-installer"; +import VersionCheck from "react-native-version-check"; +import CustomModal from '../components/CustomModal'; +import Graphic1 from '../assets/performics/mpin.svg'; +import {getProjectData, getProjectInfo, login, RestoreProjectInProps } from '../controller/functions'; +import CustomLoader from '../components/CustomLoader'; +// import Geolocation from '@react-native-community/geolocation'; +// import Geolocation from '@react-native-community/geolocation' +import Geolocation from 'react-native-geolocation-service'; + + +import moment from 'moment'; +import DeviceInfo from 'react-native-device-info'; +import Text_eng from '../constants/Text_eng.json'; +import Text_thai from '../constants/Text_thai.json'; +import DownloadAPKModal from '../components/downloadApkModal'; +import ReactNativeBlobUtil from 'react-native-blob-util'; +import { SafeAreaView } from 'react-native-safe-area-context'; + +function Mpin (props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const todayDate=moment(new Date()).format('DD/MM/YYYY'); + const [ST,setST] = useState((props.StaticText || {})); + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [state, setState] = useState({mpin:'',cmpin:''}); + const [fieldsChange, setFieldsChange] = useState(false); + const animatedEffects=useRef(new Animated.Value(0)).current; + const [downloading, setDownloading] = useState(false); + const [processing, setProcessing] = useState(false); + const [loading, setLoading] = useState(true); + const [dowloadedCount, setDowloadedCount] = useState(0); + const [totalCount, setTotalCount] = useState(0); + const [isMPINUpdate, setIsMPINUpdate] = useState(false); + const [loaderTitle, setLoaderTitle] = useState(''); + const [downloadingText,setDownloadingText] = useState(''); + + const [verToUpdate, setVerToUpdate] = useState(''); + const [loginRes, setLoginRes] = useState({}); + const [showVerUpdateModal, setShowVerUpdateModal] = useState(false); + + + + useEffect(() => { + + SplashScreen.hide(); + checkVersion() + getsetLanguage(); + requestMultiplePerms(); + RestoreProjectInProps(props) + const keyboardDidShowListener = Keyboard.addListener( + 'keyboardDidShow', + () => { + + Animated.timing(animatedEffects, { + toValue: 1, + duration:400, + useNativeDriver:(Platform.OS=='ios'?false:true), + }).start(); + } + ); + const keyboardDidHideListener = Keyboard.addListener( + 'keyboardDidHide', + () => { + Animated.timing(animatedEffects, { + toValue: 0, + duration:400, + useNativeDriver:(Platform.OS=='ios'?false:true), + }).start(); + } + ); + return () => { + keyboardDidHideListener.remove(); + keyboardDidShowListener.remove(); + }; + }, []); + + + // useEffect(() => { + // autologin(); + // }, [fieldsChange]); + + useEffect(() => { + let timeOutId = setTimeout(() => { + autosubmit(); + }, 500); + + return () => { + clearTimeout(timeOutId); + }; + + }, [isMPINUpdate]); + + + useEffect(() => { + console.log('props.StaticText changed'); + setLoading(false); + setLoaderTitle(props.StaticText.Loading+'...') + setST(props.StaticText); + }, [props.StaticText]); + + async function getsetLanguage(){ + let country = await get_item('UserCountry'); + let lngJson=country=='2'?Text_thai:Text_eng; + props.setStaticText(lngJson); + setTimeout(()=>{setLoading(false);console.log('props.StaticText timeout');},3000); + } + + async function checkIfData_Downloaded(){ + try{ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + const isDataStorageCleared=await get_item('DataStorageCleared'); + console.log('iisDataStorageCleared on login:',isDataStorageCleared); + let dateWiseDataDownload=await get_item('dateWiseDataDownload'); + let dateWiseDataDownload1=dateWiseDataDownload!=null?JSON.parse(dateWiseDataDownload):{}; + if(isDataStorageCleared!='1'){ + // let isDataExists=await checkIfData_Downloaded2(); + // console.log('isDataExists on login:',isDataExists); + + if(dateWiseDataDownload1[todayDate]!=null){ + let d=dateWiseDataDownload1[todayDate]; + props.setTodayDataExists(d); + props.setGlobalData({isDataDownloaded:d}); + } + else{ + + let lods={}; + lods[todayDate]=false; + set_item('dateWiseDataDownload',JSON.stringify(lods)); + props.setTodayDataExists(false); + } + } + } + catch(err){ + console.log(err); + } + } + + + const mpinlogin=async()=>{ + + const {mpin,cmpin}=state; + if(validate()){ + //set m-pin info in global reducer + props.set_mpin({mpin:mpin}); + + //set m-pin info in encryted local storage + set_item('mpin',mpin); + + //clear stack and mpin open login screen + refreshToken(); + // props.navigation.reset({index: 0,routes: [{name: 'MpinLogin'}],}); + } + + } + + function autologin(){ + const {mpin,cmpin}=state; + if(mpin.trim().length == 4 && cmpin.trim().length==4){ + mpinlogin(); + } + } + + // const validate=()=>{ + // const {mpin}=state; + // if(mpin.trim().length == 0){ + // notify(ST.PleaseenterMPin,'SHORT'); + // return false; + // } + // return true; + // } + + const validate=()=>{ + const {mpin,cmpin}=state; + console.log('state',state) + + if(mpin.trim().length == 0){ + notify(ST.PleaseenterMPin,'SHORT'); + return false; + } + else if(mpin.trim().length>0 && mpin.trim().length<4){ + notify(ST.Pleaseenter4digitMPin,'SHORT'); + return false; + } + + if(cmpin.trim().length == 0){ + notify(ST.PleaseconfirmyourMPin,'SHORT'); + return false; + } + + if(cmpin!=mpin){ + console.warn("checkmpin",cmpin,mpin) + notify(ST.ConfirmMPindoesnotmatch,'SHORT'); + return false; + } + + return true; + } + + async function refreshToken(){ + let login_credentials=await get_item('login_credentials'); + let credentials=login_credentials!=null?JSON.parse(login_credentials):{}; + if(credentials.un!=null && credentials.pass!=null){ + + _getCurrentLocation(credentials.un,credentials.pass); + } + else{ + notify(ST.Sessionnotfoundpleaseloginagain,'SHORT'); + // clear stack and open login + props.navigation.reset({index: 0,routes: [{name: 'Login'}],}); + } + + } + + // async function mpinlogin(){ + // const {mpin}=state; + // if(validate()){ + // let token=await get_item('loginToken'); + // let master_pin=await get_item('mpin'); + // console.log('master_pin',master_pin) + // if(master_pin==mpin && master_pin!='' && master_pin!=null && token!='' && token!=null && token!=undefined) + // { + // refreshToken();// refresh token + // } + // else{ + // notify(ST.YouenteredwrongMPin,'SHORT'); + // } + // } + // } + + async function autosubmit(){ + const {mpin,cmpin}=state; + if(mpin.trim().length == 4 && cmpin.trim().length == 4){ + mpinlogin(); + } + } + + // async function _getCurrentLocation(un,pass) { + // const hasPermission=await _checkLocationPermission(); + // if(hasPermission==true) + // { + // setProcessing(true); + // Geolocation.getCurrentPosition( + // async (position) => { + // let loc={lat:position.coords.latitude,lng:position.coords.longitude}; + // setState({...state,location:loc}); + // await userlogin(loc,un,pass); + // }, + // (error) => { + // notify(ST.Cannotgetuserposition); + // setProcessing(false); + // }, + // { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + // ); + // } + // else{ + // notify(ST.Pleaseallowlocationpermissiontologin); + // } + // } + + async function _getCurrentLocation(un, pass) { + const hasPermission = await _checkLocationPermission(); + + if (!hasPermission) { + notify(ST.Pleaseallowlocationpermissiontologin); + return; + } + + setProcessing(true); + + Geolocation.getCurrentPosition( + async (position) => { + const loc = { + lat: position.coords.latitude, + lng: position.coords.longitude, + }; + + setState({ ...state, location: loc }); + + await userlogin(loc, un, pass); + }, + (error) => { + console.log("LOCATION ERROR =>", error); + notify(ST.Cannotgetuserposition); + setProcessing(false); + }, + { + enableHighAccuracy: true, + timeout: 15000, + maximumAge: 0, + forceRequestLocation: true, + showLocationDialog: true, + } + ); +} + async function update_project(){ + // refresh project settings + let defData={isUpdated:false,ProjectDetails:{},projectid:""} + let projectid=await get_item('projectCode'); + console.log('projectid',projectid); + + return await new Promise((resolve,reject)=>{ + if(projectid!='' && projectid!=null){ + + getProjectData(projectid) + .then((res)=>{ + console.log(res); + if(res.success && res.projectName!=null){ + //set project info in global reducer + const pdata=getProjectInfo(res,projectid); + props.set_project(pdata); + //set project info in encryted local storage + set_item('projectCode',projectid); + set_item('projectInfo',JSON.stringify(res)); + + defData['projectid']=projectid; + defData['isUpdated']=true; + defData['ProjectDetails']=res; + resolve(defData); + } + else if(res.projectName==null){ + resolve(defData); + } + }) + .catch((err)=>{ + console.log('err',err); + resolve(defData); + }); + } + else{ + resolve(defData); + } + }) + .catch((err)=>{ + return defData; + }); + + } + + async function checkIfData_Downloaded(){ + try{ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + const isDataStorageCleared=await get_item('DataStorageCleared'); + console.log('iisDataStorageCleared on login:',isDataStorageCleared); + let dateWiseDataDownload=await get_item('dateWiseDataDownload'); + let dateWiseDataDownload1=dateWiseDataDownload!=null?JSON.parse(dateWiseDataDownload):{}; + if(isDataStorageCleared!='1'){ + // let isDataExists=await checkIfData_Downloaded2(); + // console.log('isDataExists on login:',isDataExists); + + if(dateWiseDataDownload1[todayDate]!=null){ + let d=dateWiseDataDownload1[todayDate]; + props.setTodayDataExists(d); + props.setGlobalData({isDataDownloaded:d}); + } + else{ + + let lods={}; + lods[todayDate]=false; + set_item('dateWiseDataDownload',JSON.stringify(lods)); + props.setTodayDataExists(false); + } + } + } + catch(err){ + console.log(err); + } + } + + const userlogin=async(loc,username,password)=>{ + let proj_data=await update_project(); + let {isUpdated,ProjectDetails,projectid}=proj_data + + console.log('is Project Detail refreshed:',isUpdated); + + let projectInfo=await get_item('projectInfo'); + let projectDetails=projectInfo!=null?JSON.parse(projectInfo):{}; + let loginDetails=await get_item('loginOfDays'); + let loginOfDays=loginDetails!=null?JSON.parse(loginDetails):{}; + + let loginInfo=await get_item('loginInfo'); + loginInfo=loginInfo!=null && loginInfo!=''?JSON.parse(loginInfo):{}; + let apv=loginInfo.AppVersion?loginInfo.AppVersion:''; + // apv='0'; + + const todate=new Date(); + const today=moment(todate).format("HH:mm:ss"); + let manufacturer =await DeviceInfo.getManufacturer(); + let model =await DeviceInfo.getDeviceName(); + let os=await DeviceInfo.getSystemVersion(); + let imeiNo1=await DeviceInfo.getAndroidId(); + + const data={un:username,pass:password,Intime:today,lat:loc.lat,lng:loc.lng,manufacturer:manufacturer,model:model,os:os,imeiNo1:imeiNo1,imeiNo2:imeiNo1}; + + const method_name=getMethodName(METHODS.LOGIN_METHOD); + const url=(props.baseurl || baseurl)+method_name; + console.log('url:',url); + + await login(url,data) + .then(async(res)=>{ + + setProcessing(false); + if(res.networkErr && res.error){ + notify(ST.Pleaseconnecttointernet+'-'+res.error,'SHORT'); + } + else if(!res.false && res.error){ + notify(res.error,'SHORT'); + } + else{ + let currentAppVersion=res.AppVersion!=null ?res.AppVersion.toString() :''; + if(currentAppVersion!=null && currentAppVersion!='' && AppVersion!=null && AppVersion!='' && currentAppVersion.replace(" ",'')!=AppVersion.replace(" ",'') && Platform.OS=='android'&& DevType=="Prod" ){ + console.log('update version'); + setVerToUpdate(currentAppVersion); + setLoginRes(res); + setShowVerUpdateModal(true); + return; + } + notify(ST.LoginSuccess,'SHORT'); + //set login info in global reducer + const pdata={islogin:true,UserId:res.UserId,SecurityToken:'',sessionData:res}; + props.set_session(pdata); + + const proj_udata=getProjectInfo(ProjectDetails,projectid,res.AppClearData); + let ManagerAppConfigObj= props?.ManagerAppConfig && JSON.parse(props.ManagerAppConfig) + let ManagerObj=ManagerAppConfigObj?.ManagerAppConfig?.filter(obj1=>obj1.Designation==res?.Designation) ||[] + + if(ManagerObj.length>0){ + proj_udata["SUP_StorewisePJP"]=ManagerObj?.[0]?.StorewisePJP + proj_udata["ShowStoreSearch"]=ManagerObj?.[0]?.StoreSearch + } + props.set_project(proj_udata); + + let country=res.CountryId!=null?res.CountryId+'':''; + + //set login info in encryted local storage + set_item('islogin','done'); + set_item('UserCountry',country); + set_item('loginToken',res.UserId); + set_item('loginInfo',JSON.stringify(res)); + props.set_user_details({session_name:res.UserId}); + + let lngJson=country=='2'?Text_thai:Text_eng; + props.setStaticText(lngJson) + + await checkIfData_Downloaded(); + + // open login screen + + if(loginOfDays[todayDate]!=null){ + props.setLoginExists(true); + props.navigation.reset({index: 0,routes: [{name: 'NoticeBoard',params:{UserData:res,'TodayLogin':true}}],}); + } + else{ + let currenttime=moment(new Date()).format('DD/MM/YYYY HH:mm:ss'); + let lods={}; + lods[todayDate]=currenttime; + set_item('loginOfDays',JSON.stringify(lods)); + props.setLoginExists(false); + props.navigation.reset({index: 0,routes: [{name: 'One_QAD',params:{UserData:res,'TodayLogin':false}}],}); + } + + } + }) + .catch((err)=>{ + setProcessing(false); + console.log('onPage Login error1',err); + }); + + + } + + const checkVersion = async () => { + try { + const updateNeeded = await VersionCheck.needUpdate({ + packageName: "com.cpmindiait.PerformicsManager", + }); + + console.log("Version check result:", updateNeeded); + + if (updateNeeded?.isNeeded) { + setShowVerUpdateModal(true); + setVerToUpdate(" "+updateNeeded?.latestVersion) + checkVersion() + } + } catch (error) { + console.error("Error checking version:", error); + } + }; + + + + async function UpdateAppVersion(){ + setShowVerUpdateModal(false); + let res=loginRes; + let AppPath=res.AppPath?res.AppPath:''; + + if(Platform.OS=='ios'){ + Linking.openURL("https://apps.apple.com/us/app/performicsmanager/id6446242809"); + // props.navigation.reset({index: 0,routes: [{name: 'NoticeBoard',params:{UserData:res}}],}); + } + else{ + if(AppPath!='' && AppPath!=null){ + // Do you have permission to install from unknown sources? + let hasAPKInstallPerm=RNApkInstaller.haveUnknownAppSourcesPermission(); + + if(!hasAPKInstallPerm){ + // Turn on Unknown Sources permission settings + RNApkInstaller.showUnknownAppSourcesPermission(); + } + + // android update app + setDownloading(true); + let file_parts=AppPath.split('/'); + let filename=file_parts[file_parts.length-1]; + const filePath = RNFS.DownloadDirectoryPath + "/"+filename; + console.log('filePath for downloading:',filename,filePath); + let size=0; + + let isExists=await RNFS.exists(filePath).then((res)=>{return res;}); + if(isExists){ + let tempPath= RNFS.DocumentDirectoryPath + "/"+filename; + await RNFS.moveFile(filePath,tempPath).then((res)=>{console.log('file moved');}); + console.log('tempPath:',tempPath); + await RNFS.unlink(tempPath); + } + + setTotalCount(size); + // setDownloadingText('0%') + setDownloadingText('0 %') + // RNFS.writeFile(filePath, '').then((create_res)=>{ + + ReactNativeBlobUtil.config({ + // response data will be saved to this path if it has access right. + + addAndroidDownloads: { + path : filePath, + useDownloadManager: true, + title: filename, + description: 'An APK that will be installed', + mime: 'application/vnd.android.package-archive', + notification: true, + mediaScannable: true, + } + }) + .fetch('GET', AppPath, { + //some headers .. + }) + .progress((received, total) => { + let status_inpercent=((received / total)*100); + try{ + status_inpercent=status_inpercent!=NaN && status_inpercent!=null?parseInt(status_inpercent):status_inpercent; + } + catch(err){ + console.log('status_inpercent error:',err); + } + setDownloadingText(status_inpercent+' %'); + setDowloadedCount(received); + setTotalCount(total); + }) + .then(async(res) => { + // the path should be dirs.DocumentDir + 'path-to-file.anything' + // let status = res.info().status; + let cache_filePath=res.path(); + console.log('The file saved to ',cache_filePath,filePath); + setDownloading(false); + if (cache_filePath!=null && cache_filePath!="" && cache_filePath!='undefined') { + // let result = await ReactNativeBlobUtil.MediaCollection.copyToMediaStore({ + // name: filename, parentFolder: '', mimeType: 'application/vnd.android.package-archive' + // },'Download', // Media Collection to store the file in ("Audio" | "Image" | "Video" | "Download") + // cache_filePath ); + // console.log("copy file result:",result); + + RNApkInstaller.install(filePath); + //set login info in global reducer + const pdata={islogin:true,UserId:res.UserId,SecurityToken:'',sessionData:res}; + props.set_session(pdata); + + //set login info in encryted local storage + set_item('islogin','done'); + set_item('loginToken',res.UserId); + set_item('loginInfo',JSON.stringify(res)); + set_item('clearOnInstall','true'); + props.set_user_details({session_name:res.UserId}); + + // }).catch((err)=>{ + // console.log('error',err); + // notify('Sorry! Cannot download apk. Storage Permission Issue'); + // }); + // res.flush(); + // console.log('removed the apk'); + + } + }); + + // }).catch((err)=>{ + // console.log('Error while creating:',err); + // setDownloading(false); + // notify('Sorry! Cannot download apk'); + // }); + } + else{ + setDownloading(false); + notify('Something went wrong! Cannot update version') + } + } + } + function _render_Alert(){ + return ( + + + {UpdateAppVersion()}}> + {ST.OK} + + + + ) + } + function _renderAnimPart(){ + let cl_scale=1,cl_ty=0,pl_scale=1,illus_scale=1,illus_ty=0,formty=0; + if(animatedEffects!=null ){ + pl_scale=animatedEffects.interpolate({ + inputRange:[0,1], + outputRange:[1,0.7], + }); + cl_scale=animatedEffects.interpolate({ + inputRange:[0,1], + outputRange:[1,0.6], + }); + cl_ty=animatedEffects.interpolate({ + inputRange:[0,1], + outputRange:[0,-40], + }); + illus_scale=animatedEffects.interpolate({ + inputRange:[0,1], + outputRange:[1,0.5], + }); + illus_ty=animatedEffects.interpolate({ + inputRange:[0,1], + outputRange:[0,-160], + }); + formty=animatedEffects.interpolate({ + inputRange:[0,1], + outputRange:[0,-130], + }); + } + return( + + + + + + {props.splashlogo!=null && props.splashlogo!= '' && + + } + + + + + + {ST.HeyThere} + {ST.SetMPintologinyouraccount} + + {ST.EnterMPin} + {setState({...state,mpin:code}); setFieldsChange(!fieldsChange);}} + handleChange={(code) => { setState({...state,mpin:code}); setIsMPINUpdate(!isMPINUpdate);}} + numberOfInputs={4} + secureTextEntry={true} + keyboardType={"numeric"} + defaultValue={''} + autofillFromClipboard={false} + inputStyles={customStyle.otp_inputStyle} + style={customStyle.otp_field} + /> + + + {ST.ConfirmMPin} + {setState({...state,cmpin:code}); setFieldsChange(!fieldsChange);}} + handleChange={(code) => { setState({...state,cmpin:code}); setIsMPINUpdate(!isMPINUpdate);}} + numberOfInputs={4} + secureTextEntry={true} + keyboardType={"numeric"} + defaultValue={''} + autofillFromClipboard={false} + inputStyles={customStyle.otp_inputStyle} + style={customStyle.otp_field} + // onSubmitEditing={(val)=>{ mpinlogin();}} + /> + + + + + + + + ) + } + + return ( + + {processing && } + {loading && } + {(downloading) && } + {_render_Alert()} + + + {_renderAnimPart()} + + + + {mpinlogin();}}/> + + {version} + {copyrightText} + + + + + ); +} + +export default connect(mapStateToProps, mapDispatchToProps)(Mpin) \ No newline at end of file diff --git a/src/screens/MpinLogin.js b/src/screens/MpinLogin.js new file mode 100644 index 0000000..206cf0b --- /dev/null +++ b/src/screens/MpinLogin.js @@ -0,0 +1,741 @@ +import React,{useState,useEffect, useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import CustomButton from '../components/customButton'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,KeyboardAvoidingView, Platform, Linking, Animated, Keyboard} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,copyrightText,baseurl,logoImage,db, AppVersion, DevType} from '../constants/constants'; +import {METHODS,getMethodName} from '../constants/methodNames'; +import {checkPermissions, requestMultiplePerms, _checkLocationPermission} from '../components/geolocation'; +import OtpInputs from 'react-native-otp-inputs'; +import SplashScreen from 'react-native-splash-screen'; +import CustomLoader from '../components/CustomLoader'; +import DeviceInfo from 'react-native-device-info'; +import {getProjectData, getProjectInfo, login, RestoreProjectInProps} from '../controller/functions'; +// import Geolocation from '@react-native-community/geolocation'; +// import Geolocation from '@react-native-community/geolocation' +import Geolocation from 'react-native-geolocation-service'; + +import moment from 'moment'; +import { SvgUri, SvgXml} from 'react-native-svg'; +import GradientButton from '../components/gradientButton'; +import { Ionicons, MaterialIcons } from '../components/icons'; +import * as RNFS from "react-native-fs"; +import RNApkInstaller from "@dominicvonk/react-native-apk-installer"; +import VersionCheck from "react-native-version-check"; +import DownloadDataModal from '../components/downloadDataModal'; +import CustomModal from '../components/CustomModal'; +import Graphic1 from '../assets/performics/mpin.svg'; +import { AppTables } from '../constants/tableConstants'; +// import { exitApp } from 'react-native-exit-app'; +import NetworkStatusBar from '../components/NetworkStatusBar'; +import Text_eng from '../constants/Text_eng.json'; +import Text_thai from '../constants/Text_thai.json'; +import DownloadAPKModal from '../components/downloadApkModal'; +import ReactNativeBlobUtil from 'react-native-blob-util'; + +function MpinLogin(props) { + const route = useRoute(); + const [ST,setST] = useState((props.StaticText || {})); + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const todayDate=moment(new Date()).format('DD/MM/YYYY'); + + const [state, setState] = useState({mpin:''}); + const [isMPINUpdate, setIsMPINUpdate] = useState(false); + const [processing, setProcessing] = useState(false); + const [loading, setLoading] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(''); + + const [downloading, setDownloading] = useState(false); + const [verToUpdate, setVerToUpdate] = useState(''); + const [loginRes, setLoginRes] = useState({}); + const [showVerUpdateModal, setShowVerUpdateModal] = useState(false); + const [dowloadedCount, setDowloadedCount] = useState(0); + const [totalCount, setTotalCount] = useState(0); + const [downloadingText,setDownloadingText] = useState(''); + const animatedEffects=useRef(new Animated.Value(0)).current; + + + + useEffect(() => { + SplashScreen.hide(); + getsetLanguage(); + requestMultiplePerms(); + RestoreProjectInProps(props); + + if(Platform.OS=='ios'){ + checkVersion() + } + + const keyboardDidShowListener = Keyboard.addListener( + 'keyboardDidShow', + () => { + + Animated.timing(animatedEffects, { + toValue: 1, + duration:400, + useNativeDriver:(Platform.OS=='ios'?false:true), + }).start(); + } + ); + const keyboardDidHideListener = Keyboard.addListener( + 'keyboardDidHide', + () => { + + Animated.timing(animatedEffects, { + toValue: 0, + duration:400, + useNativeDriver:(Platform.OS=='ios'?false:true), + }).start(); + } + ); + return () => { + keyboardDidHideListener.remove(); + keyboardDidShowListener.remove(); + }; + }, []); + + useEffect(() => { + autosubmit(); + }, [isMPINUpdate]); + + useEffect(() => { + console.log('props.StaticText changed'); + setLoading(false); + setLoaderTitle(props.StaticText.Loading+'...') + setST(props.StaticText); + }, [props.StaticText]); + + async function getsetLanguage(){ + let country = await get_item('UserCountry'); + let lngJson=country=='2'?Text_thai:Text_eng; + props.setStaticText(lngJson); + setTimeout(()=>{setLoading(false);console.log('props.StaticText timeout');},3000); + } + + async function checkIfData_Downloaded(){ + try{ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + const isDataStorageCleared=await get_item('DataStorageCleared'); + console.log('iisDataStorageCleared on login:',isDataStorageCleared); + let dateWiseDataDownload=await get_item('dateWiseDataDownload'); + let dateWiseDataDownload1=dateWiseDataDownload!=null?JSON.parse(dateWiseDataDownload):{}; + if(isDataStorageCleared!='1'){ + // let isDataExists=await checkIfData_Downloaded2(); + // console.log('isDataExists on login:',isDataExists); + + if(dateWiseDataDownload1[todayDate]!=null){ + let d=dateWiseDataDownload1[todayDate]; + props.setTodayDataExists(d); + props.setGlobalData({isDataDownloaded:d}); + } + else{ + + let lods={}; + lods[todayDate]=false; + set_item('dateWiseDataDownload',JSON.stringify(lods)); + props.setTodayDataExists(false); + } + } + } + catch(err){ + console.log(err); + } + } + + async function checkIfAttendanceUploaded(){ + try{ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + const isDataStorageCleared=await get_item('DataStorageCleared'); + let loginInfo=await get_item('loginInfo'); + loginInfo=loginInfo!=null && loginInfo!=''?JSON.parse(loginInfo):{}; + + if(isDataStorageCleared!='1'){ + + await db.transaction(async function (txn) { + + await txn.executeSql(`Select * from ${AppTables.ATTENDANCE} where ATTENDANCE_DATE='${d2}' and EMP_ID='${loginInfo.UserId}' `,[],async function (txn2, txnres2) { + console.log('attends=ance datafound in mpin:',txnres2.rows.length); + if(txnres2.rows.length>0){ + let data=txnres2.rows.item(0); + let {ENTRY_ALLOW}=data; + props.setAttendanceStatus({isAttendanceMarked:true,isEntryAllow:(ENTRY_ALLOW=='1' || ENTRY_ALLOW=='true'?true:false)}); + } + else{ + + } + },function (txn2, txnerr) { + console.log(txnerr); + }, + ); + }); + } + } + catch(err){ + console.log(err); + } + } + + async function refreshToken(){ + let login_credentials=await get_item('login_credentials'); + let credentials=login_credentials!=null?JSON.parse(login_credentials):{}; + if(credentials.un!=null && credentials.pass!=null){ + + _getCurrentLocation(credentials.un,credentials.pass); + } + else{ + notify(ST.Sessionnotfoundpleaseloginagain,'SHORT'); + // clear stack and open login + props.navigation.reset({index: 0,routes: [{name: 'Login'}],}); + } + + } + + // async function _getCurrentLocation(un,pass) { + // const hasPermission=await _checkLocationPermission(); + // if(hasPermission==true) + // { + // setProcessing(true); + // Geolocation.getCurrentPosition( + // async (position) => { + // let loc={lat:position.coords.latitude,lng:position.coords.longitude}; + // setState({...state,location:loc}); + // await userlogin(loc,un,pass); + // }, + // (error) => { + // notify(ST.Cannotgetuserposition); + // setProcessing(false); + // }, + // { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + // ); + // } + // else{ + // notify(ST.Pleaseallowlocationpermissiontologin); + // } + // } + + async function _getCurrentLocation(un, pass) { + const hasPermission = await _checkLocationPermission(); + + if (!hasPermission) { + notify(ST.Pleaseallowlocationpermissiontologin); + return; + } + + setProcessing(true); + + Geolocation.getCurrentPosition( + async (position) => { + const loc = { + lat: position.coords.latitude, + lng: position.coords.longitude, + }; + + setState({ ...state, location: loc }); + + await userlogin(loc, un, pass); + }, + (error) => { + console.log("LOCATION ERROR =>", error); + notify(ST.Cannotgetuserposition); + setProcessing(false); + }, + { + enableHighAccuracy: true, + timeout: 15000, + maximumAge: 0, + forceRequestLocation: true, + showLocationDialog: true, + } + ); + } + + + + const userlogin=async(loc,username,password)=>{ + if(validate()){ + let proj_data=await update_project(); + let {isUpdated,ProjectDetails,projectid}=proj_data + + console.log('is Project Detail refreshed:',isUpdated); + + let projectInfo=await get_item('projectInfo'); + let projectDetails=projectInfo!=null?JSON.parse(projectInfo):{}; + let loginDetails=await get_item('loginOfDays'); + let loginOfDays=loginDetails!=null?JSON.parse(loginDetails):{}; + + let loginInfo=await get_item('loginInfo'); + loginInfo=loginInfo!=null && loginInfo!=''?JSON.parse(loginInfo):{}; + let apv=loginInfo.AppVersion?loginInfo.AppVersion:''; + // apv='0'; + + const todate=new Date(); + const today=moment(todate).format("HH:mm:ss"); + let manufacturer =await DeviceInfo.getManufacturer(); + let model =await DeviceInfo.getDeviceName(); + let os=await DeviceInfo.getSystemVersion(); + let imeiNo1=await DeviceInfo.getAndroidId(); + + const data={un:username,pass:password,Intime:today,lat:loc.lat,lng:loc.lng,manufacturer:manufacturer,model:model,os:os,imeiNo1:imeiNo1,imeiNo2:imeiNo1}; + + const method_name=getMethodName(METHODS.LOGIN_METHOD); + const url=(props.baseurl || baseurl)+method_name; + console.log('url:',url); + + await login(url,data) + .then(async(res)=>{ + + setProcessing(false); + if(res.networkErr && res.error){ + notify(ST.Pleaseconnecttointernet+'-'+res.error,'SHORT'); + } + else if(!res.false && res.error){ + notify(res.error,'SHORT'); + } + else{ + let currentAppVersion=res.AppVersion!=null ?res.AppVersion.toString() :''; + if(currentAppVersion!=null && currentAppVersion!='' && AppVersion!=null && AppVersion!='' && currentAppVersion.replace(" ",'')!=AppVersion.replace(" ",'') && Platform.OS=='android' && DevType == "Prod" ){ + console.log('update version'); + setVerToUpdate(currentAppVersion); + setLoginRes(res); + setShowVerUpdateModal(true); + return; + } + notify(ST.LoginSuccess,'SHORT'); + //set login info in global reducer + const pdata={islogin:true,UserId:res.UserId,SecurityToken:'',sessionData:res}; + props.set_session(pdata); + + const proj_udata=getProjectInfo(ProjectDetails,projectid,res.AppClearData); + let ManagerAppConfigObj= props?.ManagerAppConfig && JSON.parse(props.ManagerAppConfig) + let ManagerObj=ManagerAppConfigObj?.ManagerAppConfig?.filter(obj1=>obj1.Designation==res?.Designation) ||[] + if(ManagerObj.length>0){ + proj_udata["SUP_StorewisePJP"]=ManagerObj?.[0]?.StorewisePJP + proj_udata["ShowStoreSearch"]=ManagerObj?.[0]?.StoreSearch + } + props.set_project(proj_udata); + + let country=res.CountryId!=null?res.CountryId+'':''; + + //set login info in encryted local storage + set_item('islogin','done'); + set_item('UserCountry',country); + set_item('loginToken',res.UserId); + set_item('loginInfo',JSON.stringify(res)); + props.set_user_details({session_name:res.UserId}); + + let lngJson=country=='2'?Text_thai:Text_eng; + props.setStaticText(lngJson) + + await checkIfData_Downloaded(); + await checkIfAttendanceUploaded(); + // open login screen + + if(loginOfDays[todayDate]!=null){ + + props.navigation.reset({index: 0,routes: [{name: 'NoticeBoard',params:{UserData:res}}],}); + } + else{ + + let currenttime=moment(new Date()).format('DD/MM/YYYY HH:mm:ss'); + let lods={}; + lods[todayDate]=currenttime; + set_item('loginOfDays',JSON.stringify(lods)); + + props.navigation.reset({index: 0,routes: [{name: 'One_QAD',params:{UserData:res}}],}); + } + + } + }) + .catch((err)=>{ + setProcessing(false); + console.log('onPage Login error1',err); + }); + } + + } + + async function update_project(){ + // refresh project settings + let defData={isUpdated:false,ProjectDetails:{},projectid:""} + let projectid=await get_item('projectCode'); + console.log('projectid',projectid); + + return await new Promise((resolve,reject)=>{ + if(projectid!='' && projectid!=null){ + + getProjectData(projectid) + .then((res)=>{ + console.log(res); + if(res.success && res.projectName!=null){ + //set project info in global reducer + const pdata=getProjectInfo(res,projectid); + props.set_project(pdata); + //set project info in encryted local storage + set_item('projectCode',projectid); + set_item('projectInfo',JSON.stringify(res)); + + defData['projectid']=projectid; + defData['isUpdated']=true; + defData['ProjectDetails']=res; + resolve(defData); + } + else if(res.projectName==null){ + resolve(defData); + } + }) + .catch((err)=>{ + console.log('err',err); + resolve(defData); + }); + } + else{ + resolve(defData); + } + }) + .catch((err)=>{ + return defData; + }); + + } + + async function mpinlogin(){ + const {mpin}=state; + if(validate()){ + let token=await get_item('loginToken'); + let master_pin=await get_item('mpin'); + if(master_pin==mpin && master_pin!='' && master_pin!=null && token!='' && token!=null && token!=undefined) + { + refreshToken();// refresh token + } + else{ + notify(ST.YouenteredwrongMPin,'SHORT'); + } + } + } + + async function autosubmit(){ + const {mpin}=state; + if(mpin.trim().length == 4){ + + mpinlogin(); + } + } + + const validate=()=>{ + const {mpin}=state; + if(mpin.trim().length == 0){ + notify(ST.PleaseenterMPin,'SHORT'); + return false; + } + return true; + } + + + async function forgetMpin(){ + let params={'forgotMpin':'1'}; + props.navigation.reset({index: 0,routes: [{name: 'Login',params:params}],}); + } + + const checkVersion = async () => { + try { + const updateNeeded = await VersionCheck.needUpdate({ + packageName: "com.cpmindiait.PerformicsManager", + }); + + console.log("Version check result:", updateNeeded); + + if (updateNeeded?.isNeeded) { + setShowVerUpdateModal(true); + setVerToUpdate(" "+updateNeeded?.latestVersion) + checkVersion() + } + } catch (error) { + console.error("Error checking version:", error); + } + } + + async function UpdateAppVersion(){ + setShowVerUpdateModal(false); + let res=loginRes; + let AppPath=res.AppPath?res.AppPath:''; + let IpaPath=res.IpaPath?res.IpaPath:''; + + + if(Platform.OS=='ios'){ + Linking.openURL("https://apps.apple.com/us/app/performicsmanager/id6446242809"); + // props.navigation.reset({index: 0,routes: [{name: 'NoticeBoard',params:{UserData:res}}],}); + } + else{ + if(AppPath!='' && AppPath!=null){ + // Do you have permission to install from unknown sources? + let hasAPKInstallPerm=RNApkInstaller.haveUnknownAppSourcesPermission(); + + if(!hasAPKInstallPerm){ + // Turn on Unknown Sources permission settings + RNApkInstaller.showUnknownAppSourcesPermission(); + } + + // android update app + setDownloading(true); + let file_parts=AppPath.split('/'); + let filename=file_parts[file_parts.length-1]; + const filePath = RNFS.DownloadDirectoryPath + "/"+filename; + console.log('filePath for downloading:',filename,filePath); + let size=0; + + let isExists=await RNFS.exists(filePath).then((res)=>{return res;}); + if(isExists){ + let tempPath= RNFS.DocumentDirectoryPath + "/"+filename; + await RNFS.moveFile(filePath,tempPath).then((res)=>{console.log('file moved');}); + console.log('tempPath:',tempPath); + await RNFS.unlink(tempPath); + } + + setTotalCount(size); + // setDownloadingText('0%') + setDownloadingText('0 %') + // RNFS.writeFile(filePath, '').then((create_res)=>{ + + ReactNativeBlobUtil.config({ + // response data will be saved to this path if it has access right. + + addAndroidDownloads: { + path : filePath, + useDownloadManager: true, + title: filename, + description: 'An APK that will be installed', + mime: 'application/vnd.android.package-archive', + notification: true, + mediaScannable: true, + } + }) + .fetch('GET', AppPath, { + //some headers .. + }) + .progress((received, total) => { + let status_inpercent=((received / total)*100); + try{ + status_inpercent=status_inpercent!=NaN && status_inpercent!=null?parseInt(status_inpercent):status_inpercent; + } + catch(err){ + console.log('status_inpercent error:',err); + } + setDownloadingText(status_inpercent+' %'); + setDowloadedCount(received); + setTotalCount(total); + }) + .then(async(res) => { + // the path should be dirs.DocumentDir + 'path-to-file.anything' + // let status = res.info().status; + let cache_filePath=res.path(); + console.log('The file saved to ',cache_filePath,filePath); + setDownloading(false); + if (cache_filePath!=null && cache_filePath!="" && cache_filePath!='undefined') { + // let result = await ReactNativeBlobUtil.MediaCollection.copyToMediaStore({ + // name: filename, parentFolder: '', mimeType: 'application/vnd.android.package-archive' + // },'Download', // Media Collection to store the file in ("Audio" | "Image" | "Video" | "Download") + // cache_filePath ); + // console.log("copy file result:",result); + + RNApkInstaller.install(filePath); + //set login info in global reducer + const pdata={islogin:true,UserId:res.UserId,SecurityToken:'',sessionData:res}; + props.set_session(pdata); + + //set login info in encryted local storage + set_item('islogin','done'); + set_item('loginToken',res.UserId); + set_item('loginInfo',JSON.stringify(res)); + set_item('clearOnInstall','true'); + props.set_user_details({session_name:res.UserId}); + + // }).catch((err)=>{ + // console.log('error',err); + // notify('Sorry! Cannot download apk. Storage Permission Issue'); + // }); + // res.flush(); + // console.log('removed the apk'); + + } + }); + + // }).catch((err)=>{ + // console.log('Error while creating:',err); + // setDownloading(false); + // notify('Sorry! Cannot download apk'); + // }); + } + else{ + setDownloading(false); + notify('Something went wrong! Cannot update version') + } + } + } + + + function _render_Alert(){ + return ( + + + {UpdateAppVersion()}}> + {ST.OK} + + + + ) + } + + + function _renderAnimPart(){ + let cl_scale=1,cl_ty=0,pl_scale=1,illus_scale=1,illus_ty=0,formty=0; + if(animatedEffects!=null ){ + pl_scale=animatedEffects.interpolate({ + inputRange:[0,1], + outputRange:[1,0.7], + }); + cl_scale=animatedEffects.interpolate({ + inputRange:[0,1], + outputRange:[1,0.6], + }); + cl_ty=animatedEffects.interpolate({ + inputRange:[0,1], + outputRange:[0,-40], + }); + illus_scale=animatedEffects.interpolate({ + inputRange:[0,1], + outputRange:[1,0.5], + }); + illus_ty=animatedEffects.interpolate({ + inputRange:[0,1], + outputRange:[0,-150], + }); + formty=animatedEffects.interpolate({ + inputRange:[0,1], + outputRange:[0,-120], + }); + } + return( + + + props.navigation.navigate('Settings')}> + + + + {props.splashlogo!=null && props.splashlogo!= '' && + } + + + + + {loading==false && + {ST.HeyThere} + {ST.MPintologinyouraccount} + + {/* { setState({...state,mpin:code}); setIsMPINUpdate(!isMPINUpdate);}} + numberOfInputs={4} + secureTextEntry={true} + keyboardType={"numeric"} + defaultValue={''} + autofillFromClipboard={false} + inputStyles={customStyle.otp_inputStyle} + style={customStyle.otp_field} + /> */} + + { + // Defer state update to next tick + setTimeout(() => { + setState(prev => ({ ...prev, mpin: code })); + setIsMPINUpdate(prev => !prev); + }, 0); + }} + numberOfInputs={4} + secureTextEntry={true} + keyboardType="numeric" + defaultValue="" + autofillFromClipboard={false} + inputStyles={customStyle.otp_inputStyle} + style={customStyle.otp_field} + /> + + + {forgetMpin()}}> + {ST.ForgotMPin} + + + + } + + + + ) + } + return ( + + {processing && } + {loading && } + {(downloading) && } + {_render_Alert()} + + + {_renderAnimPart()} + + {loading==false && + {mpinlogin();}}/> + + {version} + {copyrightText} + + } + + + ); +} + +export default connect(mapStateToProps, mapDispatchToProps)(MpinLogin) \ No newline at end of file diff --git a/src/screens/NPNDStoreList.js b/src/screens/NPNDStoreList.js new file mode 100644 index 0000000..3658a59 --- /dev/null +++ b/src/screens/NPNDStoreList.js @@ -0,0 +1,340 @@ +import React,{useState,useEffect, memo} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,TouchableHighlight,Platform,PermissionsAndroid,FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,AddStore, checkRange, UploadData2, UploadData, UpdateStoreStatus, getKPIS, marktext1, marktext2, UploadFormData} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, AppVersion} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign, Entypo, EvilIcons, Feather, FontAwesome, Fontisto, Ionicons, MaterialCommunityIcons} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import NoDataComponent from '../components/NoDataComponent'; +import {SvgXml} from 'react-native-svg'; +import MapIcon from '../assets/performics/map_icon.svg'; +import CustomModal from '../components/CustomModal'; +import { AppTables } from '../constants/tableConstants'; +import { _checkLocationPermission } from '../components/geolocation'; +import { getAvailblQuery, getIfAvlbl, getIfKPIDone, getQuery, Q_MenuList } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; +import { uploadAllImages, uploadStoreStatus } from '../constants/uploadData'; +import { PrimaryTheme } from '../styles/Themes'; +import NetworkStatusBar from '../components/NetworkStatusBar'; +import * as RNFS from 'react-native-fs'; + +import CameraImg2 from '../assets/performics/camera_icon.svg'; +import CustomCamera from '../components/Camera'; +import NoAttendance from '../components/NoAttendance'; +import HeaderTabsTeam from '../components/HeaderTabsTeam'; + +const EmployeeItem=memo((props)=>{ + const route = useRoute(); + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const item=props.item; + + const ST=props.StaticText || {}; + + async function gotoPage(data){ + props.navigation.navigate('StoreList',{empData:data,'isAdhoc':false});//props.isAdhocScreen + } + + + return( + {gotoPage(item)}}> + + + + {item.EmployeeName} + + + + + + {'Employee Id:'} + {item.EmpId} + + + + + {'User Id:'} + {item.UserId} + + + { + (item.ChekedInStatus==true) && + + + + {'You have some Checked In data for this employee'} + + + } + + + + ); +}); + +function NPNDStoreList(props) { + const route = useRoute(); + + const ST=props.StaticText || {}; + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const [loaderTitle, setLoaderTitle] = useState(); + const [processing, setProcessing] = useState((props.isDataDownloaded?true:false)); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [nodataFound, setNodataFound] = useState(false); + const [showStoreVisitModal, setShowStoreVisitModal] = useState(false); + const [showGeoTagModal, setShowGeoTagModal] = useState(false); + const [showDistanceModal, setShowDistanceModal] = useState(false); + const [currentStore, setCurrentStore] = useState({}); + const [storeDistance, setStoreDistance] = useState('0 M'); + const [storeDistanceinM, setStoreDistanceinM] = useState(0); + const [showAlert, setShowAlert] = useState(false); + const [checkOutStore,setCheckOutStore]=useState({}); + const [rerenderdata, setrerenderdata]= useState(false); + const [EmployeesList, setEmployeesList] = useState([]); + const [globalEmplist, setGlobalEmplist] = useState([]); + + const [globalStorelist, setGlobalStorelist] = useState([]); + const [cancelCheckOutStore,setCancelCheckOutStore]=useState({}); + const [showCancelCIModal, setShowCancelCIModal]= useState(false); + const [searchedItem, setSearchedItem]= useState(''); + + + const [CheckOutImage, setCheckOutImage] = useState(''); + const [CheckOutImagePath, setCheckOutImagePath] = useState(''); + const [CheckOutImageModal, setCheckOutImageModal] = useState(false); + const [CheckOutLoc, setCheckOutLoc] = useState({}); + const [showImageSaveOp, setShowImageSaveOp] = useState(true); + const [showCamera, setShowCamera] = useState(false); + const [GeoFenceEnable_Checkout, setGeoFenceEnable_Checkout] = useState(false); + const [GeoFenceRadius_Checkout, setGeoFenceRadius_Checkout] = useState(''); + + useEffect(() => { + setLoaderTitle(ST.Loading+'...'); + + if(props.isDataDownloaded ==true && !props.isAttendanceMarked){ + props.navigation.pop();props.navigation.push('Attendance'); + } + else{ + // checkLocalData(); + + const FocusUnsubscribe=props.navigation.addListener('focus', () => {checkLocalData();}); + + return function cleanup() { + FocusUnsubscribe(); + return; + }; + } + + }, []); + + async function checkLocalData(){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + + let token=await get_item('loginToken'); + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + let params=props.route.params? props.route.params:{}; + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + + var q=''; + // if(isAdhoc==true){ + // q=`Select * from Sup_NPNDStore where UploadStatus='N'`; + // } + // else{ + // q=`Select * from Sup_NPNDStore where UploadStatus='Y'`; + // } + + q=`Select * from Sup_TeamList `; + + console.log("NPNDStoreList q:",q); + await db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log("NPNDStoreList length:",txnres2.rows.length); + if(txnres2.rows.length>0){ + // show from local + var storeArr=[]; + for(var i=0;i{ + db.transaction(async function (txn) { + + //let join=`INNER JOIN ${AppTables.COVERAGE_DATA} t2 on t2.STORE_ID=t1.StoreId and t2.JCP_TYPE='Sup_JourneyPlan' `; + let q=`Select t1.* from Sup_JourneyPlan t1 where t1.VisitDate='${d2}' and t1.MerchandiserId='${EmpId}' and t1.UploadStatus='I'` + + //let join2=`INNER JOIN ${AppTables.COVERAGE_DATA} t2 on t2.STORE_ID=t1.StoreId and t2.JCP_TYPE='Sup_AdhocJourneyPlan' `; + let q2=`Select t1.* from Sup_AdhocJourneyPlan t1 where t1.VisitDate='${d2}' and t1.MerchandiserId='${EmpId}' and t1.UploadStatus='I'` + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + // show from local + resolve(true); + } + else{ + await txn.executeSql(q2,[],async function (txn2, txnres3) { + if(txnres3.rows.length>0){ + // show from local + resolve(true); + } + else{ + resolve(false); + } + },function(txn2,txnerr){console.log(txnerr);resolve(false); }); + } + },function(txn2,txnerr){console.log(txnerr);resolve(false); }); + + }); + + }).then((val)=>{ + return val; + }).catch((err)=>{ + return false; + }); + } + + + function FilterStores(searchedQry){ + searchedQry=searchedQry.toLowerCase(); + console.log('searchedQry',searchedQry); + let arr=[] + if(searchedQry!=null && searchedQry!=''){ + globalEmplist.map((item,index)=>{ + let {EmpId,EmployeeName}=item; + if(EmployeeName.toLowerCase().includes(searchedQry) || JSON.stringify(EmpId).toLowerCase().includes(searchedQry)){ + arr.push(item); + } + }); + } + else{ + // arr=globalStorelist; + arr=globalEmplist; // search fixed + } + setEmployeesList(arr); + setrerenderdata(!rerenderdata) + } + + return ( + + {processing && } + + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + + { !props.isDataDownloaded && } + {props.isDataDownloaded ==true && !props.isAttendanceMarked && + + } + {props.isDataDownloaded ==true && props.isAttendanceMarked==true && props.isEntryAllow==false && + + } + + + + + {/* + + {props.navigation.pop();props.navigation.push('NPNDStoreList')}}> + {ST.Planned} + + {props.navigation.pop();props.navigation.push('NPNDStoreList',{'isAdhoc': true})}}> + {ST.Adhoc} + + + */} + + + + + {setSearchedItem(val); FilterStores(val)}} + autoComplete='off' + /> + {FilterStores(searchedItem)}}> + + + + + { nodataFound && + + {ST.NoDataAvailable} + + } + { (props.isDataDownloaded==true && props.isAttendanceMarked==true && !nodataFound) && + + { + return( + + ); + }} + /> + + } + + + + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(NPNDStoreList); \ No newline at end of file diff --git a/src/screens/NoticeBoard.js b/src/screens/NoticeBoard.js new file mode 100644 index 0000000..ff81907 --- /dev/null +++ b/src/screens/NoticeBoard.js @@ -0,0 +1,5732 @@ +import React, { useState, useEffect, useRef } from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles, customStyles, GetPageTheme, WP, HP } from "../styles/Global"; +import { StatusBar, Image, TextInput, View, Text, ScrollView, TouchableOpacity, Pressable, Platform, PermissionsAndroid, Modal, Alert, Dimensions, LogBox, StyleSheet } from 'react-native'; +import { ReactReduxContext, connect, useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps, mapDispatchToProps } from '../reducers/contextProvider'; +import { notify } from '../components/notify'; +import moment from 'moment'; +import { getDownloadJson, DownloadData, getDownloadJson1, fetchProjectConfig, UpdateStoreStatus, getKPIS, getAttendNonWorkingRsns, getProjectInfo, UploadData2, UploadFormData, getIf_UserIsManager, UploadData, get_rowColSettings } from '../controller/functions'; +import { get_item, set_item, clear_item } from '../components/localStorage'; +import { version, sloganline, appname, testurl, db, resumeurl, common_ImagePath } from '../constants/constants'; +import SplashScreen from 'react-native-splash-screen'; +import { WebView } from 'react-native-webview'; +import CustomLoader from '../components/CustomLoader'; +import DownloadDataModal from '../components/downloadDataModal'; +import DrawerHeader from '../components/drawerHeader'; +import LinearGradient from 'react-native-linear-gradient'; +import { getDownloadDataTask, getPostData } from '../components/downloadTasks'; +import { getMethodName, METHODS } from '../constants/methodNames'; +import { getImagePOSTData, uploadAllData, uploadAllImages, uploadAllVisitors, uploadStoreStatus } from '../constants/uploadData'; +import { AppTables } from '../constants/tableConstants'; +import Svg, { SvgUri, SvgXml } from 'react-native-svg'; +import * as RNFS from 'react-native-fs'; +import { Q_MenuList } from '../constants/ConstantQueries'; +import kwaza_image from '../assets/performics/kwaza.png'; +import store_planned from '../assets/performics/Planned.svg'; +import store_covered from '../assets/performics/Covered.svg'; +import { Directions, FlatList } from 'react-native-gesture-handler'; +import { logout } from '../components/logout'; +import Carousel, { Pagination } from 'react-native-snap-carousel'; +import { FontAwesome, MaterialCommunityIcons, AntDesign, Entypo, EvilIcons } from '../components/icons'; +import CustomModal from '../components/CustomModal'; +import { Feather } from '../components/icons'; +import { ProgressChart } from 'react-native-chart-kit'; +import cross_icon from '../assets/icons/crossmodal.svg'; + +// webview survey +import { useIsFocused } from "@react-navigation/native"; + +function NoticeBoard(props) { + + const { width: screenWidth, height: screenHeight } = Dimensions.get('window') + + const cardPadding = 15 + const totalPadding = 15 * 3 // left-side, in-between, right-side + const imageWidth = (screenWidth - totalPadding) / 2 + const imageHeight = 250 + + + const route = useRoute(); + + const ST = props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const globalStyle = globalStyles(props.DarkMode, route.name); + + + const [state, setState] = useState({ webviewurl: '' }); + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + + // download data state + const [isDataDownloaded, setisDataDownloaded] = useState(false); + const [isDataUploaded, setisDataUploaded] = useState(false); + + + const [TaskResponse, setTaskResponse] = useState([]); + + const [downloadingText, setDownloadingText] = useState(''); + const [dowloadedCount, setDowloadedCount] = useState(-1); + const [totalCount, setTotalCount] = useState(0); + const [AllTableQueries, setAllTableQueries] = useState([]); + const [IsPJPMandatory, setIsPJPMandatory] = useState(true); + + const [DErrorMsg, setDErrorMsg] = useState({}); + const [showDErrAlert, setshowDErrAlert] = useState(false); + + + const projectCode = props.projectCode; + const [activeSlide, setActiveSlide] = useState(0); + + const imageSlider = useRef(null); + const [nodataFound, setNodataFound] = useState(false); + const [EmployeesList, setEmployeesList] = useState([]); + const [globalEmplist, setGlobalEmplist] = useState([]); + const [planned, setPlanned] = useState(0); + const [covered, setCovered] = useState(0); + const [merchandised, setmerchandised] = useState(0); + const [bannerdetail, setBannerDetail] = useState([]); + const [DownloadTasks, setDownloadTasks] = useState([]); + const GMUploadedCountref = useRef(0); + const IAUploadedCountref = useRef(0); + + const [AppDashReportsSec, setAppDashReportsSec] = useState([]); + + const [modaldata, setModalData] = useState({ colname: '', colValue: '', 'row': {}, item: {} }); + + // modal + const [modalVisible, setModalVisible] = useState(false); + const toggleModal = (colname, colValue, row, item) => { + setModalVisible(!modalVisible); + setModalData({ colname: colname, colValue: colValue, row: row, item: item }) + }; + + + //add noticeboard data + + const SUP_StorewisePJP = props.SUP_StorewisePJP + + const DATA = [ + { + text: 'Download Data', + icon: () => { + return ( + + + + ) + }, + iconType: 'Icon', + itemOnPress: () => { AskForDownload() } + + }, + { + text: 'Attendance', + icon: () => { + return ( + + + + ) + }, + iconType: 'Icon', + itemOnPress: () => { props.navigation.navigate('Attendance'); } + }, + + + { + text: 'Daily Route Map', + icon: () => { + return ( + + + + ) + }, + iconType: 'Icon', + // props.route.params? props.route.params:{} + // ==true && + itemOnPress: () => { gotoStore() } + }, + { + text: 'Grooming Images', + icon: () => { + return ( + + + + ) + }, + iconType: 'Icon', + itemOnPress: () => { props.navigation.navigate('GroomingPictures'); } + + }, + { + text: 'Reports', + icon: () => { + return ( + + + + ) + }, + iconType: 'Icon', + itemOnPress: () => { props.navigation.navigate('ReportsMenu'); } + + }, + { + text: 'Upload Data', + icon: () => { + return ( + + + + ) + }, + iconType: 'Icon', + itemOnPress: () => { AskForUpload() } + + }, + + { + text: 'Exit', + icon: () => { + return ( + + + + ) + }, + iconType: 'Icon', + itemOnPress: () => { logout(props) } + + }, + ]; + + + + const images = [ + { + urlImage: kwaza_image, + descImage: "https://www.shutterstock.com/image-photo/panorama-beautiful-countryside-romania-sunny-600w-1302294157.jpg" + }, + { + urlImage: kwaza_image, + descImage: "https://www.shutterstock.com/image-photo/panorama-beautiful-countryside-romania-sunny-600w-1302294157.jpg" + }, + ]; + + + const storeperformancetext = [ + { + text: 'Store Visited', + icon: store_planned, + value: planned, + }, + { + text: 'Store Executed', + icon: store_covered, + value: covered, + }, + + ]; + + + + useEffect(() => { + setLoaderTitle(ST.Loading + '...') + + const item = props; + dashboardview(); + getdashboardData(); + + const willFocusSubscription = props.navigation.addListener('focus', () => { + + getdashboardData(); + }); + + return willFocusSubscription; + }, []); + + + + // useEffect(() => { + // if(props.startDownload==true){ + // beforeExecuteTasks(); + // startDownload(); + // } + // }, [props.startDownload]); + useEffect(() => { + console.log('on props.startDownload change:', props.startDownload); + if (props.startDownload == true) { + beforeExecuteTasks(); + } + }, [props.startDownload]); + + useEffect(() => { + console.log('on totalCount change:', totalCount, props.startDownload); + if (props.startDownload == true) { + startDownload(); + } + }, [totalCount]); + + useEffect(() => { + if (props.startUpload == true) { + startUpload(); + } + }, [props.startUpload]); + + + + useEffect(() => { + + if (props.startDownload && TaskResponse != null) { + console.log('increment dowloadedCount changed'); + let count = dowloadedCount + 1; + setDowloadedCount(count); + } + }, [TaskResponse]); + + + useEffect(() => { + console.log | ("dowloadedCount on change:", dowloadedCount, totalCount) + if (dowloadedCount >= 0 && dowloadedCount <= totalCount) { + // dowloadAllData(); + executeTasks(); + } + else { + props.set_startDownload({ startDownload: false }); + notify(ST.DataDownloaded, 'SHORT'); + } + }, [dowloadedCount]); + + async function gotoStore() { + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + console.log("loginDetails--------", loginDetails) + let userIsManager = await getIf_UserIsManager(props); + // let storewisePjp = await fetchProjectConfig(props.ManagerAppConfig); + const { StorewisePJP: storewisePjp } = await fetchProjectConfig(props.ManagerAppConfig); + console.log("userIsManager", userIsManager) + + console.log("storewisePjpGotoStore>>:", storewisePjp); + + if (storewisePjp == true) { + props.navigation.navigate('StoreList', { showSearchWiseStore: true }) + } + else { + if (loginDetails?.Designation != "Supervisor") { + props.navigation.navigate('TeamList'); + } + else if (loginDetails?.Designation == "Supervisor") { + storewisePjp == true ? props.navigation.navigate('StoreList') : props.navigation.navigate('TeamList'); + } else { + props.navigation.navigate('StoreList', { showSearchWiseStore: true }); + } + + } + + } + + async function checkData() { + let projectInfo = await get_item('projectInfo'); + let projectCode = await get_item('projectCode'); + let projectDetails = JSON.parse(projectInfo); + let isPJPMand = projectDetails.PJPMandatory != null ? projectDetails.PJPMandatory : true; + setIsPJPMandatory(isPJPMand); + + if (props.baseurl == '' || props.baseurl == null || props.baseurl == undefined) { + + //set project info in global redux state + let imgurl = projectDetails.imageUploadURL != null ? projectDetails.imageUploadURL + '/' : ''; + const pdata = getProjectInfo(res, projectid); + // const pdata={pid:projectCode,pname:projectDetails.projectName,pcode:projectCode,alldata:projectDetails,baseurl:projectDetails.baseURL,imageUploadUrl:imgurl,GeoFenceEnable:(projectDetails.GeoFenceEnable_checkin!=null && projectDetails.GeoFenceEnable_checkin==1),GeoFenceRadius:(projectDetails.GeoFenceRadius_checkin || 0),GFEnable_checkout:(res.GeoFenceEnable_checkout!=null && res.GeoFenceEnable_checkout==1),GFRadius_checkout:(res.GeoFenceRadius_checkout || 0),CheckOut_PhotoReq:res.PhotoRequired_Checkout }; + props.set_project(pdata); + + // setisDataDownloaded(props.isDataDownloaded); + // await checkIfData_Downloaded(); + } + } + + + + async function dashboardview() { + // console.log("dashboardview-----call----") + await checkData(); + await getDTasks(); + + downloaddatabanner(); + let token = await get_item('loginToken'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const todate = new Date(); + const today = moment(todate).format("HH:mm:ss"); + // const storewisePjp = await fetchProjectConfig(props.ManagerAppConfig); + const {StorewisePJP: storewisePjp, StoreSearch: storeSearch } = await fetchProjectConfig(props.ManagerAppConfig); + // console.log("storewisePjpNoticBoard::", storewisePjp); + // console.log("storeSearch::", storeSearch); + + const data = { Downloadtype: "Notice_Board", username: loginDetails.UserId, empid: '', storeWisePjp: storewisePjp }; + const url = props.baseurl + getMethodName(METHODS.DOWNLOADJSON_METHOD); + await getDownloadJson(url, data) + .then(async (res) => { + + if (res.Notice_Board) { + + let obj = res.Notice_Board.length > 0 ? res.Notice_Board[0] : {}; + // console.log('noticeBoard: webview',obj.NOTICE_BOARD); + setState({ ...state, webviewurl: obj.NOTICE_BOARD }); + setProcessing(false); + + + // if(props.ShowBeatPlanList==true){ + + // } + // else{ + let isAlreadyDownl = await checkIfData_Downloaded(); + let params = props.route.params ? props.route.params : {}; + // let isTodayLogin=params.TodayLogin!=null?params.TodayLogin:true; + let isTodayLogin = props.isTodayLoginExists != null ? props.isTodayLoginExists : true; + + // check for autodownload + console.log('check for auto download', isTodayLogin, isAlreadyDownl, props.startDownload); + if (isAlreadyDownl == false && props.startDownload == false) {//isTodayLogin==false + await clear_item('storeData'); + console.log('start auto download'); + // start auto download + props.set_startDownload({ startDownload: true }); + } + // new + else { + // get dashboards reports + { } + getAppDashBReports(); + } + // } + } + }) + .catch((err) => { + console.log('onPage Login error1', err); + }); + + SplashScreen.hide(); + } + + async function getDTasks() { + return new Promise(async (resolve, reject) => { + var DownloadTasks1 = []; + if (props.DownloadKey != null && props.DownloadKey != '') { + let prop_dk = JSON.parse(props.DownloadKey); + console.log('set server d keys'); + let AllDTs = prop_dk['DownloadKey'] || []; + + await new Promise.all(AllDTs.sort((a, b) => { + if (a.DownloadSequence < b.DownloadSequence) { + return -1; + } + if (a.DownloadSequence > b.DownloadSequence) { + return 1; + } + // a must be equal to b + return 0; + })).then((val) => { + DownloadTasks1 = AllDTs + }); + // for(let i=0;i { + return false; + console.log('getDTasks err', Err); + }) + + } + + async function checkIfData_Downloaded() { + console.log('checkIfData_Downloaded'); + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + const isDataStorageCleared = await get_item('DataStorageCleared'); + let dateWiseDataDownload = await get_item('dateWiseDataDownload'); + let dateWiseDataDownload1 = dateWiseDataDownload != null ? JSON.parse(dateWiseDataDownload) : {}; + let todayDate = moment(new Date()).format('DD/MM/YYYY'); + if (isDataStorageCleared != '1') { + + if (dateWiseDataDownload1[todayDate] != null) { + let d = dateWiseDataDownload1[todayDate]; + console.log('isdtatdownloaded:', d); + props.setTodayDataExists(d); + props.setGlobalData({ isDataDownloaded: d }) + return d; + } + else { + + let lods = {}; + lods[todayDate] = false; + console.log('lods:', lods); + await set_item('dateWiseDataDownload', JSON.stringify(lods)); + props.setTodayDataExists(false); + return false; + } + + } + else { + return false; + } + + } + + + // download functionality start + async function startDownload() { + console.log("startDownload downloadedCount:", dowloadedCount); + props.set_startDownload({ startDownload: true }); + setDowloadedCount(0); + } + + async function beforeExecuteTasks() { + console.log('beforeExecuteTasks:'); + let clear_data = props.Clear_storage; + let clearOnInstall = await get_item('clearOnInstall'); + console.log("clear_data :", clear_data, clearOnInstall) + // if (clear_data == true && clearOnInstall=="true") { + // let isCleared=await clearStorage(); + // console.log("isCleared:",isCleared); + // await clear_item("clearOnInstall"); + // await clear_item('storeData'); + // console.log('Storage cleared'); + // } + + let ddata = { isDataDownloaded: false }; + await DownloadData(props, ddata).then((res) => { + console.log('isAllTablesCreates:', res, DownloadTasks.length, totalCount, props.startDownload) + console.log('DownloadTasks===>', DownloadTasks); + + if (totalCount == (DownloadTasks.length - 1) && totalCount > 0 && props.startDownload == true) { + startDownload(); + } + else { + setTotalCount((DownloadTasks.length - 1)); + } + }); + } + + // function onNoData(data=[],shouldStop=false,tbname=''){ + // if(tbname!=''){ + // db.transaction(function(txn) { + // // delete all today data + // txn.executeSql(`delete from ${tbname} where 1=1`,[],function(txn1,txnres){ + // console.log('deleted all data for '+tbname); + // },function(txn1,err){ + // console.log('err:',err); + // }); + // }); + // } + + // if(shouldStop==true){ + // let msg=ST.Nodatafoundfor+tbname+''; + // if(tbname=='Sup_JourneyPlan'){ + // msg=ST.Youhavenojourneyplanfortoday; + // } + // notify(msg); + // props.set_startDownload({startDownload:false}); + // } + // else{ + // setTaskResponse(data); + // } + // } + + async function onNoData(data = [], shouldStop = false, tbname = '', res = '') { + console.log("res on no data:", res); + if (tbname != '') { + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from ${tbname} where 1=1`, [], function (txn1, txnres) { + console.log('deleted all data for ' + tbname); + }, function (Etxn, err) { + console.log('err:', err); + }); + }); + } + + if (shouldStop == true) { + let msg = ''; + // res should be set only when there is network or other related issue + if (res == '') { + msg = ST.Nodatafoundfor + tbname + ''; + } + else { + msg = res + " Please ensure you are connected to the internet and retry downloading! "; + } + + console.log("msg :", msg); + + // set is Data downloaded to false so that no other parts of app can be accessed if data is not downloaded + + // update download status on local async storage + let dateWiseDataDownload = await get_item('dateWiseDataDownload'); + let dateWiseDataDownload1 = dateWiseDataDownload != null ? JSON.parse(dateWiseDataDownload) : {}; + let todayDate = moment(new Date()).format('DD/MM/YYYY'); + dateWiseDataDownload1[todayDate] = false; + set_item('dateWiseDataDownload', JSON.stringify(dateWiseDataDownload1)); + + // update downloaed status on redux props + props.setTodayDataExists(false); + props.setGlobalData({ isDataDownloaded: false }) + + + // notify(msg); + // show error msg + let obj = { "ErrorMsg": "!! Error in downloading data !!", "ErrorSubMsg": tbname, "ErrorDetail": msg } + setDErrorMsg(obj); + props.set_startDownload({ startDownload: false }); + setDowloadedCount(-1); + setshowDErrAlert(true); + } + else { + setTaskResponse(data); + } + } + + function onTaskError() { + notify(ST.Cannotdownloaddata); + props.set_startDownload({ startDownload: false }); + } + + async function executeTasks() { + console.log("executeTasks"); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + var currentIndex = dowloadedCount; + + console.log('currentIndex:', currentIndex); + if (currentIndex >= 0) { + let dk_data = DownloadTasks[currentIndex]; + console.log('dk_data', dk_data); + let key = dk_data.DownloadKey || ''; + setDownloadingText(key); + var data = await getPostData(DownloadTasks, currentIndex, props); + var url = props.baseurl + getMethodName(METHODS.DOWNLOADJSON_METHOD); + + + console.log(url, data); + await getDownloadJson1(url, data) + .then(async (res) => { + let isAdded = await updateTaskRes(res, currentIndex, 1); + console.log("isAdded:", isAdded); + if (isAdded == true) { + if (currentIndex == DownloadTasks.length - 1) { + console.log('last found all downloaded'); + await InsertAttendance() + onDownloadComplete(); + } + else { + console.log('all downloaded but last not found '); + } + + } + else { + console.log('Cannot download all Data'); + } + }) + .catch(err => { + console.log('onPage Team error', err); + }); + } + + } + + + async function onDownloadComplete() { + console.log("onDownloadComplete"); + let dateWiseDataDownload = await get_item('dateWiseDataDownload'); + let dateWiseDataDownload1 = dateWiseDataDownload != null ? JSON.parse(dateWiseDataDownload) : {}; + let todayDate = moment(new Date()).format('DD/MM/YYYY'); + dateWiseDataDownload1[todayDate] = true; + set_item('dateWiseDataDownload', JSON.stringify(dateWiseDataDownload1)); + // last download + // let ddata={isDataDownloaded:false}; + // await DownloadData(props,ddata).then(()=>{ + // await CreateDirKPIimg(); + // await UploadAllPrevImages(); + setisDataDownloaded(true); + let count = dowloadedCount + 1; + props.set_startDownload({ startDownload: false }); + setDowloadedCount(-1); + props.setTodayDataExists(true); + props.setGlobalData({ isDataDownloaded: true }) + clear_item('DataStorageCleared'); + setDowloadedCount(count); + notify(ST.DataDownloaded, 'SHORT'); + + // }); + } + + function AskForDownload() { + Alert.alert( + "Performics", + ST.Doyouwanttodownloaddata, + [ + { + text: ST.Cancel, + onPress: () => { }, + style: "cancel" + }, + { text: ST.OK, onPress: () => { startDownload(); } } + ], + ); + } + + function AskForUpload() { + Alert.alert( + "Performics", + ST.Doyouwanttouploaddata, + [ + { + text: ST.Cancel, + onPress: () => { }, + style: "cancel" + }, + { text: ST.OK, onPress: () => { startUpload(); } } + ], + ); + } + + + async function downloaddatabanner() { + let token = await get_item('loginToken'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + + // const data={Downloadtype: 'Sup_NoticeBoard',username: loginDetails.UserId,empid: '',token: token,}; + const data = { Downloadtype: "Sup_NoticeBoard", username: loginDetails.UserId, empid: '', }; + console.log('da', data); + const url = props.baseurl + getMethodName(METHODS.DOWNLOADJSON_METHOD); + console.log('res', data) + + //download position data + + await getDownloadJson(url, data) + .then((res) => { + if (res.Sup_NoticeBoard) { + + let dataarr = res.Sup_NoticeBoard ? res.Sup_NoticeBoard : []; + console.log('dataarr banner', dataarr); + setBannerDetail(dataarr); + // call education + setProcessing(false); + } + }) + .catch((err) => { + setProcessing(false); + notify('Not data downloaded..!', 'SHORT'); + console.log('Position_Master not download data...!', err); + }); + + + + + + } + + async function InsertAttendance() { + const todate = new Date(); + const today = moment(todate).format("MM/DD/YYYY"); + let nonWrkRsns = await getAttendNonWorkingRsns() || []; + return new Promise((resolve, reject) => { + db.transaction(function (txn) { + let q = `DELETE FROM ${AppTables.ATTENDANCE} WHERE EMP_ID='${props.UserId}' and ATTENDANCE_DATE='${today}' `; + // remove old data + txn.executeSql(q, [], async function (txn2, txnres) { + console.log('old attend deleted'); + + let query = "SELECT * FROM Sup_AttendanceStatus" + txn.executeSql(query, [], async function (txn2, txnres3) { + if (txnres3.rows.length > 0) { + for (var i = 0; i < txnres3.rows.length; i++) { + // let sdata=txnres3.rows.item(i); + let sdata3 = txnres3.rows.item(i); + let ReasonId = sdata3?.ReasonId + console.log("ReasonId--------", ReasonId, sdata3) + let selRsn_I = nonWrkRsns.findIndex(i => i.ReasonId == ReasonId); + if (selRsn_I >= 0) { + + let selRsn = selRsn_I >= 0 ? nonWrkRsns[selRsn_I] : {}; + let { EntryAllow, Reason } = selRsn; + let values = ` ('${props.UserId}','${today}','${EntryAllow}','','${ReasonId}','${Reason}','','${today}') `; + + console.log('values:', values); + let add_data = `INSERT INTO ${AppTables.ATTENDANCE} (EMP_ID,ATTENDANCE_DATE,ENTRY_ALLOW,REMARK,REASON_ID, REASON,IMAGE1 ,ADDED_DATE) VALUES ${values} `; + + txn.executeSql(add_data, [], async function (txn2, txnres) { + console.log('attend added'); + props.setAttendanceStatus({ isAttendanceMarked: true, isEntryAllow: (EntryAllow == '1' || EntryAllow == 'true' ? true : false) }); + resolve(true); + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); },); + } + else { + resolve(false); + } + + } + + } else { + resolve(false); + } + + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); },); + + + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); },); + }); + }).catch((err) => { + console.log(err); + return false; + }) + } + + // DOWNLOAD FUNCTIONALITY START + async function updateTaskRes(res, index, count) { + const todate = new Date(); + const today = moment(todate).format("MM/DD/YYYY"); + let d2 = today; + let dk_data = DownloadTasks[index]; + console.log('updateTaskRes', dk_data) + let key = dk_data != null ? dk_data.DownloadKey : ''; + console.log('key', dk_data) + let IsMandatory = dk_data.IsMandatory == 'true' || dk_data.IsMandatory == 1 ? true : false; + console.log("call promise"); + console.log("keys===============>", key) + return new Promise(async (resolve, reject) => { + + switch (key) { + + case 'Table_Structure_Sup': { + if (res != null && res.Table_Structure_Sup) { + + const Table_Structure_Sup = res.Table_Structure_Sup; + setAllTableQueries(Table_Structure_Sup); + var allstmnts = []; + if (Table_Structure_Sup.length > 0) { + for (const i in Table_Structure_Sup) { + const table = Table_Structure_Sup[i]; + let stmnt = table.SqlText; + db.transaction(function (txn) { + txn.executeSql(stmnt, [], function (txn2, txnres) { + if (i == (Table_Structure_Sup.length - 1)) { + setTaskResponse(Table_Structure_Sup); + resolve(true); + } + }, function (txn2, txnerr) { + console.log('txnerr', txnerr, stmnt); + if (i == (Table_Structure_Sup.length - 1)) { + resolve(true); + } + }); + }); + } + } + else { + resolve(false); + } + } + else { + resolve(false); + } + break; + } + + case 'Sup_SupervisorList': { + if (res != null && typeof res == 'object' && res.Sup_SupervisorList != null && res.Sup_SupervisorList != '') { + let data_arr = res.Sup_SupervisorList || []; + + var values = []; + data_arr.map((data_obj) => { + let { EmpId, UserId, EmployeeName, VisitDate } = data_obj; + values.push(` ('${EmpId}', '${UserId}', '${EmployeeName}','${VisitDate}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_SupervisorList(EmpId,UserId,EmployeeName,VisitDate) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_SupervisorList where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_SupervisorList added'); + // console.log('data_arr',data_arr) + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_SupervisorList'], false, 'Sup_SupervisorList'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_SupervisorList'], true, 'Sup_SupervisorList', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_SupervisorList'], true, 'Sup_SupervisorList', res); + resolve(false); + } + break; + } + + case 'Sup_TeamList': { + if (res != null && typeof res == 'object' && res.Sup_TeamList != null && res.Sup_TeamList != '') { + let data_arr = res.Sup_TeamList || []; + + var values = []; + data_arr.map((data_obj) => { + let { EmpId, UserId, EmployeeName, VerticalId, Vertical, VisitDate, TodayPJP } = data_obj; + values.push(` ('${EmpId}', '${UserId}', '${EmployeeName}', '${VerticalId}', '${Vertical}', '${VisitDate}', '${TodayPJP}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_TeamList(EmpId,UserId,EmployeeName,VerticalId,Vertical,VisitDate,TodayPJP) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_TeamList where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_TeamList added'); + console.log('data_arr', data_arr) + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_TeamList'], false, 'Sup_TeamList'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_TeamList'], true, 'Sup_TeamList', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_TeamList'], true, 'Sup_TeamList', res); + resolve(false); + } + break; + } + + case 'Sup_JourneyPlanStorewiseSup': { + console.log("res:", res); + if (res != null && typeof res == 'object' && res.Sup_JourneyPlanStorewiseSup != null && res.Sup_JourneyPlanStorewiseSup != '') { + let data_arr = res.Sup_JourneyPlanStorewiseSup || []; + var values = []; + data_arr.map((data_obj) => { + let { MID, ChannelId, StoreId, StoreCode, EmpId, MerchandiserId, VisitDate, ChainId, ChainName, StoreName, Address, Location, Landmark, CityId, CityName, StateId, StateName, RegionId, StoreTypeId, StoreType, Pincode, Latitude, Longitude, Phone, Mobile, ContactPerson, Email, Deviation, UploadStatus, GeoTag, GeoFenceRadius, InTime, OutTime, CameraAllow } = data_obj; + StoreName = StoreName.replace(/'/g, ''); + Address = Address.replace(/'/g, ''); + StateName = StateName.replace(/'/g, ''); + CityName = CityName.replace(/'/g, ''); + values.push(` ('${MID}', '${ChannelId}','${StoreId}','${StoreCode}','${EmpId}','${MerchandiserId || 0}', '${VisitDate}','${ChainId}','${ChainName}','${StoreName}', '${Address}','${Location}','${Landmark}','${CityId}', '${CityName}','${StateId}','${StateName}','${RegionId}', '${StoreTypeId}', '${StoreType}', '${Pincode}', '${Latitude}', '${Longitude}', '${Phone}', '${Mobile}', '${ContactPerson}', '${Email}' , '${Deviation}', '${UploadStatus}', '${GeoTag}', '${GeoFenceRadius}', '${InTime}','${OutTime}','${CameraAllow}')`); + }); + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_JourneyPlanStorewiseSup(MID, ChannelId, StoreId, StoreCode, EmpId, MerchandiserId,VisitDate, ChainId, ChainName, StoreName, Address, Location, Landmark, CityId, CityName, StateId, StateName, RegionId, StoreTypeId, StoreType, Pincode, Latitude, Longitude, Phone, Mobile, ContactPerson, Email,Deviation, UploadStatus, GeoTag, GeoFenceRadius,InTime,OutTime,CameraAllow) + values ${all_vals}`; + db.transaction(function (txn) { + txn.executeSql(`delete from Sup_JourneyPlanStorewiseSup where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_JourneyPlanStorewiseSup added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr1) { + console.log(txnerr1) + resolve(true); + }); + }, function (txn1, txnerr1) { + console.log(txnerr1) + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_JourneyPlanStorewiseSup'], false, 'Sup_JourneyPlanStorewiseSup'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_JourneyPlanStorewiseSup'], true, 'Sup_JourneyPlanStorewiseSup', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_JourneyPlanStorewiseSup'], true, 'Sup_JourneyPlanStorewiseSup', res); + resolve(false); + } + break; + } + + case 'Sup_NPNDStore': { + console.log("res:", res); + if (res != null && typeof res == 'object' && res.Sup_NPNDStore != null && res.Sup_NPNDStore != '') { + let data_arr = res.Sup_NPNDStore || []; + var values = []; + data_arr.map((data_obj) => { + let { MID, ChannelId, StoreId, StoreCode, EmpId, MerchandiserId, VisitDate, ChainId, ChainName, StoreName, Address, Location, Landmark, CityId, CityName, StateId, StateName, RegionId, StoreTypeId, StoreType, Pincode, Latitude, Longitude, Phone, Mobile, ContactPerson, Email, UploadStatus, GeoTag, GeoFenceRadius, InTime, OutTime, CameraAllow } = data_obj; + StoreName = StoreName.replace(/'/g, ''); + Address = Address.replace(/'/g, ''); + StateName = StateName.replace(/'/g, ''); + CityName = CityName.replace(/'/g, ''); + values.push(` ('${MID}', '${ChannelId}','${StoreId}','${StoreCode}','${EmpId}','${MerchandiserId}', '${VisitDate}','${ChainId}','${ChainName}','${StoreName}', '${Address}','${Location}','${Landmark}','${CityId}', '${CityName}','${StateId}','${StateName}','${RegionId}', '${StoreTypeId}', '${StoreType}', '${Pincode}', '${Latitude}', '${Longitude}', '${Phone}', '${Mobile}', '${ContactPerson}', '${Email}' , '${UploadStatus}', '${GeoTag}', '${GeoFenceRadius}', '${InTime}','${OutTime}','${CameraAllow}')`); + }); + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_NPNDStore(MID, ChannelId, StoreId, StoreCode, EmpId, MerchandiserId,VisitDate, ChainId, ChainName, StoreName, Address, Location, Landmark, CityId, CityName, StateId, StateName, RegionId, StoreTypeId, StoreType, Pincode, Latitude, Longitude, Phone, Mobile, ContactPerson, Email, UploadStatus, GeoTag, GeoFenceRadius,InTime,OutTime,CameraAllow) + values ${all_vals}`; + db.transaction(function (txn) { + txn.executeSql(`delete from Sup_NPNDStore where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_NPNDStore added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr1) { + console.log(txnerr1) + resolve(true); + }); + }, function (txn1, txnerr1) { + console.log(txnerr1) + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_NPNDStore'], false, 'Sup_NPNDStore'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_NPNDStore'], true, 'Sup_NPNDStore', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_NPNDStore'], true, 'Sup_NPNDStore', res); + resolve(false); + } + break; + } + + case 'Sup_JourneyPlanStorewiseSup_Adhoc': { + if (res != null && typeof res == 'object' && res.Sup_JourneyPlanStorewiseSup_Adhoc != null && res.Sup_JourneyPlanStorewiseSup_Adhoc != '') { + let data_arr = res.Sup_JourneyPlanStorewiseSup_Adhoc || []; + var values = []; + data_arr.map((data_obj) => { + let { MID, ChannelId, StoreId, StoreCode, EmpId, MerchandiserId, VisitDate, ChainId, ChainName, StoreName, Address, Location, Landmark, CityId, CityName, StateId, StateName, RegionId, StoreTypeId, StoreType, Pincode, Latitude, Longitude, Phone, Mobile, ContactPerson, Email, UploadStatus, GeoTag, GeoFenceRadius, InTime, OutTime, CameraAllow } = data_obj; + StoreName = StoreName.replace(/'/g, ''); + Address = Address.replace(/'/g, ''); + StateName = StateName.replace(/'/g, ''); + CityName = CityName.replace(/'/g, ''); + values.push(` ('${MID}', '${ChannelId}','${StoreId}','${StoreCode}','${EmpId}', '${MerchandiserId}','${VisitDate}','${ChainId}','${ChainName}','${StoreName}', '${Address}','${Location}','${Landmark}','${CityId}', '${CityName}','${StateId}','${StateName}','${RegionId}', '${StoreTypeId}', '${StoreType}', '${Pincode}', '${Latitude}', '${Longitude}', '${Phone}', '${Mobile}', '${ContactPerson}', '${Email}','${UploadStatus}', '${GeoTag}', '${GeoFenceRadius}', '${InTime}','${OutTime}','${CameraAllow}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_JourneyPlanStorewiseSup_Adhoc(MID, ChannelId, StoreId, StoreCode, EmpId, MerchandiserId,VisitDate, ChainId, ChainName, StoreName, Address, Location, Landmark, CityId, CityName, StateId, StateName, RegionId, StoreTypeId, StoreType, Pincode, Latitude, Longitude, Phone, Mobile, ContactPerson, Email, UploadStatus, GeoTag, GeoFenceRadius,InTime,OutTime,CameraAllow) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_JourneyPlanStorewiseSup_Adhoc where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_JourneyPlanStorewiseSup_Adhoc added'); + setTaskResponse(data_arr); + resolve(true); + }, + function (Etxn, err) { + console.log('err:', err); + resolve(true); + }); + }, function (Etxn, err) { + console.log('err:', err); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_JourneyPlanStorewiseSup_Adhoc'], false, 'Sup_JourneyPlanStorewiseSup_Adhoc'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_JourneyPlanStorewiseSup_Adhoc'], true, 'Sup_JourneyPlanStorewiseSup_Adhoc', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_JourneyPlanStorewiseSup_Adhoc'], true, 'Sup_JourneyPlanStorewiseSup_Adhoc', res); + resolve(false); + } + break; + } + + case 'Sup_Menu_Master': { + if (res != null && typeof res == 'object' && res.Sup_Menu_Master != null && res.Sup_Menu_Master != '') { + let data_arr = res.Sup_Menu_Master || []; + + var values = []; + data_arr.map((data_obj) => { + let { MenuId, MenuName, NormalIcon, TickIcon, GreyIcon, MenuPath, MenuSequence, ScreenName } = data_obj; + values.push(` ('${MenuId}', '${MenuName}', '${NormalIcon}', '${TickIcon}', '${GreyIcon}', '${MenuPath}', '${MenuSequence}', '${ScreenName}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Menu_Master(MenuId,MenuName,NormalIcon,TickIcon,GreyIcon,MenuPath,MenuSequence,ScreenName) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Menu_Master where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Menu_Master added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Menu_Master'], false, 'Sup_Menu_Master'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Menu_Master'], true, 'Sup_Menu_Master', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Menu_Master'], true, 'Sup_Menu_Master', res); + resolve(false); + } + break; + } + + case 'Mapping_MenuSup': { + if (res != null && typeof res == 'object' && res.Mapping_MenuSup != null && res.Mapping_MenuSup != '') { + let data_arr = res.Mapping_MenuSup || []; + + var values = []; + data_arr.map((data_obj) => { + let { MenuId, VisitType } = data_obj; + values.push(` ('${MenuId}','${VisitType}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Mapping_MenuSup(MenuId,VisitType) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Mapping_MenuSup where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Mapping_MenuSup added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Mapping_MenuSup'], false, 'Mapping_MenuSup'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Mapping_MenuSup'], true, 'Mapping_MenuSup', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Mapping_MenuSup'], true, 'Mapping_MenuSup', res); + resolve(false); + } + break; + } + + case 'Sup_ImageType': { + if (res != null && typeof res == 'object' && res.Sup_ImageType != null && res.Sup_ImageType != '') { + let data_arr = res.Sup_ImageType || []; + var values = []; + data_arr.map((data_obj) => { + let { ImageTypeId, ImageType } = data_obj; + values.push(` ('${ImageTypeId}','${ImageType}')`); + }); + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_ImageType(ImageTypeId, ImageType) + values ${all_vals}`; + db.transaction(function (txn) { + txn.executeSql(`delete from Sup_ImageType where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_ImageType added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr1) { + console.log(txnerr1); + resolve(true); + }); + }, function (txn1, txnerr1) { + console.log(txnerr1); + resolve(true); + }); + }); + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_ImageType'], false, 'Sup_ImageType'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_ImageType'], true, 'Sup_ImageType', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_ImageType'], true, 'Sup_ImageType', res); + resolve(false); + } + break; + } + + case 'Sup_Master_ActivationType': { + if (res != null && typeof res == 'object' && res.Sup_Master_ActivationType != null && res.Sup_Master_ActivationType != '') { + let data_arr = res.Sup_Master_ActivationType || []; + var values = []; + data_arr.map((data_obj) => { + let { ActivationTypeId, ActivationType, ShowContactFlag } = data_obj; + values.push(` ('${ActivationTypeId}','${ActivationType}','${ShowContactFlag}')`); + }); + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Master_ActivationType(ActivationTypeId, ActivationType,ShowContactFlag) + values ${all_vals}`; + db.transaction(function (txn) { + txn.executeSql(`delete from Sup_Master_ActivationType where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_ActivationType added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr1) { + console.log(txnerr1); + resolve(true); + }); + }, function (txn1, txnerr1) { + console.log(txnerr1); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Master_ActivationType'], false, 'Sup_Master_ActivationType'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Master_ActivationType'], true, 'Sup_Master_ActivationType', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Master_ActivationType'], true, 'Sup_Master_ActivationType', res); + resolve(false); + } + break; + } + + case 'Sup_Master_SkuSize': { + if (res != null && typeof res == 'object' && res.Sup_Master_SkuSize != null && res.Sup_Master_SkuSize != '') { + let data_arr = res.Sup_Master_SkuSize || []; + var values = []; + data_arr.map((data_obj) => { + let { SkuSize } = data_obj; + values.push(` ('${SkuSize}')`); + }); + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Master_SkuSize(SkuSize) + values ${all_vals}`; + db.transaction(function (txn) { + txn.executeSql(`delete from Sup_Master_SkuSize where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_SkuSize added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr1) { + console.log(txnerr1); + resolve(true); + }); + }, function (txn1, txnerr1) { + console.log(txnerr1); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Master_SkuSize'], false, 'Sup_Master_SkuSize'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Master_SkuSize'], true, 'Sup_Master_SkuSize', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Master_SkuSize'], true, 'Sup_Master_SkuSize', res); + resolve(false); + } + break; + } + + case 'Sup_Master_ProductFlavour': { + if (res.Sup_Master_ProductFlavour) { + let data_arr = res.Sup_Master_ProductFlavour || []; + var values = []; + data_arr.map((data_obj) => { + let { ProductFlavour } = data_obj; + values.push(` ('${ProductFlavour}')`); + }); + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Master_ProductFlavour(ProductFlavour) + values ${all_vals}`; + db.transaction(function (txn) { + txn.executeSql(`delete from Sup_Master_ProductFlavour where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_ProductFlavour added'); + setTaskResponse(data_arr); + }, function (txn1, txnerr1) { console.log(txnerr1) }); + }, function (txn1, txnerr1) { console.log(txnerr1) }); + }); + + } + else if (res != null && typeof (res) == 'object' && (res.success == false || (res[0] != null && res[0].Result != null))) { + // console.log('No data found'); + onNoData(['No data for Sup_Master_ProductFlavour'], false, 'Sup_Master_ProductFlavour'); + } + else { onNoData(['No data for Sup_Master_ProductFlavour']); } + break; + } + + case 'Sup_Master_ProductPack': { + if (res != null && typeof res == 'object' && res.Sup_Master_ProductPack != null && res.Sup_Master_ProductPack != '') { + let data_arr = res.Sup_Master_ProductPack || []; + var values = []; + data_arr.map((data_obj) => { + let { PackName } = data_obj; + values.push(` ('${PackName}')`); + }); + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Master_ProductPack(PackName) + values ${all_vals}`; + db.transaction(function (txn) { + txn.executeSql(`delete from Sup_Master_ProductPack where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_ProductPack added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr1) { + console.log(txnerr1); + resolve(true); + }); + }, function (txn1, txnerr1) { + console.log(txnerr1); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Master_ProductPack'], false, 'Sup_Master_ProductPack'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Master_ProductPack'], true, 'Sup_Master_ProductPack', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Master_ProductPack'], true, 'Sup_Master_ProductPack', res); + resolve(false); + } + break; + } + + case 'Sup_JourneyPlan': { + + if (res != null && typeof res == 'object' && res.Sup_JourneyPlan != null && res.Sup_JourneyPlan != '') { + let data_arr = res.Sup_JourneyPlan || []; + + var values = []; + data_arr.map((data_obj) => { + let { MID, ChannelId, StoreId, StoreCode, EmpId, MerchandiserId, VisitDate, ChainId, ChainName, StoreName, Address, Location, Landmark, CityId, CityName, StateId, StateName, RegionId, StoreTypeId, StoreType, Pincode, Latitude, Longitude, Phone, Mobile, ContactPerson, Email, UploadStatus, GeoTag, GeoFenceRadius, InTime, OutTime, CameraAllow } = data_obj; + values.push(` ('${MID}', '${ChannelId}', '${StoreId}', '${StoreCode}', '${EmpId}', '${MerchandiserId}', '${VisitDate}', '${ChainId}', '${ChainName}', '${StoreName}', '${Address}', '${Location}', '${Landmark}', '${CityId}', '${CityName}', '${StateId}', '${StateName}', '${RegionId}', '${StoreTypeId}', '${StoreType}', '${Pincode}', '${Latitude}', '${Longitude}', '${Phone}', '${Mobile}', '${ContactPerson}', '${Email}', '${UploadStatus}', '${GeoTag}', '${GeoFenceRadius}', '${InTime}', '${OutTime}', '${CameraAllow}')`); + }); + + var all_vals = values.join(','); + + var sql_stmnt = `INSERT INTO Sup_JourneyPlan(MID,ChannelId,StoreId,StoreCode,EmpId,MerchandiserId,VisitDate,ChainId,ChainName,StoreName,Address,Location,Landmark,CityId,CityName,StateId,StateName,RegionId,StoreTypeId,StoreType,Pincode,Latitude,Longitude,Phone,Mobile,ContactPerson,Email,UploadStatus,GeoTag,GeoFenceRadius,InTime,OutTime,CameraAllow) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_JourneyPlan where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_JourneyPlan added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_JourneyPlan'], false, 'Sup_JourneyPlan'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_JourneyPlan'], true, 'Sup_JourneyPlan', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_JourneyPlan'], true, 'Sup_JourneyPlan', res); + resolve(false); + } + break; + } + + case 'Sup_AdhocJourneyPlan': { + if (res != null && typeof res == 'object' && res.Sup_AdhocJourneyPlan != null && res.Sup_AdhocJourneyPlan != '') { + let data_arr = res.Sup_AdhocJourneyPlan || []; + var values = []; + data_arr.map((data_obj) => { + let { MID, ChannelId, StoreId, StoreCode, EmpId, VisitDate, ChainId, ChainName, StoreName, Address, Location, Landmark, CityId, CityName, StateId, StateName, RegionId, StoreTypeId, StoreType, Pincode, Latitude, Longitude, Phone, Mobile, ContactPerson, Email, UploadStatus, GeoTag, GeoFenceRadius, ExpiryStock, InTime, OutTime } = data_obj; + values.push(` ('${MID}', '${ChannelId}','${StoreId}','${StoreCode}','${EmpId}', '${VisitDate}','${ChainId}','${ChainName}','${StoreName}', '${Address}','${Location}','${Landmark}','${CityId}', '${CityName}','${StateId}','${StateName}','${RegionId}', '${StoreTypeId}', '${StoreType}', '${Pincode}', '${Latitude}', '${Longitude}', '${Phone}', '${Mobile}', '${ContactPerson}', '${Email}', '${UploadStatus}', '${GeoTag}', '${GeoFenceRadius}', '${ExpiryStock}','${InTime}','${OutTime}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_AdhocJourneyPlan(MID, ChannelId, StoreId, StoreCode, EmpId, VisitDate, ChainId, ChainName, StoreName, Address, Location, Landmark, CityId, CityName, StateId, StateName, RegionId, StoreTypeId, StoreType, Pincode, Latitude, Longitude, Phone, Mobile, ContactPerson, Email, UploadStatus, GeoTag, GeoFenceRadius, ExpiryStock,InTime,OutTime) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_AdhocJourneyPlan where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_AdhocJourneyPlan added'); + setTaskResponse(data_arr); + resolve(true); + }, + function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_AdhocJourneyPlan'], false, 'Sup_AdhocJourneyPlan'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_AdhocJourneyPlan'], true, 'Sup_AdhocJourneyPlan', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_AdhocJourneyPlan'], true, 'Sup_AdhocJourneyPlan', res); + resolve(false); + } + break; + } + + case 'Sup_MasterDistributor': { + + if (res != null && typeof res == 'object' && res.Sup_MasterDistributor != null && res.Sup_MasterDistributor != '') { + let data_arr = res.Sup_MasterDistributor || []; + + var values = []; + data_arr.map((data_obj) => { + let { DMID, EmpId, DistributorId, DistributorName, DistributorCode, Latitude, Longitude, InTime, OutTime, UploadStatus, GeoTag } = data_obj; + values.push(` ('${DMID}', '${EmpId}', '${DistributorId}', '${DistributorName}', '${DistributorCode}', '${Latitude}','${InTime}', '${OutTime}', '${Longitude}','${UploadStatus}', '${GeoTag}')`); + }); + + var all_vals = values.join(','); + + var sql_stmnt = `INSERT INTO Sup_MasterDistributor(DMID,EmpId,DistributorId,DistributorName,DistributorCode,Latitude,InTime,OutTime,Longitude,UploadStatus,GeoTag) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_MasterDistributor where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_MasterDistributor added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_MasterDistributor'], false, 'Sup_MasterDistributor'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_MasterDistributor'], true, 'Sup_MasterDistributor', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_MasterDistributor'], true, 'Sup_MasterDistributor', res); + resolve(false); + } + break; + } + + case 'Sup_Non_Working_ReasonDistributor': { + + if (res != null && typeof res == 'object' && res.Sup_Non_Working_ReasonDistributor != null && res.Sup_Non_Working_ReasonDistributor != '') { + let data_arr = res.Sup_Non_Working_ReasonDistributor || []; + + var values = []; + data_arr.map((data_obj) => { + let { ReasonId, Reason, EntryAllow, ImageAllow } = data_obj; + values.push(` ('${ReasonId}', '${Reason}', '${EntryAllow}', '${ImageAllow}')`); + }); + + var all_vals = values.join(','); + + var sql_stmnt = `INSERT INTO Sup_Non_Working_ReasonDistributor(ReasonId,Reason,EntryAllow,ImageAllow) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Non_Working_ReasonDistributor where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Non_Working_ReasonDistributor added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Non_Working_ReasonDistributor'], false, 'Sup_Non_Working_ReasonDistributor'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Non_Working_ReasonDistributor'], true, 'Sup_Non_Working_ReasonDistributor', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Non_Working_ReasonDistributor'], true, 'Sup_Non_Working_ReasonDistributor', res); + resolve(false); + } + break; + } + + case 'Mapping_MenuDistributorPointSup': { + + if (res != null && typeof res == 'object' && res.Mapping_MenuDistributorPointSup != null && res.Mapping_MenuDistributorPointSup != '') { + let data_arr = res.Mapping_MenuDistributorPointSup || []; + + var values = []; + data_arr.map((data_obj) => { + let { MenuId } = data_obj; + values.push(` ('${MenuId}')`); + }); + + var all_vals = values.join(','); + + var sql_stmnt = `INSERT INTO Mapping_MenuDistributorPointSup(MenuId) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Mapping_MenuDistributorPointSup where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Mapping_MenuDistributorPointSup added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }, function (txn1, err) { + console.log('err:', err); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Mapping_MenuDistributorPointSup'], false, 'Mapping_MenuDistributorPointSup'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Mapping_MenuDistributorPointSup'], true, 'Mapping_MenuDistributorPointSup', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Mapping_MenuDistributorPointSup'], true, 'Mapping_MenuDistributorPointSup', res); + resolve(false); + } + break; + } + + case 'Mapping_MenuDistributorPointSup': { + if (res != null && typeof res == 'object' && res.Mapping_MenuDistributorPointSup != null && res.Mapping_MenuDistributorPointSup != '') { + let data_arr = res.Mapping_MenuDistributorPointSup || []; + var values = []; + data_arr.map((data_obj) => { + let { MenuId } = data_obj; + values.push(` ('${MenuId}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Mapping_MenuDistributorPointSup(MenuId) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Mapping_MenuDistributorPointSup where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Mapping_MenuDistributorPointSup added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Mapping_MenuDistributorPointSup'], false, 'Mapping_MenuDistributorPointSup'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Mapping_MenuDistributorPointSup'], true, 'Mapping_MenuDistributorPointSup', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Mapping_MenuDistributorPointSup'], true, 'Mapping_MenuDistributorPointSup', res); + resolve(false); + } + break; + } + + case 'Sup_Distributor_PreviousVisicooler': { + if (res != null && typeof res == 'object' && res.Sup_Distributor_PreviousVisicooler != null && res.Sup_Distributor_PreviousVisicooler != '') { + let data_arr = res.Sup_Distributor_PreviousVisicooler || []; + var values = []; + data_arr.map((data_obj) => { + let { DistributorId, VisitDate, VC_QRCode, VC_AssetCode } = data_obj; + values.push(` ('${DistributorId}','${VisitDate}','${VC_QRCode}','${VC_AssetCode}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Distributor_PreviousVisicooler(DistributorId,VisitDate,VC_QRCode,VC_AssetCode) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Distributor_PreviousVisicooler where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Distributor_PreviousVisicooler added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Distributor_PreviousVisicooler'], false, 'Sup_Distributor_PreviousVisicooler'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Distributor_PreviousVisicooler'], true, 'Sup_Distributor_PreviousVisicooler', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Distributor_PreviousVisicooler'], true, 'Sup_Distributor_PreviousVisicooler', res); + resolve(false); + } + break; + } + + case 'Sup_Product_Master': { + if (res != null && typeof res == 'object' && res.Sup_Product_Master != null && res.Sup_Product_Master != '') { + let data_arr = res.Sup_Product_Master || []; + var values = []; + data_arr.map((data_obj, index) => { + let { ProductId, ProductCode, ProductName, Mrp, BrandId, BrandName, SubCategoryId, SubCategoryName, CategoryId, CategoryName, CompanyId, ProductSequence, BrandSequence, SubCategorySequence, CategorySequence, IsCompetitor } = data_obj; + values.push(` ('${ProductId}', '${ProductCode}','${ProductName}','${Mrp}','${BrandId}', '${BrandName}','${SubCategoryId}','${SubCategoryName}','${CategoryId}', '${CategoryName}','${CompanyId}','${ProductSequence}','${BrandSequence}', '${SubCategorySequence}','${CategorySequence}','${(IsCompetitor == true ? 1 : 0)}')`); + + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Product_Master(ProductId, ProductCode, ProductName, Mrp, BrandId, BrandName, SubCategoryId, SubCategoryName, CategoryId, CategoryName, CompanyId, ProductSequence, BrandSequence, SubCategorySequence, CategorySequence,IsCompetitor) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Product_Master where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Product_Master added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log(txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log(txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Product_Master'], false, 'Sup_Product_Master'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Product_Master'], true, 'Sup_Product_Master', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Product_Master'], true, 'Sup_Product_Master', res); + resolve(false); + } + break; + } + + + case 'Sup_NonWorkingReason': { + if (res != null && typeof res == 'object' && res.Sup_NonWorkingReason != null && res.Sup_NonWorkingReason != '') { + let data_arr = res.Sup_NonWorkingReason || []; + var values = []; + data_arr.map((data_obj) => { + let { ReasonId, Reason, EntryAllow, ImageAllow, GPSMandatory, ShowAttendance, ShowStore } = data_obj; + values.push(` ('${ReasonId}', '${Reason}', '${(EntryAllow == true ? 1 : 0)}', '${(ImageAllow == true ? 1 : 0)}', '${(GPSMandatory == true ? 1 : 0)}', '${(ShowAttendance == true ? 1 : 0)}', '${(ShowStore == true ? 1 : 0)}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_NonWorkingReason(ReasonId,Reason,EntryAllow,ImageAllow,GPSMandatory,ShowAttendance,ShowStore) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_NonWorkingReason where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_NonWorkingReason added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_NonWorkingReason'], false, 'Sup_NonWorkingReason'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_NonWorkingReason'], true, 'Sup_NonWorkingReason', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_NonWorkingReason'], true, 'Sup_NonWorkingReason', res); + resolve(false); + } + break; + } + + case 'Sup_Master_Competitor': { + if (res != null && typeof res == 'object' && res.Sup_Master_Competitor != null && res.Sup_Master_Competitor != '') { + let data_arr = res.Sup_Master_Competitor || []; + console.log('data_arr', data_arr) + var values = []; + data_arr.map((data_obj) => { + let { CompanyId, Company, CategoryId, CategoryName, SubCategoryId, SubCategoryName, BrandId, BrandName, SubBrandId, SubBrandName, ProductId, ProductName } = data_obj; + values.push(` ('${CompanyId}', '${Company}', '${CategoryId}' , '${CategoryName}', '${SubCategoryId}', '${SubCategoryName}', '${BrandId}', '${BrandName}', '${SubBrandId}', '${SubBrandName}', '${ProductId}', '${ProductName}')`); + }); + + var all_vals = values.join(','); + console.log('') + var sql_stmnt = `INSERT INTO Sup_Master_Competitor(CompanyId, Company, CategoryId, CategoryName, SubCategoryId, SubCategoryName, BrandId, BrandName,SubBrandId, SubBrandName, ProductId, ProductName) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Master_Competitor where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_Competitor added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Master_Competitor'], false, 'Sup_Master_Competitor'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Master_Competitor'], true, 'Sup_Master_Competitor', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Master_Competitor'], true, 'Sup_Master_Competitor', res); + resolve(false); + } + break; + } + + case 'Sup_Master_Display': { + if (res != null && typeof res == 'object' && res.Sup_Master_Display != null && res.Sup_Master_Display != '') { + let data_arr = res.Sup_Master_Display || []; + var values = []; + data_arr.map((data_obj) => { + let { DisplayId, DisplayName, RefImage } = data_obj; + values.push(` ('${DisplayId}', '${DisplayName}', '${RefImage}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Master_Display(DisplayId, DisplayName, RefImage) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Master_Display where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_Display added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Master_Display'], false, 'Sup_Master_Display'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Master_Display'], true, 'Sup_Master_Display', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Master_Display'], true, 'Sup_Master_Display', res); + resolve(false); + } + break; + } + + case 'Sup_AttendanceStatus': { + if (res != null && typeof res == 'object' && res.Sup_AttendanceStatus != null && res.Sup_AttendanceStatus != '') { + let data_arr = res.Sup_AttendanceStatus || []; + console.log('data_arr', data_arr) + var values = [], RsnId = ''; + data_arr.map((data_obj) => { + + let { ReasonId } = data_obj; + RsnId = ReasonId; + values.push(` ('${ReasonId}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_AttendanceStatus(ReasonId) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_AttendanceStatus where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], async function (txn1, txnres) { + console.log('Sup_AttendanceStatus added'); + // let isInserted=await InsertAttendance(RsnId); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_AttendanceStatus'], false, 'Sup_AttendanceStatus'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_AttendanceStatus'], true, 'Sup_AttendanceStatus', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_AttendanceStatus'], true, 'Sup_AttendanceStatus', res); + resolve(false); + } + break; + } + + case 'Sup_Master_MenuReports': { + if (res != null && typeof res == 'object' && res.Sup_Master_MenuReports != null && res.Sup_Master_MenuReports != '') { + let data_arr = res.Sup_Master_MenuReports || []; + var values = []; + data_arr.map((data_obj) => { + let { ReportId, ReportName, ReportType, DownloadKey, ColumnConfig } = data_obj; + values.push(` ('${ReportId}', '${ReportName}', '${ReportType}','${DownloadKey}','${ColumnConfig}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Master_MenuReports(ReportId,ReportName,ReportType,DownloadKey,ColumnConfig) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Master_MenuReports where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_MenuReports added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Master_MenuReports'], false, 'Sup_Master_MenuReports'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Master_MenuReports'], true, 'Sup_Master_MenuReports', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Master_MenuReports'], true, 'Sup_Master_MenuReports', res); + resolve(false); + } + break; + } + + case 'Sup_Master_PromoType': { + if (res != null && typeof res == 'object' && res.Sup_Master_PromoType != null && res.Sup_Master_PromoType != '') { + let data_arr = res.Sup_Master_PromoType || []; + + var values = []; + data_arr.map((data_obj) => { + let { PromoTypeId, PromoType } = data_obj; + values.push(` ('${PromoTypeId}','${PromoType}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Master_PromoType(PromoTypeId,PromoType) + values ${all_vals}`; + console.log('sql_stmnt', sql_stmnt) + console.log('values', values) + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Master_PromoType where 1=1`, [], function (txn1, txnres) { + console.log('txnres', txnres) // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_PromoType added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Master_PromoType'], false, 'Sup_Master_PromoType'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Master_PromoType'], true, 'Sup_Master_PromoType', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Master_PromoType'], true, 'Sup_Master_PromoType', res); + resolve(false); + } + break; + } + + case 'Sup_Master_SurveyQuestion': { + + if (res != null && typeof res == 'object' && res.Sup_Master_SurveyQuestion != null && res.Sup_Master_SurveyQuestion != '') { + let data_arr = res.Sup_Master_SurveyQuestion || []; + console.log('surveys:', data_arr.length) + var values = []; + data_arr.map((data_obj) => { + let { SurveyId, SurveyName, CategoryId, Category, CategorySequence, QuestionId, Question, QuestionType, QuestionImageAllow, QEnable, LengthValidation, MinLength, MaxLength, OTP, DateRange, QuestionSequence, AnswerId, Answer, ImageAllow1, ImageAllow2, EnableQuestion, DisableQuestion, AnswerSequence, ShowCat, SubCategoryId, SubCategory, SubCategorySequence, MenuId, QuestionTypeNew, QuestionImageMandatory, Image1Mandatory, Image2Mandatory, CalFormula, RefImage, QuestionRefImage } = data_obj; + values.push(` ('${SurveyId}','${SurveyName}','${CategoryId}','${Category}','${CategorySequence}','${QuestionId}','${Question}','${QuestionType}','${QuestionImageAllow}','${QEnable}','${LengthValidation}','${MinLength}','${MaxLength}','${OTP}','${DateRange}','${QuestionSequence}','${AnswerId}','${Answer}','${ImageAllow1}','${ImageAllow2}','${EnableQuestion}','${DisableQuestion}','${AnswerSequence}','${(ShowCat == true ? 1 : 0)}','${SubCategoryId}','${SubCategory}','${SubCategorySequence}','${MenuId}','${QuestionTypeNew}','${QuestionImageMandatory}','${Image1Mandatory}','${Image2Mandatory}','${CalFormula}','${RefImage}','${QuestionRefImage}')`); + }); + + console.log('sdjh') + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Master_SurveyQuestion(SurveyId, SurveyName, CategoryId, Category, CategorySequence, QuestionId, Question, QuestionType, QuestionImageAllow, QEnable, LengthValidation, MinLength, MaxLength, OTP, DateRange, QuestionSequence, AnswerId, Answer, ImageAllow1, ImageAllow2, EnableQuestion, DisableQuestion, AnswerSequence,ShowCat, SubCategoryId,SubCategory, SubCategorySequence,MenuId,QuestionTypeNew,QuestionImageMandatory,Image1Mandatory,Image2Mandatory,CalFormula,RefImage,QuestionRefImage) + values ${all_vals}`; + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Master_SurveyQuestion where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_SurveyQuestion added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Master_SurveyQuestion'], false, 'Sup_Master_SurveyQuestion'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Master_SurveyQuestion'], true, 'Sup_Master_SurveyQuestion', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Master_SurveyQuestion'], true, 'Sup_Master_SurveyQuestion', res); + resolve(false); + } + break; + } + + case 'Mapping_SurveySup': { + + if (res != null && typeof res == 'object' && res.Mapping_SurveySup != null && res.Mapping_SurveySup != '') { + let data_arr = res.Mapping_SurveySup || []; + console.log('surveys:', data_arr.length) + var values = []; + data_arr.map((data_obj) => { + let { SurveyId, StoreId } = data_obj; + values.push(` ('${SurveyId}','${StoreId}')`); + }); + + console.log('sdjh') + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Mapping_SurveySup(SurveyId, StoreId) + values ${all_vals}`; + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Mapping_SurveySup where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Mapping_SurveySup added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Mapping_SurveySup'], false, 'Mapping_SurveySup'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Mapping_SurveySup'], true, 'Mapping_SurveySup', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Mapping_SurveySup'], true, 'Mapping_SurveySup', res); + resolve(false); + } + break; + } + + case 'Sup_Mapping_VisibilityQuestion': { + + if (res != null && typeof res == 'object' && res.Sup_Mapping_VisibilityQuestion != null && res.Sup_Mapping_VisibilityQuestion!= '') { + let data_arr = res.Sup_Mapping_VisibilityQuestion || []; + console.log('Sup_Mapping_VisibilityQuestion:', data_arr.length) + var values = []; + data_arr.map((data_obj) => { + let { VisibilityDefinitionId, VisibilityQuestionId } = data_obj; + values.push(` ('${VisibilityDefinitionId}','${VisibilityQuestionId}')`); + }); + + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Mapping_VisibilityQuestion(VisibilityDefinitionId, VisibilityQuestionId) + values ${all_vals}`; + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Mapping_VisibilityQuestion where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Mapping_VisibilityQuestion added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Mapping_VisibilityQuestion'], false, 'Sup_Mapping_VisibilityQuestion'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Mapping_VisibilityQuestion'], true, 'Sup_Mapping_VisibilityQuestion', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Mapping_VisibilityQuestion'], true, 'Sup_Mapping_VisibilityQuestion', res); + resolve(false); + } + break; + } + + + case 'Sup_Master_VisibilityStockDefinition': { + + if (res != null && typeof res == 'object' && res.Sup_Master_VisibilityStockDefinition != null && res.Sup_Master_VisibilityStockDefinition!= '') { + let data_arr = res.Sup_Master_VisibilityStockDefinition || []; + console.log('Sup_Master_VisibilityStockDefinition:', data_arr.length) + let values = []; + data_arr.map((data_obj) => { + let { VisibilityStockDefinitionId, VisibilityDefinitionId,VisibilityStockTable,VisibilityStockField,VisibilityStockValue,VisibilityStockMBQ,ProductName } = data_obj; + values.push(` ('${VisibilityStockDefinitionId}', '${VisibilityDefinitionId}','${VisibilityStockTable}','${VisibilityStockField}','${VisibilityStockValue}','${VisibilityStockMBQ}','${ProductName}')`); + }); + + + let all_vals = values.join(','); + let sql_stmnt = `INSERT INTO Sup_Master_VisibilityStockDefinition(VisibilityStockDefinitionId, VisibilityDefinitionId,VisibilityStockTable,VisibilityStockField,VisibilityStockValue,VisibilityStockMBQ,ProductName) + values ${all_vals}`; + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Master_VisibilityStockDefinition where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_VisibilityStockDefinition added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Mapping_VisibilityQuestion'], false, 'Sup_Mapping_VisibilityQuestion'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Mapping_VisibilityQuestion'], true, 'Sup_Mapping_VisibilityQuestion', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Mapping_VisibilityQuestion'], true, 'Sup_Mapping_VisibilityQuestion', res); + resolve(false); + } + break; + } + + case 'Sup_Master_DetailerContent': { + if (res != null && typeof res == 'object' && res.Sup_Master_DetailerContent != null && res.Sup_Master_DetailerContent != '') { + let data_arr = res.Sup_Master_DetailerContent || []; + console.log('data_arr', data_arr) + var values = []; + data_arr.map((data_obj) => { + let { Id, ContentTypeId, ContentType, Topic, Description, MediaType, FilePath, FName, PublishDate, IconPath, Icon, InnerScreenView, InnerScreenConfig, ContentSequence, DownloadKey, ReportView } = data_obj; + values.push(` ('${Id}','${ContentTypeId}','${ContentType}', '${Topic}', '${Description}', '${MediaType}', '${FilePath}', '${FName}', '${PublishDate}','${IconPath}','${Icon}','${InnerScreenView}','${InnerScreenConfig}','${ContentSequence}','${DownloadKey}','${ReportView}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Master_DetailerContent(Id,ContentTypeId,ContentType,Topic,Description,MediaType,FilePath,FName,PublishDate, IconPath,Icon,InnerScreenView,InnerScreenConfig,ContentSequence,DownloadKey,ReportView) + values ${all_vals}`; + console.log('sql_stmnt', sql_stmnt) + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Master_DetailerContent `, [], function (txn1, txnres) { + // insert or refresh all today dataz + + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_DetailerContent added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Master_DetailerContent'], false, 'Sup_Master_DetailerContent'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Master_DetailerContent'], true, 'Sup_Master_DetailerContent', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Master_DetailerContent'], true, 'Sup_Master_DetailerContent', res); + resolve(false); + } + break; + } + + case 'Mapping_MenuConfiguration_Sup': { + if (res != null && typeof res == 'object' && res.Mapping_MenuConfiguration_Sup != null && res.Mapping_MenuConfiguration_Sup != '') { + let data_arr = res.Mapping_MenuConfiguration_Sup || []; + console.log('data_arr', data_arr) + var values = []; + data_arr.map((data_obj) => { + let { Id, ScreenName, KPIFieldName, KPIFieldDisplayName, KPIFieldEnable, KPISequence, KPIType, KPIMandatory } = data_obj; + values.push(` ('${Id}', '${ScreenName}', '${KPIFieldName}', '${KPIFieldDisplayName}', '${KPIFieldEnable}', '${KPISequence}', '${KPIType}', '${KPIMandatory}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Mapping_MenuConfiguration_Sup(Id,ScreenName,KPIFieldName,KPIFieldDisplayName,KPIFieldEnable,KPISequence,KPIType,KPIMandatory) + values ${all_vals}`; + console.log('sql_stmnt', sql_stmnt) + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Mapping_MenuConfiguration_Sup `, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_TeamList added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Mapping_MenuConfiguration_Sup'], false, 'Mapping_MenuConfiguration_Sup'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Mapping_MenuConfiguration_Sup'], true, 'Mapping_MenuConfiguration_Sup', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Mapping_MenuConfiguration_Sup'], true, 'Mapping_MenuConfiguration_Sup', res); + resolve(false); + } + break; + } + + case 'Sup_Master_VisibilityDefinition': { + + if (res != null && typeof res == 'object' && res.Sup_Master_VisibilityDefinition != null && res.Sup_Master_VisibilityDefinition != '') { + let data_arr = res.Sup_Master_VisibilityDefinition || []; + var values = []; + data_arr.map((data_obj) => { + let { VisibilityDefinitionId, MenuId, MenuName, VisibilityId, VisibilityName, VisibilityTable, VisibilityField, VisibilityValue, ChildName, VisibilityRefImage, VisibilityElementStockRequired, VisibilityElementCheckAssortment, NoOfSplit, VisibilityImage1, VisibilityImage2, VisibilityImage1Lable, VisibilityImage2Lable, VisibilityNotExistCamera, VisibilityExistReasonEnable, VisibilityNotExistReasonEnable, VisibilityImage1CameraGrid, VisibilityImage2CameraGrid, StockQtyRequired, VisiDefSequence } = data_obj; + values.push(` ('${VisibilityDefinitionId}','${MenuId}','${MenuName}','${VisibilityId}','${VisibilityName}','${VisibilityTable}','${VisibilityField}','${VisibilityValue}','${ChildName}','${VisibilityRefImage}','${VisibilityElementStockRequired}','${VisibilityElementCheckAssortment}','${NoOfSplit}','${VisibilityImage1}','${VisibilityImage2}','${VisibilityImage1Lable}','${VisibilityImage2Lable}','${VisibilityNotExistCamera}','${VisibilityExistReasonEnable}','${VisibilityNotExistReasonEnable}','${VisibilityImage1CameraGrid}','${VisibilityImage2CameraGrid}','${StockQtyRequired}','${VisiDefSequence}')`); + }); + + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Master_VisibilityDefinition(VisibilityDefinitionId,MenuId,MenuName,VisibilityId,VisibilityName,VisibilityTable,VisibilityField,VisibilityValue,ChildName,VisibilityRefImage,VisibilityElementStockRequired,VisibilityElementCheckAssortment,NoOfSplit,VisibilityImage1,VisibilityImage2,VisibilityImage1Lable,VisibilityImage2Lable,VisibilityNotExistCamera,VisibilityExistReasonEnable,VisibilityNotExistReasonEnable,VisibilityImage1CameraGrid,VisibilityImage2CameraGrid,StockQtyRequired,VisiDefSequence) + values ${all_vals}`; + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Master_VisibilityDefinition where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_VisibilityDefinition added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Master_VisibilityDefinition'], false, 'Sup_Master_VisibilityDefinition'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Master_VisibilityDefinition'], true, 'Sup_Master_VisibilityDefinition', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Master_VisibilityDefinition'], true, 'Sup_Master_VisibilityDefinition', res); + resolve(false); + } + break; + } + + case 'Sup_Master_VisibilityQuestion': { + if (res != null && typeof res == 'object' && res.Sup_Master_VisibilityQuestion != null && res.Sup_Master_VisibilityQuestion != '') { + let data_arr = res.Sup_Master_VisibilityQuestion || []; + console.log('surveys:', data_arr.length) + var values = []; + data_arr.map((data_obj) => { + let { VisibilityQuestionId, VisibilityQuestionCode, VisibilityQuestionName, QuestionType, VQShowCamera, VQCameraMandatory, VQLengthValidationRequired, VQMinimumChar, VQMaximumChar, VQDecimalPoint, VQDateRangeMin, VQDateRangeMax, VQVoiceLengthInMinutes, VQDefaultQuestionEnable, VisibilityQuestionSequence, VisibilityAnswerId, VisibilityAnswerName, VAShowCamera, VACameraMandatory, VAQuestionEnable, VAQuestionDisable, VASequence } = data_obj; + values.push(` ('${VisibilityQuestionId}','${VisibilityQuestionCode}','${VisibilityQuestionName}','${QuestionType}','${VQShowCamera}','${VQCameraMandatory}','${VQLengthValidationRequired}','${VQMinimumChar}','${VQMaximumChar}','${VQDecimalPoint}','${VQDateRangeMin}','${VQDateRangeMax}','${VQVoiceLengthInMinutes}','${VQDefaultQuestionEnable}','${VisibilityQuestionSequence}','${VisibilityAnswerId}','${VisibilityAnswerName}','${VAShowCamera}','${VACameraMandatory}','${VAQuestionEnable}','${VAQuestionDisable}','${VASequence}')`); + }); + + console.log('sdjh') + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Master_VisibilityQuestion(VisibilityQuestionId,VisibilityQuestionCode,VisibilityQuestionName,QuestionType,VQShowCamera,VQCameraMandatory,VQLengthValidationRequired,VQMinimumChar,VQMaximumChar,VQDecimalPoint,VQDateRangeMin,VQDateRangeMax,VQVoiceLengthInMinutes,VQDefaultQuestionEnable,VisibilityQuestionSequence,VisibilityAnswerId,VisibilityAnswerName,VAShowCamera,VACameraMandatory,VAQuestionEnable,VAQuestionDisable,VASequence) + values ${all_vals}`; + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Master_VisibilityQuestion where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_VisibilityQuestion added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Master_VisibilityQuestion'], false, 'Sup_Master_VisibilityQuestion'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Master_VisibilityQuestion'], true, 'Sup_Master_VisibilityQuestion', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Master_VisibilityQuestion'], true, 'Sup_Master_VisibilityQuestion', res); + resolve(false); + } + break; + } + + case 'Sup_VisibilityAudit': { + if (res != null && typeof res == 'object' && res.Sup_VisibilityAudit != null && res.Sup_VisibilityAudit != '') { + let data_arr = res.Sup_VisibilityAudit || []; + console.log('surveys:', data_arr.length) + var values = []; + data_arr.map((data_obj) => { + let { VId, MID, StoreId, LastVisitDate, VisibilityDefinitionId, Present, VisibilityReasonId, VisibilityImages, VisibilityQuestion } = data_obj; + values.push(` ('${VId}','${MID}','${StoreId}','${LastVisitDate}','${VisibilityDefinitionId}','${Present}','${VisibilityReasonId}','${VisibilityImages}','${VisibilityQuestion}')`); + }); + + console.log('sdjh') + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_VisibilityAudit(VId,MID,StoreId,LastVisitDate,VisibilityDefinitionId,Present,VisibilityReasonId,VisibilityImages,VisibilityQuestion) + values ${all_vals}`; + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_VisibilityAudit where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_VisibilityAudit added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_VisibilityAudit'], false, 'Sup_VisibilityAudit'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_VisibilityAudit'], true, 'Sup_VisibilityAudit', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_VisibilityAudit'], true, 'Sup_VisibilityAudit', res); + resolve(false); + } + break; + } + + case 'Sup_Master_VisibilityReason': { + if (res != null && typeof res == 'object' && res.Sup_Master_VisibilityReason != null && res.Sup_Master_VisibilityReason != '') { + let data_arr = res.Sup_Master_VisibilityReason || []; + var values = []; + data_arr.map((data_obj) => { + let { VisibilityReasonId, VisibilityReason, MenuId, IsRemarkTaken } = data_obj; + values.push(` ('${VisibilityReasonId}','${VisibilityReason}','${MenuId}','${IsRemarkTaken}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Master_VisibilityReason(VisibilityReasonId,VisibilityReason,MenuId,IsRemarkTaken) + values ${all_vals}`; + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Master_VisibilityReason where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_VisibilityReason added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Master_VisibilityReason'], false, 'Sup_Master_VisibilityReason'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Master_VisibilityReason'], true, 'Sup_Master_VisibilityReason', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Master_VisibilityReason'], true, 'Sup_Master_VisibilityReason', res); + resolve(false); + } + break; + } + + case 'Sup_Master_PosSaleReason': { + if (res != null && typeof res == 'object' && res.Sup_Master_PosSaleReason != null && res.Sup_Master_PosSaleReason != '') { + let data_arr = res.Sup_Master_PosSaleReason || []; + // data_arr.push({"ChannelId":1,"RegionId":1,"MenuId":18}) + var values = []; + data_arr.map((data_obj) => { + let { PosReasonId, PosReason } = data_obj; + values.push(` ('${PosReasonId}', '${PosReason}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Master_PosSaleReason(PosReasonId,PosReason) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Master_PosSaleReason where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_PosSaleReason added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Master_PosSaleReason'], false, 'Sup_Master_PosSaleReason'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Master_PosSaleReason'], true, 'Sup_Master_PosSaleReason', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Master_PosSaleReason'], true, 'Sup_Master_PosSaleReason', res); + resolve(false); + } + break; + } + + case 'Sup_Mapping_PosSaleDefinition': { + if (res != null && typeof res == 'object' && res.Sup_Mapping_PosSaleDefinition != null && res.Sup_Mapping_PosSaleDefinition != '') { + let data_arr = res.Sup_Mapping_PosSaleDefinition || []; + // data_arr.push({"ChannelId":1,"RegionId":1,"MenuId":18}) + var values = []; + data_arr.map((data_obj) => { + let { PosDefinitionId, PosSaleValue, ChildName } = data_obj; + values.push(`('${PosDefinitionId}', '${PosSaleValue}', '${ChildName}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Mapping_PosSaleDefinition(PosDefinitionId,PosSaleValue,ChildName) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Mapping_PosSaleDefinition where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Mapping_PosSaleDefinition added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Mapping_PosSaleDefinition'], false, 'Sup_Mapping_PosSaleDefinition'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Mapping_PosSaleDefinition'], true, 'Sup_Mapping_PosSaleDefinition', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Mapping_PosSaleDefinition'], true, 'Sup_Mapping_PosSaleDefinition', res); + resolve(false); + } + break; + } + + case 'Sup_Master_PosSaleDefinition': { + if (res != null && typeof res == 'object' && res.Sup_Master_PosSaleDefinition != null && res.Sup_Master_PosSaleDefinition != '') { + let data_arr = res.Sup_Master_PosSaleDefinition || []; + // data_arr.push({"ChannelId":1,"RegionId":1,"MenuId":18}) + var values = []; + data_arr.map((data_obj) => { + let { PosDefinitionId, PosTable, PosField, PosOverall, PosCheckAssortment, ShowPosValue, ShowPosVolume, PosValueLabel, PosVolumeLabel, PosNotExistReasonEnable, HeaderImageRequired, HeaderImageCount, HeaderImageMandatory } = data_obj; + values.push(` ('${PosDefinitionId}', '${PosTable}' , '${PosField}','${PosOverall}', '${PosCheckAssortment}', '${ShowPosValue}', '${ShowPosVolume}','${PosValueLabel}','${PosVolumeLabel}','${PosNotExistReasonEnable == true ? 1 : 0}','${HeaderImageRequired == true ? 1 : 0}','${HeaderImageCount}','${HeaderImageMandatory}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Master_PosSaleDefinition(PosDefinitionId,PosTable,PosField,PosOverall,PosCheckAssortment,ShowPosValue,ShowPosVolume,PosValueLabel,PosVolumeLabel,PosNotExistReasonEnable,HeaderImageRequired,HeaderImageCount,HeaderImageMandatory) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Master_PosSaleDefinition where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_PosSaleDefinition added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Master_PosSaleDefinition'], false, 'Sup_Master_PosSaleDefinition'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Master_PosSaleDefinition'], true, 'Sup_Master_PosSaleDefinition', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Master_PosSaleDefinition'], true, 'Sup_Master_PosSaleDefinition', res); + resolve(false); + } + break; + } + + case 'Sup_Master_PosSaleCycle': { + if (res != null && typeof res == 'object' && res.Sup_Master_PosSaleCycle != null && res.Sup_Master_PosSaleCycle != '') { + let data_arr = res.Sup_Master_PosSaleCycle || []; + // data_arr.push({"ChannelId":1,"RegionId":1,"MenuId":18}) + var values = []; + data_arr.map((data_obj) => { + let { CycleId, CycleYear, CycleMonth, CyclePeriod } = data_obj; + values.push(` ('${CycleId}', '${CycleYear}' , '${CycleMonth}','${CyclePeriod}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Master_PosSaleCycle(CycleId,CycleYear,CycleMonth,CyclePeriod) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Master_PosSaleCycle where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Master_PosSaleCycle added', data_arr); + setTaskResponse(data_arr); + + resolve(true); + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Master_PosSaleCycle'], false, 'Sup_Master_PosSaleCycle'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Master_PosSaleCycle'], true, 'Sup_Master_PosSaleCycle', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Master_PosSaleCycle'], true, 'Sup_Master_PosSaleCycle', res); + resolve(false); + } + break; + } + + case 'Sup_Mapping_StorePosSaleDefinition': { + if (res != null && typeof res == 'object' && res.Sup_Mapping_StorePosSaleDefinition != null && res.Sup_Mapping_StorePosSaleDefinition != '') { + let data_arr = res.Sup_Mapping_StorePosSaleDefinition || []; + // data_arr.push({"ChannelId":1,"RegionId":1,"MenuId":18}) + var values = []; + data_arr.map((data_obj) => { + let { PosDefinitionId, StoreId, VisitDate } = data_obj; + values.push(`('${PosDefinitionId}', '${StoreId}','${VisitDate})`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_Mapping_StorePosSaleDefinition(PosDefinitionId,StoreId,VisitDate) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_Mapping_StorePosSaleDefinition where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_Mapping_StorePosSaleDefinition added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_Mapping_StorePosSaleDefinition'], false, 'Sup_Mapping_StorePosSaleDefinition'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_Mapping_StorePosSaleDefinition'], true, 'Sup_Mapping_StorePosSaleDefinition', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_Mapping_StorePosSaleDefinition'], true, 'Sup_Mapping_StorePosSaleDefinition', res); + resolve(false); + } + break; + } + + // new cases + case 'Sup_ImageAuditKPIImages': { + if (res != null && typeof res == 'object' && res.Sup_ImageAuditKPIImages != null && res.Sup_ImageAuditKPIImages != '') { + let data_arr = res.Sup_ImageAuditKPIImages || []; + var values = []; + data_arr.map((data_obj) => { + let { MID, MenuId, Menu, KPIImageId, QuestionImageId, DefId, DefName, BaseUrl, ImageName, Image1, Image2 } = data_obj; + values.push(`('${MID}','${MenuId}','${Menu}','${KPIImageId}','${QuestionImageId}','${DefId}','${DefName}','${BaseUrl}','${ImageName}','${Image1}','${Image2}')`); + }); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_ImageAuditKPIImages(MID ,MenuId,Menu,KPIImageId,QuestionImageId,DefId,DefName,BaseUrl,ImageName,Image1,Image2) + values ${all_vals}`; + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_ImageAuditKPIImages where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_ImageAuditKPIImages added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_ImageAuditKPIImages'], false, 'Sup_ImageAuditKPIImages'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_ImageAuditKPIImages'], true, 'Sup_ImageAuditKPIImages', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_ImageAuditKPIImages'], true, 'Sup_ImageAuditKPIImages', res); + resolve(false); + } + break; + } + + case 'Sup_ImageAuditKPIQuestion': { + if (res != null && typeof res == 'object' && res.Sup_ImageAuditKPIQuestion != null && res.Sup_ImageAuditKPIQuestion != '') { + let data_arr = res.Sup_ImageAuditKPIQuestion || []; + console.log('surveys:', data_arr.length) + var values = []; + data_arr.map((data_obj) => { + let { AIQuestionId, AIQuestionCode, AIQuestionName, QuestionType, AIShowCamera, AICameraMandatory, AILengthValidationRequired, AIMinimumChar, AIMaximumChar, AIDecimalPoint, AIDateRangeMin, AIDateRangeMax, AIVoiceLengthInMinutes, AIDefaultQuestionEnable, AIQuestionSequence, AIAnswerId, AIAnswerName, AIAShowCamera, AIACameraMandatory, AIAQuestionEnable, AIAQuestionDisable, AIASequence } = data_obj; + values.push(` ('${AIQuestionId}','${AIQuestionCode}','${AIQuestionName}','${QuestionType}','${AIShowCamera}','${AICameraMandatory}','${AILengthValidationRequired}','${AIMinimumChar}','${AIMaximumChar}','${AIDecimalPoint}','${AIDateRangeMin}','${AIDateRangeMax}','${AIVoiceLengthInMinutes}','${AIDefaultQuestionEnable}','${AIQuestionSequence}','${AIAnswerId}','${AIAnswerName}','${AIAShowCamera}','${AIACameraMandatory}','${AIAQuestionEnable}','${AIAQuestionDisable}','${AIASequence}')`); + }); + + console.log('Sup_ImageAuditKPIQuestion'); + + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_ImageAuditKPIQuestion(AIQuestionId,AIQuestionCode,AIQuestionName,QuestionType,AIShowCamera,AICameraMandatory,AILengthValidationRequired,AIMinimumChar,AIMaximumChar,AIDecimalPoint,AIDateRangeMin,AIDateRangeMax,AIVoiceLengthInMinutes,AIDefaultQuestionEnable,AIQuestionSequence,AIAnswerId,AIAnswerName,AIAShowCamera,AIACameraMandatory,AIAQuestionEnable,AIAQuestionDisable,AIASequence) + values ${all_vals}`; + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_ImageAuditKPIQuestion where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_ImageAuditKPIQuestion added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }, function (txn1, txnerr) { + console.log('err:', txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_ImageAuditKPIQuestion'], false, 'Sup_ImageAuditKPIQuestion'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_ImageAuditKPIQuestion'], true, 'Sup_ImageAuditKPIQuestion', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_ImageAuditKPIQuestion'], true, 'Sup_ImageAuditKPIQuestion', res); + resolve(false); + } + break; + } + + case 'Sup_ImageAuditStoreList': { + console.log("res:", res); + if (res != null && typeof res == 'object' && res.Sup_ImageAuditStoreList != null && res.Sup_ImageAuditStoreList != '') { + let data_arr = res.Sup_ImageAuditStoreList || []; + var values = []; + data_arr.map((data_obj) => { + let { MID, CoveredBy, StoreId, StoreName, StoreType, Address, CityName, VisitDate } = data_obj; + StoreName = StoreName?.replace(/'/g, ''); + Address = Address?.replace(/'/g, ''); + CityName = CityName?.replace(/'/g, ''); + values.push(` ('${MID}', '${CoveredBy}','${StoreId}','${StoreName}','${StoreType}','${Address}', '${CityName}','${VisitDate}')`); + }); + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_ImageAuditStoreList(MID,CoveredBy,StoreId,StoreName,StoreType,Address,CityName,VisitDate) + values ${all_vals}`; + db.transaction(function (txn) { + txn.executeSql(`delete from Sup_ImageAuditStoreList where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + console.log('Sup_ImageAuditStoreList added'); + setTaskResponse(data_arr); + resolve(true); + }, function (txn1, txnerr1) { + console.log(txnerr1) + resolve(true); + }); + }, function (txn1, txnerr1) { + console.log(txnerr1) + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + await onNoData(['No data for Sup_ImageAuditStoreList'], false, 'Sup_ImageAuditStoreList'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + await onNoData(['No data for Sup_ImageAuditStoreList'], true, 'Sup_ImageAuditStoreList', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + await onNoData(['No data for Sup_ImageAuditStoreList'], true, 'Sup_ImageAuditStoreList', res); + resolve(false); + } + break; + } + + // dashboard + case 'Sup_MenuAppDashboard': { + if (res != null && typeof res == 'object' && res.Sup_MenuAppDashboard != null && res.Sup_MenuAppDashboard != '') { + let data_arr = res.Sup_MenuAppDashboard || []; + var values = [], reportKeysToDownload = [], MainReportsToShow = []; + data_arr.map((data_obj) => { + let { DashboardId, DashboardName, DashboardType, DashboardSection, TabName, DownloadKey, GraphDetail, DrillDown, ParentId, ShowGraph, DisplayOrder } = data_obj; + + values.push(` ('${DashboardId}','${DashboardName}','${DashboardType}','${DashboardSection}','${TabName}','${DownloadKey}','${GraphDetail}','${DrillDown}','${ParentId}','${ShowGraph}','${DisplayOrder}')`); + + if (DashboardSection != "DrilldownScreen" && DashboardSection != "PeopleDrilldownScreen") { + reportKeysToDownload.push(DownloadKey); + } + // reportKeysToDownload.push(DownloadKey); + + // only those report will be shown which parent id is either null or 0 + + if (ParentId == null || ParentId == 0 || ParentId == '0') { + MainReportsToShow.push(data_obj); + } + + }); + + MainReportsToShow.sort((a, b) => a.DisplayOrder - b.DisplayOrder); + + setAppDashReportsSec(MainReportsToShow); + var all_vals = values.join(','); + var sql_stmnt = `INSERT INTO Sup_MenuAppDashboard(DashboardId,DashboardName,DashboardType,DashboardSection,TabName,DownloadKey,GraphDetail,DrillDown,ParentId,ShowGraph,DisplayOrder) + values ${all_vals}`; + + db.transaction(function (txn) { + // delete all today data + txn.executeSql(`delete from Sup_MenuAppDashboard where 1=1`, [], function (txn1, txnres) { + // insert or refresh all today data + txn.executeSql(sql_stmnt, [], async function (txn1, txnres) { + console.log('Sup_MenuAppDashboard added'); + + + // download reports data for dashboard + let isReportsDownloaded = await downloadReportKeys(reportKeysToDownload) + if (!isReportsDownloaded.success && isReportsDownloaded.error != null && isReportsDownloaded.error != '') { + console.log("Cannot download dashboard reports"); + await onNoData(['No data for Sup_MenuAppDashboard'], true, 'Sup_MenuAppDashboard - ' + isReportsDownloaded.reportKey, isReportsDownloaded.error); + resolve(false); + } + else { + setTaskResponse(data_arr); + console.log("All Report Keys Dowbloaded", isReportsDownloaded); + resolve(true); + } + + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }, function (txnE, txnerr) { + console.log(txnerr); + resolve(true); + }); + }); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + setAppDashReportsSec([]); + await onNoData(['No data for Sup_MenuAppDashboard'], false, 'Sup_MenuAppDashboard'); + resolve(true); + } + // Stop Downloading and report error + else if (res != null && typeof (res) == 'object' && res.success == false) { + console.log('Error in downloading network', res); + setAppDashReportsSec([]); + await onNoData(['No data for Sup_MenuAppDashboard'], true, 'Sup_MenuAppDashboard', res); + resolve(false); + } + // Stop Downloading and report error + else { + console.log('Error in downloading else', res); + setAppDashReportsSec([]); + await onNoData(['No data for Sup_MenuAppDashboard'], true, 'Sup_MenuAppDashboard', res); + resolve(false); + } + break; + } + + case "default": return false; + } + }).catch((err) => { + console.log('error in downloading', err); + return false; + }); + } + // DOWNLOAD FUNCTIONALITY END + + + // upload functionality start + async function startUpload() { + console.log("start upload called"); + setLoaderTitle(ST.UploadingData + '...'); + setProcessing(true); + UploadOnCheckOut(); + } + + async function getMenuList(storeData1) { + let { StoreId, ChannelId, RegionId } = storeData1; + return new Promise((resolve, reject) => { + + db.transaction(async function (txn) { + let q = Q_MenuList(storeData1); + await txn.executeSql(q, [], async function (txn2, txnres) { + console.log("Menu List Query:", txnres.rows.length); + if (txnres.rows.length > 0) { + let arr = []; + for (var i = 0; i < txnres.rows.length; i++) { + let data = txnres.rows.item(i); + console.log("Menu List Query:", data); + arr.push(data); + if (i == (txnres.rows.length - 1)) { + resolve(arr); + } + } + } + else { + resolve([]) + } + }, function (txn2, txnerr) { console.log(txnerr); resolve([]); },); + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log('') + return [] + }) + } + + + + async function UploadOnCheckOut() { + try { + let userIsManager = await getIf_UserIsManager(props); + // const storewisePjp = await fetchProjectConfig(props.ManagerAppConfig); + const { StorewisePJP: storewisePjp, StoreSearch: storeSearch } = await fetchProjectConfig(props.ManagerAppConfig); + + setLoaderTitle("Loading..."); + setProcessing(true); + GMUploadedCountref.current = 0; + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + let token = await get_item('loginToken'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + console.log("storewisePjpAskForUpload>>:", storewisePjp); + let AllEmployees = await getEmployees(); + + let AllVisitors = [];//await getVisitorLogin(d2); + + let ALlGMs = await getGateMeetingsToUpload(); + console.log("ALlGMs", ALlGMs) + if (ALlGMs.length > 0) { + setLoaderTitle(`Uploading Gate Meetings Data (${GMUploadedCountref.current}/${ALlGMs.length})...`); + let isGMUploaded = await uploadGateMeetings(ALlGMs); + setLoaderTitle("Loading..."); + } + + // image audit + + let ALlIAs = await getImageAuditToUpload(); + console.log("ALlIAs", ALlIAs) + if (ALlIAs.length > 0) { + setLoaderTitle(`Uploading Image Audit Data (${IAUploadedCountref.current}/${ALlIAs.length})...`); + let isIAUploaded = await uploadImageAudits(ALlIAs); + setLoaderTitle("Loading..."); + } + + await db.transaction(async function (txn) { + + for (let empINdex = 0; empINdex < AllEmployees.length; empINdex++) { + + let PJPStores = []; + // if user is manager + if (userIsManager) { + AllStores = await getPJPStoresData('Sup_JourneyPlan', [], d2); + } + else if (storewisePjp == true) { + PJPStores = await getPJPStoresData('Sup_JourneyPlanStorewiseSup', [], d2); + AllStores = await getPJPStoresData('Sup_JourneyPlanStorewiseSup_Adhoc', PJPStores, d2); + } + else { + PJPStores = await getPJPStoresData('Sup_JourneyPlan', [], d2); + AllStores = await getPJPStoresData('Sup_AdhocJourneyPlan', PJPStores, d2); + } + + console.log('stores to upload:', AllStores.length); + if (AllStores.length > 0) { + if (AllVisitors.length > 0) { + setLoaderTitle(ST.Uploadingvisitorsdata + '...'); + let isallVisUploaded = await uploadAllVisitors(props, AllVisitors); + + if (isallVisUploaded == true) { + notify(ST.AllDataUploaded + '...'); + } + else { + notify(ST.CannotUploadVisitors); + } + } + for (var i = 0; i < AllStores.length; i++) { + let data = AllStores[i]; + const index = i; + let { StoreId, StoreName, EmpId, MerchandiserId, MID, UploadStatus, Status, VisitDate, REASON_ID, JCP_TYPE } = data; + // get all checkout ids data + setLoaderTitle(ST.UploadingDatafor + ' ' + StoreName + '...'); + let MenuList = await getMenuList(data); + let allKPIs = await getKPIS(MenuList); + if (UploadStatus == 'C') { + let isUploaded_P = await uploadStoreStatus(props, data, 'P', JCP_TYPE); + if (isUploaded_P == true) { + console.log('proceed to upload after C to P status', MenuList, allKPIs); + await uploadAfter_P_status(index, AllStores, data, MenuList, allKPIs, JCP_TYPE) + } + else { + notify(ST.Erroroccurwhileuploadingdatafor + ' ' + StoreName, 'LONG'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + } + else if (UploadStatus == 'D') { + // this never be called if there is no KPI + console.log('uploadAfter_P_status - MenuList.length:', allKPIs); + let allFilesToUpload = await uploadAllData(props, data, allKPIs, props.UserId, JCP_TYPE, false, MenuList,true); + console.log('allFilesToUpload.length:', allFilesToUpload.length); + if (allFilesToUpload.length > 0) { + await UploadDataWithImages(index, AllStores, data, MenuList, allKPIs, JCP_TYPE, allFilesToUpload); + } + else { + notify(ST.Alldatauploadedfor + ' ' + StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + + } + else if (UploadStatus == 'P') { + await uploadAfter_P_status(index, AllStores, data, MenuList, allKPIs, JCP_TYPE); + } + else if (UploadStatus == 'L') { + let isAllUploaded_S = await uploadStoreStatus(props, data, 'U', JCP_TYPE); + if (isAllUploaded_S == true) { + notify(ST.Alldatauploadedfor + ' ' + StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + else { + if (index == AllStores.length - 1) { + setProcessing(false); notify(ST.Erroroccurwhileuploadingdatafor, 'LONG'); + } + } + } + + if (index == 0) { + props.set_startUpload({ startUpload: false }); + } + } + + } + else if (AllVisitors.length > 0) { + setLoaderTitle(ST.Uploadingvisitorsdata + '...'); + let isallVisUploaded = await uploadAllVisitors(props, AllVisitors); + setProcessing(false); + props.set_startUpload({ startUpload: false }); + if (isallVisUploaded == true) { + notify(ST.AllDataUploaded); + } + else { + notify(ST.CannotUploadVisitors); + } + } + else if (ALlGMs.length > 0) { + props.set_startUpload({ startUpload: false }); + setProcessing(false); + } + else if (ALlIAs.length > 0) { + props.set_startUpload({ startUpload: false }); + setProcessing(false); + } + else { + setProcessing(false); + notify(ST.NodatatoUpload); + props.set_startUpload({ startUpload: false }); + } + } + + }); + + + + } catch (err) { + console.log(err); + } + } + + + async function getImageAuditToUpload() { + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + let query1 = `SELECT DISTINCT MenuId, MID, Menu FROM ${AppTables.IMAGE_AUDIT_HDR_DATA} WHERE (STATUS != 'U' OR STATUS IS NULL) AND VISIT_DATE = '${d2}'`; + console.log("query1", query1); + + await txn.executeSql(query1, [], async function (txn2, txnres1) { + if (txnres1.rows.length > 0) { + let fetchedData = []; + + // Wrap the loop in a Promise.all to wait for all async operations to complete + await Promise.all(Array.from({ length: txnres1.rows.length }, async (_, i) => { + let item = txnres1.rows.item(i); + let defArray = []; + + // Step 2: Fetch DefName and DefId for each MenuId and MID + let query2 = `SELECT DISTINCT DefName, DefId, MID, MenuId FROM ${AppTables.IMAGE_AUDIT_HDR_DATA} WHERE MID = '${item.MID}' AND MenuId = '${item.MenuId}'`; + console.log("query2", query2); + + return new Promise(async (resolveDef, rejectDef) => { + await txn.executeSql(query2, [], async function (txn3, txnres2) { + // Wrap another Promise.all to wait for the completion of this loop + await Promise.all(Array.from({ length: txnres2.rows.length }, async (_, j) => { + let defItem = txnres2.rows.item(j); + let images1Array = []; + + // Step 3: Fetch images for each DefId + let query3 = `SELECT DISTINCT S.KPIImageId, S.QuestionImageId, S.DefId, S.DefName, S.BaseUrl, S.ImageName, S.Image1, S.Image2, + IFNULL(S.pictureokay, 0) AS pictureokay, IFNULL(S.pictureokay2, 0) AS pictureokay2 + FROM ${AppTables.IMAGE_AUDIT_HDR_DATA} S WHERE DefId = '${defItem.DefId}' AND MenuId = '${item.MenuId}' AND MID = '${item.MID}'`; + console.log("query3", query3); + + return new Promise((resolveImg, rejectImg) => { + txn.executeSql(query3, [], function (txn4, txnres3) { + for (let k = 0; k < txnres3.rows.length; k++) { + let imageItem = txnres3.rows.item(k); + images1Array.push({ + KPIImageId: imageItem.KPIImageId, + QuestionImageId: imageItem.QuestionImageId, + ImageName: imageItem.ImageName, + Image1: imageItem.Image1, + Image2: imageItem.Image2, + pictureokay: imageItem.pictureokay, + pictureokay2: imageItem.pictureokay2 + }); + } + + // Step 4: Push DefData and resolve the promise for the image query + defArray.push({ + DefName: defItem.DefName, + DefId: defItem.DefId, + Images: images1Array + }); + resolveImg(); + }, (error) => { + console.log("Error in query3", error); + rejectImg(); + }); + }); + })); + + // Resolve when defArray is fully populated + resolveDef(); + }, (error) => { + console.log("Error in query2", error); + rejectDef(); + }); + }).then(() => { + // Add the final data to fetchedData once the defArray is ready + fetchedData.push({ + MenuId: item.MenuId, + MID: item.MID, + Menu: item.Menu, + DefData: defArray + }); + }); + })); + + // Resolve the promise when everything is done + resolve(fetchedData); + } else { + resolve([]); // No data found + } + }, function (txnErr) { + console.log(txnErr); + resolve([]); // Error in first query + }); + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log(err); + return []; + }); + } + + + + async function uploadImageAudits(ALlIAs = []) { + console.log("uploadImageAudits", ALlIAs.length) + // let isUploaded=true; + // return Promise.all( + // ALlIAs.map(async(item,index)=>{ + let isGMuploaded = await uploadImageAuditData(ALlIAs); + if (isGMuploaded) { + notify("All Image Audit Data uploaded!") + return true; + } + notify("Cannot upload all Image Audit data!") + return false; + // else{ + // isUploaded=false; + // } + // }) + // ).then((val)=>{ + // if(isUploaded){ + // notify("All Image Audit Data uploaded!") + // } + // else{ + // notify("Cannot upload all Image Audit data!") + // } + // return isUploaded; + // }).catch((err)=>{ + // console.log("Error in uploading data:",err); + // return false; + // }); + + } + + + + + async function uploadImageAuditData(data) { + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + + setLoaderTitle('Uploading Data...'); + + let storeInfo = data; + + let arr = []; + + console.log(JSON.stringify(data), "DATATTATATATTATTA___AUDIT") + // Create a shallow copy or filtered version of dataInfo + let filteredStoreInfo = data.map(item => { + let filteredDefData = item.DefData.map(defItem => { + // Include all images, setting pictureokay/pictureokay2 to 0 if not already set + let allImages = defItem.Images.map(image => ({ + ...image, + pictureokay: image.pictureokay ? image.pictureokay : 0, + pictureokay2: image.pictureokay2 ? image.pictureokay2 : 0, + })); + + return { + ...defItem, + Images: allImages + }; + }); + + return { + ...item, + DefData: filteredDefData + }; + }); + + // Filter out any entries where Images is empty + filteredStoreInfo = filteredStoreInfo.filter(item => item.DefData.some(defItem => defItem.Images.length > 0)); + + + await filteredStoreInfo.map((item, i) => { + let itemObj2 = item; + + if (item.Status !== "U") { + let rsData = item.DefData.map(item3 => { + let Images = []; + + item3?.Images.map(item2 => { + let obj = { + KPIImageId: item2.KPIImageId, + QuestionImageId: item2.QuestionImageId + }; + + if (item2?.Image1) { + Images.push({ + ...obj, + imageType: "Image1", + Questions: item2.Questions1, + Image: item2?.Image1, + pictureokay: item2.pictureokay + }); + } + + if (item2?.Image2) { + Images.push({ + ...obj, + imageType: "Image2", + Questions: item2.Questions2, + Image: item2?.Image2, + pictureokay: item2.pictureokay2 + }); + } + }); + + item3["Images"] = Images; + return item3; + }); + + itemObj2["UserId"] = props.UserId; + itemObj2["DefData"] = rsData; + arr.push(itemObj2); + } + }); + + console.log(JSON.stringify(arr), "postDATAAAA----------") + + let postData = { + "MID": 0, + "Keys": "Sup_Image_Audit_Info", + "JsonData": JSON.stringify(arr), + "UserId": props.UserId, + }; + + + const url = props.baseurl + getMethodName(METHODS.UPLOADJSON_METHOD); + + console.log(url, postData, 'url and postDaata...'); + + return await UploadData(url, postData) + .then(async (res) => { + console.log('res: 12', res); + if (res?.UploadJsonResult == "Success") { + setProcessing(false); + updateImageAuditUploadStatus(); + return true; + } else { + setProcessing(false); + } + }) + .catch((err) => { + console.log(err); + setProcessing(false); + }); + + } + + async function updateImageAuditUploadStatus() { + + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + let q = `Update ${AppTables.IMAGE_AUDIT_HDR_DATA} SET STATUS='U'`; + await txn.executeSql(q, [], async function (txn2, txnres) { + console.log('Image Audit upload status Updated'); + resolve(true); + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); },); + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log(err); + return false; + }); + } + + // image audit upload end + + async function getGateMeetingsToUpload() { + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + let q = `select * from ${AppTables.GATE_MEETING} where (UPLOADSTATUS!='U' or UPLOADSTATUS is null)`; + await txn.executeSql(q, [], async function (txn2, txnres) { + console.log('meets', txnres.rows.length); + if (txnres.rows.length > 0) { + let allMeet = []; + for (let i = 0; i < txnres.rows.length; i++) { + let data = txnres.rows.item(i); + let discP = await getDiscussionPoint(data); + data["DISCUSSION_POINTS"] = discP != null && discP != "" ? discP : []; + allMeet.push(data) + if (i == txnres.rows.length - 1) { + resolve(allMeet) + } + } + } + else { + resolve([]) + } + }, function (txn2, txnerr) { console.log(txnerr); resolve([]); },); + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log(err); + return []; + }); + } + + async function getDiscussionPoint(gateMeeting) { + + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + // get inserted audit + let q = `SELECT DISCUSSION_POINTS FROM ${AppTables.GATE_MEETING_DISCUSSION} WHERE GATEMEETING_ID='${gateMeeting.UNIQUE_ID}' ` + await db.transaction(async function (txn) { + await txn.executeSql(q, [], async function (txn2, txnres2) { + // console.log('txnres4',txnres2.rows.length) + if (txnres2.rows.length > 0) { + let dp = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + dp.push(data.DISCUSSION_POINTS) + + if (i == (txnres2.rows.length - 1)) { + resolve(dp) + } + } + } + else { + resolve([]) + } + + }, function (txn2, txnerr) { console.log(txnerr); resolve([]) }); + }); + + }); + }).then((val) => { + return val; + }).catch((err) => { + return [] + }); + } + + async function uploadGateMeetings(ALlGMs = []) { + console.log("uploadGateMeetings", ALlGMs.length) + let isUploaded = true; + return Promise.all( + ALlGMs.map(async (item, index) => { + let isGMuploaded = await uploadGateMeetingData(item); + if (isGMuploaded) { + GMUploadedCountref.current++; + setLoaderTitle(`Uploading Gate Meetings Data (${GMUploadedCountref.current}/${ALlGMs.length})...`); + } + else { + isUploaded = false; + } + }) + ).then((val) => { + if (isUploaded) { + notify("All Gate Meetings Data uploaded!") + } + else { + notify("Cannot upload all Gate Meetings data!") + } + return isUploaded; + }).catch((err) => { + console.log("Error in uploading data:", err); + return false; + }); + } + + + async function uploadGateMeetingData(data) { + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + const url = props.baseurl + getMethodName(METHODS.UPLOADJSON_METHOD); + setLoaderTitle("Uploading Data...") + setProcessing(true); + let employeesArr = data.EMP_ID != null && data.EMP_ID != '' ? data.EMP_ID.split(',') : []; + + let obj = { + "MID": 0, + "UniqueId": data.UNIQUE_ID, + "UserId": props.UserId, + "VisitDate": d2, + "Time": data.TIME, + "Image": data.IMAGE, + "MerchandiserId": employeesArr, + "DiscussionPoints": data.DISCUSSION_POINTS + } + + let JsonChange = JSON.stringify(obj)?.replace(/'/g, '"') + + let postData = { + "MID": 0, + "Keys": "GateMeeting_Sup", + "JsonData": JsonChange, + "UserId": props.UserId, + }; + + console.log('postData', postData) + + let ImageName = data.IMAGE; + let imgPath = 'file://' + `${common_ImagePath}${ImageName}`; + + return await UploadData2(url, postData) + .then(async (res) => { + console.log('res:', res); + if (res.UploadJsonResult != null && res.UploadJsonResult == 'Success') { + + // uplod images + const url2 = (props.imageUploadUrl || URL_IMAGE) + getMethodName(METHODS.UPLOADIMAGES_METHOD); + if (ImageName != '' && ImageName != null) { + let file = { + uri: imgPath, + type: 'image/jpeg', + name: ImageName, + filetype: 'image', + folderName: 'SupGateMeetingImages', + } + + let isExists = await RNFS.exists(file.uri).then((res) => { return res; }); + console.log('isExists file', isExists); + if (isExists == true) { + let fileData = getImagePOSTData(file, d2); + + let isImageUploaded = await UploadFormData(url2, fileData); + console.log('isImageUploaded', isImageUploaded) + if (isImageUploaded == false) { + notify('Cannot upload GateMeeting image!'); + } + } + else { + notify("Error uploading image! GateMeeting Image does not exists "); + } + } + + let isupdated = updateGateMeetUploadStatus(data.UNIQUE_ID); + return isupdated; + + } else { + return false; + } + }) + .catch((err) => { + console.log(err); + return false; + }); + } + + async function updateGateMeetUploadStatus(uniqueId) { + + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + let q = `Update ${AppTables.GATE_MEETING} SET UPLOADSTATUS='U' WHERE UNIQUE_ID='${uniqueId}'`; + await txn.executeSql(q, [], async function (txn2, txnres) { + console.log('Gate Meeting upload status Updated'); + resolve(true); + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); },); + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log(err); + return false; + }); + } + + + + + + async function uploadAfter_P_status(index, AllStores, data, MenuList, allKPIs, JCP_TYPE) { + let { StoreName } = data; + if (MenuList.length > 0) { + // Upload data with Images + console.log('uploadAfter_P_status - MenuList.length:', allKPIs); + let allFilesToUpload = await uploadAllData(props, data, allKPIs, props.UserId, JCP_TYPE, true, MenuList,true); + UploadDataWithImages(index, AllStores, data, MenuList, allKPIs, JCP_TYPE, allFilesToUpload); + } + else { + // Upload statua u if no data exists + let isAllUploaded_S = await uploadStoreStatus(props, data, 'U', JCP_TYPE); + if (isAllUploaded_S == true) { + notify(ST.Alldatauploadedfor + ' ' + StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + else { + if (index == AllStores.length - 1) { + setProcessing(false); notify(ST.Erroroccurwhileuploadingdatafor, 'LONG'); + } + } + } + } + + async function UploadDataWithImages(index, AllStores, data, MenuList, allKPIs, JCP_TYPE, allFilesToUpload) { + + let { StoreName } = data; + if (allFilesToUpload.length > 0) { + setLoaderTitle(ST.UploadingImages + '...'); + + let isAllUploaded = await uploadAllImages(props, data, allFilesToUpload, JCP_TYPE); + + if (isAllUploaded == true) { + notify(ST.Alldataandimagesuploadedfor + ' ' + StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } else { + notify(ST.Cannotuploadimagesfor + ' ' + StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + } + else { + notify(ST.Alldatauploadedfor + ' ' + StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + } + + async function getPJPStoresData(tbname, Stores = [], d2) { + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + + let join = `INNER JOIN ${AppTables.COVERAGE_DATA} t2 on t2.STORE_ID=t1.StoreId and t2.EMP_ID=t1.MerchandiserId and t2.JCP_TYPE='${tbname}' `; + await txn.executeSql(`Select t1.*,t2.REASON_ID,t2.JCP_TYPE from ${tbname} t1 ${join} where t1.VisitDate='${d2}' and t1.UploadStatus in ('C','P','D','L')`, [], async function (txn2, txnres2) { + + if (txnres2.rows.length > 0) { + + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + Stores.push(data); + } + resolve(Stores); + } + else { + resolve(Stores); + } + }, function (txn2, txnerr) { console.log(txnerr); resolve(Stores) },); + + }); + }).then((val) => { + return val; + }) + .catch((err) => { + console.log(err); + return Stores; + }) + } + + async function getEmployees() { + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + + await txn.executeSql(`Select * from Sup_TeamList `, [], async function (txn2, txnres2) { + + if (txnres2.rows.length > 0) { + let arr = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + arr.push(data); + if (i == txnres2.rows.length - 1) { + resolve(arr); + } + } + } + else { + resolve([]); + } + }, function (txn2, txnerr) { console.log(txnerr); resolve([]) },); + + }); + }).then((val) => { + return val; + }) + .catch((err) => { + console.log(err); + return []; + }) + } + + async function getVisitorLogin(d2) { + let allVisitors = []; + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + + let q = `Select * from ${AppTables.VISITOR_LOGIN} where VISIT_DATE='${d2}' and OUT_TIME!='' and UPLOADSTATUS!='U' `; + await txn.executeSql(q, [], async function (txn2, txnres2) { + if (txnres2.rows.length > 0) { + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + allVisitors.push(data); + } + resolve(allVisitors); + } + else { + resolve(allVisitors); + } + }, function (txn2, txnerr) { console.log(txnerr); resolve(allVisitors) },); + + }); + }).then((val) => { + return val; + }) + .catch((err) => { + console.log(err); + return Stores; + }) + } + + async function getdashboardData() { + + async function getPlannedData() { + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + + let token = await get_item('loginToken'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + let params = props.route.params ? props.route.params : {}; + // let isAdhoc=params.isAdhoc || false; + // setIsAdhocScreen(isAdhoc); + + var q = ''; + + q = `Select Distinct STORE_ID from DR_COVERAGE where VISIT_DATE='${d2}'`; + // console.log('teamlistq',q); + + + await db.transaction(async function (txn) { + await txn.executeSql(q, [], async function (txn2, txnres2) { + + // console.log('txnres5',txnres2.rows.length) + + + setPlanned(txnres2.rows.length) + + if (txnres2.rows.length > 0) { + // show from local + var storeArr = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + console.log('teamlistdata', data) + // let ChekedInStatus=await getCheckInStatus(data); + // data['ChekedInStatus']=ChekedInStatus; + + storeArr.push(data); + + + + if (i == (txnres2.rows.length - 1)) { + setEmployeesList(storeArr); + setGlobalEmplist(storeArr); + setProcessing(false); + + } + } + } + else { + setProcessing(false); + } + }, function (txn2, txnerr) { console.log(txnerr); }); + }); + } + + async function getExecutedData() { + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + + let token = await get_item('loginToken'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + let params = props.route.params ? props.route.params : {}; + // let isAdhoc=params.isAdhoc || false; + // setIsAdhocScreen(isAdhoc); + + var q = ''; + + q = `Select Distinct STORE_ID from DR_COVERAGE where VISIT_DATE='${d2}' and REASON_ID=0`; + console.log('teamlistq', q); + + + await db.transaction(async function (txn) { + await txn.executeSql(q, [], async function (txn2, txnres2) { + + + + + setCovered(txnres2.rows.length) + + if (txnres2.rows.length > 0) { + // show from local + var storeArr = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + console.log('teamlistdata', data) + // let ChekedInStatus=await getCheckInStatus(data); + // data['ChekedInStatus']=ChekedInStatus; + + storeArr.push(data); + + + + if (i == (txnres2.rows.length - 1)) { + setEmployeesList(storeArr); + setGlobalEmplist(storeArr); + setProcessing(false); + + } + } + } + else { + setProcessing(false); + } + }, function (txn2, txnerr) { console.log(txnerr); }); + }); + } + + + + getPlannedData(); + getExecutedData(); + } + + + // new dashboard data sup + + async function downloadReportKeys(reportKeysToDownload = []) { + console.log('downloadReportKeys'); + let defData = { success: true, error: '', } + return new Promise(async (resolve, reject) => { + let reports = {}; + for (let i = 0; i < reportKeysToDownload.length; i++) { + let reportKey = reportKeysToDownload[i]; + let reportData = await DownloadDashboardReportData(reportKey); + console.log('DownloadDashboardReportData downloded:', reportKey, reportData); + if (!reportData.success && reportData.error != null && reportData.error != '') { + defData["success"] = false; + defData["error"] = reportData.error; + defData["reportKey"] = reportKey; + resolve(defData); + } + + reports[reportKey] = reportData.data; + + if (i == reportKeysToDownload.length - 1) { + + console.log('all reports downloded:', JSON.stringify(reports)); + set_item('Sup_MenuAppDashboard', JSON.stringify(reports)); + props.set_DashboardReports(reports); + resolve(defData); + } + } + }).catch((err) => { + console.log("err:", err); + defData["success"] = false; + defData["error"] = "Error while downloading dashboard reports!"; + resolve(defData); + }); + } + + // doownload reports + async function DownloadDashboardReportData(reportKey = '') { + console.log('DownloadDashboardReportData:', reportKey); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + console.log("report Key dashboard sup:", reportKey); + let defData = { success: false, data: {} }; + + if (reportKey != null && reportKey != '') { + setDownloadingText("Sup_MenuAppDashboard - " + reportKey); + let postdata = { + Downloadtype: reportKey, + Username: loginDetails.UserId, + Param1: '', + Param2: '', + }; + + var url = props.baseurl + getMethodName(METHODS.DOWNLOADJSON_METHOD); + console.log(url, postdata); + + return await getDownloadJson1(url, postdata) + .then(async (res) => { + if (res != null && typeof res == 'object' && res[reportKey] != null && res[reportKey] != '') { + let data_arr = res[reportKey] || []; + + // Get columns and columnWidth based on the first row + let allCols = [], columnWidth = '50%'; + let keylen = Object.keys(data_arr[0] || {}).length; + + // Loop through all rows to process columns + for (let row of data_arr) { + let i = 0; + for (let key in row) { + if (i < keylen) { + let obj = { 'actual_colname': key }; + let colname = key.replace(/[$$]/g, ' ').replace(/Percent/g, '%'); + obj['colname'] = colname; + let dontShowCol = (colname == 'Srno' || colname == 'AdKPIId' || colname == 'ReportValue' || colname == 'Color' || colname == 'DisplayOrder' || colname == 'KPIDrilldown'); + + // Add columns to display + if (!dontShowCol && !allCols.some(col => col.actual_colname === key)) { + allCols.push(obj); + } + } + i++; + } + } + + // Adjust column width based on the number of columns + if (allCols.length > 0) { + let colLen = allCols.length; + columnWidth = (94 / colLen) + '%'; + } + + // No need to map through the rows again if you're not altering them. + defData["success"] = true; + defData["data"] = { + "report_data": data_arr, + "report_colWidth": columnWidth, + "report_cols": allCols + }; + + return defData; + } + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + console.log('No data found'); + defData["success"] = true; + return defData; + } else { + defData["error"] = res; + return defData; + } + + }).catch((err) => { + notify("Please retry downloading! There is some error while downloading data"); + props.set_startDownload({ startDownload: false }); + console.log('onDownload report error', err); + return defData; + }); + } else { + return defData; + } + } + + + async function getAppDashBReports() { + + console.log("sup getAppDashBReports called manager --->"); + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + let arr = []; + + await db.transaction(async function (txn) { + //get MenuAppDashboard Reports sections to show + // only those report will be shown which parent id is either null or 0 + let q = `Select * from Sup_MenuAppDashboard where ParentId is null or ParentId='0' order by DisplayOrder`; + await txn.executeSql(q, [], async function (txn2, txnres2) { + console.log('Sup_MenuAppDashboard count:', txnres2.rows.length); + if (txnres2.rows.length > 0) { + for (let i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + arr.push(data); + if (i == txnres2.rows.length - 1) { + // console.log("array-------",arr) + setAppDashReportsSec(arr) + } + } + } + else { + setAppDashReportsSec([]) + } + }, function (txn2, txnerr) { console.log(txnerr); setAppDashReportsSec([]) }); + }); + } + + + function DownloadErrorAlert() { + + let { ErrorMsg, ErrorSubMsg, ErrorDetail } = DErrorMsg; + + return ( + + {ErrorDetail != null && ErrorDetail != '' && {ErrorDetail}} + + { setshowDErrAlert(false) }}> + {'Ok'} + + + + ) + } + + async function refreshDashBReport() { + console.log('refreshDashBReportSup'); + setLoaderTitle("Refreshing dashboard reports..") + setProcessing(true); + try { + + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + + let dk_index = DownloadTasks.findIndex(i => i.DownloadKey == 'Sup_MenuAppDashboard'); + var data = { + Downloadtype: "Sup_MenuAppDashboard", + Username: loginDetails.UserId, + Param1: '', + Param2: '', + }; + var url = props.baseurl + getMethodName(METHODS.DOWNLOADJSON_METHOD); + console.log(url, data); + + await getDownloadJson1(url, data) + .then(async (res) => { + let isAdded = await updateTaskRes(res, dk_index, 1); + if (isAdded == true) { + notify("Sup Dashboard reports refreshed!"); + setProcessing(false); + } + else { + notify("Cannot refresh sup dashboard reports!"); + setProcessing(false); + } + }) + .catch(err => { + notify("Cannot refresh sup dashboard reports!"); + setProcessing(false); + }); + + } catch (err) { + setProcessing(false); + console.log(err); + } + } + + const _renderAttendanceReport = (item) => { + + let report_key = item.DownloadKey; + let reportContentObj = props.AppDashboardReports != null && typeof props.AppDashboardReports == 'object' && props.AppDashboardReports[report_key] != null && props.AppDashboardReports[report_key] != '' ? props.AppDashboardReports[report_key] : {}; + + // {"report_data":data_arr,"report_colWidth":columnWidth,"report_cols":allCols} + let report_data = reportContentObj['report_data'] != null ? reportContentObj['report_data'] : []; + let report_colWidth = reportContentObj['report_colWidth'] != null ? reportContentObj['report_colWidth'] : '50%'; + let report_cols = reportContentObj['report_cols'] != null ? reportContentObj['report_cols'] : []; + // console.log("report_cols:",report_cols,report_data); + + + return ( + + + + + + {report_data?.map((item, index) => ( + + {item.Attendance} + {item.TotCount} + + ))} + + + + + + ); + }; + + + function renderPeopleList(activeTab) { + + const [peoplelist, setPeopleList] = useState([]); + const [tabledata, setTableData] = useState([]); + const [searchedmiddyItem, setSearchedMiddyItem] = useState(''); + + const [filterData, setFilterData] = useState([]); + + useEffect(() => { + getPeopleDataTable(); + }, [activeTab]); + + + async function getPeopleDataTable() { + try { + + db.transaction(async function (txn) { + // get data for report + let q = `Select * from Sup_MenuAppDashboard where DashboardSection ='People' order by DisplayOrder`; + console.log("Detailed reports q:", q); + txn.executeSql(q, [], async function (txn2, txnres2) { + console.log("Detailed reports count:", txnres2.rows.length); + if (txnres2.rows.length > 0) { + let arr = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + arr.push(data); + if (i == txnres2.rows.length - 1) { + if (activeTab == 1) { + DownloadDataPeopledashboard(arr); + setTableData(arr); + } + } + } + } else { + + setProcessing(false); + } + }, function (txnE, txnerr) { console.log(txnerr); setTableData([]); setProcessing(false); },); + + }); + + + } catch (err) { + setProcessing(false); + console.log(err); + } + } + + + function transformData(peoplelist) { + const transformedData = []; + + peoplelist?.forEach(item => { + // Check if EmpId already exists in transformedDatas + let employee = transformedData.find(emp => emp.EmpId == item.EmpId); + + if (employee) { + // If the employee already exists, just push the new KPI data to their KPIs array + employee?.KPIs?.push({ + "KPI": item?.KPI, + "PER": item?.PER, + "Color": item?.Color, + }); + } else { + // If the employee doesn't exist, create a new entry + transformedData.push({ + "EmpId": item?.EmpId, + "NAME": item?.NAME, + "LastMechandisedVisit": item?.LastMechandisedVisit, + "KPIs": [ + { + "KPI": item?.KPI, + "PER": item?.PER, + "Color": item?.Color, + } + ] + }); + } + }); + + return transformedData; + } + + const sortedPeopleList = React.useMemo(() => { + return [...peoplelist].sort((a, b) => { + if (a.NAME && b.NAME) { + + return a.NAME.localeCompare(b.NAME); + } else { + return 0; + } + }); + }, [peoplelist]); + + const transformedJSON = transformData(sortedPeopleList); + + const handleSearch = text => { + // console.log(text) + setSearchedMiddyItem(text); + const filteredList = transformedJSON?.filter(item => { + // console.log(item?.NAME, 'item....JJJj....'); + return item?.NAME?.toLowerCase()?.trim().includes(text?.toLowerCase()?.trim()); + }); + setFilterData(filteredList); + }; + + const ClearSearch = text => { + setSearchedMiddyItem(''); + setFilterData(transformedJSON); + }; + + // async function DownloadDataPeopledashboard(tabledata){ + + // // console.log(tabledata[0].DownloadKey) + // let downloadkey = tabledata[0].DownloadKey ; + + // let loginInfo = await get_item('loginInfo'); + // const loginDetails = JSON.parse(loginInfo); + // const url=props.baseurl+getMethodName(METHODS.DOWNLOADJSON_METHOD); + + // let data=''; + + // data={ + // Downloadtype:downloadkey, + // Username: loginDetails.UserId, + // Param1: '', + // Param2: '', + // } + + // console.log(url,data); + // return await getDownloadJson1(url,data) + // .then(async(res)=>{ + // // console.log("DownloadDataPosSaleDefination res:",res); + // if(res.Sup_Dashboard_People!=null || res.Sup_Dashboard_People!= ''){ + + // let peopleListArr = []; + // peopleListArr= res.Sup_Dashboard_People; + + // if(peopleListArr?.length > 0 ) { + + // setLoaderTitle("Downloading People list Data..."); + // setProcessing(true); + + // if(peopleListArr?.length > peoplelist) { + // setPeopleList(peopleListArr); + // notify("People list downloaded successfully."); + // setProcessing(false); + // } + // else{ + // setPeopleList(peopleListArr); + // setProcessing(false); + // } + + // } else { + // setPeopleList([]); + // notify('No data found!'); + // setProcessing(false); + // } + + // } + + // else{ + // notify('No data found!'); + // setProcessing(false); + // return []; + // } + + // }) + // .catch((err)=>{ + // console.log('onPage Team error people',err); + // setProcessing(false); + // notify("Cannot download people list data!") + // return []; + // }); + // } + + async function DownloadDataPeopledashboard(tabledata) { + let downloadkey = tabledata[0].DownloadKey; + + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url = props.baseurl + getMethodName(METHODS.DOWNLOADJSON_METHOD); + + let data = { + Downloadtype: downloadkey, + Username: loginDetails.UserId, + Param1: '', + Param2: '', + }; + + console.log(url, data); + + return await getDownloadJson1(url, data) + .then(async (res) => { + // Check if res.Sup_Dashboard_People is valid + if (res?.Sup_Dashboard_People) { + let peopleListArr = res.Sup_Dashboard_People; + + // Proceed if we received data + if (peopleListArr?.length > 0) { + // Compare the new data length with existing peoplelist length + const isDataChanged = peopleListArr.length !== peoplelist.length; + + // Only show loader if data has changed + if (isDataChanged) { + setLoaderTitle("Downloading People list Data..."); + setProcessing(true); + } + + // Update state with the new data + setPeopleList(peopleListArr); + + // Notify if the list is updated + if (isDataChanged) { + notify("People list downloaded successfully."); + } + + // Hide the loader after processing + setProcessing(false); + + } else { + // No data found scenario + setPeopleList([]); + notify('No data found!'); + setProcessing(false); + } + } else { + // Handle null or empty response + notify('No data found!'); + setProcessing(false); + return []; + } + }) + .catch((err) => { + console.log('Error in downloading people list:', err); + setProcessing(false); + notify("Cannot download people list data!"); + return []; + }); + } + + + const ProgressBar = ({ progress, kpi }) => ( + + + + + ); + + + const ListItem = ({ name, kpis, tabledata, items }) => { + // console.log("tabledata------>",tabledata) + return ( + props.navigation.navigate('PeopleDetail', { "Reportdata": tabledata, "peopledata": items })}> + + {/* Name and Sale */} + + {name} + + + + {kpis?.length > 0 && + kpis?.map((kpi, index) => { + return ( + + {kpi?.KPI} + + + {Math.round(kpi?.PER)}% + + + ) + }) + } + + + + Store Visited: {items?.LastMechandisedVisit ? (moment(items?.LastMechandisedVisit).format('DD/MM/YYYY')) : 'NA'} + + {/* Progress Bar */} + + + + ); + }; + + let report_key = 'Sup_Dashboard_People'; + let reportContentObj = props.AppDashboardReports != null && typeof props.AppDashboardReports == 'object' && props.AppDashboardReports[report_key] != null && props.AppDashboardReports[report_key] != '' ? props.AppDashboardReports[report_key] : {}; + + let report_data = reportContentObj['report_data'] != null ? reportContentObj['report_data'] : []; + let report_colWidth = reportContentObj['report_colWidth'] != null ? reportContentObj['report_colWidth'] : '50%'; + let report_cols = reportContentObj['report_cols'] != null ? reportContentObj['report_cols'] : []; + + // console.log("report_dataPeoples", report_data); + + return ( + + Sort By: Alphabet A To Z + + + handleSearch(text)} + /> + { ClearSearch(text) }}> + + + + + + + + + {filterData.length === 0 && searchedmiddyItem !== '' ? ( + No results found + ) : + index.toString()} + contentContainerStyle={{ + paddingBottom: 250 + }} + renderItem={({ item }) => } + scrollEnabled={true} + /> + } + + ) + } + + function _renderTabularReport(item) { + let report_key = item.DownloadKey; + let reportContentObj = props.AppDashboardReports != null && typeof props.AppDashboardReports == 'object' && props.AppDashboardReports[report_key] != null && props.AppDashboardReports[report_key] != '' ? props.AppDashboardReports[report_key] : {}; + + // {"report_data":data_arr,"report_colWidth":columnWidth,"report_cols":allCols} + let report_data = reportContentObj['report_data'] != null ? reportContentObj['report_data'] : []; + let report_colWidth = reportContentObj['report_colWidth'] != null ? reportContentObj['report_colWidth'] : '50%'; + let report_cols = reportContentObj['report_cols'] != null ? reportContentObj['report_cols'] : []; + // console.log("report_cols:",report_data , "report_colss",report_cols); + + + return ( + + {/* render No data */} + {report_data.length <= 0 && No Data} + {report_data.length > 0 && + {/* render columns */} + + {/* render header */} + + {report_cols.map((column, index) => { + return ( + + {column.colname} + + ) + })} + + + {/* render content */} + + + {report_data.map((row, row_index) => { + + let gset_obj = row["Color"] != null && row["Color"] != null != '' ? (row["Color"]) : {}; + + // console.log("gset_obj",gset_obj); + + return ( + + {report_cols.map((column, index) => { + let colValue = row[column.actual_colname] != null ? row[column.actual_colname] : ''; + + // console.log("colValue",colValue) + + let color_obj = get_rowColSettings(colValue, column.actual_colname, row); + + let cust_style = {}, bg_style = {}; + if (color_obj.color != null && color_obj.color != '') { + bg_style["backgroundColor"] = color_obj.color; + cust_style["color"] = '#fff' + } + if (color_obj.fontsize != null && color_obj.fontsize != '') { + cust_style["fontSize"] = color_obj.fontsize + } + if (color_obj.bold == 1) { + cust_style["fontWeight"] = "600" + } + + return ( + toggleModal(column.colname, colValue, row, item)} + > + {colValue} + + ) + })} + + ) + })} + + + + + } + + ) + } + + function _renderCardReport(item) { + let report_key = item.DownloadKey; + let reportContentObj = props.AppDashboardReports != null && typeof props.AppDashboardReports == 'object' && props.AppDashboardReports[report_key] != null && props.AppDashboardReports[report_key] != '' ? props.AppDashboardReports[report_key] : {}; + + // {"report_data":data_arr,"report_colWidth":columnWidth,"report_cols":allCols} + let report_data = reportContentObj['report_data'] != null ? reportContentObj['report_data'] : []; + let report_colWidth = reportContentObj['report_colWidth'] != null ? reportContentObj['report_colWidth'] : '50%'; + let report_cols = reportContentObj['report_cols'] != null ? reportContentObj['report_cols'] : []; + // console.log("report_cols:",report_data ,"itemss",item); + let ShowGraph = item?.ShowGraph + + return ( + + {/* render No data */} + {report_data.length <= 0 && No Data} + {report_data.length > 0 && + {/* render columns */} + + + {/* render content */} + + index.toString()} + renderItem={({ item, index }) => { + let gset_obj = item["Color"] != null && item["Color"] != '' ? item["Color"] : {}; + let card_bgColor = gset_obj["bgColor"] != null ? gset_obj["bgColor"] : ''; + let card_font = gset_obj["font"] != null ? gset_obj["font"] : {}; + let card_name = gset_obj["card_name"] != null ? gset_obj["card_name"] : ''; + let card_icon = gset_obj["icon"] != null ? gset_obj["icon"] : ''; + let show_random_icon = gset_obj["random_icon"] != null ? gset_obj["random_icon"] : true; + let hide_report_name = gset_obj["hide_report_name"] != null ? gset_obj["hide_report_name"] : false; + let isfirsItem = index == 0; + let islastItem = index == report_data.length - 1; + let isLastItem = report_data.length % 2 !== 0 && index === report_data.length - 1; + + // console.log("itemm----",item) + + const chartConfig = { + backgroundGradientFrom: "#fff", + backgroundGradientTo: "#fff", + color: (opacity = 1, dataIndex) => { + const color = gset_obj; + return color ? `${color}${Math.floor(opacity * 255).toString(16).padStart(2, '0')}` : `rgba(255, 255, 255, 0)`; + }, + strokeWidth: 2, + barPercentage: 0.5, + useShadowColorFromDataset: false, + }; + + let label = []; + let labelVal = []; + let barColor = []; + + label.push(item?.KPI); + let percentage = item?.PER?.replace('%', ''); + + if (percentage > 100) { + labelVal.push(parseFloat(100) / 100); + } else { + labelVal.push(parseFloat(item?.PER) / 100); + } + barColor.push(() => item?.Color); + + let showgraph = ShowGraph ? ShowGraph : false; + + let itemStyle = isLastItem ? { flex: 1, marginLeft: 'auto', marginRight: 'auto', width: '95%' } : { flex: 1 }; + + return ( + 1 + ? [customStyle.DashBCard_ItemNB1, { width: WP(isLastItem ? '92%' : '45%'), margin: 5, paddingVertical: 0, paddingHorizontal: 0 }] + : [customStyle.DashBCard_ItemNB1, { width: WP('95%') }], + (!isfirsItem && !islastItem ? customStyle.DashBCard_ItemMid : (isfirsItem ? customStyle.DashBCard_ItemFirst : customStyle.DashBCard_ItemLast)) + ]} + > + 1 + ? [customStyle.DashBCard_ItemNB2, { width: WP(isLastItem ? '92%' : '45%'), margin: 0, paddingVertical: 0, paddingHorizontal: 0 }] + : [customStyle.DashBCard_ItemNB2, { width: WP('95%') }] + ]}> + + {item?.Attendance != null && item?.Attendance != undefined && + + {item?.Attendance} + {item?.TotalCount} + + } + + {item?.KPI != null && item?.KPI != undefined && {item?.KPI}} + {item?.AvgCFT != null && item?.AvgCFT != undefined && {item?.AvgCFT}} + + {item?.TGT != null && item?.TGT != undefined && + + Target: + {item?.TGT} + + } + + {item?.ACT != null && item?.ACT != undefined && (!showgraph ? ( + + + {item?.ACT} + Achievement + + + {item?.PER} + + + ) : ( + + + {item?.ACT} + Achievement + + + + + {item?.PER} + + + + ))} + + {item?.Vacancy != null && item?.Vacancy != undefined && + + {item?.Name} + {item?.Vacancy} + + } + + + + + ); + }} + /> + + + + + } + + ) + } + + function _renderDashboardReports() { + + const [activeTabday, setActiveTabDay] = useState(0); + + const mainScreenTabs = AppDashReportsSec?.filter(item => item?.DashboardSection == "MainScreen")?.map(item => item?.TabName)?.filter(tabName => tabName); + + + const uniqueTabs = [...new Set(mainScreenTabs)]; + + const tabs = uniqueTabs.map((tabName) => ({ + title: tabName, // Tab title + content: `${tabName} content` // Placeholder for the content + })); + + + const filteredData = AppDashReportsSec?.filter((item) => item?.TabName?.includes(tabs[activeTabday].title)); + + + const renderItem = ({ item, index }) => { + const isAttendance = item?.DownloadKey && item?.DownloadKey?.includes("Attendance"); + + return ( + + + {item.DashboardName} + + {/* Render attendance data separately */} + {/* isAttendance == true && _renderAttendanceReport(item) */} + + {/* Render custom view for Attendance reports */} + {item.DashboardType === 'Card' && _renderCardReport(item)} + + {item.DashboardType === 'Tabular' && _renderTabularReport(item)} + + {/* Uncomment if needed */} + {/* {item.DrillDown && + { props.navigation.navigate("DashboardReportDetail", { "ReportData": item }) }}> + + } */} + + + ); + }; + + return ( + + + {/* Custom Tab Bar */} + + {tabs.map((tab, index) => ( + setActiveTabDay(index)} + > + + {tab.title} + + + ))} + + + + + {filteredData.length > 0 && + <> + + { refreshDashBReport() }} style={[customStyle.Dashboard_refrehButton]}> + REFRESH + + + + { props.navigation.navigate('DashboardReportDetail', { "ReportData": {} }) }}> + + SEE DETAIL + + + + + + } + + + index.toString()} + contentContainerStyle={{ paddingBottom: 100 }} + /> + + + + + ) + } + + function _renderDashboardView() { + + const [activeTab, setActiveTab] = useState(0); + + const tabs = [ + // { title: 'Dashboard', content: _renderDashboard() }, + { title: 'Dashboard', content: _renderDashboardReports() }, + + { title: 'People', content: renderPeopleList(activeTab) }, + ]; + + return ( + + {/* Custom Tab Bar */} + + {tabs.map((tab, index) => ( + setActiveTab(index)} + > + + {tab.title} + + + ))} + + + {/* Screen Content */} + + {tabs[activeTab].content} + + + ) + } + + // console.log("AppDashReportsSec", AppDashReportsSec) + const excludeKeys = ['AdKPIId', 'Color', 'KPIDrilldown', 'DisplayOrder']; + + + + // WebView Survey + + const [surveydata, setSurveyData] = useState({}); + const [modalVisiblesurvey, setModalVisibleSurvey] = useState(false); + const [surveyloader, setSurveyLoader] = useState(false); + const webViewRef = useRef(null); + const isFocused = useIsFocused(); + + const ShowSurveyPopup = async () => { + console.log("Survey popup called---") + let projectInfo = await get_item('projectInfo'); + let projectCode = await get_item('projectCode'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const projectDetails = JSON.parse(projectInfo); + + try { + setSurveyLoader(true); + const raw = JSON.stringify({ + ProjectId: projectDetails?.projectID, + UserId: loginDetails?.UserId || '', + + }); + let res = await fetch( + "https://api1.parinaam.in/api/cpminternal/GetPopupWeburl", + { + method: "POST", + body: raw, + headers: { + Accept: "application/json", + "Content-Type": "application/json", + }, + } + ); + let responseJson = await res.json(); + if (responseJson) { + setSurveyData(responseJson?.GetPopupWeburl || {}); + // console.log("responseJson?.GetPopupWeburl[0]?.Status",responseJson?.GetPopupWeburl[0]) + if (responseJson?.GetPopupWeburl[0]?.Status) { + setModalVisibleSurvey(false); + } else { + setModalVisibleSurvey(true); + } + + } else { + setSurveyData({}); + } + } catch (error) { + Alert.alert("Survey Popup:" + error); + } finally { + setSurveyLoader(false); + } + }; + + useEffect(() => { + ShowSurveyPopup(); + }, [isFocused]); + + let webUrl = surveydata[0]?.WebUrl; + + + const injectedJS = ` + (function() { + const element = document.getElementById('cpminternalclose'); + console.log(element, "element") + if (element) { + window.ReactNativeWebView.postMessage(JSON.stringify({ id: element.id })); + } else { + // window.ReactNativeWebView.postMessage(JSON.stringify({ message: "Element not found" })); + } + })(); + true; + `; + + const handleMessage = (event) => { + try { + const data = JSON.parse(event.nativeEvent.data); + if (data.error) { + Alert.alert(data.error); + } else { + console.log('Element data:', data); + if (data?.id == 'cpminternalclose') { + setTimeout(() => { + setModalVisibleSurvey(false); + ShowSurveyPopup(); + }, 1500); + } else { + Alert.alert("Id not found"); + } + + } + } catch (error) { + Alert.alert('Error parsing message:', error); + } + }; + + return ( + + <> + + {processing && } + {(props.startDownload && dowloadedCount <= totalCount) && } + + + {/* + + {(state.webviewurl!='' && state.webviewurl!=null) && } + + */} + + + + + + Quick Links + { + // console.log('onrender item ', item); + let IconCompFunc = item.icon; + let showVectoreIcon = item.iconType == 'Icon' ? true : false; + return ( + + + + {!showVectoreIcon && } + {showVectoreIcon && IconCompFunc()} + + {item.text} + + + ) + }} + /> + + + + {bannerdetail.length > 0 && + + { setActiveSlide(index) }} + renderItem={({ item, index }) => { + let url = item.NoticeLink_Thumbnail; + // console.log('onrender item ',url); + return ( + + { props.navigation.navigate('Bannerdetail', { imagedesc: item }) }} > + + + + ) + }} + /> + + + + + } + + {props.Show_OldMTDReports && + + Performance + { + return ( + + + + + + {item.text} + {item.value} + + + + + + + ) + }} + /> + + } + + {props.ShowDashboard && _renderDashboardView()} + + + + + { + Alert.alert('Modal has been closed.'); + setModalVisible(!modalVisible); + }}> + + + + + setModalVisible(false)}> + {modaldata?.item.DashboardName + ' Detail'} + + + + + {Object.entries(modaldata?.row) + .filter(([key]) => !excludeKeys.includes(key)) // Filter out excluded keys + .map(([key, value]) => ( + + {key}: + {value.toString()} + + ))} + + + + + + + + + + + + + { + setModalVisibleSurvey(false)} + > + + + {surveyloader && } + setSurveyLoader(true)} + onLoadEnd={() => { + setSurveyLoader(false); + // setWebViewReady(true); + console.log("ENd Loadingggg...---"); + }} + ref={webViewRef} + injectedJavaScript={injectedJS} + onMessage={handleMessage} + /> + + + + } + + + ); +} + + +const styles = StyleSheet.create({ + container: { + flex: 1, + backgroundColor: '#fff', + }, + tabBar: { + flexDirection: 'row', + justifyContent: 'space-around', + backgroundColor: '#e6ecec', + }, + tabButton: { + paddingHorizontal: 30, + paddingVertical: 10 + + }, + subtabButton: { + paddingHorizontal: 20, + paddingVertical: 6 + + }, + tabText: { + fontSize: 16, + color: '#666', + }, + activeTab: { + borderBottomWidth: 3, + borderBottomColor: '#000', + }, + activeTabText: { + color: '#000', + fontWeight: '500' + }, + subtabBar: { + flexDirection: 'row', + // justifyContent: 'space-around', + paddingHorizontal: 10, + marginTop: 10 + }, + subactiveTab: { + borderRadius: 20, + backgroundColor: '#01978C', + //overflow: 'hidden', + }, + subinactiveTab: { + borderRadius: 20, + borderColor: '#01978C', + borderWidth: 1, + overflow: 'hidden' + }, + subactiveTabText: { + color: '#fff', + fontWeight: '500' + }, + subinactiveTabText: { + color: '#000', + fontWeight: '500' + }, + screenContainer: { + // flex:1 + }, + screen: { + // flex:1 + }, + screenText: { + fontSize: 24, + fontWeight: 'bold', + }, + divider: { + height: 2, + + }, + verticalLine: { + height: 1.5, + width: '100%', + backgroundColor: '#ACB7C233', + marginVertical: 5 + }, + statsContainer: { + flexDirection: 'row', + justifyContent: 'space-between', + // alignItems: 'center', + // width: WP('92%'), + backgroundColor: '#71c4c0', + padding: 0 + }, + statItem: { + flexDirection: 'row', + alignItems: 'center', + }, + presentStatValue: { + backgroundColor: '#71c4c0', + padding: 15, + fontSize: 14, + fontWeight: '500', + color: '#000' + }, + absentStatValue: { + backgroundColor: '#F8C6AB', + padding: 15, + fontSize: 14, + fontWeight: '500', + }, + statLabel: { + paddingLeft: 20, + paddingRight: 20, + fontSize: 14, + fontWeight: '500', + color: '#000' + }, + // list of peoples + itemContainer: { + backgroundColor: '#fff', + padding: 10, + borderRadius: 10, + marginVertical: 10, + elevation: 2, + shadowColor: '#000', + shadowOffset: { width: 0, height: 2 }, + shadowOpacity: 0.1, + shadowRadius: 5, + borderColor: '#B2BCCE', + borderWidth: 1 + }, + textContainer: { + flexDirection: 'row', + justifyContent: 'space-between', + marginBottom: 5, + }, + nameText: { + fontSize: 15, + fontWeight: '500', + color: '#000000', + + }, + saleText: { + fontSize: 14, + fontWeight: '400', + color: '#000', + marginBottom: 5, + + }, + progressBarContainer: { + height: 8, + flex: 1, + backgroundColor: '#D3D3D3', + borderRadius: 5, + overflow: 'hidden', + }, + progressBarFill: { + height: '100%', + // backgroundColor: '#00968e', + borderRadius: 5, + }, + coverageButton: { + backgroundColor: '#E9F1FE', + paddingVertical: 10, + borderRadius: 5, + flexDirection: 'row', + alignItems: 'center', + width: '40%', + justifyContent: 'center', + // alignSelf: 'flex-end' + alignSelf: 'flex-start' + + + }, + progressText: { + marginLeft: 10, + fontSize: 14, + color: '#000', + fontWeight: '500' + }, + buttonText: { + color: 'gray', + fontSize: 14, + fontWeight: '500', + }, + chartContainer: { + position: 'relative', + alignItems: 'center', + marginTop: 0 + }, + percentageContainer: { + position: 'absolute', + top: '50%', + left: '50%', + transform: [{ translateX: -15 }, { translateY: -12 }], + }, + + // modal survey + // modal + screen: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: '#f2f2f2', + }, + buttonText: { + color: '#fff', + fontSize: 16, + }, + modalContainer: { + flex: 1, + // backgroundColor: 'rgba(0, 0, 0, 0.5)', + justifyContent: 'center', + alignItems: 'center', + overflow: 'hidden', + marginTop: -20 + }, + modalContent: { + width: '90%', + height: '90%', + backgroundColor: '#fff', + borderRadius: 10, + overflow: 'hidden', + }, + webView: { + flex: 1, + }, +}); + + +export default connect(mapStateToProps, mapDispatchToProps)(NoticeBoard); \ No newline at end of file diff --git a/src/screens/One_QAD.js b/src/screens/One_QAD.js new file mode 100644 index 0000000..bca2bf8 --- /dev/null +++ b/src/screens/One_QAD.js @@ -0,0 +1,452 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import CustomButton from '../components/customButton'; +import { globalStyles,customStyles,GetPageTheme,customeButtons } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,KeyboardAvoidingView,Animated, ImageBackground, FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,copyrightText,baseurl} from '../constants/constants'; +import {_checkLocationPermission} from '../components/geolocation'; +import OtpInputs from 'react-native-otp-inputs'; +import SplashScreen from 'react-native-splash-screen'; +import CustomLoader from '../components/CustomLoader'; +import DeviceInfo from 'react-native-device-info'; +import {getDownloadJson, UploadData2,UploadData} from '../controller/functions'; +import moment from 'moment'; +import { SvgUri, SvgXml} from 'react-native-svg'; +import GradientButton from '../components/gradientButton'; +import { Ionicons ,Fontisto, AntDesign} from '../components/icons'; +import LinearGradient from 'react-native-linear-gradient'; + +import Graphic1 from '../assets/performics/oqad_graphic.svg'; +import { getMethodName, METHODS } from '../constants/methodNames'; + +function One_QAD(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const customeButton=customeButtons(props.DarkMode,route.name); + const todayDate=moment(new Date()).format('DD/MM/YYYY'); + + const AnswerTimeOut=props.OQAD_TimeOut; + var globalTimer=AnswerTimeOut; + const timerRef = useRef({}); + const timerAnimated = useRef(new Animated.Value(0)).current; + const [answers, setAnswers] = useState({}); + const [rerenderdata, setrerenderdata]= useState(0); + const [processing, setProcessing] = useState(false); + const [currentQtn, setCurrentQtn] = useState(1); + const [totalQtn, setTotalQtn] = useState(0); + const [answerTimer, setAnswerTimer] = useState({"1":globalTimer}); + const [qad, setQad] = useState([]); + + + useEffect(() => { + SplashScreen.hide(); + get_OQAD(); + }, []); + + useEffect(() => { + console.log('currentQtn chnge'); + let cqtn=currentQtn; + if(currentQtn>1){ + let item=qad.length>0? qad[(cqtn-1)]:null; + if(item){ + let qid=item.QuestionId; + let qtnKey=qid+'_question'; + let show_qtnKey=qid+'_question_show'; + let AllAns=answers; + console.log(answerTimer); + + if(AllAns[qtnKey]==null && AllAns[show_qtnKey]==null){ + globalTimer=AnswerTimeOut; + let atimerarr=answerTimer; + atimerarr[cqtn]=AnswerTimeOut; + setAnswerTimer(atimerarr); + timerAnimated.setValue(0); + setTimer(); //restart timer + } + } + } + }, [currentQtn]); + + + async function get_OQAD(){ + setProcessing(true); + let token = await get_item('loginToken'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + var data = {Downloadtype: 'OQAD',username: loginDetails.UserId,empid: '',token: token,}; + + const url=(props.baseurl || baseurl)+getMethodName(METHODS.DOWNLOADJSON_METHOD); + console.log(url,data); + await getDownloadJson(url, data) + .then(async(res) => { + setProcessing(false); + console.log('res:',res); + if (res.OQAD!=null) { + let QAD_arr=res.OQAD|| []; + let allQADS=[]; + + var qad_data={}; + var qids=[]; + for(var i=0;i0) allQADS.push(qad_data); + qids.push(data.QuestionId) + qad_data={}; + qad_data['QuestionId']=data.QuestionId; + qad_data['Question']=data.Question; + qad_data['Options']=[{'AnswerId':data.AnswerId,'Answer':data.Answer}]; + if(data.RightAnswer==true) qad_data['Answer']=data.AnswerId; + + } + else{ + let ops=qad_data['Options'] || []; + ops.push({'AnswerId':data.AnswerId,'Answer':data.Answer}); + if(data.RightAnswer==true) qad_data['Answer']=data.AnswerId; + + } + } + + allQADS.push(qad_data); + setQad(allQADS); + setTotalQtn(allQADS.length); + setTimer(false,false,allQADS); + + } + else if(typeof(res)=='object' && res.length>0 && res[0].Result!=null && res[0].Result.includes('No Data')){ + // OQAD Not Found + goToHome(); + } + }) + .catch(err => { + console.log('onPage Team error', err); + }); + + } + + + async function submitAnswer(){ + if(validate()){ + setProcessing(true); + let token = await get_item('loginToken'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const today=moment(new Date()).format('MM/DD/YYYY'); + + var user_answers=[]; + for (const qtn_key in answers){ + const item=answers[qtn_key]; + console.log(qtn_key); + if(qtn_key.includes('_question_show')){ + console.log('showed question'); + let qid=qtn_key.replace('_question_show',''); + let answerid=0; + var ans_obj={"ANSWER_ID":answerid,"QUESTION_ID":qid,"VISIT_DATE":today,"USER_NAME":loginDetails.UserId}; + } + else if(qtn_key.includes('_question')){ + console.log('qtn replied') + let qid=item.qid; + let answerid=item.selId; + var ans_obj={"ANSWER_ID":answerid,"QUESTION_ID":qid,"VISIT_DATE":today,"USER_NAME":loginDetails.UserId}; + } + user_answers.push(ans_obj); + } + let post_data={ + "MID":"0", + "Keys": "TODAY_ANSWER", + "JsonData":JSON.stringify(user_answers), + "UserId": loginDetails.UserId + } + + + + const url=props.baseurl+getMethodName(METHODS.UPLOADJSON_METHOD); + + console.log('OQAD upload ',url,post_data); + + await UploadData2(url, post_data) + .then(async(res) => { + setProcessing(false); + console.log(res); + if(res.UploadJsonResult=='Success'){ + + } + goToHome(); + + }) + .catch(err => { + console.log('onPage Team error', err); + }); + } + } + + async function goToHome(){ + let params=props.route.params? props.route.params:{}; + let isTodayLogin=params.TodayLogin!=null?params.TodayLogin:false; + // props.setLoginExists(false); + props.navigation.reset({index: 0,routes: [{name: 'NoticeBoard',params:{'TodayLogin':isTodayLogin}}],}); + } + + async function goToNext(){ + if(validate()){ + let cqtn=currentQtn; + cqtn=cqtn1?cqtn-1:cqtn; + setCurrentQtn(cqtn); + } + + function setTimer(reset,stop,allQADS=[]){ + let arr=timerRef.current; + if(stop){ + console.log('clearTimeout',arr[currentQtn],currentQtn,arr); + if(arr[currentQtn]){clearTimeout(arr[currentQtn]);} + } + else{ + reset?globalTimer=AnswerTimeOut:--globalTimer; + if(globalTimer>=0){ + let atimerarr=answerTimer; + atimerarr[currentQtn]=globalTimer; + + if(timerAnimated){ + Animated.timing(timerAnimated, { + toValue: (AnswerTimeOut-globalTimer), + duration:1100, + useNativeDriver:false, + }).start(); + } + + // console.log('atimerarr',currentQtn,globalTimer,atimerarr); + setAnswerTimer(atimerarr); + setrerenderdata(globalTimer); + arr[currentQtn]=setTimeout(()=>{ setTimer(false,false,allQADS);},1000); + } + else{showAnswer(allQADS);} + } + + } + + async function selectAnswer(item,option){ + console.log('selectAnswer'); + let qid=item.QuestionId; + let qtnKey=qid+'_question'; + let AllAns=answers; + if(AllAns[qtnKey]==null){ + AllAns[qtnKey]={'selId':option.AnswerId,'selText':option.Answer,'qid':qid}; + } + setTimer(false,true); // stop timer + setAnswers(AllAns); + console.log('selectAnswer:',AllAns); + setrerenderdata(!rerenderdata); + + } + + async function showAnswer(allQADS=[]){ + let item=allQADS.length>0 && currentQtn>=1?allQADS[(currentQtn-1)]:null; + + if(item!=null){ + let qid=item?item.QuestionId:''; + let show_qtnKey=qid+'_question_show'; + let AllAns=answers; + if(AllAns[show_qtnKey]==null){ + AllAns[show_qtnKey]=true; + } + setAnswers(AllAns); + console.log('showAnswer:',AllAns); + setrerenderdata(!rerenderdata); + } + } + + + const validate=()=>{ + let item=qad.length>0? qad[(currentQtn-1)]:null; + if(item){ + let qid=item.QuestionId; + let qtnKey=qid+'_question'; + let show_qtnKey=qid+'_question_show'; + let AllAns=answers; + if(AllAns[qtnKey]==null && AllAns[show_qtnKey]==null){ + notify(ST.Pleaseselectyouranswer,'SHORT'); + return false; + } + } + return true; + } + + const validate2=()=>{ + + if(qad.length>0){ + for(var i=0;i + + {processing && } + + + {ST.HeyThere} + {ST.OneQuestionADay} + + + + + {/* */} + + + + + 0?(((currentQtn/totalQtn)*100)+'%'):'100%')}]}> + + {currentQtn+'/'+totalQtn} + + + { qad.length>0 && + { + let Options=item.Options; + let qid=item.QuestionId; + let qtnKey=qid+'_question'; + let show_qtnKey=qid+'_question_show'; + let AllAns=answers; + + let showAnswer=AllAns[show_qtnKey]!=null?AllAns[show_qtnKey]:false; + let selAns=AllAns[qtnKey]!=null?AllAns[qtnKey]['selId']:''; + console.log('AllAns',showAnswer); + + let prev_time=answerTimer[currentQtn] + {item.Question} + + { Options.length>0 && + Options.map((option,op_index)=>{ + let show_diff_bg=(item.Answer && ((selAns!='' && selAns!=null) || showAnswer) + && (item.Answer==option.AnswerId || ((selAns!='' && selAns!=null) && selAns==option.AnswerId))) ?true:false; + + let ansbgColor=((selAns!='' && selAns!=null) && selAns==option.AnswerId && (item.Answer!=selAns))?'red':'green'; + + let opbg=show_diff_bg?{backgroundColor:ansbgColor}:{}; + let opcolorText=show_diff_bg?{color:'#fff'}:{}; + let isD=((selAns!='' && selAns!=null) || showAnswer); + let isdisabled=(((selAns!='' && selAns!=null) || showAnswer) && item.Answer!=null && item.Answer!=option.AnswerId); + let disablebg=(isdisabled?{backgroundColor:PageTheme.$text_color_500}:{}); + let disabletext=(isdisabled?{color:PageTheme.$accent_color}:{}); + + return( + {selectAnswer(item,option)}}> + {option.Answer} + + ) + }) + } + + + + {answerTimer[currentQtn]+'s'} + + + {/* */} + + + + + {(selAns==item.Answer && (selAns!=null && selAns!='')) && + {ST.WellDoneGoodJob} + } + {(selAns!=item.Answer && ((selAns!=null && selAns!='') || showAnswer)) && + {ST.OopsBetterlucknexttime} + } + { index==( qad.length-1) && + + { (index!=0) && + {goToPrev();}} style={[customStyle.qad_qtnBtn,customStyle.qad_btnBack]}> + {ST.Back} + + } + {submitAnswer();}} style={[customStyle.qad_btnSubmitCon]}> + + {ST.Submit} + + + + } + { index<( qad.length-1) && + + {(index!=0) && + {goToPrev();}} style={[customStyle.qad_qtnBtn,customStyle.qad_btnBack]}> + {ST.Back} + + } + {goToNext();}} style={[customStyle.qad_qtnBtn,customStyle.qad_btnNext]}> + {ST.Next} + + + } + + ) + }} + + /> + } + + + + {/* */} + + {version} + {copyrightText} + + + + + ); +} + +export default connect(mapStateToProps, mapDispatchToProps)(One_QAD) \ No newline at end of file diff --git a/src/screens/OpeningStock.js b/src/screens/OpeningStock.js new file mode 100644 index 0000000..0b86404 --- /dev/null +++ b/src/screens/OpeningStock.js @@ -0,0 +1,756 @@ +import React,{useState,useEffect, useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, KeyboardAvoidingView, BackHandler} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,getKPIFields,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { ExitScreenAlert } from '../components/alert'; +import CustomCamera from '../components/Camera'; + +function OpeningStock(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [brandData, setBrandData] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + const [KPIFields, setKPIFields] = useState([]); + + const [catImages, setCatImages] = useState([]); + const [SKUStockData, setSKUStockData] = useState([]); + const [showAlert, setShowAlert] = useState(false); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + + const inputRefs = useRef({}); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + + function onRemoveScreen(e){ + Alert.alert( + "", + "Do you really want to exit the screen?", + [ + { + text: "Cancel", + onPress: () => {}, + style: "cancel" + }, + { text: "OK", onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + async function getData(storeData1,menu1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + let allCats=[]; + + let AllKPIFields=await getKPIFields(menu1); + setKPIFields(AllKPIFields); + + await db.transaction(async function (txn) { + + let join=' INNER join Product_Master p on c.CategoryId=p.CategoryId '; + let join2=' INNER join Mapping_ProductAssortment mp on p.ProductId=mp.ProductId '; + let q=`SELECT DISTINCT c.CategoryId,c.CategoryName,mp.MSL from Master_Category c ${join} ${join2} where mp.StateId='${StateId}' and mp.ChainId='${ChainId}' and mp.StoreTypeId='${StoreTypeId}' order by p.CategorySequence`; + + let q2=` SELECT CATEGORY_ID as CategoryId,CATEGORY as CategoryName,MSL,IMAGE,IMAGEPATH FROM ${AppTables.INSERT_OPENINGHEADER_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + await txn.executeSql(q2,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + + let arr=[]; + for(var i=0;i0){ + let arr=[]; + for(var i=0;i { + let seletlist=`PRODUCT as ProductName,PRODUCT_ID as ProductId,BRAND as BrandName,BRAND_ID as BrandId,MSL,OPENING_STOCK,MIDDAY_STOCK,CLOSING_STOCK,EXPIRY_ISOPEN,EXPIRY_STK`; + let sku_q=`SELECT ${seletlist} FROM ${AppTables.STOCK_DATA} WHERE STORE_ID='${StoreId}' and CATEGORY_ID='${item.CategoryId}' `; + + let join=` inner join Mapping_ProductAssortment m on p.ProductId=m.ProductId `; + let join2=` inner join Master_Category mc on mc.CategoryId=p.CategoryId `; + let sku_q2=`select distinct p.ProductName,p.ProductId,p.BrandName,p.BrandId,m.MSL from Product_Master p ${join} ${join2} where m.ChainId='${ChainId}' and m.StateId='${StateId}' and m.StoreTypeId='${StoreTypeId}' and p.CategoryId='${item.CategoryId}' and CompanyId='1' order by p.ProductSequence`; + + + return await txn.executeSql(sku_q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + + let arr=[]; + for(var i=0;i{setrerenderdata2(!rerenderdata2);},3000); + setProcessing(false); + } + return item; + } + } + } + else{ + return await txn.executeSql(sku_q2,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + + }); + }); + } catch (err) { + console.log(err); + } + } + + async function focusToNext(cat,index,sku,sku_index,inputType='1'){ + console.log('focusToNext',index,sku_index,inputType); + let data=brandData; + + let isExpStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ExpiredStock') + let isExpStockPIObj=isExpStockIndex>=0?KPIFields[isExpStockIndex]:{}; + let isExpStockEnable=isExpStockIndex>=0?isExpStockPIObj['KPIFieldEnable']:true; + let key=isExpStockEnable?'input1_':'input2_'; + + if(inputType=='1'){ + console.log('next 1 call') + let refIn2=inputRefs.current['input2_'+cat.CategoryId+'_'+sku.ProductId]; + refIn2.focus(); + } + else{ + let ccat_index=index; + let skulist=cat.skulist || []; + console.log('skulist.length:',skulist.length) + if(sku_index==skulist.length-1){ // if last subcategory element + //then move to next category + console.log('move to next cat',ccat_index,data.length) + if(ccat_index==data.length-1){ + return; + } + else{ + ccat_index+=1; + console.log('move to next cat n:',ccat_index) + let cat1=data[ccat_index]; + let skulist1=cat1.skulist || []; + if(skulist1.length>0){ + let sku1=skulist1[0]; + + let refIn1=inputRefs.current[key+cat1.CategoryId+'_'+sku1.ProductId]; + console.log('move to next cat refIn1:',key+cat1.CategoryId+'_'+sku1.ProductId) + refIn1.focus(); + } + } + } + else{ + // move to next subcategory + let sku1=skulist[sku_index+1]; + let refIn1=inputRefs.current[key+cat.CategoryId+'_'+sku1.ProductId]; + refIn1.focus(); + } + + + + } + + } + + async function getImage(imgdata){ + let cat=getImageProps.option || ''; + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify('Camera unavailable'); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl='file://'+img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: Opening Stock'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+(props.UserId || '')+'_OpeningStk-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let allIMgs=catImages; + let defData={'CategoryId':cat.CategoryId}; + const cindex=allIMgs.findIndex(i=>i.CategoryId==cat.CategoryId); + const imgData=cindex>=0?(allIMgs[cindex] || defData):defData; + imgData.ImageName=filename; + + // renamefile + let imagePath='file://'+`${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri=imagePath; + console.log('image marker',uri); + imgData.ImagePath=uri; + cindex>=0?allIMgs[cindex]=imgData:allIMgs.push(imgData); + setCatImages(allIMgs); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(option){ + setGetImageProps({'option':option}); + console.log('openCamera'); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}); + setShowCamera(true); + } + + async function submitOpeningStock(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + let q=`DELETE FROM ${AppTables.STOCK_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + let q2=`DELETE FROM ${AppTables.INSERT_OPENINGHEADER_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // remove old data + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('stock data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('stock header data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + let seq_q=` select seq from sqlite_sequence where name="${AppTables.INSERT_OPENINGHEADER_DATA}" `; + await txn.executeSql(seq_q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let data=txnres.rows.item(0); + let seq=data.seq; + insertData(seq); + } + else{ + insertData(0); + } + },function (txn2, txnerr) { console.log(txnerr); insertData(0); },); + + + }); + } catch (err) { + console.log(err); + } + } + + async function insertData(seq=0){ + try { + console.log(seq); + let {StoreId,ChainId,StateId,StoreTypeId,ExpiryStock}=storeData; + + let isExpStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ExpiredStock') + let isExpStockPIObj=isExpStockIndex>=0?KPIFields[isExpStockIndex]:{}; + let isExpStockEnable=isExpStockIndex>=0?isExpStockPIObj['KPIFieldEnable']:true; + + await db.transaction(async function (txn) { + var values='',stock_values=''; + for(var i=0;ici.CategoryId==item.CategoryId) || {}; + values+=values!=''?' , ':''; + + + values+=` ('${StoreId}','${d2}','${item.CategoryName}','${item.CategoryId}','${item.MSL}','${cimage.ImageName}','${cimage.ImagePath}','${d2}') `; + + let skulist=item['skulist'] || []; + + for(var j=0;jci.CategoryId==item.CategoryId && ci.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || {}) : {}; + let expStock=isExpStockEnable==true?(skud['ExpiryStock']!=null?skud['ExpiryStock']:'0'):'0'; + + + stock_values+=` ('${seq}','${StoreId}','${d2}','${item.CategoryId}','${item.CategoryName}','${BrandId}','${BrandName}','${ProductId}','${ProductName}','${MSL}','${skud['Stock']}','','','${ExpiryStock}','${expStock}','${d2}') `; + } + } + + let add_StockHdr=`INSERT INTO ${AppTables.INSERT_OPENINGHEADER_DATA} (STORE_ID,VISIT_DATE,CATEGORY,CATEGORY_ID,MSL,IMAGE,IMAGEPATH,ADDED_DATE) VALUES ${values} `; + let add_Stock=`INSERT INTO ${AppTables.STOCK_DATA} (COMMON_ID,STORE_ID,VISIT_DATE,CATEGORY_ID,CATEGORY,BRAND_ID,BRAND,PRODUCT_ID,PRODUCT,MSL,OPENING_STOCK,MIDDAY_STOCK,CLOSING_STOCK,EXPIRY_ISOPEN,EXPIRY_STK,ADDED_DATE) VALUES ${stock_values} `; + + + + await txn.executeSql(add_StockHdr,[],async function (txn2, txnres) { + console.log('stock header added'); + await txn.executeSql(add_Stock,[],async function (txn2, txnres) { + console.log('stock added'); + notify('Stock updated successfully'); + setProcessing(false); + props.navigation.goBack(); + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot add stock') },); + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot add stock') },); + }); + } catch (err) { + console.log(err); + } + } + + + async function validate(){ + let isValid=true; + var i=0,j=0; + + let isExpMandIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ExpiredStockMandatory') + let isExpMandKPIObj=isExpMandIndex>=0?KPIFields[isExpMandIndex]:{}; + let isExpMandEnable=isExpMandIndex>=0?isExpMandKPIObj['KPIFieldEnable']:true; + + let isExpStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ExpiredStock') + let isExpStockPIObj=isExpStockIndex>=0?KPIFields[isExpStockIndex]:{}; + let isExpStockEnable=isExpStockIndex>=0?isExpStockPIObj['KPIFieldEnable']:true; + + + await Promise.all( + brandData.map(async (item,index) => { + if(isValid){ + let catId=item.CategoryId; + let cimgData=catImages.find(ci=>ci.CategoryId==catId) || {}; + if(cimgData.ImagePath== null || cimgData.ImagePath==''){ + notify('Please click image for '+item.CategoryName,'SHORT'); + isValid=false; + } + else{ + let skulist=item.skulist || []; + if(skulist.length>0){ + await Promise.all( + skulist.map(async (skuItem,skuIndex) => { + if(isValid){ + let skuData=SKUStockData.find(ci=>ci.CategoryId==item.CategoryId && ci.ProductId==skuItem.ProductId ) || {}; + + if(skuData.Stock!==0 && ( skuData.Stock==null || skuData.Stock=='')){ + notify('Please enter stock for '+skuItem.ProductName,'SHORT'); + isValid=false; + } + else if((isExpMandEnable==1 && isExpStockEnable==true) && skuData.ExpiryStock!==0 && (skuData.ExpiryStock==null || skuData.ExpiryStock=='')){ + notify('Please enter expiry stock for '+skuItem.ProductName,'SHORT'); + isValid=false; + } + else if(isExpStockEnable==true &&(parseInt(skuData.ExpiryStock)>parseInt(skuData.Stock))){ + notify('Expiry Stock value should be less than or equal to Stock for '+skuItem.ProductName,'SHORT'); + isValid=false; + }else{ + + } + } + }) + ); + } + } + } + }) + ); + + console.log('isValid:',isValid); + return isValid; + } + + function onStockValChange(item,skuItem,val,key,type=''){ + if(type=='numeric' && val!=''){ + const regex = new RegExp(/^\d+$/); + let isNUmeric=regex.test(val); + if(!isNUmeric){ + notify('Please enter whole numbers only','SHORT'); + return; + } + } + + let allSKUData=SKUStockData; + let defData={'CategoryId':item.CategoryId,'ProductId':skuItem.ProductId}; + const skud_index=allSKUData.findIndex(i=>i.CategoryId==item.CategoryId && i.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + skud[key]=val; + + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function _render_Alert(){ + return ( + + + {setShowAlert(false)}}> + Cancel + + {saveData()}}> + Yes + + + + ) + } + + function _renderStocks(){ + let isExpStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ExpiredStock') + let isExpStockPIObj=isExpStockIndex>=0?KPIFields[isExpStockIndex]:{}; + let isExpStockEnable=isExpStockIndex>=0?isExpStockPIObj['KPIFieldEnable']:true; + + return ( + + { + const cat=item; + const catIndex=index; + const cindex=catImages.findIndex(i=>i.CategoryId==item.CategoryId); + const cimgName=cindex>=0?(catImages[cindex]?catImages[cindex].ImageName:''):''; + const cimgPath=cindex>=0?(catImages[cindex]?catImages[cindex].ImagePath:''):''; + const showIMg=cimgPath!='' && cimgPath!=null; + return( + + + + {item.CategoryName} + + + {/* + + */} + { !showIMg && + {openCamera(item)}}> + + + } + { showIMg && + + + {/* */} + {openCamera(item)}}> + + + + } + + + + { + + { + const skus=item; + const sku_index=index; + let thisCatSkuData_i=SKUStockData.findIndex(i=>i.CategoryId==cat.CategoryId && i.ProductId==skus.ProductId); + let thisCatSkuData=thisCatSkuData_i>=0?(SKUStockData[thisCatSkuData_i] || {}):{}; + let stock=thisCatSkuData.Stock!=null?thisCatSkuData.Stock:''; + let ex_stock=thisCatSkuData.ExpiryStock!=null?thisCatSkuData.ExpiryStock:''; + return( + + {skus.ProductName} + + {isExpStockEnable==true && + + + Stock + {inputRefs.current['input1_'+cat.CategoryId+'_'+skus.ProductId]=reff;}} + style={[customStyle.openStk_prd_inputStyle]} + placeholder="" + placeholderTextColor={PageTheme.$placeholder_color} + value={(stock!=null?stock+'':'0')} + keyboardType='number-pad' + onSubmitEditing={()=>{focusToNext(cat,catIndex,skus,sku_index,'1')}} + onChangeText={(val)=>{ onStockValChange(cat,skus,val,'Stock','numeric')}} + autoComplete='off' + /> + + + Expiry Stock + {inputRefs.current['input2_'+cat.CategoryId+'_'+skus.ProductId]=reff;}} + style={[customStyle.openStk_prd_inputStyle]} + placeholder="" + placeholderTextColor={PageTheme.$placeholder_color} + value={(ex_stock+'' || '')} + keyboardType='number-pad' + onSubmitEditing={()=>{focusToNext(cat,catIndex,skus,sku_index,'2')}} + onChangeText={(val)=>{ onStockValChange(cat,skus,val,'ExpiryStock','numeric')}} + autoComplete='off' + /> + + + } + {isExpStockEnable==false && + + + Stock + {inputRefs.current['input2_'+cat.CategoryId+'_'+skus.ProductId]=reff;}} + style={[customStyle.openStk_prd_inputStyle,customStyle.openStk_prd_flex_inputStyle]} + placeholder="" + placeholderTextColor={PageTheme.$placeholder_color} + value={(stock+'' || '')} + keyboardType='number-pad' + onChangeText={(val)=>{ onStockValChange(cat,skus,val,'Stock','numeric')}} + onSubmitEditing={()=>{focusToNext(cat,catIndex,skus,sku_index,'2')}} + autoComplete='off' + /> + + + } + + + ) + }}/> + } + + + ); + }} + /> + + ); + } + + return ( + + {processing && } + + {_render_Alert()} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + { Object.keys(storeData).length>0 && + _renderStocks() + } + + {submitOpeningStock()}}/> + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(OpeningStock); \ No newline at end of file diff --git a/src/screens/POSM.js b/src/screens/POSM.js new file mode 100644 index 0000000..7bf69e5 --- /dev/null +++ b/src/screens/POSM.js @@ -0,0 +1,1666 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, Animated} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,getKPIFields,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, FontAwesome, Fontisto, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector' +import { CustomPicker, CustomPicker2 } from '../components/CustomPicker'; +import CustomCamera from '../components/Camera'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import DateTimePicker from '@react-native-community/datetimepicker'; + + +import cameraImg from '../assets/performics/camera_front_image.svg' +import MultiSelect from 'react-native-multiple-select'; + +function POSM(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const animatedChoice=useRef(new Animated.Value(0)).current; + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + const [rerenderdata3, setrerenderdata3]= useState(0); + const [rerenderdata4, setrerenderdata4]= useState(0); + + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + + const [dateValue, setDateValue] = useState(''); + const [WindowData, setWindowData] = useState([]); + const [reasons_list, setReasons_list] = useState([]); + const [Windows, setWindows] = useState([]); + const [globalWindows, setGlobalWindows] = useState([]); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [showAlert, setShowAlert] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const zoomView=useRef(null); + const [showRating, setShowRating] = useState(false); + const [RatingQtn, setRatingQtn] = useState({}); + const [RatingWindow, setRatingWindow] = useState({}); + const [RatingOrder, setRatingOrder] = useState([]); + const [searchedItem, setSearchedItem]= useState(''); + const [KPIFields, setKPIFields] = useState([]); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + + function onRemoveScreen(e){ + Alert.alert( + "", + ST.Doyoureallywanttoexitthescreen, + [ + { + text: ST.Cancel, + onPress: () => {}, + style: "cancel" + }, + { text: ST.OK, onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + + async function getData(storeData1,menu1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + let AllKPIFields=await getKPIFields(menu1); + setKPIFields(AllKPIFields); + + await db.transaction(async function (txn) { + + + let q3=`Select POSMReasonId as ReasonId,POSMReason as Reason From Master_POSMReason`; + await txn.executeSql(q3,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i0){ + let arr=[];let images=[],allWindowsData=[]; + for(var i=0;i0){ + let arr=[],images=[],allWindowsData=[]; + for(var i=0;i{ + db.transaction(async function (txn) { + var q='',selectlist='',join='',join2=''; + if(isInserted==true){ + selectlist=` DISTINCT q.QUESTION_ID as POSMQuestionId,q.QUESTION_CODE as POSMQuestionCode,wq.POSMQuestionName,wq.QuestionType,wq.PQShowCamera,wq.PQCameraMandatory,wq.PQLengthValidationRequired,wq.PQMinimumChar,wq.PQMaximumChar,wq.PQDecimalPoint,wq.PQDateRangeMin,wq.PQDateRangeMax,wq.PQVoiceLengthInMinutes,wq.PQDefaultQuestionEnable,q.ANSWER as Answer,q.ANSWER_ID as AnswerId,q.MULTI_OPTIONS_IDS as multi_op_ids,q.IMAGE_ALLOW1 as PAShowCamera,q.IMAGE1 as Image1 `; + join2=` inner join Mapping_POSMQuestion mq on mq.POSMQuestionId=wq.POSMQuestionId `; + join=` inner join Master_POSMQuestion wq on wq.POSMQuestionId=q.QUESTION_ID `; + q=`select ${selectlist} from ${AppTables.POSM_CHILD_DATA} q ${join} ${join2} where q.STORE_ID='${storeData1.StoreId}' and q.POSM_DEFINITION_ID='${window.POSMDefinitionId}' and q.POSM_ID='${window.PosmId}' order by wq.POSMQuestionSequence `; + } + else{ + selectlist=` DISTINCT wq.POSMQuestionId,wq.POSMQuestionCode,wq.POSMQuestionName,wq.QuestionType,wq.PQShowCamera,wq.PQCameraMandatory,wq.PQLengthValidationRequired,wq.PQMinimumChar,wq.PQMaximumChar,wq.PQDecimalPoint,wq.PQDateRangeMin,wq.PQDateRangeMax,wq.PQVoiceLengthInMinutes,wq.PQDefaultQuestionEnable `; + join=` inner join Mapping_POSMQuestion mq on mq.POSMQuestionId=wq.POSMQuestionId `; + q=`select ${selectlist} from Master_POSMQuestion wq ${join} where mq.POSMDefinitionId='${window.POSMDefinitionId}' order by wq.POSMQuestionSequence `; + } + + await txn.executeSql(q,[],async function (txn2, txnres2) { + + if(txnres2.rows.length>0){ + let arr=[]; + let wqa_obj={}; + for(var i=0;i0){ + for(var k=0;k=0)){ + showImageTag=true; + } + } + } + } + + if(showImageTag && data.Answer!=null){ + console.log('Image1 qa',data); + let imgPath=(Platform.OS=='ios'?'file://':'')+common_ImagePath+data.Image1; + wqa_obj[imgname_key]=data.Image1; + wqa_obj[img_key]=imgPath; + } + + + + if(data.QuestionType=='Date' && data.Answer!=null){ + let dayonly=moment().format('DD'); + let actual_date=data.Answer?data.Answer.split('/'):[]; + let month=actual_date[0],year=actual_date[1]; + let fulldate=month+'/'+dayonly+'/'+year; + wqa_obj[date_key]=fulldate; + + } + + arr.push(data); + if(i==txnres2.rows.length-1){ + obj['WindowQuestions']=arr; + obj['WindowQA']=wqa_obj; + resolve(obj) + } + } + } + else{ + resolve(obj) + } + },function (txn2, txnerr) { console.log(txnerr); resolve(obj) },); + }); + }).then((val)=>{ + return val + }).catch((err)=>{ + console.log(err); + return obj; + }); + } + + + async function getWindowAnswers(qtn){ + + return new Promise((resolve,reject)=>{ + + db.transaction(async function (txn) { + var q='',selectlist=''; + selectlist=` DISTINCT POSMAnswerId as AnswerId,POSMAnswerName as Answer,PAShowCamera,PACameraMandatory,PAQuestionEnable,PAQuestionDisable `; + q=`select ${selectlist} from Master_POSMQuestion where POSMQuestionId='${qtn.POSMQuestionId}' order by PASequence `; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return []; + }); + } + + + + async function getImage(imgdata){ + let type=getImageProps.type || ''; + let window=getImageProps.window || {}; + let qtn=getImageProps.qtn || {}; + let cameraType=getImageProps.cameraType!=null?getImageProps.cameraType:'1'; + + if(typeof imgdata=='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: POSM'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+window.POSMDefinitionId+'_'+window.PosmId+'_'+(props.UserId || '')+'_POSMImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let allData=WindowData; + let defData={'PosmId':window.PosmId,'POSMDefinitionId':window.POSMDefinitionId}; + const wind_index=allData.findIndex(i=>i.PosmId==window.PosmId && i.POSMDefinitionId==window.POSMDefinitionId) ; + let wind=wind_index>=0?allData[wind_index]:defData; + + if(cameraType=='2'){ + + var QD=wind.WindowQA || {}; + var image_key=qtn.POSMQuestionId+'_ImageName1'; + var image_key_path=qtn.POSMQuestionId+'_ImagePath1'; + QD[image_key]=filename; + + } + else if(cameraType=='3'){ + var image_key='NAImage1'; + var image_key_path='NAImage1Path'; + wind[image_key]=filename; + } + else{ + var image_key=type=='1'?'Image1Name':'Image2Name'; + var image_key_path=type=='1'?'Image1':'Image2'; + wind[image_key]=filename; + } + + + + // renamefile + let imagePath=`${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker',uri); + + if(cameraType=='2'){ + QD[image_key_path]=uri; + wind.WindowQA=QD; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata3(!rerenderdata3); + } + else{ + wind[image_key_path]=uri; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(window,type='1',cameraType='1',qtn={}){ + setGetImageProps({'window':window,'type':type,'cameraType':cameraType,'qtn':qtn}); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + + async function onSubmitData(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData+'...'); + setProcessing(true); + let d1n=new Date(); + let d3=moment(d1n).format('MM/DD/YYYY'); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + // remove old data + await txn.executeSql(`DELETE FROM ${AppTables.POSM_HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window hdr data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.POSM_CHILD_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window child data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + + + // add data + var values='',childV=''; + + for (const wi in Windows){ + const window=Windows[wi]; + let isImage1=window.POSMImage1=='true' || window.POSMImage1==1?1:0; + let isImage2=window.POSMImage2=='true' || window.POSMImage2==1?1:0; + let isNAImageAvl=window.POSMNotExistCamera=='true' || window.POSMNotExistCamera==1?1:0; + let isNAReasonEnable=window.POSMNotExistReasonEnable=='true' || window.POSMNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.POSMExistReasonEnable=='true' || window.POSMExistReasonEnable==1? 1:0; + let WindowQuestions=window.WindowQuestions || []; + + + const wind=WindowData.find(i=>i.PosmId==window.PosmId && i.POSMDefinitionId==window.POSMDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:0; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let Image1Name=wind.Image1Name!=null?wind.Image1Name:''; + let Image1=wind.Image1!=null?wind.Image1:''; + let Image2Name=wind.Image2Name!=null?wind.Image2Name:''; + let Image2=wind.Image2!=null?wind.Image2:''; + + let QD=wind.WindowQA || {}; + + let POSM_HEADER_ID='POSM'+wi+(Math.floor(Math.random()*1000)+1); + let {POSMDefinitionId,PosmId,POSMName,PosmTypeId,POSMTypeName,POSMTable,POSMField,POSMValue,ChildName}=window; + + + values+=values!=''?' , ':''; + values+=` ('${POSM_HEADER_ID}','${StoreId}','${d3}','${POSMDefinitionId}','${PosmId}','${POSMName}','${PosmTypeId}','${POSMTypeName}','${POSMTable}','${POSMField}','${POSMValue}','${ChildName}','${isPresent}','${NAImage1}','${Image1Name}','${Image2Name}','${ReasonId}','${Reason}','${d3}') `; + + if(isPresent==1){ + for(const qtnIndex in WindowQuestions){ + const qtn=WindowQuestions[qtnIndex]; + + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.POSMQuestionId+'_AnswerId'; + let ans_key=qtn.POSMQuestionId+'_Answer'; + let multi_key=qtn.POSMQuestionId+'_MultiOption'; + let date_key=qtn.POSMQuestionId+'_Date'; + let img_key=qtn.POSMQuestionId+'_ImagePath1'; + let imgname_key=qtn.POSMQuestionId+'_ImageName1'; + let rating_key=qtn.POSMQuestionId+'_Rating'; + + + let {POSMQuestionId,POSMQuestionCode,QuestionType,PAShowCamera}=qtn + let answer=QD[ans_key] || ''; + let answerId=QD[id_key] || 0; + let multi_options_ids=QD[multi_key] || ''; + + if(qtn.QuestionType=='Number' || qtn.QuestionType=='Text' || qtn.QuestionType=='Decimal' || qtn.QuestionType=='Date') + { + showImageTag=(qtn.PQShowCamera==1 || qtn.PQShowCamera=='true'); + } + else if((qtn.QuestionType=='Single choice list' || qtn.QuestionType=='Multi choice list' )){ + if (qtn.Answers && qtn.Answers.length>0){ + for(var i=0;i=0)){ + showImageTag=true; + } + + } + } + } + + let Image1=showImageTag==1?QD[imgname_key]:''; + console.log('Image1',showImageTag,Image1); + + childV+=childV!=''?' , ':''; + childV+=` ('${POSM_HEADER_ID}','${StoreId}','${d3}','${POSMDefinitionId}','${PosmId}','${POSMQuestionId}','${POSMQuestionCode}','${QuestionType}','${answer}','${answerId}','${multi_options_ids}','${Image1}','${(PAShowCamera=='true' || PAShowCamera==true?1:0)}','${d3}') `; + } + } + } + + console.log('childV:',childV); + + let add_hdr_data=`INSERT INTO ${AppTables.POSM_HDR_DATA} (POSM_HEADER_ID,STORE_ID,VISIT_DATE,POSM_DEFINITION_ID,POSM_ID,POSM_NAME,POSM_TYPE_ID,POSM_TYPE_NAME,POSM_TABLE,POSM_FIELD,POSM_VALUE,CHILD_NAME,IS_PRESENT,POSM_NA_IMAGE,POSM_IMAGE1,POSM_IMAGE2,REASON_ID,REASON,ADDED_DATE) VALUES ${values} `; + let add_child_data=`INSERT INTO ${AppTables.POSM_CHILD_DATA} (POSM_HEADER_ID,STORE_ID,VISIT_DATE,POSM_DEFINITION_ID,POSM_ID,QUESTION_ID,QUESTION_CODE,QUESTION_TYPE,ANSWER,ANSWER_ID,MULTI_OPTIONS_IDS,IMAGE1,IMAGE_ALLOW1,ADDED_DATE) VALUES ${childV} `; + + await txn.executeSql(add_hdr_data,[],async function (txn2, txnres) { + console.log('posm header data added'); + var isChildAdded=true; + + if(childV!=''){ + isChildAdded=await executeQuery(add_child_data); + } + + if(!isChildAdded){ + setProcessing(false);notify(ST.Cannotaddposmquestionsdata); + } + else{ + setProcessing(false);notify(ST.POSMdataupdatedsuccessfully); + props.navigation.goBack(); + } + + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify(ST.CannotaddPOSMdata); },); + }); + } catch (err) { + console.log(err); + } + } + + async function executeQuery(q){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres2) { + resolve(true); + },function(txn2,txnerr){console.log(txnerr);resolve(false) }); + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }) + } + + + + async function validate(){ + let isValid=true; + + return new Promise((resolve,reject)=>{ + for (const wi in Windows){ + const window=Windows[wi]; + let isImage1=window.POSMImage1=='true' || window.POSMImage1==1?1:0; + let isImage2=window.POSMImage2=='true' || window.POSMImage2==1?1:0; + let isNAImageAvl=window.POSMNotExistCamera=='true' || window.POSMNotExistCamera==1?1:0; + let isNAReasonEnable=window.POSMNotExistReasonEnable=='true' || window.POSMNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.POSMExistReasonEnable=='true' || window.POSMExistReasonEnable==1? 1:0; + let WindowQuestions=window.WindowQuestions || []; + + + const wind=WindowData.find(i=>i.PosmId==window.PosmId && i.POSMDefinitionId==window.POSMDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let Image1Name=wind.Image1Name!=null?wind.Image1Name:''; + let Image1=wind.Image1!=null?wind.Image1:''; + let Image2Name=wind.Image2Name!=null?wind.Image2Name:''; + let Image2=wind.Image2!=null?wind.Image2:''; + let QD=wind.WindowQA || {}; + + if(isPresent=='1'){ + if(isReasonEnable==true && ReasonId=='' ){ + notify(`${ST.Pleaseselectreasonfor} ${window.POSMName} `,'LONG'); + resolve(false);return; + } + else{ + if(isImage1==1 && Image1Name==''){ + notify(`${ST.Pleaseclickallimagesfor} ${window.POSMName}`,'LONG'); + resolve(false);return; + } + else if(isImage2==1 && Image2Name==''){ + notify(`${ST.Pleaseclickallimagesfor} ${window.POSMName}`,'LONG'); + resolve(false);return; + } + else if(WindowQuestions.length>0){ + for(const qtnIndex in WindowQuestions){ + const qtn=WindowQuestions[qtnIndex]; + + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.POSMQuestionId+'_AnswerId'; + let ans_key=qtn.POSMQuestionId+'_Answer'; + let multi_key=qtn.POSMQuestionId+'_MultiOption'; + let date_key=qtn.POSMQuestionId+'_Date'; + let img_key=qtn.POSMQuestionId+'_ImagePath1'; + let imgname_key=qtn.POSMQuestionId+'_ImageName1'; + let rating_key=qtn.POSMQuestionId+'_Rating'; + let list_mcdata=[]; + + let isImgAllowed=(qtn.PQShowCamera=='true' || qtn.PQShowCamera==1); + let checkForAnsKey=(qtn.QuestionType=='Decimal' || qtn.QuestionType=='Number' || qtn.QuestionType=='Text' || qtn.QuestionType=='Date' || qtn.QuestionType=='Rating') ; + if(qtn.QuestionType=='Single choice list') + { + selansid=QD[id_key]; + } + else if(qtn.QuestionType=='Multi choice list') + { + selansid=QD[multi_key]!=null && QD[multi_key]!=''?QD[multi_key].split(','):[]; + } + + + if(qtn.QuestionType=='Multi choice list' && selansid.length<=0){ + notify(`${ST.Pleaseselectoptionsfortherequiredfield} ${ST.In} ${window.POSMName}`,'SHORT'); + resolve(false);return; + } + else if( checkForAnsKey && (Object.keys(QD).indexOf(ans_key)<0 || (Object.keys(QD).indexOf(ans_key)>=0 && QD[ans_key]===''))){ + console.log('jhg') + let msg=( qtn.QuestionType=='Date'?`${ST.Pleasepickadatefortherequiredfield} ${ST.In} ${window.POSMName}`:(qtn.QuestionType=='Rating'?`${ST.Pleaseselectratingfortherequiredfield} ${ST.In} ${window.POSMName}`:`${ST.Pleasefillalltherequiredfield} ${ST.In} ${window.POSMName}`)); + notify(msg,'SHORT'); + resolve(false);return; + } + else if(Object.keys(QD).indexOf(id_key)<0 || (Object.keys(QD).indexOf(id_key)>=0 && (QD[id_key]==='' || (QD[id_key]===0 && qtn.isDisabled===false) ))){ + console.log('test',QD[id_key],id_key,QD) + notify(`${ST.Pleasefillalltherequiredfield} ${ST.In} ${window.POSMName}`,'SHORT'); + resolve(false);return; + } + else if(isImgAllowed && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + notify(`${ST.Pleaseaddimages} ${ST.In} ${window.POSMName}`,'SHORT'); + resolve(false);return; + }else{ + console.log('no condition found'); + } + + if((qtn.QuestionType=='Single choice list' || qtn.QuestionType=='Multi choice list' )){ + if (qtn.Answers && qtn.Answers.length>0){ + for(var j=0;j=0)){ + showImageTag=true; + } + } + } + } + + if(showImageTag && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + notify(`${ST.Pleaseaddimages} ${ST.In} ${window.POSMName}`,'SHORT'); + resolve(false);return; + } + } + } + } + } + else{ + if(isNAReasonEnable==true && ReasonId=='' ){ + notify(`${ST.Pleaseselectreasonfor} ${window.POSMName} `,'LONG'); + resolve(false);return; + } + else if(isNAImageAvl==true && NAImage1=='' ){ + notify(`${ST.Pleaseclickimagefor} ${window.POSMName}`,'LONG'); + resolve(false);return; + } + } + + if(wi==(Windows.length-1)){ + resolve(true);return; + } + + } + + }).then((val)=>{return val}) + .catch((err)=>{console.log(err); return false}); + + } + + + function onselectionChange(option,keyLbl,keyVal,otherData){ + let item=otherData.window; + let allData=WindowData; + let defData={'PosmId':item.PosmId,'POSMDefinitionId':item.POSMDefinitionId}; + const win_index=allData.findIndex(i=>i.PosmId==item.PosmId && i.POSMDefinitionId==item.POSMDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[keyVal]=option.value; + wind[keyLbl]=option.label; + + win_index>=0?allData[win_index]=wind:allData.push(wind); + console.log('allData:',allData); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onselectionChange2(option,qtn,window){ + let allData=WindowData; + let defData={'PosmId':window.PosmId,'POSMDefinitionId':window.POSMDefinitionId}; + const wind_index=allData.findIndex(i=>i.PosmId==window.PosmId && i.POSMDefinitionId==window.POSMDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let data=wind.WindowQA || {}; + let id_key=qtn.POSMQuestionId+'_AnswerId'; + let ans_key=qtn.POSMQuestionId+'_Answer'; + data[id_key]=option.value; + data[ans_key]=option.label; + + + wind['WindowQA']=data; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + + let aq_ans=qtn.Answers!=null?qtn.Answers:[]; + let ans_obj=aq_ans.find(i=>i.AnswerId==option.value) || {}; + let EQtns=ans_obj.WAQuestionEnable!=null && ans_obj.WAQuestionEnable!=''?ans_obj.WAQuestionEnable.replace(' ','').split(','):[]; + let DQtns=ans_obj.WAQuestionDisable!=null && ans_obj.WAQuestionDisable!=''?ans_obj.WAQuestionDisable.replace(' ','').split(','):[]; + + let sqtns=window.WindowQuestions || [] + + if(EQtns.length>0){ + enableQtns(sqtns,EQtns,DQtns,data,wind,wind_index,allData,window) + } + else if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data,wind,wind_index,allData,window) + } + else{ + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + } + + async function disableQtns(sqtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + + if(DQtns.length>0){ + new Promise.all( + DQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.POSMQuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=true + sqtns[s_qtnindex]=s_qtn; + let id_key=s_qtn.POSMQuestionId+'_AnswerId'; + let ans_key=s_qtn.POSMQuestionId+'_Answer'; + data[id_key]=0; + data[ans_key]=''; + + wind['WindowQA']=data; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + return false + }) + ).then(async (val)=>{ + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.POSMDefinitionId==window.POSMDefinitionId && i.PosmId==window.PosmId) + if(windowIndex>0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindowData(allData); + setWindows(allwindows); + setGlobalWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + }) + } + } + + async function enableQtns(sqtns,EQtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + new Promise.all( + EQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.POSMQuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=false + sqtns[s_qtnindex]=s_qtn; + return false + }) + ).then(async (val)=>{ + if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data,wind,wind_index,allData,window) + } + else{ + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.POSMDefinitionId==window.POSMDefinitionId && i.PosmId==window.PosmId) + if(windowIndex>0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindows(allwindows); + setGlobalWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + } + }) + } + + async function setMultiSelectValue(selectedItems=[],qtn={},window={}) { + console.log('setMultiSelectValue',selectedItems); + let id_key=qtn.POSMQuestionId+'_AnswerId'; + let ans_key=qtn.POSMQuestionId+'_Answer'; + let multi_key=qtn.POSMQuestionId+'_MultiOption'; + + let allData=WindowData; + let defData={'PosmId':window.PosmId,'POSMDefinitionId':window.POSMDefinitionId}; + const wind_index=allData.findIndex(i=>i.PosmId==window.PosmId && i.POSMDefinitionId==window.POSMDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + obj[id_key]=0; + obj[multi_key]=selectedItems.join(','); + let anss=[]; + selectedItems.map((itemValue)=>{ + let ans = qtn.Answers.find(c1 => c1.AnswerId == itemValue); + if(ans.Answer){anss.push(ans.Answer)} + }); + obj[ans_key]=anss.join(','); + console.log('obj:',obj); + + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function setTextValue(value,qtn,window) { + + let id_key=qtn.POSMQuestionId+'_AnswerId'; + let ans_key=qtn.POSMQuestionId+'_Answer'; + + let allData=WindowData; + let defData={'PosmId':window.PosmId,'POSMDefinitionId':window.POSMDefinitionId}; + const wind_index=allData.findIndex(i=>i.PosmId==window.PosmId && i.POSMDefinitionId==window.POSMDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + if(qtn.QuestionType=='Date' ){ + let date_key=qtn.POSMQuestionId+'_Date'; + let d=value!=null?new Date(value):new Date(); + let mfdate=moment(d).format('MM/YYYY'); + showQtnDatePicker(qtn,window,false); + obj[id_key]=0; + obj[ans_key]=mfdate; + obj[date_key]=moment(d).format('MM/DD/YYYY'); + } + else{ + obj[id_key]=0; + obj[ans_key]=value; + } + + console.log(value,obj); + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function showQtnDatePicker(qtn,window,show=false){ + let allQtns=window.WindowQuestions || []; + let newqtnIndex=allQtns.findIndex(q=>q.POSMQuestionId==qtn.POSMQuestionId); + + if(newqtnIndex>=0){ + let newqtn=allQtns[newqtnIndex]; + newqtn.showDatePicker=show; + allQtns[newqtnIndex]=newqtn; + window['WindowQuestions']=allQtns; + let allWindows=Windows; + const winIndex=allWindows.findIndex(i=>i.PosmId==window.PosmId && i.POSMDefinitionId==window.POSMDefinitionId) || {}; + allWindows[winIndex]=window; + setWindows(allWindows); + setGlobalWindows(allWindows); + if(show==true) setrerenderdata(!rerenderdata); + } + } + + function setRatingValue(data){ + setRatingOrder(data); + } + + function onRatingCancel(){ + setShowRating(false); + } + + function onRatingSave(){ + setShowRating(false); + let qtn=RatingQtn; + let window=RatingWindow; + let id_key=qtn.POSMQuestionId+'_AnswerId'; + let ans_key=qtn.POSMQuestionId+'_Answer'; + let rating_key=qtn.POSMQuestionId+'_Rating'; + let ids=[],anss=[]; + RatingOrder.map((item,index)=>{ + ids.push(item.AnswerId); + anss.push(item.Answer); + }) + + let allData=WindowData; + let defData={'PosmId':window.PosmId,'POSMDefinitionId':window.POSMDefinitionId}; + const wind_index=allData.findIndex(i=>i.PosmId==window.PosmId && i.POSMDefinitionId==window.POSMDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + obj[rating_key]=ids.join(','); + obj[id_key]=0; + obj[ans_key]=anss.join(','); + + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function onChoiceSelect(item,val,key,animatedChoice){ + console.log('onChoiceSelect',animatedChoice) + var val1=0; + val==1?val1=1:''; + + if(animatedChoice!=null){ + Animated.timing(animatedChoice, { + toValue: val1, + duration:400, + useNativeDriver:false, + }).start(); + } + onWindowDataChange(item,val,key) + } + + function onWindowDataChange(item,val,key){ + let allData=WindowData; + let defData={'PosmId':item.PosmId,'POSMDefinitionId':item.POSMDefinitionId}; + const win_index=allData.findIndex(i=>i.PosmId==item.PosmId && i.POSMDefinitionId==item.POSMDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[key]=val; + + if(key=='ReasonId'){ + let rsn=reasons_list.find(r=>r.ReasonId==val) || {}; + wind['Reason']=rsn.Reason || ''; + } + + win_index>=0?allData[win_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function setWindowStockVal(val,window,stockProd){ + let allData=WindowData; + let defData={'PosmId':window.PosmId,'POSMDefinitionId':window.POSMDefinitionId}; + const win_index=allData.findIndex(i=>i.PosmId==window.PosmId && i.POSMDefinitionId==window.POSMDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + let sdIndex=WStocksData.findIndex(i=> i.ProductId==stockProd.WindowStockValue); + let sd=sdIndex>=0?WStocksData[sdIndex]:{'ProductId':stockProd.WindowStockValue,'Stock':''}; + sd['Stock']=val; + sdIndex>=0?WStocksData[sdIndex]=sd:WStocksData.push(sd); + wind['WStocksData']=WStocksData; + win_index>=0?allData[win_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata4(!rerenderdata4); + } + + function onSaveCancel(){ + setShowAlert(false); + } + + + + function openImageRefView(RefImage=''){ + setShow_zoomImage(true); + } + + function renderRatingView(){ + let qtn=RatingQtn; + let Answers=qtn.Answers; + let id_key=qtn.POSMQuestionId+'_AnswerId'; + let ans_key=qtn.POSMQuestionId+'_Answer'; + let rating_key=qtn.POSMQuestionId+'_Rating'; + + let newarr=RatingOrder; + if(RatingOrder.length<=0){ + newarr=Answers; + } + + return ( + + + {ST.DragItemsInOrder} + {ST.Pressandholdtodrag} + {setRatingValue(data)}} + keyExtractor={(item) => item.AnswerId} + renderItem={renderItem} + /> + + {onRatingCancel()}}> + {ST.Cancel} + + {onRatingSave()}}> + {ST.Save} + + + + + ) + } + + function render_Picker(label_key,value_key,onChange=()=>{},selected_data={}){ + var data=[]; + let qtn=selected_data.qtn || {}; + let window=selected_data.window || {}; + let isQtnDisabled=qtn.isDisabled!=null || qtn.isDisabled!=''?false:true; + let allAnswers=qtn.Answers || []; + + allAnswers.map((item,index)=>{ + let obj={ key: index, label: item[label_key],value:item[value_key] }; + if(selected_data.value==item[label_key]) + obj['component']= {item[label_key]}; + data.push(obj); + }); + + return ( + {onChange(option,qtn,window) }} + overlayStyle={customStyle.addVisPickerOverlay} + cancelContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + optionStyle={customStyle.addvis_opStyle} + optionTextStyle={customStyle.addvis_opTextStyle} + optionContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + selectedKey={'1'} + disabled={isQtnDisabled} + cancelText={ST.Cancel} + > + {(selected_data.value!=null && selected_data.value!=''?selected_data.value: '-'+ST.select+'-')} + + ) + } + + function renderDatePicker(qtn,window){ + + let qtnn=qtn; + let DateRange=qtn.DateRange; + let maxDate=moment().add(10,'years').format('MM/DD/YYYY'); + let minDate=moment().subtract(10,'years').format('MM/DD/YYYY'); + if(DateRange=='RFD'){ + maxDate=moment().format('MM/DD/YYYY'); + } + else if(DateRange=='RPD'){ + minDate=moment().format('MM/DD/YYYY'); + } + + + + return ( + {setTextValue(selectedDate,qtnn,window)}} + maximumDate={new Date(maxDate)} + minimumDate={new Date(minDate)} + /> + ); + } + + function _renderWindow(){ + return ( + `posm_${index.toString()}`} + renderItem={({item,index})=>{ + const window=item; + + let isImage1=window.POSMImage1=='true' || window.POSMImage1==1?1:0; + let isImage2=window.POSMImage2=='true' || window.POSMImage2==1?1:0; + let isNAImageAvl=window.POSMNotExistCamera=='true' || window.POSMNotExistCamera==1?1:0; + let isNAReasonEnable=window.POSMNotExistReasonEnable=='true' || window.POSMNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.POSMExistReasonEnable=='true' || window.POSMExistReasonEnable==1? 1:0; + let POSMTitleEnable=window.POSMDefinitionTitleEnable=='true' || window.POSMDefinitionTitleEnable==1? 1:0; + let POSMTitle=window.POSMDefinitionTitle!=null && window.POSMDefinitionTitle!='undefined'? window.POSMDefinitionTitle:""; + let RefImage=window.POSMRefImage; + let camera1Label=window.POSMImage1Lable || ''; + let camera2Label=window.POSMImage2Lable || ''; + let WindowQuestions=window.WindowQuestions || []; + + const wind=WindowData.find(i=>i.PosmId==window.PosmId && i.POSMDefinitionId==window.POSMDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let QuestionsData=wind.WindowQA || {}; + let Image1Name=wind.Image1Name!=null?wind.Image1Name:''; + let Image1=wind.Image1!=null?wind.Image1:''; + let Image2Name=wind.Image2Name!=null?wind.Image2Name:''; + let Image2=wind.Image2!=null?wind.Image2:''; + + var xpos=isPresent=='1'?-75:0; + if(window.animatedChoice!=null ){ + xpos=window.animatedChoice.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + + console.log(window); + return( + + + {/* */} + + {window.POSMName} + {(POSMTitleEnable==1 && POSMTitle!=null && POSMTitle!='') && {POSMTitle}} + {openImageRefView(RefImage)}}> + + + + {/* */} + + + + + + {ST.IsPresent} + + + + {onChoiceSelect(window,1,'isPresent',window.animatedChoice)}}> + {ST.Yes} + + {onChoiceSelect(window,0,'isPresent',window.animatedChoice)}}> + {ST.No} + + + + + {((isPresent!='1' && isNAReasonEnable==true) || (isPresent=='1' && isReasonEnable==true)) && + + {ST.SelectReason} + {} + + } + + + {(isPresent!='1' && isNAImageAvl==true) && + + + + {ST.CaptureImage} + + + + { (NAImage1Path=='' || NAImage1Path==null) && + {openCamera(window,'1','3')}}> + + + } + { (NAImage1Path!='' && NAImage1Path!=null) && + + + {openCamera(window,'1','3')}}> + + + + } + + + + + } + + + + {(isPresent=='1') && + + {(isImage1==1 || isImage2==1)&& + + + {ST.CaptureImage} + + + {isImage1==1 && + + { (Image1=='' || Image1==null) && + {openCamera(window,'1','1')}}> + + + } + { (Image1!='' && Image1!=null) && + + + {openCamera(window,'1','1')}}> + + + + } + {camera1Label} + + } + {isImage2==1 && + + { (Image2=='' || Image2==null) && + {openCamera(window,'2','1')}}> + + + } + { (Image2!='' && Image2!=null) && + + + {openCamera(window,'2','1')}}> + + + + } + {camera2Label} + + } + + + } + + {(WindowQuestions.length>0) && + + + {ST.POSMQuestions} + + {WindowQuestions.map((item,index)=>{ + + let qtn=item; + let qtnIndex=index; + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.POSMQuestionId+'_AnswerId'; + let ans_key=qtn.POSMQuestionId+'_Answer'; + let multi_key=qtn.POSMQuestionId+'_MultiOption'; + let date_key=qtn.POSMQuestionId+'_Date'; + let img_key=qtn.POSMQuestionId+'_ImagePath1'; + let imgname_key=qtn.POSMQuestionId+'_ImageName1'; + let rating_key=qtn.POSMQuestionId+'_Rating'; + + let list_mcdata=[]; + + if(qtn.QuestionType=='Single choice list') + { + selansid=QuestionsData[id_key]!=null ?QuestionsData[id_key] :''; + selanswer=QuestionsData[ans_key]!=null ?QuestionsData[ans_key] :''; + } + else if(qtn.QuestionType=='Multi choice list') + { + if(qtn.Answers!=null){ + for(var i=0;i0){ + // let arr=[]; + // for(var i=0;i0){ + for(var i=0;i=0)){ + showImageTag=true; + } + + } + } + } + + if(showImageTag){ + selimg=QuestionsData[img_key]!=null && QuestionsData[img_key]!=''?'file://'+QuestionsData[img_key]:''; + } + + + return( + + {qtn.POSMQuestionName} + {qtn.QuestionType=='Single choice list' && qtn.Answers && + render_Picker('Answer','AnswerId',onselectionChange2,{value:selanswer,qtn:qtn,window:window}) + } + {qtn.QuestionType=='Multi choice list' && qtn.Answers && + { setMultiSelectValue(selectedItems,qtn,window) }} //setMultiSelectValue(selectedItems,qtn) + selectedItems={selansid} + selectText="Pick Items" + searchInputPlaceholderText={ST.SearchItems+"..."} + // onChangeInput={ (text)=> console.log(text)} + tagRemoveIconColor={PrimaryTheme.$primary_color} + tagBorderColor={PrimaryTheme.$primary_color} + tagTextColor={PrimaryTheme.$primary_color} + selectedItemTextColor={PrimaryTheme.$primary_color} + selectedItemIconColor={PrimaryTheme.$primary_color} + itemTextColor={PrimaryTheme.$text_color} + displayKey="Answer" + searchInputStyle={{ color: '#CCC' }} + submitButtonColor={PrimaryTheme.$primary_color} + + submitButtonText={ST.Submit} + /> + } + { (qtn.QuestionType=='Number' || qtn.QuestionType=='Decimal' || qtn.QuestionType=='Text') && + {setTextValue(val,qtn,window)}} + autoComplete='off' + /> + + } + + { + (qtn.QuestionType=='Date') && + + {selansid!=''?selansid:'MM/YYYY'} + {setDateValue(selanswer);showQtnDatePicker(qtn,window,true)}}> + + + + } + { ((qtn.showDatePicker==true || qtn.showDatePicker=='true') && (qtn.QuestionType=='Date') ) && + renderDatePicker(qtn,window) + } + { + (qtn.QuestionType=='Rating') && + + {selanswer} + {setRatingQtn(qtn);setRatingWindow(window);setShowRating(true);}}> + + + + } + + { + // (qtn.QuestionType=='Audio') && + // + // {selanswer} + // {show_recorder(qtn);}}> + // + // + // + } + + { + showImageTag && + + + {openCamera(window,'1','2',qtn)}}> + + + + } + + + + ) + })} + + } + + + + } + + + + + + + ); + }} + /> + ) + } + + function _renderHeader(currentIndex){ + return( + + {/* {`${(currentIndex+1)}/${zoomImageUrl.length}`} */} + {console.log('tsth');setShow_zoomImage(false) }}> + + + + ) + } + + function FilterStores(searchedQry){ + searchedQry=searchedQry.toLowerCase(); + console.log('searchedQry',searchedQry); + let arr=[]; + var arr2={}; + if(searchedQry!=null && searchedQry!=''){ + for(let i=0;ii.KPIFieldName=='SearchEnable') + let isSearchEnableKPIObj=isSearchEnableIndex>=0?KPIFields[isSearchEnableIndex]:{}; + let isSearchEnable=isSearchEnableIndex>=0?isSearchEnableKPIObj['KPIFieldEnable']:false; + if(isSearchEnable==true){ + return ( + + {setSearchedItem(val); FilterStores(val)}} + autoComplete='off' + /> + {FilterStores(searchedItem)}}> + + + + ) + } + else{ + return( + + ) + } + } + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + {getSearchBar()} + { Object.keys(storeData).length>0 && + + {_renderWindow()} + + } + + {onSubmitData()}}/> + + + + + { showRating==true && + renderRatingView() + } + {show_zoomImage && + + null} + /> + + } + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(POSM); \ No newline at end of file diff --git a/src/screens/POSSale copy.js b/src/screens/POSSale copy.js new file mode 100644 index 0000000..a1e5e12 --- /dev/null +++ b/src/screens/POSSale copy.js @@ -0,0 +1,1993 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, Animated, Keyboard} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,getDownloadJson1,getKPIFields,getServerDT,marktext1,marktext2, restore_ImageWithMetaData, validateNumber} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath,ImageFolderPath, HierarchyTbls} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, FontAwesome, Fontisto, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector' +import { CustomPicker, CustomPicker2 } from '../components/CustomPicker'; +import CustomCamera from '../components/Camera'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import DateTimePicker from '@react-native-community/datetimepicker'; +import CheckBox from '@react-native-community/checkbox'; + +import CameraImg3 from '../assets/performics/camera_tick.svg'; +import CameraImg2 from '../assets/performics/camera_icon.svg'; +import CameraImg5 from '../assets/image/camera_asterisk.png'; +import MultiSelect from 'react-native-multiple-select'; +import { ObjectFlags } from 'typescript'; +import { getMethodName, METHODS } from '../constants/methodNames'; + +function POSSale(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + + // console.log(HierarchyTbls, "HierarchyTbls-->") + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(''); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [StoreCameraAllow, setStoreCameraAllow] = useState(true); + const [currentMenu, setCurrentMenu] = useState({}); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + const [rerenderdata3, setrerenderdata3]= useState(0); + const [rerenderdata4, setrerenderdata4]= useState(0); + const [getImageProps,setGetImageProps]= useState({}); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + + const [WindowData, setWindowData] = useState([]); + const [reasons_list, setReasons_list] = useState([]); + const [Windows, setWindows] = useState([]); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [refImageIndex, setrefImageIndex] = useState(0); + const [zoomImageIndex, setzoomImageIndex] = useState(0); + const [showAlert, setShowAlert] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [showCamera, setShowCamera] = useState(false); + const zoomView=useRef(null); + const [showRating, setShowRating] = useState(false); + const [RatingQtn, setRatingQtn] = useState({}); + const [RatingWindow, setRatingWindow] = useState({}); + const [RatingOrder, setRatingOrder] = useState([]); + + const [AllImagesData, setAllImagesData] = useState([]); + const [globalWindows, setGlobalWindows] = useState([]); + const [KPIFields, setKPIFields] = useState([]); + const [showSwitchCamera,setShowSwitchCamera]= useState(false); + const [Image1, setImage1] = useState(''); + const [Image2, setImage2] = useState(''); + const [imageCapture, setimageCapture] = useState(''); + const [imageCapture2, setimageCapture2] = useState(''); + + + + const [DataCleanModal, setDataCleanModal] = useState(false); + const [DataCleanAnim, setDataCleanAnim] = useState(""); + const [DataCleanItem, setDataCleanItem] = useState({}); + const [isPresentClean, setIsPresentClean] = useState(0); + const [data, setData] = useState({}); + const [POSDef, setPOSDef] = useState({}); + const [Months, setMonths] = useState([]); + + const [Months1, setMonths1] = useState([]); + const [Years, setYears] = useState([]); + const [Periods, setPeriods] = useState([]); + + + const [posSData, setPosSData] = useState({}); + const [posSImgArr, setPosSImgArr] = useState([]); + + const [SelectedImg, setSelectedImg] = useState(''); + const [showModal, setShowModal] = useState(false); + const [reCapImgModalObj, setReCapImgModalObj] = useState({}); + const [showImageSaveOp, setShowImageSaveOp] = useState(true); + const [saleArr ,setsaleArr] = useState([]); + const [showchildview ,setShowChildView] = useState(true); + + const [InputChange, setInputChange] = useState([]); + const DefPOSWind={"WindowId":"0","WindowName":"POS Sale", "Sale":"0"}; + + const inputRefs = useRef({}); + + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + + useEffect(() => { + getyearmonthandcycle(); + },[posSData.Year,posSData.Month]) + + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + let cameraAllow=storeData1.CameraAllow=='true' || storeData1.CameraAllow==1?true:false; + setStoreCameraAllow(cameraAllow); + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + + const unsubscribe=props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + return unsubscribe; + }; + }, []); + + useEffect(() => { + const unsubscribe=props.navigation.addListener('beforeRemove', onBeforeRemove); + return unsubscribe; + }, [hasUnsavedChanges]); + + useEffect(() => { + const unsubscribe=props.navigation.addListener('beforeRemove', onBeforeRemove); + return unsubscribe; + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + function onRemoveScreen(e){ + Alert.alert( + "", + ST.Doyoureallywanttoexitthescreen, + [ + { + text: ST.Cancel, + onPress: () => {}, + style: "cancel" + }, + { text: ST.OK, onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + + async function DownloadMerchandiserSaleData(){ + + setLoaderTitle("Downloading Merchandiser Sale Data..."); + setProcessing(true); + let downloadKey="Sup_MerchandiserSaleData"; + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + const url=props.baseurl+getMethodName(METHODS.DOWNLOADJSON_METHOD); + + let data=''; + + data={ + Downloadtype:downloadKey, + Username: loginDetails.UserId, + Param1: storeData?.StoreId, + Param2: posSData?.PeriodId, + + } + + console.log(url,data); + return await getDownloadJson1(url,data) + .then(async(res)=>{ + console.log("DownloadMerchandiserSaleData res:",res); + if(res.Sup_MerchandiserSaleData!=null || res.Sup_MerchandiserSaleData!= ''){ + // setProcessing(false); + let posSaleArr= res.Sup_MerchandiserSaleData ? res.Sup_MerchandiserSaleData : []; + let isInserted= posSaleArr.length > 0 ? await InsertDownloadedMerSaleData(posSaleArr) : false; + + console.log('Inserted data:', posSaleArr); + console.log('isInserted:',isInserted) + + + if(isInserted){ + getData(storeData1,menu1); + setShowChildView(true); + notify("Merchandiser sale data downloaded successfully."); + } + else{ + notify("Cannot download merchandiser sale data! No data found."); + getData(storeData1,menu1); + setShowChildView(true); + // setProcessing(false); + return []; + } + } + else{ + notify('No data found!'); + setProcessing(false); + return []; + } + + }) + .catch((err)=>{ + console.log('onPage Team error',err); + setProcessing(false); + notify("Cannot download merchandiser sale data!") + return []; + }); + } + + async function InsertDownloadedMerSaleData(posSaleArr){ + console.log("insert download posSale called"); + return new Promise((resolve,reject)=>{ + + var values=[],sql_stmnt='',all_vals=''; + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let tbname='Sup_MerchandiserSaleData'; + let storeId = storeData.StoreId; + let q=`Delete from ${tbname} where StoreId='${storeId}' AND CycleId='${posSData?.PeriodId}' `; + + posSaleArr = posSaleArr ? posSaleArr : []; + + console.log("posSaleArr", posSaleArr) + + posSaleArr?.map((data_obj)=>{ + let {CycleId,StoreId,PosSaleValue,Sale}=data_obj; + values.push(` ('${CycleId || ''}', '${StoreId || ''}', '${PosSaleValue || ''}', '${Sale || 0}')`); + }); + all_vals=values.join(','); + sql_stmnt=`INSERT INTO ${tbname}(CycleId,StoreId,PosSaleValue,Sale) + values ${all_vals}`; + + db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres4) { + console.log('removeddata'); + await txn.executeSql(sql_stmnt,[],async function (txn2, txnres2) { + resolve(true); + },function(txn2,txnerr){ console.log(txnerr);resolve(false);}); + },function(txn2,txnerr){console.log(txnerr);resolve(false);}); + }) + }).catch((err)=>{ + console.log(err); + return false; + }) + + } + + async function getposSaledefinationdata(id) { + + console.log(id, "posSData?.PeriodId") + + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + setProcessing(true); + try { + await db.transaction(async (txn) => { + let query = ` + SELECT DISTINCT * FROM Sup_MerchandiserSaleData Where StoreId = '${storeData?.StoreId}' AND CycleId='${id}';`; + + console.log(query, "query"); + + txn.executeSql(query, [], (txn, result) => { + if (result.rows.length > 0) { + + console.log(result.rows.length, "result.rows.length") + + let arr=[]; + + for(var i=0;i',data) + arr.push(data); + if(i==result.rows.length-1){ + console.log(arr) + setsaleArr(arr); + getData(storeData1,menu1); + setShowChildView(true); + notify("Merchandiser sale data downloaded successfully."); + // setProcessing(false); + } + } + } + else { + console.log('Table is empty. Triggering data download.'); + DownloadMerchandiserSaleData(); + // setProcessing(false); + } + }, (error) => { + setProcessing(false); + console.log("Error while executing getMerchSaledata SQL: ", error); + }); + }); + } catch (err) { + console.log("Error in get Merch Sale data function: ", err); + setProcessing(false); + } + } + + // end of downloading / get get sale data + + async function getyearmonthandcycle(){ + try { + + await db.transaction(async function (txn) { + + let q6=`SELECT DISTINCT CycleYear as Year FROM Sup_Master_PosSaleCycle`; + await txn.executeSql(q6,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + + for(var i=0;i',data) + arr.push(data); + if(i==txnres2.rows.length-1){ + console.log(arr) + setYears(arr); + } + } + } + },function (txnE,txnerr) { console.log(txnerr); },); + + let q7=`SELECT DISTINCT CycleMonth as Month FROM Sup_Master_PosSaleCycle WHERE CycleYear = '${posSData?.Year}'`; + await txn.executeSql(q7,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + + for(var i=0;i',data) + arr.push(data); + if(i==txnres2.rows.length-1){ + console.log(arr) + setMonths1(arr); + } + } + } + },function (txnE,txnerr) { console.log(txnerr); },); + + let q8=`SELECT DISTINCT CycleId as PeriodId , CyclePeriod as Period FROM Sup_Master_PosSaleCycle WHERE CycleMonth = '${posSData?.Month}' AND CycleYear = '${posSData?.Year}'`; + await txn.executeSql(q8,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i',data) + arr.push(data); + if(i==txnres2.rows.length-1){ + console.log(arr) + setPeriods(arr); + } + } + } + else{ + setProcessing(false); + } + },function (txnE,txnerr) { console.log(txnerr);setProcessing(false); },); + }); + //end queries for month / day / year + } catch (err) { + console.log(err); + setProcessing(false); + } + } + + + async function getData(storeData1,menu1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId,StoreCategoryId,StoreClassId}=storeData1; + let arrobj=[]; + + let AllKPIFields=await getKPIFields(menu1); + setKPIFields(AllKPIFields); + + // set switch camera flag as defined in mapping menu flag (if exists) + let SwitchingCameraI=AllKPIFields.findIndex(i=>i.KPIFieldName=='SwitchingCamera'); + let SwitchingCameraObj=SwitchingCameraI>=0?AllKPIFields[SwitchingCameraI]:{}; + let SwitchingCamera=SwitchingCameraI>=0?SwitchingCameraObj['KPIFieldEnable']:false; + setShowSwitchCamera(SwitchingCamera); + + await db.transaction(async function (txn) { + + + let q3=`Select PosReasonId as ReasonId,PosReason as Reason From Sup_Master_PosSaleReason`; + await txn.executeSql(q3,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + + for(var i=0;i0){ + let pos_d=txnres5.rows.item(0); + let {MONTH,YEAR,CYCLEPERIOD,CYCLEPERIODID ,IMAGE1,IMAGE2,TOTAL_POS_VALUE}=pos_d; + console.log("pos_d--->",pos_d) + // let image1Path=IMAGE1!=''?'file://'+ImageFolderPath+menu1.ScreenName+"/"+IMAGE1:''; + // let image2Path=IMAGE2!=''?'file://'+ImageFolderPath+menu1.ScreenName+"/"+IMAGE2:''; + let posdata_obj={"Month":MONTH, "Year": YEAR, "Period": CYCLEPERIOD,"PeriodId" : CYCLEPERIODID, "TotalPosValue":TOTAL_POS_VALUE};//,"Image1Name":IMAGE1,"Image1":image1Path,"Image2Name":IMAGE2,"Image2":image2Path + setPosSData(posdata_obj); + } + },function (txnE,txnerr) { console.log(txnerr); }); + + let q=` Select * from Sup_Master_PosSaleDefinition p INNER join Sup_Mapping_StorePosSaleDefinition mps on p.PosDefinitionId=mps.PosDefinitionId where mps.StoreId='${StoreId}' `; + let possaledata ={},defposData=[],inputChangeFlag=[]; + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('q dicide',txnres2.rows.length) + if(txnres2.rows.length>0){ + let data=txnres2.rows.item(0); + let PosOverall=data.PosOverall==true || data.PosOverall=='true'?1:0; + let poscheckAssortment = data.PosCheckAssortment + console.log('PSA',poscheckAssortment) + possaledata = data; + + let HeaderImageRequired=data.HeaderImageRequired==1 || data.HeaderImageRequired=='1' ?true:false; + let HeaderImageCount=data.HeaderImageCount!=null?data.HeaderImageCount:2; + let HeaderImageMandatory=data.HeaderImageMandatory!=null?data.HeaderImageMandatory:2; + + // console.log("possaledata",possaledata) + + setPOSDef(possaledata); + + let q2=` Select * from ${AppTables.POSSALE_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + await txn.executeSql(q2,[],async function (txn2, txnres3) { + console.log('added data:',txnres2.rows.length); + if(txnres3.rows.length>0){ + let allWindowsData=[]; + + for(var i=0;i0){ + + let arr=[]; + for(var i=0;i>>", data ) + + arr.push(data); + + let obj={"WindowId":data.WindowId,"WindowName":data.WindowName, "Sale": data.Sale,"PosValue":'',"PosVolume":'',"ReasonId":'',"Reason":'',"isPresent":0} + let animatedChoice=new Animated.Value((data.IsPresent=='1' || data.IsPresent==1?1:0)); + data.animatedChoice=animatedChoice; + let changesFlag = {WindowId:data.WindowId, WindowName: data.WindowName, Sale:data.Sale, Flag:false} + inputChangeFlag.push(changesFlag) + datapossale.push(obj); + + if(i==txnres4.rows.length-1){ + setInputChange(inputChangeFlag) + setWindowData(datapossale); + let PosSaleImages= HeaderImageRequired==true?await getPosSaleImages(HeaderImageCount,HeaderImageMandatory,possaledata,storeData1,menu1):[]; + setPosSImgArr(PosSaleImages); + // console.log("possaledata2",possaledata) + setPOSDef(possaledata); + setProcessing(false); + } + } + } + else{ + let PosSaleImages= HeaderImageRequired==true?await getPosSaleImages(HeaderImageCount,HeaderImageMandatory,possaledata,storeData1,menu1):[]; + setPosSImgArr(PosSaleImages); + setProcessing(false); + } + },function (txnE,txnerr) { console.log(txnerr);setProcessing(false); },); + } + }},function (txnE,txnerr) { console.log(txnerr);setProcessing(false); },); + + } + }, function (txnE,txnerr) { console.log(txnerr);setProcessing(false); }); + }); + } catch (err) { + console.log(err); + } + } + + + + async function getPosSaleImages(ImageCount,MandCount,data,storeData1,menu1){ + let WindowSplits_def= []; + for(var s=0;s{ + + db.transaction(async function (txn) { + + let q=`select * from ${AppTables.POSSALE_IMAGES} where POSDEFINITIONID='${data.PosDefinitionId}' and STORE_ID='${storeData1.StoreId}' and VISIT_DATE='${d2}' `; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return WindowSplits_def; + }); + } + + + async function onSubmitData(){ + let isvalid = ''; + isvalid=await validate(); + if(isvalid){ + Keyboard.dismiss(); + setShowAlert(true); + } + + + } + + async function saveData(){ + + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData+'...'); + setProcessing(true); + let d1n=new Date(); + let d3=moment(d1n).format('MM/DD/YYYY'); + try { + let {StoreId,MerchandiserId,ChainId,StateId,StoreTypeId}=storeData; + + await db.transaction(async function (txn) { + + // remove old data + await txn.executeSql(`DELETE FROM ${AppTables.HEADER_POSSALE_DATA} WHERE STORE_ID='${StoreId}'and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('Possale hdr data deleted'); + },function (txnE,txnerr) { console.log(txnerr); },); + + await txn.executeSql(`DELETE FROM ${AppTables.POSSALE_DATA} WHERE STORE_ID='${StoreId}'and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('Possale data deleted'); + },function (txnE,txnerr) { console.log(txnerr); },); + + + await txn.executeSql(`DELETE FROM ${AppTables.POSSALE_IMAGES} WHERE STORE_ID='${StoreId}'and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('Possale images data deleted'); + },function (txnE,txnerr) { console.log(txnerr); },); + + + + var values='',values1='',img_values=''; + let {Month,Year,Period , PeriodId ,Image1Name,Image2Name,TotalPosValue}=posSData; + + console.log("posSData --->",posSData) + + + values1+=` ('${MerchandiserId}','${StoreId}','${d3}','${Month}','${Year}','${Period}','${PeriodId}','${Image1Name || ''}','${Image2Name || ''}','${TotalPosValue}','${d3}') `; + + let PosOverall=POSDef.PosOverall==true || POSDef.PosOverall=='true'?1:0; + let HeaderImageRequired=POSDef.HeaderImageRequired==1 || POSDef.HeaderImageRequired=='1'?true:false; + let HeaderImageCount=POSDef.HeaderImageCount!=null?POSDef.HeaderImageCount:2; + let HeaderImageMandatory=POSDef.HeaderImageMandatory!=null?POSDef.HeaderImageMandatory:2; + + for (const wi in WindowData){ + const window=WindowData[wi]; + + let wind=window; + let isPresent = '', ReasonId='', Reason='', PosValue='',PosVolume='',WindowId='',WindowName='', Sale=''; + WindowId = wind.WindowId; + WindowName = wind.WindowName; + Sale = wind.Sale; + isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + Reason=wind.Reason!=null?wind.Reason:''; + PosValue=wind.PosValue!=null?wind.PosValue:''; + PosVolume=wind.PosVolume!=null?wind.PosVolume:''; + + values+=values!=''?' , ':''; + + values+=` ('${MerchandiserId}','${StoreId}','${d3}','${WindowId}','${WindowName}','${Sale}','${POSDef.PosDefinitionId}','${PosValue}','${PosVolume}','${isPresent}','${ReasonId}','${Reason}','${d3}') `; // add here empiid + + } + + for (const imgI in posSImgArr){ + let item=posSImgArr[imgI]; + let Image1=item.Image1!=null?item.Image1:''; + let Image1Name=item.Image1Name!=null?item.Image1Name:''; + img_values+=img_values!=''?' , ':''; + + img_values+=` ('${StoreId}','${d3}','${POSDef.PosDefinitionId}','${Image1Name}','${d3}') `; + } + + console.log('values:',values); + let header_add_possale_data=`INSERT INTO ${AppTables.HEADER_POSSALE_DATA} (EMP_ID ,STORE_ID,VISIT_DATE,MONTH,YEAR,CYCLEPERIOD,CYCLEPERIODID,IMAGE1,IMAGE2,TOTAL_POS_VALUE,ADDED_DATE) VALUES ${values1} `; + console.log('add_possale_data',header_add_possale_data) + + let add_possale_data=`INSERT INTO ${AppTables.POSSALE_DATA} (EMP_ID ,STORE_ID,VISIT_DATE,WINDOW_ID,WINDOW_NAME,SALE ,POSDEFINITIONID,POS_VALUE,POS_VOLUME,ISPRESENT,REASONID,REASON,ADDED_DATE) VALUES ${values} `; + let add_possale_Images=`INSERT INTO ${AppTables.POSSALE_IMAGES} (STORE_ID,VISIT_DATE,POSDEFINITIONID,IMAGE1,ADDED_DATE) VALUES ${img_values} `; + + await txn.executeSql(header_add_possale_data,[],async function (txn2, txnres) { + console.log('POSSALE header data added'); + await txn.executeSql(add_possale_data,[],async function (txn2, txnres) { + console.log('POSSALE data added'); + if(HeaderImageRequired==true && HeaderImageMandatory>=0){ + await txn.executeSql(add_possale_Images,[],async function (txn2, txnres) { + console.log('POSSALE header images added'); + props.navigation.goBack(); + },function (txnE,txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot save possale data'); },); + }else{ + props.navigation.goBack(); + } + },function (txnE,txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot save possale data'); },); + },function (txnE,txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot save headerpossale data'); },); + + + }); + } catch (err) { + console.log(err); + } + } + + async function executeQuery(q){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres2) { + resolve(true); + },function(Etxn,txnerr){console.log(txnerr);resolve(false) }); + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }) + } + + + + + async function validate(){ + console.log('validate') + let isValid=true; + let isReasonEnable=POSDef.PosNotExistReasonEnable=='true' || POSDef.PosNotExistReasonEnable==1? 1:0; + let isshowPosValue=POSDef.ShowPosValue=='true' || POSDef.ShowPosValue==1?1:0; + let isshowPosVolume=POSDef.ShowPosVolume=='true' || POSDef.ShowPosVolume==1?1:0; + + let ShowHdrPosSaleI=KPIFields.findIndex(i=>i.KPIFieldName=='ShowTotalPosSaleHeade'); + let ShowHdrPosSaleObj=ShowHdrPosSaleI>=0?KPIFields[ShowHdrPosSaleI]:{}; + let ShowHdrPosSale=ShowHdrPosSaleI>=0?ShowHdrPosSaleObj['KPIFieldEnable']:false; + let ShowHdrPosSaleDN=ShowHdrPosSaleObj['KPIFieldDisplayName']!='' && ShowHdrPosSaleObj['KPIFieldDisplayName']!=null ? ShowHdrPosSaleObj['KPIFieldDisplayName'] :"Total POS Value"; + + // let posCAValue=KPIFields.findIndex(i=>i.KPIFieldName=='PosSaleCameraAllow') + // let posCAValueObj=posCAValue>=0?KPIFields[posCAValue]:{}; + // let posCAValueEnable=posCAValue>=0?posCAValueObj['KPIFieldEnable']:true; + + let HeaderImageRequired=POSDef.HeaderImageRequired==1 || POSDef.HeaderImageRequired=='1'?true:false; + let HeaderImageCount=POSDef.HeaderImageCount!=null?POSDef.HeaderImageCount:2; + let HeaderImageMandatory=POSDef.HeaderImageMandatory!=null?POSDef.HeaderImageMandatory:2; + + + + + return new Promise(async(resolve,reject)=>{ + let {Image1,Image1Name,Image2,Image2Name,Month,Year,Period,TotalPosValue}=posSData; + if(Year==null || Year==''){ + notify(`Please select Year`,'SHORT'); + resolve(false);return; + } + else if(Month==null || Month==''){ + notify(`Please select month`,'SHORT'); + resolve(false);return; + } + else if(Period==null || Period==''){ + notify(`Please select Cycle`,'SHORT'); + resolve(false);return; + } + else if(ShowHdrPosSale==true && TotalPosValue!==0 && (TotalPosValue=='' || TotalPosValue==null)){ + notify(`Please enter ${ShowHdrPosSaleDN} value`,'SHORT'); + resolve(false);return; + } + // else if(posCAValueEnable && (Image1==null || Image1=='')){ + // notify(`Please click image`,'SHORT'); + // resolve(false);return; + // } + else{ + + if(HeaderImageRequired==true && HeaderImageMandatory>=0){ + let res=await new Promise((resolve1,reject1)=>{ + posSImgArr.map((item,index)=>{ + if(StoreCameraAllow && item.img1Required==true && (item.Image1=='' || item.Image1==null)){ + notify(`Please click image`,'SHORT'); + resolve1(false); + } + if(index==posSImgArr.length-1){ + resolve1(true); + } + }) + }).catch((err)=>{ + console.log("error:",err); + return false; + }) + console.log("HeaderImageRequired validate res:",res) + if(res==false){ + isValid=false;return false; + } + } + if(isValid){ + for (const wi in WindowData){ + const window=WindowData[wi]; + const wind=window; + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let PosValue=wind.PosValue!=null?wind.PosValue:''; + let PosVolume=wind.PosVolume!=null?wind.PosVolume:''; + if(isPresent=='1'){ + if(isshowPosValue==true && ( PosValue==null || PosValue=='')){ + notify(`Please Enter ${POSDef.PosValueLabel} `,'SHORT'); + resolve(false);return; + } + else if(isshowPosVolume==true && (PosVolume==null || PosVolume=='')){ + notify(`Please Enter ${POSDef.PosVolumeLabel}`,'SHORT'); + resolve(false);return; + } + } + else { + if(isReasonEnable==true && ReasonId=='' ){ + notify(`${'Please Select Reason'}`,'SHORT'); + resolve(false);return; + } + } + + if(wi==WindowData.length-1){ + resolve(true);return; + } + + } + } + + } + + }).then((val)=>{return val}) + .catch((err)=>{console.log(err); return false}); + + + } + + function onselectionChange3(option,keyLbl,keyVal,otherData){ + let item=otherData.window; + let index=otherData.index; + + let allData=WindowData; + let wind = item; + wind[keyVal]=option.value; + wind[keyLbl]=option.label; + + let objIndex = InputChange.findIndex(i=>i.WindowId==item.WindowId); + let winArr=[...InputChange] + winArr[objIndex].Flag=true + setInputChange(winArr); + + + index>=0?allData[index]=wind:''; + console.log('windowallData',allData) + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + + } + + + async function disableQtns(sqtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + + if(DQtns.length>0){ + new Promise.all( + DQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.VisibilityQuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=true + sqtns[s_qtnindex]=s_qtn; + let id_key=s_qtn.VisibilityQuestionId+'_AnswerId'; + let ans_key=s_qtn.VisibilityQuestionId+'_Answer'; + data[id_key]=0; + data[ans_key]=''; + + wind['WindowQA']=data; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + return false + }) + ).then(async (val)=>{ + + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.VisibilityDefinitionId==window.VisibilityDefinitionId && i.VisibilityId==window.VisibilityId) + if(windowIndex>=0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindowData(allData); + setWindows(allwindows); + setGlobalWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + }) + } + } + + async function enableQtns(sqtns,EQtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + new Promise.all( + EQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.VisibilityQuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=false + sqtns[s_qtnindex]=s_qtn; + return false + }) + ).then(async (val)=>{ + if(DQtns.length>0){ + await disableQtns(sqtns,DQtns,data,wind,wind_index,allData,window) + } + else{ + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.VisibilityDefinitionId==window.VisibilityDefinitionId && i.VisibilityId==window.VisibilityId) + if(windowIndex>0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindows(allwindows); + setGlobalWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + } + }) + } + + + function setTextValue(value,qtn,window) { + let id_key=qtn.VisibilityQuestionId+'_AnswerId'; + let ans_key=qtn.VisibilityQuestionId+'_Answer'; + + let allData=WindowData; + let defData={'PosDefinitionId':window.PosDefinitionId}; + const wind_index=allData.findIndex(i=> i.PosDefinitionId==window.PosDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + if(qtn.QuestionType=='Date' ){ + let date_key=qtn.VisibilityQuestionId+'_Date'; + let d=value!=null?new Date(value):new Date(); + let mfdate=moment(d).format('MM/YYYY'); + showQtnDatePicker(qtn,window,false); + obj[id_key]=0; + obj[ans_key]=mfdate; + obj[date_key]=moment(d).format('MM/DD/YYYY'); + } + else{ + obj[id_key]=0; + obj[ans_key]=value; + } + + console.log(value,obj); + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + let objIndex = InputChange.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let winArr=[...InputChange] + winArr[objIndex].Flag=true + console.log("changeValue---------1",winArr) + setInputChange(winArr) + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function showQtnDatePicker(qtn,window,show=false){ + let allQtns=window.WindowQuestions || []; + let newqtnIndex=allQtns.findIndex(q=>q.VisibilityQuestionId==qtn.VisibilityQuestionId); + + if(newqtnIndex>=0){ + let newqtn=allQtns[newqtnIndex]; + newqtn.showDatePicker=show; + allQtns[newqtnIndex]=newqtn; + window['WindowQuestions']=allQtns; + let allWindows=Windows; + const winIndex=allWindows.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId) || {}; + allWindows[winIndex]=window; + setWindows(allWindows); + setGlobalWindows(allwindows); + if(show==true) setrerenderdata(!rerenderdata); + } + } + + function setRatingValue(data){ + setRatingOrder(data); + } + + function onRatingCancel(){ + setShowRating(false); + } + + function onRatingSave(){ + setShowRating(false); + let qtn=RatingQtn; + let window=RatingWindow; + let id_key=qtn.VisibilityQuestionId+'_AnswerId'; + let ans_key=qtn.VisibilityQuestionId+'_Answer'; + let rating_key=qtn.VisibilityQuestionId+'_Rating'; + let ids=[],anss=[]; + RatingOrder.map((item,index)=>{ + ids.push(item.AnswerId); + anss.push(item.Answer); + }) + + let allData=WindowData; + let defData={'PosDefinitionId':window.PosDefinitionId}; + const wind_index=allData.findIndex(i=>i.PosDefinitionId==window.PosDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + obj[rating_key]=ids.join(','); + obj[id_key]=0; + obj[ans_key]=anss.join(','); + + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + let objIndex = InputChange.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let winArr=[...InputChange] + winArr[objIndex].Flag=true + console.log("changeValue---------7",winArr) + + setInputChange(winArr) + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function onChoiceSelect(item,index,val,key,animatedChoice){ + + let win_index=InputChange.find(i=>i.WindowId==item.WindowId) + console.log('win_index123',win_index) + let changeValue=win_index.Flag>=0?win_index.Flag:false; + console.log("win_index--------",win_index) + console.log("changeValue--------",changeValue) + console.log("InputChange--------",InputChange) + + + if(changeValue){ + setIsPresentClean(val) + setDataCleanAnim(animatedChoice) + setDataCleanItem(item) + setDataCleanModal(true) + return + } + + var val1=0; + val==1?val1=1:''; + + if(animatedChoice!=null){ + Animated.timing(animatedChoice, { + toValue: val1, + duration:400, + useNativeDriver:false, + }).start(); + } + onWindowDataChange(item,index,val,key) + } + + function onWindowDataChange(item,index,val,key,type=''){ + + let allData=WindowData; + + if(val!=''){ + let isValid=validateNumber(val,type); + if(!isValid){ + return; + } + } + + let wind = item; + + let PosOverall=POSDef.PosOverall==true || POSDef.PosOverall=='true'?1:0; + wind[key]=val; + // if(key=='ReasonId'){ + // let rsn=reasons_list.find(r=>r.ReasonId==val) || {}; + // wind['Reason']=rsn.Reason || ''; + // } + + index>=0?allData[index]=wind:''; + + console.log('windowallData',allData) + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onHdrDataChange(val,key,type=''){ + if(val!=''){ + let isValid=validateNumber(val,type); + if(!isValid){ + return; + } + } + + let alldata=posSData; + alldata[key]=val; + setPosSData(alldata); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onselectionChange(option,keyLbl,keyVal,otherData){ + let allData=posSData; + + console.log("allData",allData) + + console.log(keyLbl,keyVal) + + allData[keyLbl]=option.label; + allData[keyVal]=option.value; + + if (keyLbl == 'Year') { + allData['Month'] = ''; // Reset Month + allData['Period'] = ''; + allData['PeriodId'] = ''; // Reset Period + setShowChildView(false); + } + + // If Month is selected, reset Period + if (keyLbl == 'Month') { + allData['Period'] = ''; + allData['PeriodId'] = ''; // Reset Period + setShowChildView(false); + } + + if (keyLbl == 'Period' && keyLbl == 'PeriodId') { + setShowChildView(false); + } + setShowChildView(false); + setPosSData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + async function setWindowStockVal(val,window,stockProd,key,type=''){ + if(type=='numeric' && val!=''){ + const regex = new RegExp(/^\d+$/); + let isNUmeric=regex.test(val); + if(!isNUmeric){ + notify(ST.Pleaseenterwholenumbersonly,'SHORT'); + return; + } + } + + let allData=WindowData; + let defData={'VisibilityId':window.VisibilityId,'VisibilityDefinitionId':window.VisibilityDefinitionId}; + const win_index=allData.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + let sdIndex=WStocksData.findIndex(i=> i.ProductId==stockProd.VisibilityStockValue); + let sd=sdIndex>=0?WStocksData[sdIndex]:{'ProductId':stockProd.VisibilityStockValue,'Stock':''}; + sd[key]=val; + sdIndex>=0?WStocksData[sdIndex]=sd:WStocksData.push(sd); + wind['WStocksData']=WStocksData; + win_index>=0?allData[win_index]=wind:allData.push(wind); + if(key=='isPVisPresent'){ + let isAllChecked = await verifyAllChecked(val,window,stockProd,key); + wind['isAllSKUChecked']=isAllChecked; + } + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata4(!rerenderdata4); + } + + + + + async function onCatTextChange(window,key,val){ + let item=window; + let allData=WindowData; + let defData={'VisibilityId':item.VisibilityId,'VisibilityDefinitionId':item.VisibilityDefinitionId}; + const win_index=allData.findIndex(i=>i.VisibilityId==item.VisibilityId && i.VisibilityDefinitionId==item.VisibilityDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[key]=val; + + win_index>=0?allData[win_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + async function verifyAllChecked(val,window,stockProd,key){ + return await new Promise((resolve,reject)=>{ + let WindowStocks=window.WindowStocks || []; + let allData=WindowData; + const win_index=allData.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + if(WindowStocks.length>0){ + let isAllChecked=1; + for(var i=0;i a.ProductId==stockProd.VisibilityStockValue); + let sd1=sdIndex1>=0?WStocksData[sdIndex1]:{}; + let isPVisPresent=sd1.isPVisPresent; + if(isPVisPresent==null || isPVisPresent=='' || isPVisPresent==0 || isPVisPresent=='0'){ + isAllChecked=0 + } + + if(i==WindowStocks.length-1){ + resolve(isAllChecked); + } + } + } + else{ + resolve(0); + } + + }).catch((err)=>{ + console.log(err); + return 0; + }); + } + + async function getImage(imgdata){ + // const serverDT = await getServerDT(); + let type=getImageProps.type || ''; + let ImageIndex=getImageProps.ImageIndex; + + console.log('getImage ImageIndex:',type,ImageIndex) + + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + let isImgFromGallery=img.fromGallery!=null?img.fromGallery:false; + let picture_clickedd=isImgFromGallery==true?img.datetime:new Date(); + let picture_clicked_time=moment(picture_clickedd).format('DD-MM-YYYY HH:mm:ss') + + + // let picture_clicked_date1=serverDT?.ServerDate?.replace(/\//g, ''); + // let picture_clicked_time1=serverDT?.ServerTime?.replace(/\:/g, ''); + let picture_clicked_date1=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time1=moment(picture_clickedd).format('HHmmss'); + + console.log(picture_clicked_date1 , picture_clicked_time1, "DATEANDTIME") + + let filename=(props.UserId || '')+'_PossaleImg-'+picture_clicked_date1+'_'+picture_clicked_time1+'.jpg'; + + let allData=posSImgArr;//posSData; + let image_key,image_key_path; + let imgObj={}; + if(ImageIndex>=0){ + imgObj=allData[ImageIndex]; + } + if(type=='1'){ + image_key='Image1Name'; + image_key_path="Image1"; + } + // else{ + // image_key='Image2Name'; + // image_key_path="Image2"; + // } + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: '+currentMenu.MenuName+' | Date:'+picture_clicked_time; + + + // renamefile + let imagePath='file://'+`${common_ImagePath}${filename}`; + + // let imagePath=`${common_ImagePath+currentMenu.ScreenName}/${filename}`; + + console.log('imagePath',imagePath,imgObj) + RNFS.copyFile(imgurl,imagePath) + .then(async(resn) => { + // render data with clicked image + let uri='file://'+imagePath; + imgObj[image_key]=filename; + imgObj[image_key_path]=uri; + + ImageIndex>=0?allData[ImageIndex]=imgObj:allData.push(imgObj); + console.log("allData:",allData); + setPosSImgArr(allData); + setSelectedImg(uri); + setrerenderdata(!rerenderdata); + + // add metdata then resize image and restored back to the imagePath + + // let restore_data={"destFilePath":imagePath,"imgurl":imgurl,imgWidth,imgHeight,mark_text1,mark_text2} + + // console.log("restore_data--->",restore_data) + + // let is_restored=await restore_ImageWithMetaData(restore_data,imgdata); + // console.log("image restored:",is_restored); + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + } + } + + + + async function removeImage(){ + let index=toRemoveIndex; + let allData=AllImagesData; + let imgData=allData[index]; + let imgPath=imgData.ImagePath || ''; + if(imgPath!=''){ + let imgPath1='file://'+imgPath; + RNFS.unlink(imgPath1); + } + allData.splice(index,1); + setAllImagesData(allData); + } + + async function onRemoveImage(imgName,index){ + setToRemoveIndex(index); + } + + + async function openCamera(type='1',index=''){ + setGetImageProps({'type':type,"ImageIndex":index}); + setShowCamera(true); + } + + + function onWindowDataClean(){ + if(DataCleanAnim!=null){ + console.log("anim---") + let anim=isPresentClean==1?1:''; + Animated.timing(DataCleanAnim, { + toValue:anim, + duration:400, + useNativeDriver:false, + }).start(); + } + let allData=WindowData; + let WindowSplits = []; + for(var s=0;si.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId + let defData={'WindowId':DataCleanItem.WindowId,isPresent:isPresentClean}; + const win_index=allData.findIndex(i=>i.WindowId==DataCleanItem.WindowId); + allData[win_index]=defData + + let objIndex = InputChange.findIndex((obj => obj.WindowId == DataCleanItem.WindowId)); + let winArr=[...InputChange] + winArr[objIndex].Flag=false + console.log("changeValue---------7",winArr) + setInputChange(winArr) + setWindowData(allData); + setHasUnsavedChanges(true); + setDataCleanModal(false) + setrerenderdata(!rerenderdata); + } + + function checkAllSKUs(val,window){ + + let WindowStocks=window.WindowStocks || []; + let allData=WindowData; + let defData={'VisibilityId':window.VisibilityId,'VisibilityDefinitionId':window.VisibilityDefinitionId}; + const win_index=allData.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + console.log('WStocksData before:',WStocksData) + for(var i=0;i a.ProductId==stockProd.VisibilityStockValue); + let sd=sdIndex>=0?WStocksData[sdIndex]:{'ProductId':stockProd.VisibilityStockValue,'Stock':''}; + let isPVisPresent=(val==1 || val=='1')?1:0; + sd['isPVisPresent']=isPVisPresent; + + sdIndex>=0?(WStocksData[sdIndex]=sd):(WStocksData.push(sd)); + } + + + wind['WStocksData']=WStocksData; + wind['isAllSKUChecked']=val==1?1:0; + console.log('wind updated'); + win_index>=0?allData[win_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onSaveCancel(){ + setShowAlert(false); + } + + + + function openImageRefView(windowIndex=0){ + setrefImageIndex(windowIndex); + setShow_zoomImage(true); + } + + function FilterStores(searchedQry){ + searchedQry=searchedQry.toLowerCase(); + console.log('searchedQry',searchedQry); + let arr=[]; + let newWindows=[]; + if(searchedQry!=null && searchedQry!=''){ + + for(let i=0;i + + {ST.DragItemsInOrder} + {ST.Pressandholdtodrag} + {setRatingValue(data)}} + keyExtractor={(item) => item.AnswerId} + renderItem={renderItem} + /> + + {onRatingCancel()}}> + {ST.Cancel} + + {onRatingSave()}}> + {ST.Save} + + + + + ) + } + + function render_Picker(label_key,value_key,onChange=()=>{},selected_data={}){ + var data=[]; + let qtn=selected_data.qtn || {}; + let window=selected_data.window || {}; + let isQtnDisabled=qtn.isDisabled!=null || qtn.isDisabled!=''?false:true; + let allAnswers=qtn.Answers || []; + + allAnswers.map((item,index)=>{ + let obj={ key: index, label: item[label_key],value:item[value_key] }; + if(selected_data.value==item[label_key]) + obj['component']= {item[label_key]}; + data.push(obj); + }); + + return ( + {onChange(option,qtn,window) }} + overlayStyle={customStyle.addVisPickerOverlay} + cancelContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + optionStyle={customStyle.addvis_opStyle} + optionTextStyle={customStyle.addvis_opTextStyle} + optionContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + selectedKey={'1'} + disabled={isQtnDisabled} + > + {(selected_data.value!=null && selected_data.value!=''?selected_data.value: '-'+ST.select+'-')} + + ) + } + + function renderDatePicker(qtn,window){ + let qtnn=qtn; + let DateRange=qtn.DateRange; + let maxDate=moment().add(10,'years').format('MM/DD/YYYY'); + let minDate=moment().subtract(10,'years').format('MM/DD/YYYY'); + if(DateRange=='RFD'){ + maxDate=moment().format('MM/DD/YYYY'); + } + else if(DateRange=='RPD'){ + minDate=moment().format('MM/DD/YYYY'); + } + + return ( + {setTextValue(selectedDate,qtnn,window)}} + maximumDate={new Date(maxDate)} + minimumDate={new Date(minDate)} + /> + ); + } + + + function _renderItem(item,index){ + + const window=item; + const windowIndex=index; + + let isNAReasonEnable=POSDef.PosNotExistReasonEnable=='true' || POSDef.PosNotExistReasonEnable==1?1:0; + let isshowPosValue=POSDef.ShowPosValue=='true' || POSDef.ShowPosValue==1?1:0; + let isshowPosVolume=POSDef.ShowPosVolume=='true' || POSDef.ShowPosVolume==1?1:0; + let wind = item; + + + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let Reason=wind.Reason!=null?wind.Reason:''; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let PosValue=wind.PosValue!=null?wind.PosValue:''; + let PosVolume=wind.PosVolume!=null?wind.PosVolume:''; + + var xpos=isPresent=='1'?-75:0; + if(wind.animatedChoice!=null ){ + xpos=wind.animatedChoice.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + + + // console.log("saleArr-->",saleArr) + + return( + <> + {posSData?.PeriodId && showchildview && + + + + {item.WindowName} + + + + + {'Promotor Sale Volume :' } {item.Sale} + + + {ST.IsPresent} + + + + {onChoiceSelect(window,index,1,'isPresent',wind.animatedChoice)}}> + {ST.Yes} + + {onChoiceSelect(window,index,0,'isPresent',wind.animatedChoice)}}> + {ST.No} + + + + + + { ((isPresent=='1'&& isshowPosValue==true)) && + + {POSDef.PosValueLabel} + {onWindowDataChange(item,index,val,'PosValue','numeric')}} + + /> + + + } + { ((isPresent=='1'&& isshowPosVolume==true) ) && + + {POSDef.PosVolumeLabel} + {inputRefs.current['input1_'+stockProd.VisibilityDefinitionId+'_'+stockProd.VisibilityStockDefinitionId]=reff;}} + placeholder="" + autoComplete='off' + placeholderTextColor={PageTheme.$placeholder_color} + keyboardType={'numeric'} + value ={(PosVolume+'')} + onChangeText={(val)=>{onWindowDataChange(item,index,val,'PosVolume','numeric')}} + /> + + } + + { + (isPresent=='0' && isNAReasonEnable==true) && + + {ST.SelectReason} + {} + + } + + + + + } + + ); + + } + + function _renderWindow(){ + + + let PosOverall=POSDef.PosOverall==true || POSDef.PosOverall=='true'?1:0; + if(PosOverall==1){ + return ( + <> + {_renderPOSSHeader()} + {_renderItem(DefPOSWind,0)} + + ) + } + else{ + return ( + `window_${index.toString()}`} + renderItem={({item,index})=>{ + return _renderItem(item,index); + + }} + /> + ) + } + } + + + + function _renderHeader(currentIndex){ + return( + + {`${(currentIndex+1)}/${zoomImageUrl.length}`} + {setShow_zoomImage(false) }}> + + + + ) + } + + function _renderPOSSHeader(){ + + // console.log(posSData?.PeriodId , showchildview, "Values--->>") + + let {TotalPosValue}=posSData;//Image1,Image1Name,Image2,Image2Name + + let HeaderImageRequired=POSDef.HeaderImageRequired==1 || POSDef.HeaderImageRequired=='1'?true:false; + let HeaderImageCount=POSDef.HeaderImageCount!=null?POSDef.HeaderImageCount:2; + // let HeaderImageMandatory=POSDef.HeaderImageMandatory!=null?POSDef.HeaderImageMandatory:2; + + let ShowHdrPosSaleI=KPIFields.findIndex(i=>i.KPIFieldName=='ShowTotalPosSaleHeade'); + let ShowHdrPosSaleObj=ShowHdrPosSaleI>=0?KPIFields[ShowHdrPosSaleI]:{}; + let ShowHdrPosSale=ShowHdrPosSaleI>=0?ShowHdrPosSaleObj['KPIFieldEnable']:false; + let ShowHdrPosSaleDN=ShowHdrPosSaleObj['KPIFieldDisplayName']!='' && ShowHdrPosSaleObj['KPIFieldDisplayName']!=null ? ShowHdrPosSaleObj['KPIFieldDisplayName'] :"Total POS Value"; + return ( + + + + {'Year'} + + {CustomPicker(props,Years,'Year','Year','Year','Year',onselectionChange,{value:posSData?.Year})} + + + + + {'Month'} + + {CustomPicker(props,Months1,'Month','Month','Month','Month',onselectionChange,{value: posSData?.Month})} + + + + + + + {'Cycle'} + + {CustomPicker(props,Periods,'Period','PeriodId','Period','PeriodId',onselectionChange,{value: posSData?.Period})} + + + + + getposSaledefinationdata(posSData?.PeriodId)} + > + Get Sale data + + + + + { /* + + {'Month'} + + {CustomPicker(props,Months,'MonthId','MonthName','MonthId','MonthName',onselectionChange,{value:posSData.MonthName})} + + + */ + } + + {ShowHdrPosSale==true && + + + {ShowHdrPosSaleDN} + {onHdrDataChange(val,"TotalPosValue","numeric")}} + /> + + } + + + {HeaderImageRequired && HeaderImageCount>0 && + posSImgArr.map((item,index)=>{ + + let Image1=item.Image1!=null?item.Image1:''; + let img1Required=item.img1Required!=null?item.img1Required:false; + return ( + + <> + {posSData?.PeriodId && showchildview && + + { (Image1=='' || Image1==null) ? + (img1Required? + {openCamera('1',index)}}> + + : + {openCamera('1',index)}}> + + + ) : + + ((Image1!='' && Image1!=null) ? + {OpenImgModal(Image1,'1',index)}}> + + : null) + } + + } + + + + ) + }) + } + + {/* + + { (Image1=='' || Image1==null) ? + {openCamera('1')}}> + + : (Image1!='' && Image1!=null) ? + {OpenImgModal(Image1,'1')}}> + + : null + } + */} + + + {/* + + { (Image2=='' || Image2==null) ? + {openCamera('2')}}> + + : (Image2!='' && Image2!=null) ? + {OpenImgModal(Image2,'2')}}> + + : null + } + */} + + + + ); + } + + const onCancelClean = () =>{ + setDataCleanModal(false) + } + const onclear = () => { + console.log("onclear---------",DataCleanItem) + onWindowDataClean(DataCleanItem) + } + + function _OpenCaptureImage_Modal(img){ + + const isImageCap=(img!='' || img!=null)?true:false; + + let {type,ImageIndex}=reCapImgModalObj + return ( + + { + isImageCap && + + + + + + {openCamera(type,ImageIndex)}}> + + + + {!showImageSaveOp && + {cancelImage(false)}}> + + {ST.Close} + + } + + } + + ) + } + +// console.log("posSData--->",posSData) + + return ( + + + {processing && } + + {_OpenCaptureImage_Modal()} + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {ConfirmSaveAlert(props,DataCleanModal,onCancelClean,onclear,'Your data will be clean',)} + {/* {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> */} + + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + + + + { Object.keys(storeData).length>0 && + + {_renderWindow()} + + } + + {posSData?.PeriodId && showchildview && + + {onSubmitData()}}/> + + } + + + + + + { showRating==true && + renderRatingView() + } + {show_zoomImage && + + null} + /> + + } + + ); +} + + +export default connect(mapStateToProps, mapDispatchToProps)(POSSale); \ No newline at end of file diff --git a/src/screens/POSSale.js b/src/screens/POSSale.js new file mode 100644 index 0000000..9903537 --- /dev/null +++ b/src/screens/POSSale.js @@ -0,0 +1,2013 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, Animated, Keyboard} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,getDownloadJson1,getKPIFields,getServerDT,marktext1,marktext2, restore_ImageWithMetaData, validateNumber} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath,ImageFolderPath, HierarchyTbls} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, FontAwesome, Fontisto, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector' +import { CustomPicker, CustomPicker2 } from '../components/CustomPicker'; +import CustomCamera from '../components/Camera'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import DateTimePicker from '@react-native-community/datetimepicker'; +import CheckBox from '@react-native-community/checkbox'; + +import CameraImg3 from '../assets/performics/camera_tick.svg'; +import CameraImg2 from '../assets/performics/camera_icon.svg'; +import CameraImg5 from '../assets/image/camera_asterisk.png'; +import MultiSelect from 'react-native-multiple-select'; +import { ObjectFlags } from 'typescript'; +import { getMethodName, METHODS } from '../constants/methodNames'; + +function POSSale(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + + // console.log(HierarchyTbls, "HierarchyTbls-->") + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(''); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [StoreCameraAllow, setStoreCameraAllow] = useState(true); + const [currentMenu, setCurrentMenu] = useState({}); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + const [rerenderdata3, setrerenderdata3]= useState(0); + const [rerenderdata4, setrerenderdata4]= useState(0); + const [getImageProps,setGetImageProps]= useState({}); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + + const [WindowData, setWindowData] = useState([]); + const [reasons_list, setReasons_list] = useState([]); + const [Windows, setWindows] = useState([]); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [refImageIndex, setrefImageIndex] = useState(0); + const [zoomImageIndex, setzoomImageIndex] = useState(0); + const [showAlert, setShowAlert] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [showCamera, setShowCamera] = useState(false); + const zoomView=useRef(null); + const [showRating, setShowRating] = useState(false); + const [RatingQtn, setRatingQtn] = useState({}); + const [RatingWindow, setRatingWindow] = useState({}); + const [RatingOrder, setRatingOrder] = useState([]); + + const [AllImagesData, setAllImagesData] = useState([]); + const [globalWindows, setGlobalWindows] = useState([]); + const [KPIFields, setKPIFields] = useState([]); + const [showSwitchCamera,setShowSwitchCamera]= useState(false); + const [Image1, setImage1] = useState(''); + const [Image2, setImage2] = useState(''); + const [imageCapture, setimageCapture] = useState(''); + const [imageCapture2, setimageCapture2] = useState(''); + + + + const [DataCleanModal, setDataCleanModal] = useState(false); + const [DataCleanAnim, setDataCleanAnim] = useState(""); + const [DataCleanItem, setDataCleanItem] = useState({}); + const [isPresentClean, setIsPresentClean] = useState(0); + const [data, setData] = useState({}); + const [POSDef, setPOSDef] = useState({}); + const [Months, setMonths] = useState([]); + + const [Months1, setMonths1] = useState([]); + const [Years, setYears] = useState([]); + const [Periods, setPeriods] = useState([]); + + + const [posSData, setPosSData] = useState({}); + const [posSImgArr, setPosSImgArr] = useState([]); + + const [SelectedImg, setSelectedImg] = useState(''); + const [showModal, setShowModal] = useState(false); + const [reCapImgModalObj, setReCapImgModalObj] = useState({}); + const [showImageSaveOp, setShowImageSaveOp] = useState(true); + const [saleArr ,setsaleArr] = useState([]); + const [showchildview ,setShowChildView] = useState(true); + + const [InputChange, setInputChange] = useState([]); + const DefPOSWind={"WindowId":"0","WindowName":"POS Sale", "Sale":"0"}; + + const inputRefs = useRef({}); + + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + + useEffect(() => { + getyearmonthandcycle(); + },[posSData.Year,posSData.Month]) + + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + let cameraAllow=storeData1.CameraAllow=='true' || storeData1.CameraAllow==1?true:false; + setStoreCameraAllow(cameraAllow); + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + + const unsubscribe=props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + return unsubscribe; + }; + }, []); + + useEffect(() => { + const unsubscribe=props.navigation.addListener('beforeRemove', onBeforeRemove); + return unsubscribe; + }, [hasUnsavedChanges]); + + useEffect(() => { + const unsubscribe=props.navigation.addListener('beforeRemove', onBeforeRemove); + return unsubscribe; + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + function onRemoveScreen(e){ + Alert.alert( + "", + ST.Doyoureallywanttoexitthescreen, + [ + { + text: ST.Cancel, + onPress: () => {}, + style: "cancel" + }, + { text: ST.OK, onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + + async function DownloadMerchandiserSaleData() { + + + let downloadKey = "Sup_MerchandiserSaleData"; + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + let params = props.route.params ? props.route.params : {}; + let storeData1 = params.storeData || {}; + let menu1 = params.menu || {}; + const url = props.baseurl + getMethodName(METHODS.DOWNLOADJSON_METHOD); + + let data = { + Downloadtype: downloadKey, + Username: loginDetails.UserId, + Param1: storeData?.StoreId, + Param2: posSData?.PeriodId, + }; + + console.log(url, data); + + try { + const res = await getDownloadJson1(url, data); + console.log("DownloadMerchandiserSaleData res:", res); + setLoaderTitle("Downloading Merchandiser Sale Data..."); + setProcessing(true); + if (res.Sup_MerchandiserSaleData!=null || res.Sup_MerchandiserSaleData!= '') { + let posSaleArr = res.Sup_MerchandiserSaleData; + let isInserted = await InsertDownloadedMerSaleData(posSaleArr); + console.log('Inserted data:', posSaleArr); + console.log('isInserted:', isInserted); + + if (isInserted) { + await db.transaction(async function (txn) { + + // remove old data + await txn.executeSql(`DELETE FROM ${AppTables.HEADER_POSSALE_DATA} WHERE STORE_ID='${storeData1.StoreId}'and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('Possale hdr data deleted from main download'); + },function (txnE,txnerr) { console.log(txnerr); },); + + await txn.executeSql(`DELETE FROM ${AppTables.POSSALE_DATA} WHERE STORE_ID='${storeData1.StoreId}'and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('Possale data deleted from main download'); + },function (txnE,txnerr) { console.log(txnerr); },); + // After both deletions, call getData + notify("Merchandiser sale data downloaded successfully."); + getData(storeData1, menu1); + setShowChildView(true); + setProcessing(false); + }); + } else { + await db.transaction(async function (txn) { + + // remove old data + await txn.executeSql(`DELETE FROM ${AppTables.HEADER_POSSALE_DATA} WHERE STORE_ID='${storeData1.StoreId}'and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('Possale hdr data deleted from main download'); + },function (txnE,txnerr) { console.log(txnerr); },); + + await txn.executeSql(`DELETE FROM ${AppTables.POSSALE_DATA} WHERE STORE_ID='${storeData1.StoreId}'and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('Possale data deleted from main download'); + },function (txnE,txnerr) { console.log(txnerr); },); + + // After both deletions, call getData + // notify("Cannot download merchandiser sale data! No data found."); + getData(storeData1, menu1); + setShowChildView(true); + setProcessing(false); + }); + + } + + + } else { + notify('No data found!'); + setProcessing(false); + return []; + + } + } catch (err) { + console.log('onPage Team error',err); + setProcessing(false); + notify("Cannot download merchandiser sale data!") + return []; + } + } + + + async function InsertDownloadedMerSaleData(posSaleArr){ + console.log("insert download posSale called"); + return new Promise((resolve,reject)=>{ + + var values=[],sql_stmnt='',all_vals=''; + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let tbname='Sup_MerchandiserSaleData'; + let storeId = storeData.StoreId; + let q=`Delete from ${tbname} where StoreId='${storeId}' AND CycleId='${posSData?.PeriodId}' `; + + posSaleArr = posSaleArr ? posSaleArr : []; + + console.log("posSaleArr", posSaleArr) + + posSaleArr?.map((data_obj)=>{ + let {CycleId,StoreId,PosSaleValue,Sale}=data_obj; + values.push(` ('${CycleId || ''}', '${StoreId || ''}', '${PosSaleValue || ''}', '${Sale || 0}')`); + }); + all_vals=values.join(','); + sql_stmnt=`INSERT INTO ${tbname}(CycleId,StoreId,PosSaleValue,Sale) + values ${all_vals}`; + + db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres4) { + console.log('removeddata'); + await txn.executeSql(sql_stmnt,[],async function (txn2, txnres2) { + resolve(true); + },function(txn2,txnerr){ console.log(txnerr);resolve(false);}); + },function(txn2,txnerr){console.log(txnerr);resolve(false);}); + }) + }).catch((err)=>{ + console.log(err); + return false; + }) + + } + + async function getposSaledefinationdata(id) { + + console.log(id, "posSData?.PeriodId") + + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + setProcessing(true); + try { + await db.transaction(async (txn) => { + let query = ` + SELECT DISTINCT * FROM Sup_MerchandiserSaleData Where StoreId = '${storeData?.StoreId}' AND CycleId='${id}';`; + + console.log(query, "query"); + + txn.executeSql(query, [], (txn, result) => { + if (result.rows.length > 0) { + + console.log(result.rows.length, "result.rows.length") + + let arr=[]; + + for(var i=0;i',data) + arr.push(data); + if(i==result.rows.length-1){ + console.log(arr) + setsaleArr(arr); + getData(storeData1,menu1); + setShowChildView(true); + notify("Merchandiser sale data downloaded successfully."); + // setProcessing(false); + } + } + } + else { + console.log('Table is empty. Triggering data download.'); + DownloadMerchandiserSaleData(); + // setProcessing(false); + } + }, (error) => { + setProcessing(false); + console.log("Error while executing getMerchSaledata SQL: ", error); + }); + }); + } catch (err) { + console.log("Error in get Merch Sale data function: ", err); + setProcessing(false); + } + } + async function getyearmonthandcycle(){ + try { + + await db.transaction(async function (txn) { + + let q6=`SELECT DISTINCT CycleYear as Year FROM Sup_Master_PosSaleCycle`; + await txn.executeSql(q6,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + + for(var i=0;i',data) + arr.push(data); + if(i==txnres2.rows.length-1){ + console.log(arr) + setYears(arr); + } + } + } + },function (txnE,txnerr) { console.log(txnerr); },); + + let q7=`SELECT DISTINCT CycleMonth as Month FROM Sup_Master_PosSaleCycle WHERE CycleYear = '${posSData?.Year}'`; + await txn.executeSql(q7,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + + for(var i=0;i',data) + arr.push(data); + if(i==txnres2.rows.length-1){ + console.log(arr) + setMonths1(arr); + } + } + } + },function (txnE,txnerr) { console.log(txnerr); },); + + let q8=`SELECT DISTINCT CycleId as PeriodId , CyclePeriod as Period FROM Sup_Master_PosSaleCycle WHERE CycleMonth = '${posSData?.Month}' AND CycleYear = '${posSData?.Year}'`; + await txn.executeSql(q8,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i',data) + arr.push(data); + if(i==txnres2.rows.length-1){ + console.log(arr) + setPeriods(arr); + } + } + } + else{ + setProcessing(false); + } + },function (txnE,txnerr) { console.log(txnerr);setProcessing(false); },); + }); + //end queries for month / day / year + } catch (err) { + console.log(err); + setProcessing(false); + } + } + + + async function getData(storeData1,menu1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId,StoreCategoryId,StoreClassId}=storeData1; + let arrobj=[]; + + let AllKPIFields=await getKPIFields(menu1); + setKPIFields(AllKPIFields); + + // set switch camera flag as defined in mapping menu flag (if exists) + let SwitchingCameraI=AllKPIFields.findIndex(i=>i.KPIFieldName=='SwitchingCamera'); + let SwitchingCameraObj=SwitchingCameraI>=0?AllKPIFields[SwitchingCameraI]:{}; + let SwitchingCamera=SwitchingCameraI>=0?SwitchingCameraObj['KPIFieldEnable']:false; + setShowSwitchCamera(SwitchingCamera); + + await db.transaction(async function (txn) { + + + let q3=`Select PosReasonId as ReasonId,PosReason as Reason From Sup_Master_PosSaleReason`; + await txn.executeSql(q3,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + + for(var i=0;i0){ + let pos_d=txnres5.rows.item(0); + let {MONTH,YEAR,CYCLEPERIOD,CYCLEPERIODID ,IMAGE1,IMAGE2,TOTAL_POS_VALUE}=pos_d; + console.log("pos_d--->",pos_d) + // let image1Path=IMAGE1!=''?'file://'+ImageFolderPath+menu1.ScreenName+"/"+IMAGE1:''; + // let image2Path=IMAGE2!=''?'file://'+ImageFolderPath+menu1.ScreenName+"/"+IMAGE2:''; + let posdata_obj={"Month":MONTH, "Year": YEAR, "Period": CYCLEPERIOD,"PeriodId" : CYCLEPERIODID, "TotalPosValue":TOTAL_POS_VALUE};//,"Image1Name":IMAGE1,"Image1":image1Path,"Image2Name":IMAGE2,"Image2":image2Path + setPosSData(posdata_obj); + } + },function (txnE,txnerr) { console.log(txnerr); }); + + let q=` Select * from Sup_Master_PosSaleDefinition p INNER join Sup_Mapping_StorePosSaleDefinition mps on p.PosDefinitionId=mps.PosDefinitionId where mps.StoreId='${StoreId}' `; + let possaledata ={},defposData=[],inputChangeFlag=[]; + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('q dicide',txnres2.rows.length) + if(txnres2.rows.length>0){ + let data=txnres2.rows.item(0); + let PosOverall=data.PosOverall==true || data.PosOverall=='true'?1:0; + let poscheckAssortment = data.PosCheckAssortment + console.log('PSA',poscheckAssortment) + possaledata = data; + + let HeaderImageRequired=data.HeaderImageRequired==1 || data.HeaderImageRequired=='1' ?true:false; + let HeaderImageCount=data.HeaderImageCount!=null?data.HeaderImageCount:2; + let HeaderImageMandatory=data.HeaderImageMandatory!=null?data.HeaderImageMandatory:2; + + // console.log("possaledata",possaledata) + + setPOSDef(possaledata); + + let q2=` Select * from ${AppTables.POSSALE_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + await txn.executeSql(q2,[],async function (txn2, txnres3) { + console.log('added data:',txnres2.rows.length); + if(txnres3.rows.length>0){ + let allWindowsData=[]; + + for(var i=0;i0){ + + let arr=[]; + for(var i=0;i>>", data ) + + arr.push(data); + + let obj={"WindowId":data.WindowId,"WindowName":data.WindowName, "Sale": data.Sale,"PosValue":'',"PosVolume":'',"ReasonId":'',"Reason":'',"isPresent":0} + let animatedChoice=new Animated.Value((data.IsPresent=='1' || data.IsPresent==1?1:0)); + data.animatedChoice=animatedChoice; + let changesFlag = {WindowId:data.WindowId, WindowName: data.WindowName, Sale:data.Sale, Flag:false} + inputChangeFlag.push(changesFlag) + datapossale.push(obj); + + if(i==txnres4.rows.length-1){ + setInputChange(inputChangeFlag) + setWindowData(datapossale); + let PosSaleImages= HeaderImageRequired==true?await getPosSaleImages(HeaderImageCount,HeaderImageMandatory,possaledata,storeData1,menu1):[]; + setPosSImgArr(PosSaleImages); + // console.log("possaledata2",possaledata) + setPOSDef(possaledata); + setProcessing(false); + } + } + } + else{ + let PosSaleImages= HeaderImageRequired==true?await getPosSaleImages(HeaderImageCount,HeaderImageMandatory,possaledata,storeData1,menu1):[]; + setPosSImgArr(PosSaleImages); + setProcessing(false); + } + },function (txnE,txnerr) { console.log(txnerr);setProcessing(false); },); + } + }},function (txnE,txnerr) { console.log(txnerr);setProcessing(false); },); + + } + }, function (txnE,txnerr) { console.log(txnerr);setProcessing(false); }); + }); + } catch (err) { + console.log(err); + } + } + + + + async function getPosSaleImages(ImageCount,MandCount,data,storeData1,menu1){ + let WindowSplits_def= []; + for(var s=0;s{ + + db.transaction(async function (txn) { + + let q=`select * from ${AppTables.POSSALE_IMAGES} where POSDEFINITIONID='${data.PosDefinitionId}' and STORE_ID='${storeData1.StoreId}' and VISIT_DATE='${d2}' `; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return WindowSplits_def; + }); + } + + + async function onSubmitData(){ + let isvalid = ''; + isvalid=await validate(); + if(isvalid){ + Keyboard.dismiss(); + setShowAlert(true); + } + + + } + + async function saveData(){ + + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData+'...'); + setProcessing(true); + let d1n=new Date(); + let d3=moment(d1n).format('MM/DD/YYYY'); + try { + let {StoreId,MerchandiserId,ChainId,StateId,StoreTypeId}=storeData; + + await db.transaction(async function (txn) { + + // remove old data + await txn.executeSql(`DELETE FROM ${AppTables.HEADER_POSSALE_DATA} WHERE STORE_ID='${StoreId}'and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('Possale hdr data deleted'); + },function (txnE,txnerr) { console.log(txnerr); },); + + await txn.executeSql(`DELETE FROM ${AppTables.POSSALE_DATA} WHERE STORE_ID='${StoreId}'and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('Possale data deleted'); + },function (txnE,txnerr) { console.log(txnerr); },); + + + await txn.executeSql(`DELETE FROM ${AppTables.POSSALE_IMAGES} WHERE STORE_ID='${StoreId}'and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('Possale images data deleted'); + },function (txnE,txnerr) { console.log(txnerr); },); + + + + var values='',values1='',img_values=''; + let {Month,Year,Period , PeriodId ,Image1Name,Image2Name,TotalPosValue}=posSData; + + console.log("posSData --->",posSData) + + + values1+=` ('${MerchandiserId}','${StoreId}','${d3}','${Month}','${Year}','${Period}','${PeriodId}','${Image1Name || ''}','${Image2Name || ''}','${TotalPosValue}','${d3}') `; + + let PosOverall=POSDef.PosOverall==true || POSDef.PosOverall=='true'?1:0; + let HeaderImageRequired=POSDef.HeaderImageRequired==1 || POSDef.HeaderImageRequired=='1'?true:false; + let HeaderImageCount=POSDef.HeaderImageCount!=null?POSDef.HeaderImageCount:2; + let HeaderImageMandatory=POSDef.HeaderImageMandatory!=null?POSDef.HeaderImageMandatory:2; + + for (const wi in WindowData){ + const window=WindowData[wi]; + + let wind=window; + let isPresent = '', ReasonId='', Reason='', PosValue='',PosVolume='',WindowId='',WindowName='', Sale=''; + WindowId = wind.WindowId; + WindowName = wind.WindowName; + Sale = wind.Sale; + isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + Reason=wind.Reason!=null?wind.Reason:''; + PosValue=wind.PosValue!=null?wind.PosValue:''; + PosVolume=wind.PosVolume!=null?wind.PosVolume:''; + + values+=values!=''?' , ':''; + + values+=` ('${MerchandiserId}','${StoreId}','${d3}','${WindowId}','${WindowName}','${Sale}','${POSDef.PosDefinitionId}','${PosValue}','${PosVolume}','${isPresent}','${ReasonId}','${Reason}','${d3}') `; // add here empiid + + } + + for (const imgI in posSImgArr){ + let item=posSImgArr[imgI]; + let Image1=item.Image1!=null?item.Image1:''; + let Image1Name=item.Image1Name!=null?item.Image1Name:''; + img_values+=img_values!=''?' , ':''; + + img_values+=` ('${StoreId}','${d3}','${POSDef.PosDefinitionId}','${Image1Name}','${d3}') `; + } + + console.log('values:',values); + let header_add_possale_data=`INSERT INTO ${AppTables.HEADER_POSSALE_DATA} (EMP_ID ,STORE_ID,VISIT_DATE,MONTH,YEAR,CYCLEPERIOD,CYCLEPERIODID,IMAGE1,IMAGE2,TOTAL_POS_VALUE,ADDED_DATE) VALUES ${values1} `; + console.log('add_possale_data',header_add_possale_data) + + let add_possale_data=`INSERT INTO ${AppTables.POSSALE_DATA} (EMP_ID ,STORE_ID,VISIT_DATE,WINDOW_ID,WINDOW_NAME,SALE ,POSDEFINITIONID,POS_VALUE,POS_VOLUME,ISPRESENT,REASONID,REASON,ADDED_DATE) VALUES ${values} `; + let add_possale_Images=`INSERT INTO ${AppTables.POSSALE_IMAGES} (STORE_ID,VISIT_DATE,POSDEFINITIONID,IMAGE1,ADDED_DATE) VALUES ${img_values} `; + + await txn.executeSql(header_add_possale_data,[],async function (txn2, txnres) { + console.log('POSSALE header data added'); + await txn.executeSql(add_possale_data,[],async function (txn2, txnres) { + console.log('POSSALE data added'); + if(HeaderImageRequired==true && HeaderImageMandatory>=0){ + await txn.executeSql(add_possale_Images,[],async function (txn2, txnres) { + console.log('POSSALE header images added'); + props.navigation.goBack(); + },function (txnE,txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot save possale data'); },); + }else{ + props.navigation.goBack(); + } + },function (txnE,txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot save possale data'); },); + },function (txnE,txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot save headerpossale data'); },); + + + }); + } catch (err) { + console.log(err); + } + } + + async function executeQuery(q){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres2) { + resolve(true); + },function(Etxn,txnerr){console.log(txnerr);resolve(false) }); + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }) + } + + + + + async function validate(){ + console.log('validate') + let isValid=true; + let isReasonEnable=POSDef.PosNotExistReasonEnable=='true' || POSDef.PosNotExistReasonEnable==1? 1:0; + let isshowPosValue=POSDef.ShowPosValue=='true' || POSDef.ShowPosValue==1?1:0; + let isshowPosVolume=POSDef.ShowPosVolume=='true' || POSDef.ShowPosVolume==1?1:0; + + let ShowHdrPosSaleI=KPIFields.findIndex(i=>i.KPIFieldName=='ShowTotalPosSaleHeade'); + let ShowHdrPosSaleObj=ShowHdrPosSaleI>=0?KPIFields[ShowHdrPosSaleI]:{}; + let ShowHdrPosSale=ShowHdrPosSaleI>=0?ShowHdrPosSaleObj['KPIFieldEnable']:false; + let ShowHdrPosSaleDN=ShowHdrPosSaleObj['KPIFieldDisplayName']!='' && ShowHdrPosSaleObj['KPIFieldDisplayName']!=null ? ShowHdrPosSaleObj['KPIFieldDisplayName'] :"Total POS Value"; + + // let posCAValue=KPIFields.findIndex(i=>i.KPIFieldName=='PosSaleCameraAllow') + // let posCAValueObj=posCAValue>=0?KPIFields[posCAValue]:{}; + // let posCAValueEnable=posCAValue>=0?posCAValueObj['KPIFieldEnable']:true; + + let HeaderImageRequired=POSDef.HeaderImageRequired==1 || POSDef.HeaderImageRequired=='1'?true:false; + let HeaderImageCount=POSDef.HeaderImageCount!=null?POSDef.HeaderImageCount:2; + let HeaderImageMandatory=POSDef.HeaderImageMandatory!=null?POSDef.HeaderImageMandatory:2; + + console.log(HeaderImageRequired, "HeaderImageRequired") + + + return new Promise(async(resolve,reject)=>{ + let {Image1,Image1Name,Image2,Image2Name,Month,Year,Period,TotalPosValue}=posSData; + if(Year==null || Year==''){ + notify(`Please select Year`,'SHORT'); + resolve(false);return; + } + else if(Month==null || Month==''){ + notify(`Please select month`,'SHORT'); + resolve(false);return; + } + else if(Period==null || Period==''){ + notify(`Please select Cycle`,'SHORT'); + resolve(false);return; + } + else if(ShowHdrPosSale==true && TotalPosValue!==0 && (TotalPosValue=='' || TotalPosValue==null)){ + notify(`Please enter ${ShowHdrPosSaleDN} value`,'SHORT'); + resolve(false);return; + } + else{ + + if(HeaderImageRequired==true && HeaderImageMandatory>=0){ + console.log("HELLO") + let res=await new Promise((resolve1,reject1)=>{ + posSImgArr.map((item,index)=>{ + + console.log(StoreCameraAllow , item.img1Required ,item.Image1 , item.Image1, "CONSOLEE_-----") + if(StoreCameraAllow && item.img1Required==true && (item.Image1=='' || item.Image1==null)){ + notify(`Please click image`,'SHORT'); + resolve1(false); + } + if(index==posSImgArr.length-1){ + resolve1(true); + } + }) + }).catch((err)=>{ + console.log("error:",err); + return false; + }) + console.log("HeaderImageRequired validate res:",res) + if(res==false){ + isValid=false;return false; + } + } + if(isValid){ + for (const wi in WindowData){ + const window=WindowData[wi]; + const wind=window; + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let PosValue=wind.PosValue!=null?wind.PosValue:''; + let PosVolume=wind.PosVolume!=null?wind.PosVolume:''; + if(isPresent=='1'){ + if(isshowPosValue==true && ( PosValue==null || PosValue=='')){ + notify(`Please Enter ${POSDef.PosValueLabel} `,'SHORT'); + resolve(false);return; + } + else if(isshowPosVolume==true && (PosVolume==null || PosVolume=='')){ + notify(`Please Enter ${POSDef.PosVolumeLabel}`,'SHORT'); + resolve(false);return; + } + } + else { + if(isReasonEnable==true && ReasonId=='' ){ + notify(`${'Please Select Reason'}`,'SHORT'); + resolve(false);return; + } + } + + if(wi==WindowData.length-1){ + resolve(true);return; + } + + } + } + + } + + }).then((val)=>{return val}) + .catch((err)=>{console.log(err); return false}); + + + } + + function onselectionChange3(option,keyLbl,keyVal,otherData){ + let item=otherData.window; + let index=otherData.index; + + let allData=WindowData; + let wind = item; + wind[keyVal]=option.value; + wind[keyLbl]=option.label; + + let objIndex = InputChange.findIndex(i=>i.WindowId==item.WindowId); + let winArr=[...InputChange] + winArr[objIndex].Flag=true + setInputChange(winArr); + + + index>=0?allData[index]=wind:''; + console.log('windowallData',allData) + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + + } + + + async function disableQtns(sqtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + + if(DQtns.length>0){ + new Promise.all( + DQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.VisibilityQuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=true + sqtns[s_qtnindex]=s_qtn; + let id_key=s_qtn.VisibilityQuestionId+'_AnswerId'; + let ans_key=s_qtn.VisibilityQuestionId+'_Answer'; + data[id_key]=0; + data[ans_key]=''; + + wind['WindowQA']=data; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + return false + }) + ).then(async (val)=>{ + + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.VisibilityDefinitionId==window.VisibilityDefinitionId && i.VisibilityId==window.VisibilityId) + if(windowIndex>=0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindowData(allData); + setWindows(allwindows); + setGlobalWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + }) + } + } + + async function enableQtns(sqtns,EQtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + new Promise.all( + EQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.VisibilityQuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=false + sqtns[s_qtnindex]=s_qtn; + return false + }) + ).then(async (val)=>{ + if(DQtns.length>0){ + await disableQtns(sqtns,DQtns,data,wind,wind_index,allData,window) + } + else{ + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.VisibilityDefinitionId==window.VisibilityDefinitionId && i.VisibilityId==window.VisibilityId) + if(windowIndex>0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindows(allwindows); + setGlobalWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + } + }) + } + + + function setTextValue(value,qtn,window) { + let id_key=qtn.VisibilityQuestionId+'_AnswerId'; + let ans_key=qtn.VisibilityQuestionId+'_Answer'; + + let allData=WindowData; + let defData={'PosDefinitionId':window.PosDefinitionId}; + const wind_index=allData.findIndex(i=> i.PosDefinitionId==window.PosDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + if(qtn.QuestionType=='Date' ){ + let date_key=qtn.VisibilityQuestionId+'_Date'; + let d=value!=null?new Date(value):new Date(); + let mfdate=moment(d).format('MM/YYYY'); + showQtnDatePicker(qtn,window,false); + obj[id_key]=0; + obj[ans_key]=mfdate; + obj[date_key]=moment(d).format('MM/DD/YYYY'); + } + else{ + obj[id_key]=0; + obj[ans_key]=value; + } + + console.log(value,obj); + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + let objIndex = InputChange.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let winArr=[...InputChange] + winArr[objIndex].Flag=true + console.log("changeValue---------1",winArr) + setInputChange(winArr) + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function showQtnDatePicker(qtn,window,show=false){ + let allQtns=window.WindowQuestions || []; + let newqtnIndex=allQtns.findIndex(q=>q.VisibilityQuestionId==qtn.VisibilityQuestionId); + + if(newqtnIndex>=0){ + let newqtn=allQtns[newqtnIndex]; + newqtn.showDatePicker=show; + allQtns[newqtnIndex]=newqtn; + window['WindowQuestions']=allQtns; + let allWindows=Windows; + const winIndex=allWindows.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId) || {}; + allWindows[winIndex]=window; + setWindows(allWindows); + setGlobalWindows(allwindows); + if(show==true) setrerenderdata(!rerenderdata); + } + } + + function setRatingValue(data){ + setRatingOrder(data); + } + + function onRatingCancel(){ + setShowRating(false); + } + + function onRatingSave(){ + setShowRating(false); + let qtn=RatingQtn; + let window=RatingWindow; + let id_key=qtn.VisibilityQuestionId+'_AnswerId'; + let ans_key=qtn.VisibilityQuestionId+'_Answer'; + let rating_key=qtn.VisibilityQuestionId+'_Rating'; + let ids=[],anss=[]; + RatingOrder.map((item,index)=>{ + ids.push(item.AnswerId); + anss.push(item.Answer); + }) + + let allData=WindowData; + let defData={'PosDefinitionId':window.PosDefinitionId}; + const wind_index=allData.findIndex(i=>i.PosDefinitionId==window.PosDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + obj[rating_key]=ids.join(','); + obj[id_key]=0; + obj[ans_key]=anss.join(','); + + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + let objIndex = InputChange.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let winArr=[...InputChange] + winArr[objIndex].Flag=true + console.log("changeValue---------7",winArr) + + setInputChange(winArr) + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function onChoiceSelect(item,index,val,key,animatedChoice){ + + let win_index=InputChange.find(i=>i.WindowId==item.WindowId) + console.log('win_index123',win_index) + let changeValue=win_index.Flag>=0?win_index.Flag:false; + console.log("win_index--------",win_index) + console.log("changeValue--------",changeValue) + console.log("InputChange--------",InputChange) + + + if(changeValue){ + setIsPresentClean(val) + setDataCleanAnim(animatedChoice) + setDataCleanItem(item) + setDataCleanModal(true) + return + } + + var val1=0; + val==1?val1=1:''; + + if(animatedChoice!=null){ + Animated.timing(animatedChoice, { + toValue: val1, + duration:400, + useNativeDriver:false, + }).start(); + } + onWindowDataChange(item,index,val,key) + } + + function onWindowDataChange(item,index,val,key,type=''){ + + let allData=WindowData; + + if(val!=''){ + let isValid=validateNumber(val,type); + if(!isValid){ + return; + } + } + + let wind = item; + + let PosOverall=POSDef.PosOverall==true || POSDef.PosOverall=='true'?1:0; + wind[key]=val; + // if(key=='ReasonId'){ + // let rsn=reasons_list.find(r=>r.ReasonId==val) || {}; + // wind['Reason']=rsn.Reason || ''; + // } + + index>=0?allData[index]=wind:''; + + console.log('windowallData',allData) + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onHdrDataChange(val,key,type=''){ + if(val!=''){ + let isValid=validateNumber(val,type); + if(!isValid){ + return; + } + } + + let alldata=posSData; + alldata[key]=val; + setPosSData(alldata); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onselectionChange(option,keyLbl,keyVal,otherData){ + let allData=posSData; + + console.log("allData",allData) + + console.log(keyLbl,keyVal) + + allData[keyLbl]=option.label; + allData[keyVal]=option.value; + + if (keyLbl == 'Year') { + allData['Month'] = ''; // Reset Month + allData['Period'] = ''; + allData['PeriodId'] = ''; // Reset Period + setShowChildView(false); + } + + // If Month is selected, reset Period + if (keyLbl == 'Month') { + allData['Period'] = ''; + allData['PeriodId'] = ''; // Reset Period + setShowChildView(false); + } + + if (keyLbl == 'Period' && keyLbl == 'PeriodId') { + setShowChildView(false); + } + setShowChildView(false); + setPosSData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + async function setWindowStockVal(val,window,stockProd,key,type=''){ + if(type=='numeric' && val!=''){ + const regex = new RegExp(/^\d+$/); + let isNUmeric=regex.test(val); + if(!isNUmeric){ + notify(ST.Pleaseenterwholenumbersonly,'SHORT'); + return; + } + } + + let allData=WindowData; + let defData={'VisibilityId':window.VisibilityId,'VisibilityDefinitionId':window.VisibilityDefinitionId}; + const win_index=allData.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + let sdIndex=WStocksData.findIndex(i=> i.ProductId==stockProd.VisibilityStockValue); + let sd=sdIndex>=0?WStocksData[sdIndex]:{'ProductId':stockProd.VisibilityStockValue,'Stock':''}; + sd[key]=val; + sdIndex>=0?WStocksData[sdIndex]=sd:WStocksData.push(sd); + wind['WStocksData']=WStocksData; + win_index>=0?allData[win_index]=wind:allData.push(wind); + if(key=='isPVisPresent'){ + let isAllChecked = await verifyAllChecked(val,window,stockProd,key); + wind['isAllSKUChecked']=isAllChecked; + } + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata4(!rerenderdata4); + } + + + + + async function onCatTextChange(window,key,val){ + let item=window; + let allData=WindowData; + let defData={'VisibilityId':item.VisibilityId,'VisibilityDefinitionId':item.VisibilityDefinitionId}; + const win_index=allData.findIndex(i=>i.VisibilityId==item.VisibilityId && i.VisibilityDefinitionId==item.VisibilityDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[key]=val; + + win_index>=0?allData[win_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + async function verifyAllChecked(val,window,stockProd,key){ + return await new Promise((resolve,reject)=>{ + let WindowStocks=window.WindowStocks || []; + let allData=WindowData; + const win_index=allData.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + if(WindowStocks.length>0){ + let isAllChecked=1; + for(var i=0;i a.ProductId==stockProd.VisibilityStockValue); + let sd1=sdIndex1>=0?WStocksData[sdIndex1]:{}; + let isPVisPresent=sd1.isPVisPresent; + if(isPVisPresent==null || isPVisPresent=='' || isPVisPresent==0 || isPVisPresent=='0'){ + isAllChecked=0 + } + + if(i==WindowStocks.length-1){ + resolve(isAllChecked); + } + } + } + else{ + resolve(0); + } + + }).catch((err)=>{ + console.log(err); + return 0; + }); + } + + async function getImage(imgdata){ + // const serverDT = await getServerDT(); + let type=getImageProps.type || ''; + let ImageIndex=getImageProps.ImageIndex; + + console.log('getImage ImageIndex:',type,ImageIndex) + + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + let isImgFromGallery=img.fromGallery!=null?img.fromGallery:false; + let picture_clickedd=isImgFromGallery==true?img.datetime:new Date(); + let picture_clicked_time=moment(picture_clickedd).format('DD-MM-YYYY HH:mm:ss') + + + // let picture_clicked_date1=serverDT?.ServerDate?.replace(/\//g, ''); + // let picture_clicked_time1=serverDT?.ServerTime?.replace(/\:/g, ''); + let picture_clicked_date1=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time1=moment(picture_clickedd).format('HHmmss'); + + console.log(picture_clicked_date1 , picture_clicked_time1, "DATEANDTIME") + + let filename=(props.UserId || '')+'_PossaleImg-'+picture_clicked_date1+'_'+picture_clicked_time1+'.jpg'; + + let allData=posSImgArr;//posSData; + let image_key,image_key_path; + let imgObj={}; + if(ImageIndex>=0){ + imgObj=allData[ImageIndex]; + } + if(type=='1'){ + image_key='Image1Name'; + image_key_path="Image1"; + } + // else{ + // image_key='Image2Name'; + // image_key_path="Image2"; + // } + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: '+currentMenu.MenuName+' | Date:'+picture_clicked_time; + + + // renamefile + let imagePath='file://'+`${common_ImagePath}${filename}`; + + // let imagePath=`${common_ImagePath+currentMenu.ScreenName}/${filename}`; + + console.log('imagePath',imagePath,imgObj) + RNFS.copyFile(imgurl,imagePath) + .then(async(resn) => { + // render data with clicked image + let uri='file://'+imagePath; + imgObj[image_key]=filename; + imgObj[image_key_path]=uri; + + ImageIndex>=0?allData[ImageIndex]=imgObj:allData.push(imgObj); + console.log("allData:",allData); + setPosSImgArr(allData); + setSelectedImg(uri); + setrerenderdata(!rerenderdata); + + // add metdata then resize image and restored back to the imagePath + + // let restore_data={"destFilePath":imagePath,"imgurl":imgurl,imgWidth,imgHeight,mark_text1,mark_text2} + + // console.log("restore_data--->",restore_data) + + // let is_restored=await restore_ImageWithMetaData(restore_data,imgdata); + // console.log("image restored:",is_restored); + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + } + } + + + + async function removeImage(){ + let index=toRemoveIndex; + let allData=AllImagesData; + let imgData=allData[index]; + let imgPath=imgData.ImagePath || ''; + if(imgPath!=''){ + let imgPath1='file://'+imgPath; + RNFS.unlink(imgPath1); + } + allData.splice(index,1); + setAllImagesData(allData); + } + + async function onRemoveImage(imgName,index){ + setToRemoveIndex(index); + } + + + async function openCamera(type='1',index=''){ + setGetImageProps({'type':type,"ImageIndex":index}); + setShowCamera(true); + } + + + function onWindowDataClean(){ + if(DataCleanAnim!=null){ + console.log("anim---") + let anim=isPresentClean==1?1:''; + Animated.timing(DataCleanAnim, { + toValue:anim, + duration:400, + useNativeDriver:false, + }).start(); + } + let allData=WindowData; + let WindowSplits = []; + for(var s=0;si.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId + let defData={'WindowId':DataCleanItem.WindowId,isPresent:isPresentClean}; + const win_index=allData.findIndex(i=>i.WindowId==DataCleanItem.WindowId); + allData[win_index]=defData + + let objIndex = InputChange.findIndex((obj => obj.WindowId == DataCleanItem.WindowId)); + let winArr=[...InputChange] + winArr[objIndex].Flag=false + console.log("changeValue---------7",winArr) + setInputChange(winArr) + setWindowData(allData); + setHasUnsavedChanges(true); + setDataCleanModal(false) + setrerenderdata(!rerenderdata); + } + + function checkAllSKUs(val,window){ + + let WindowStocks=window.WindowStocks || []; + let allData=WindowData; + let defData={'VisibilityId':window.VisibilityId,'VisibilityDefinitionId':window.VisibilityDefinitionId}; + const win_index=allData.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + console.log('WStocksData before:',WStocksData) + for(var i=0;i a.ProductId==stockProd.VisibilityStockValue); + let sd=sdIndex>=0?WStocksData[sdIndex]:{'ProductId':stockProd.VisibilityStockValue,'Stock':''}; + let isPVisPresent=(val==1 || val=='1')?1:0; + sd['isPVisPresent']=isPVisPresent; + + sdIndex>=0?(WStocksData[sdIndex]=sd):(WStocksData.push(sd)); + } + + + wind['WStocksData']=WStocksData; + wind['isAllSKUChecked']=val==1?1:0; + console.log('wind updated'); + win_index>=0?allData[win_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onSaveCancel(){ + setShowAlert(false); + } + + + + function openImageRefView(windowIndex=0){ + setrefImageIndex(windowIndex); + setShow_zoomImage(true); + } + + function FilterStores(searchedQry){ + searchedQry=searchedQry.toLowerCase(); + console.log('searchedQry',searchedQry); + let arr=[]; + let newWindows=[]; + if(searchedQry!=null && searchedQry!=''){ + + for(let i=0;i + + {ST.DragItemsInOrder} + {ST.Pressandholdtodrag} + {setRatingValue(data)}} + keyExtractor={(item) => item.AnswerId} + renderItem={renderItem} + /> + + {onRatingCancel()}}> + {ST.Cancel} + + {onRatingSave()}}> + {ST.Save} + + + + + ) + } + + function render_Picker(label_key,value_key,onChange=()=>{},selected_data={}){ + var data=[]; + let qtn=selected_data.qtn || {}; + let window=selected_data.window || {}; + let isQtnDisabled=qtn.isDisabled!=null || qtn.isDisabled!=''?false:true; + let allAnswers=qtn.Answers || []; + + allAnswers.map((item,index)=>{ + let obj={ key: index, label: item[label_key],value:item[value_key] }; + if(selected_data.value==item[label_key]) + obj['component']= {item[label_key]}; + data.push(obj); + }); + + return ( + {onChange(option,qtn,window) }} + overlayStyle={customStyle.addVisPickerOverlay} + cancelContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + optionStyle={customStyle.addvis_opStyle} + optionTextStyle={customStyle.addvis_opTextStyle} + optionContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + selectedKey={'1'} + disabled={isQtnDisabled} + > + {(selected_data.value!=null && selected_data.value!=''?selected_data.value: '-'+ST.select+'-')} + + ) + } + + function renderDatePicker(qtn,window){ + let qtnn=qtn; + let DateRange=qtn.DateRange; + let maxDate=moment().add(10,'years').format('MM/DD/YYYY'); + let minDate=moment().subtract(10,'years').format('MM/DD/YYYY'); + if(DateRange=='RFD'){ + maxDate=moment().format('MM/DD/YYYY'); + } + else if(DateRange=='RPD'){ + minDate=moment().format('MM/DD/YYYY'); + } + + return ( + {setTextValue(selectedDate,qtnn,window)}} + maximumDate={new Date(maxDate)} + minimumDate={new Date(minDate)} + /> + ); + } + + + function _renderItem(item,index){ + + const window=item; + const windowIndex=index; + + let isNAReasonEnable=POSDef.PosNotExistReasonEnable=='true' || POSDef.PosNotExistReasonEnable==1?1:0; + let isshowPosValue=POSDef.ShowPosValue=='true' || POSDef.ShowPosValue==1?1:0; + let isshowPosVolume=POSDef.ShowPosVolume=='true' || POSDef.ShowPosVolume==1?1:0; + let wind = item; + + + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let Reason=wind.Reason!=null?wind.Reason:''; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let PosValue=wind.PosValue!=null?wind.PosValue:''; + let PosVolume=wind.PosVolume!=null?wind.PosVolume:''; + + var xpos=isPresent=='1'?-75:0; + if(wind.animatedChoice!=null ){ + xpos=wind.animatedChoice.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + + + // console.log("saleArr-->",saleArr) + + return( + <> + {posSData?.PeriodId && showchildview && + + + + {item.WindowName} + + + + + {'Promotor Sale Volume :' } {item.Sale} + + + {ST.IsPresent} + + + + {onChoiceSelect(window,index,1,'isPresent',wind.animatedChoice)}}> + {ST.Yes} + + {onChoiceSelect(window,index,0,'isPresent',wind.animatedChoice)}}> + {ST.No} + + + + + + { ((isPresent=='1'&& isshowPosValue==true)) && + + {POSDef.PosValueLabel} + {onWindowDataChange(item,index,val,'PosValue','numeric')}} + + /> + + + } + { ((isPresent=='1'&& isshowPosVolume==true) ) && + + {POSDef.PosVolumeLabel} + {inputRefs.current['input1_'+stockProd.VisibilityDefinitionId+'_'+stockProd.VisibilityStockDefinitionId]=reff;}} + placeholder="" + autoComplete='off' + placeholderTextColor={PageTheme.$placeholder_color} + keyboardType={'numeric'} + value ={(PosVolume+'')} + onChangeText={(val)=>{onWindowDataChange(item,index,val,'PosVolume','numeric')}} + /> + + } + + { + (isPresent=='0' && isNAReasonEnable==true) && + + {ST.SelectReason} + {} + + } + + + + + } + + ); + + } + + function _renderWindow(){ + + + let PosOverall=POSDef.PosOverall==true || POSDef.PosOverall=='true'?1:0; + if(PosOverall==1){ + return ( + <> + {_renderPOSSHeader()} + {_renderItem(DefPOSWind,0)} + + ) + } + else{ + return ( + `window_${index.toString()}`} + renderItem={({item,index})=>{ + return _renderItem(item,index); + + }} + /> + ) + } + } + + + + function _renderHeader(currentIndex){ + return( + + {`${(currentIndex+1)}/${zoomImageUrl.length}`} + {setShow_zoomImage(false) }}> + + + + ) + } + + function _renderPOSSHeader(){ + + // console.log(posSData?.PeriodId , showchildview, "Values--->>") + + let {TotalPosValue}=posSData;//Image1,Image1Name,Image2,Image2Name + + let HeaderImageRequired=POSDef.HeaderImageRequired==1 || POSDef.HeaderImageRequired=='1'?true:false; + let HeaderImageCount=POSDef.HeaderImageCount!=null?POSDef.HeaderImageCount:2; + // let HeaderImageMandatory=POSDef.HeaderImageMandatory!=null?POSDef.HeaderImageMandatory:2; + + let ShowHdrPosSaleI=KPIFields.findIndex(i=>i.KPIFieldName=='ShowTotalPosSaleHeade'); + let ShowHdrPosSaleObj=ShowHdrPosSaleI>=0?KPIFields[ShowHdrPosSaleI]:{}; + let ShowHdrPosSale=ShowHdrPosSaleI>=0?ShowHdrPosSaleObj['KPIFieldEnable']:false; + let ShowHdrPosSaleDN=ShowHdrPosSaleObj['KPIFieldDisplayName']!='' && ShowHdrPosSaleObj['KPIFieldDisplayName']!=null ? ShowHdrPosSaleObj['KPIFieldDisplayName'] :"Total POS Value"; + return ( + + + + {'Year'} + + {/* {console.log("posSData?.Year",posSData?.Year)} + {console.log("Years",Years)} */} + {CustomPicker(props,Years,'Year','Year','Year','Year',onselectionChange,{value:posSData?.Year})} + + + + + {'Month'} + + {CustomPicker(props,Months1,'Month','Month','Month','Month',onselectionChange,{value: posSData?.Month})} + + + + + + + {'Cycle'} + + {CustomPicker(props,Periods,'Period','PeriodId','Period','PeriodId',onselectionChange,{value: posSData?.Period})} + + + + + getposSaledefinationdata(posSData?.PeriodId)} + > + Get Sale data + + + + + { /* + + {'Month'} + + {CustomPicker(props,Months,'MonthId','MonthName','MonthId','MonthName',onselectionChange,{value:posSData.MonthName})} + + + */ + } + + {ShowHdrPosSale==true && + + + {ShowHdrPosSaleDN} + {onHdrDataChange(val,"TotalPosValue","numeric")}} + /> + + } + + + {HeaderImageRequired && HeaderImageCount>0 && + posSImgArr.map((item,index)=>{ + + let Image1=item.Image1!=null?item.Image1:''; + let img1Required=item.img1Required!=null?item.img1Required:false; + return ( + + <> + {posSData?.PeriodId && showchildview && + + { (Image1=='' || Image1==null) ? + (img1Required? + {openCamera('1',index)}}> + + : + {openCamera('1',index)}}> + + + ) : + + ((Image1!='' && Image1!=null) ? + {OpenImgModal(Image1,'1',index)}}> + + : null) + } + + } + + + + ) + }) + } + + {/* + + { (Image1=='' || Image1==null) ? + {openCamera('1')}}> + + : (Image1!='' && Image1!=null) ? + {OpenImgModal(Image1,'1')}}> + + : null + } + */} + + + {/* + + { (Image2=='' || Image2==null) ? + {openCamera('2')}}> + + : (Image2!='' && Image2!=null) ? + {OpenImgModal(Image2,'2')}}> + + : null + } + */} + + + + ); + } + + const onCancelClean = () =>{ + setDataCleanModal(false) + } + const onclear = () => { + console.log("onclear---------",DataCleanItem) + onWindowDataClean(DataCleanItem) + } + + function _OpenCaptureImage_Modal(img){ + + const isImageCap=(img!='' || img!=null)?true:false; + + let {type,ImageIndex}=reCapImgModalObj + return ( + + { + isImageCap && + + + + + + {openCamera(type,ImageIndex)}}> + + + + {!showImageSaveOp && + {cancelImage(false)}}> + + {ST.Close} + + } + + } + + ) + } + +// console.log("posSData--->",posSData) + + return ( + + + {processing && } + + {_OpenCaptureImage_Modal()} + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {ConfirmSaveAlert(props,DataCleanModal,onCancelClean,onclear,'Your data will be clean',)} + {/* {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> */} + + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + + + + { Object.keys(storeData).length>0 && + + {_renderWindow()} + + } + + {posSData?.PeriodId && showchildview && + + {onSubmitData()}}/> + + } + + + + + + { showRating==true && + renderRatingView() + } + {show_zoomImage && + + null} + /> + + } + + ); +} + + +export default connect(mapStateToProps, mapDispatchToProps)(POSSale); \ No newline at end of file diff --git a/src/screens/PaidVisibility.js b/src/screens/PaidVisibility.js new file mode 100644 index 0000000..4cfdbf1 --- /dev/null +++ b/src/screens/PaidVisibility.js @@ -0,0 +1,1035 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert,BackHandler, Animated} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, FontAwesome, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility } from '../constants/ConstantQueries'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import { CustomPicker, CustomPicker2 } from '../components/CustomPicker'; +import { ExitScreenAlert } from '../components/alert'; +import CustomCamera from '../components/Camera'; + +function PaidVisibility(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [brandData, setBrandData] = useState([]); + const [globalBrandData, setGlobalBrandData] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + + const [catImages, setCatImages] = useState([]); + const [SKUStockData, setSKUStockData] = useState([]); + const [showAlert, setShowAlert] = useState(false); + const [reasons_list, setReasons_list] = useState([]); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [KPIFields, setKPIFields] = useState([]); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const [searchedItem, setSearchedItem]= useState(''); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + const zoomView=useRef(null); + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + + function onRemoveScreen(e){ + Alert.alert( + "", + ST.Doyoureallywanttoexitthescreen, + [ + { + text: ST.Cancel, + onPress: () => {}, + style: "cancel" + }, + { text: ST.OK, onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + + async function getData(storeData1,menu1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + let allCats=[]; + let getKPIFieldsDone=await getKPIFields(menu1); + await db.transaction(async function (txn) { + let q2=Q_getpaidvisibility(storeData1); + let q=`Select * From Master_NonVisibility`; + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i0){ + let arr=[]; + for(var i=0;i{ + db.transaction(async function (txn) { + let q=`select * from Mapping_MenuConfiguration where ScreenName='${menu1.ScreenName}'`; + await txn.executeSql(q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + } + + async function getSKU(brands=[],storeData1={}){ + + try { + let {StoreId,ChainId,StateId,StoreTypeId,ExpiryStock}=storeData1; + + await db.transaction(async function (txn) { + let allSKUData=[]; + let completed_tasks=0; + await Promise.all( + brands.map(async (item,index) => { + let seletlist=`p.DISPLAY_ID as DisplayId,p.DISPLAY as DisplayName,p.VISIBILITY_PRESENT,p.IMAGE1,p.IMAGE2,p.REASON_ID,p.REASON,md.RefImage`; + let sku_q=`SELECT ${seletlist} FROM ${AppTables.PAID_VISIBILITY_CHILD_DATA} p INNER join Master_Display md on md.DisplayId=p.DISPLAY_ID WHERE p.STORE_ID='${StoreId}' and p.VISIT_DATE='${d2}' and p.SUB_CATEGORY_ID='${item.SubCategoryId}' `; + + let join=` INNER JOIN Mapping_Visibility v on p.SubCategoryId=v.SubCategoryId `; + let join2=` INNER join Master_Display md on md.DisplayId=v.DisplayId `; + let sku_q2=`SELECT DISTINCT md.DisplayId,md.DisplayName,md.RefImage from Product_Master p ${join} ${join2} where v.StoreId='${StoreId}' and p.SubCategoryId='${item.SubCategoryId}'`; + + let cindex=index; + return await txn.executeSql(sku_q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + + for(var i=0;i0){ + for(var k=0;k0){ + let arr=[]; + + for(var i=0;i0){ + for(var k=0;k{ + + }); + }); + } catch (err) { + console.log(err); + } + } + + async function getDisplayCheckList(DisplayId,SubCategoryId,storeData1={}){ + var result=await new Promise((resolve, reject) => { + db.transaction(async function (txn) { + + let {StoreId}=storeData1; + let join=`Inner join Mapping_DisplayChecklist v on p.ChecklistId=v.ChecklistId`; + let join2=`Left join (Select * From ${AppTables.PAID_VIS_CHECKLIST} Where STORE_ID='${StoreId}' and VISIT_DATE='${d2}' and SUB_CATEGORY_ID='${SubCategoryId}' and DISPLAY_ID='${DisplayId}') as T on p.ChecklistId=T.CHECKLIST_iD `; + let q=`Select Distinct p.ChecklistId as ChecklistId,p.ChecklistName as ChecklistName ,ifnull(T.REASON,'')as REASON,ifnull(T.REASON_ID,0)as REASON_ID from Master_Checklist p ${join} ${join2} Where v.DisplayId ='${DisplayId}'`; + + await txn.executeSql(q,[],async function (txn2, txnres) { + + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return {'Results':val}; + }).catch((err)=>{ + return {'Error':err}; + }); + return result; + } + + + async function getImage(imgdata){ + let cat=getImageProps.cat || ''; + let skuItem=getImageProps.skuItem || ''; + let type=getImageProps.type || ''; + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl='file://'+img.uri, imgWidth=img.width, imgHeight=img.height; + let picture_clicked_time2=new Date(); + picture_clicked_time2=moment(picture_clicked_time2).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time2; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: Paid Visibility'+' | Date:'+picture_clicked_time2; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+(props.UserId || '')+'_PaidVisibilityImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let allData=SKUStockData; + let defData={'SubCategoryId':cat.SubCategoryId,'DisplayId':skuItem.DisplayId}; + const cindex=allData.findIndex(ci=>ci.SubCategoryId==cat.SubCategoryId && ci.DisplayId==skuItem.DisplayId); + const imgData=cindex>=0?(allData[cindex] || defData):defData; + let image_key=type=='2'?'Image2':'Image1'; + let image_path_key=type=='2'?'Image2Path':'Image1Path'; + imgData[image_key]=filename; + + // renamefile + let imagePath='file://'+common_ImagePath+filename; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri=imagePath; + console.log('image marker',uri); + imgData[image_path_key]=uri; + cindex>=0?allData[cindex]=imgData:allData.push(imgData); + + setSKUStockData(allData); + setHasUnsavedChanges(true); + setrerenderdata2(!rerenderdata2); + }) + .catch(err => { + console.log(ST.Errorimagefilewritefailed+'!!!'); + console.log(err.message, err.code); + }); + + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(cat,skuItem,type='1'){ + setGetImageProps({'cat':cat,'skuItem':skuItem,'type':type}); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function submitOpeningStock(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData+'...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + let q=`DELETE FROM ${AppTables.PAID_VISIBILITY_HEADER_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + let q2=`DELETE FROM ${AppTables.PAID_VISIBILITY_CHILD_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + let q3=`DELETE FROM ${AppTables.PAID_VIS_CHECKLIST} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // remove old data + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('paid vis hdr data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('paid vis child data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q3,[],async function (txn2, txnres) { + console.log('paid vis checklist data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + let seq_q=` select seq from sqlite_sequence where name="${AppTables.PAID_VISIBILITY_HEADER_DATA}" `; + await txn.executeSql(seq_q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let data=txnres.rows.item(0); + let seq=data.seq; + insertData(seq); + } + else{ + insertData(0); + } + },function (txn2, txnerr) { console.log(txnerr); insertData(0); },); + + + }); + } catch (err) { + console.log(err); + } + } + + async function insertData(seq=0){ + try { + console.log(seq); + let {StoreId,ChainId,StateId,StoreTypeId,ExpiryStock}=storeData; + + await db.transaction(async function (txn) { + var values='',child_values='',checklist_values=''; + let isChecklistExists=false; + for(var i=0;ici.SubCategoryId==item.SubCategoryId && ci.DisplayId==skuItem.DisplayId); + const skud=skud_index>=0?(allSKUData[skud_index] || {}) : {}; + let checklist=skud['Checklist'] || []; + + child_values+=` ('${seq}','${StoreId}','${d2}','${item.SubCategoryName}','${item.SubCategoryId}','${skud.isPresent}','${skuItem.DisplayId}','${skuItem.DisplayName}','${(skud.Image1 || '')}','${(skud.Image2 || '')}','${skud.Reason}','${skud.ReasonId}','${d2}') `; + + if(displayCheckList.length>0 && skud.isPresent==1){ + for(var k=0;kci.ChecklistId==dcItem.ChecklistId) || {}; + + checklist_values+=checklist_values!=''?' , ':''; + + checklist_values+=` ('${seq}','${StoreId}','${d2}','${item.SubCategoryId}','${skuItem.DisplayId}','${dcItem.ChecklistName}','${dcItem.ChecklistId}','${checkeItem.Answer}','${checkeItem.AnswerId}','${d2}') `; + + isChecklistExists=true; + } + } + } + } + + let add_HdrData=`INSERT INTO ${AppTables.PAID_VISIBILITY_HEADER_DATA} (STORE_ID,VISIT_DATE,SUB_CATEGORY,SUB_CATEGORY_ID,ADDED_DATE) VALUES ${values} `; + let add_ChildData=`INSERT INTO ${AppTables.PAID_VISIBILITY_CHILD_DATA} (COMMON_ID,STORE_ID,VISIT_DATE,SUB_CATEGORY,SUB_CATEGORY_ID,VISIBILITY_PRESENT,DISPLAY_ID,DISPLAY,IMAGE1,IMAGE2,REASON,REASON_ID,ADDED_DATE) VALUES ${child_values} `; + let add_Checklist=`INSERT INTO ${AppTables.PAID_VIS_CHECKLIST} (COMMON_ID,STORE_ID,VISIT_DATE,SUB_CATEGORY_ID,DISPLAY_ID,CHECKLIST,CHECKLIST_ID,REASON,REASON_ID,ADDED_DATE) VALUES ${checklist_values} `; + + + + await txn.executeSql(add_HdrData,[],async function (txn2, txnres) { + console.log('pv header added'); + await txn.executeSql(add_ChildData,[],async function (txn2, txnres) { + console.log('pv child added'); + if(isChecklistExists){ + await txn.executeSql(add_Checklist,[],async function (txn2, txnres) { + console.log('pv checklist added'); + notify(ST.PaidVisibilityupdatedsuccessfully); + setProcessing(false); + props.navigation.goBack(); + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify(ST.Cannotaddpaidvisibility) },); + } + else{ + notify(ST.PaidVisibilityupdatedsuccessfully); + setProcessing(false); + props.navigation.goBack(); + } + + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify(ST.Cannotaddpaidvisibility) },); + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify(ST.Cannotaddpaidvisibility) },); + }); + } catch (err) { + console.log(err); + } + } + + + async function validate(){ + + let isValid=true; + var i=0,j=0; + + await Promise.all( + brandData.map(async (item,index) => { + if(isValid){ + + let skulist=item.skulist || []; + if(skulist.length>0){ + await Promise.all( + skulist.map(async (skuItem,skuIndex) => { + if(isValid){ + + let skuData=SKUStockData.find(ci=>ci.SubCategoryId==item.SubCategoryId && ci.DisplayId==skuItem.DisplayId) || {}; + let displayCheckList=skuItem['displayCheckList'] || []; + + let isCamera1EnableIndex=KPIFields.findIndex(i=>i.KPIFieldName=='Camera1Enable') + let isCamera1EnableKPIObj=isCamera1EnableIndex>=0?KPIFields[isCamera1EnableIndex]:{}; + let isCamera1Enable=isCamera1EnableIndex>=0?isCamera1EnableKPIObj['KPIFieldEnable']:true; + + let isCamera2EnableIndex=KPIFields.findIndex(i=>i.KPIFieldName=='Camera2Enable') + let isCamera2EnableKPIObj=isCamera2EnableIndex>=0?KPIFields[isCamera2EnableIndex]:{}; + let isCamera2Enable=isCamera2EnableIndex>=0?isCamera2EnableKPIObj['KPIFieldEnable']:true; + + let isCamera1MandIndex=KPIFields.findIndex(i=>i.KPIFieldName=='Camera1Mandatory') + let isCamera1MandKPIObj=isCamera1MandIndex>=0?KPIFields[isCamera1MandIndex]:{}; + let isCamera1Mand=isCamera1MandIndex>=0?isCamera1MandKPIObj['KPIFieldEnable']:true; + + let isCamera2MandIndex=KPIFields.findIndex(i=>i.KPIFieldName=='Camera2Mandatory') + let isCamera2MandKPIObj=isCamera2MandIndex>=0?KPIFields[isCamera2MandIndex]:{}; + let isCamera2Mand=isCamera2MandIndex>=0?isCamera2MandKPIObj['KPIFieldEnable']:true; + + console.log('isCamera1Mand:',isCamera1Mand,',isCamera2Mand:',isCamera2Mand) + + + if(skuData.isPresent!=0 && (skuData.isPresent==null || skuData.isPresent=='')){ + notify(ST.Pleaseselectifvisiblitypresentornotfor+' '+item.SubCategoryName+' '+skuItem.DisplayName,'SHORT'); + isValid=false; + } + else if(skuData.isPresent==0 && (skuData.ReasonId==null || skuData.ReasonId=='')){ + notify(ST.Pleaseselectreasonfor+' '+item.SubCategoryName+' '+skuItem.DisplayName,'SHORT'); + isValid=false; + }else if(skuData.isPresent==1 && (((isCamera1Enable==1 || isCamera1Enable=='true') && (isCamera1Mand==1 || isCamera1Mand=='true') && (skuData.Image1==null || skuData.Image1=='') )|| ((isCamera2Enable==1 || isCamera2Enable=='true') && (isCamera2Mand==1 || isCamera2Mand=='true') && (skuData.Image2==null || skuData.Image2=='')))){ + notify(ST.Pleaseclickallimagesfor+' '+item.SubCategoryName+' '+skuItem.DisplayName,'SHORT'); + isValid=false; + }else if(skuData.isPresent==1){ + if(displayCheckList.length>0){ + await Promise.all( + displayCheckList.map(async (dclistItem,dcIndex) => { + if(isValid){ + const skud_ckecklist=skuData['Checklist'] || []; + let checkedItem=skud_ckecklist.find(c=>c.ChecklistId==dclistItem.ChecklistId) || {}; + + if(checkedItem['AnswerId']!=0 && (checkedItem['AnswerId']==null || checkedItem['AnswerId']=='')){ + isValid=false; + notify(ST.Pleaseselectreasonfor+' '+item.SubCategoryName+' '+skuItem.DisplayName+' '+dclistItem.ChecklistName,'SHORT'); + } + } + }) + ); + } + } + } + }) + ); + } + + + } + }) + ); + + console.log('isValid:',isValid); + return isValid; + } + + function onStockValChange(item,skuItem,val,key){ + let allSKUData=SKUStockData; + let defData={'SubCategoryId':item.SubCategoryId,'DisplayId':skuItem.DisplayId}; + const skud_index=allSKUData.findIndex(i=>i.SubCategoryId==item.SubCategoryId && i.DisplayId==skuItem.DisplayId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + skud[key]=val; + if(key=='ReasonId'){ + let rsn=reasons_list.find(r=>r.ReasonId==val) || {}; + skud['Reason']=rsn.Reason || ''; + } + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + + function onChoiceSelect(item,skuItem,val,key,animatedChoice){ + console.log('onChoiceSelect',animatedChoice) + + var val1=0; + if(val==1){ + val1=1; + } + + if(animatedChoice!=null){ + Animated.timing(animatedChoice, { + toValue: val1, + duration:400, + useNativeDriver:false, + }).start(); + } + onStockValChange(item,skuItem,val,key) + } + + function onselectionChange(option,keyLbl,keyVal,otherData){ + let skuItem=otherData.skus,item=otherData.cat; + let allSKUData=SKUStockData; + let defData={'SubCategoryId':item.SubCategoryId,'DisplayId':skuItem.DisplayId}; + const skud_index=allSKUData.findIndex(i=>i.SubCategoryId==item.SubCategoryId && i.DisplayId==skuItem.DisplayId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + skud[keyVal]=option.value; + skud[keyLbl]=option.label; + + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + console.log('allSKUData:',allSKUData); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onStockCheckListChange(option,keyLbl,keyVal,otherData){ + let skuItem=otherData.skus,item=otherData.cat,dclistItem=otherData.dclist; + let allSKUData=SKUStockData; + let defData={'SubCategoryId':item.SubCategoryId,'DisplayId':skuItem.DisplayId,'Checklist':[]}; + const skud_index=allSKUData.findIndex(i=>i.SubCategoryId==item.SubCategoryId && i.DisplayId==skuItem.DisplayId); + let skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + let skud_ckecklist=skud['Checklist'] || []; + let defCheckedItem={"ChecklistId": dclistItem.ChecklistId, "ChecklistName": dclistItem.ChecklistName}; + let checkedItem_index=skud_ckecklist.findIndex(c=>c.ChecklistId==dclistItem.ChecklistId); + let checkedItem=checkedItem_index>=0?(skud_ckecklist[checkedItem_index] || defCheckedItem):defCheckedItem; + + checkedItem['AnswerId']=option.value; + checkedItem['Answer']=option.label; + + + checkedItem_index>=0?skud_ckecklist[checkedItem_index]=checkedItem:skud_ckecklist.push(checkedItem); + skud['Checklist']=skud_ckecklist; + + skud_index>=0?allSKUData[skud]=checkedItem:allSKUData.push(skud); + console.log('allSKUData:',allSKUData); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function openImageRefView(RefImage=''){ + setShow_zoomImage(true); + } + + function FilterStores(searchedQry){ + searchedQry=searchedQry.toLowerCase(); + console.log('searchedQry',searchedQry); + let arr=[]; + var arr2=[]; + if(searchedQry!=null && searchedQry!=''){ + // globalBrandData.map((item,index)=>{ + for(let i=0;i{ + for(let j=0;j0){ + arr.push(arr2); + } + } + } + + + } + } + else{ + arr=globalBrandData; + } + + setBrandData(arr); + setrerenderdata(!rerenderdata) + setrerenderdata2(!rerenderdata2) + } + + function _render_Alert(){ + return ( + + + {setShowAlert(false)}}> + {ST.Cancel} + + {saveData()}}> + {ST.Yes} + + + + ) + } + + function _renderHeader(currentIndex){ + return( + + {/* {`${(currentIndex+1)}/${zoomImageUrl.length}`} */} + {console.log('tsth');setShow_zoomImage(false) }}> + + + + ) + } + + return ( + + {processing && } + + {_render_Alert()} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + + {setSearchedItem(val); FilterStores(val)}} + autoComplete='off' + /> + {FilterStores(searchedItem)}}> + + + + { Object.keys(storeData).length>0 && + { + const cat=item; + const cindex=catImages.findIndex(i=>i.SubCategoryId==item.SubCategoryId); + const cimgName=cindex>=0?(catImages[cindex]?catImages[cindex].ImageName:''):''; + const cimgPath=cindex>=0?(catImages[cindex]?catImages[cindex].ImagePath:''):''; + const showIMg=cimgPath!='' && cimgPath!=null; + return( + + + + {item.SubCategoryName} + + + + + + { + + { + const skus=item; + const sku_index=index; + let thisCatSkuData_i=SKUStockData.findIndex(i=>i.SubCategoryId==cat.SubCategoryId && i.DisplayId==skus.DisplayId); + let thisCatSkuData=thisCatSkuData_i>=0?(SKUStockData[thisCatSkuData_i] || {}):{}; + let ReasonId=thisCatSkuData.ReasonId!=null?thisCatSkuData.ReasonId:''; + let Reason=thisCatSkuData.Reason!=null?thisCatSkuData.Reason:''; + let isPresent=thisCatSkuData.isPresent!=null?thisCatSkuData.isPresent:'0'; + let Image1=(thisCatSkuData.Image1!=null && thisCatSkuData.Image1!='')?'file://'+common_ImagePath+thisCatSkuData.Image1:''; + let Image2=(thisCatSkuData.Image2!=null && thisCatSkuData.Image2!='')?'file://'+common_ImagePath+thisCatSkuData.Image2:''; + let RefImage=skus.RefImage; + let displayCheckList=item.displayCheckList || []; + + let isCamera1EnableIndex=KPIFields.findIndex(i=>i.KPIFieldName=='Camera1Enable') + let isCamera1EnableKPIObj=isCamera1EnableIndex>=0?KPIFields[isCamera1EnableIndex]:{}; + let isCamera1Enable=isCamera1EnableIndex>=0?isCamera1EnableKPIObj['KPIFieldEnable']:true; + + let isCamera2EnableIndex=KPIFields.findIndex(i=>i.KPIFieldName=='Camera2Enable') + let isCamera2EnableKPIObj=isCamera2EnableIndex>=0?KPIFields[isCamera2EnableIndex]:{}; + let isCamera2Enable=isCamera2EnableIndex>=0?isCamera2EnableKPIObj['KPIFieldEnable']:true; + + + var xpos=isPresent==1?-75:0; + if(skus.animatedChoice!=null ){ + xpos=skus.animatedChoice.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + + + return( + + {skus.DisplayName} + + + + + + {ST.IsPresent} + + + + + {onChoiceSelect(cat,skus,1,'isPresent',skus.animatedChoice)}}> + {ST.Yes} + + {onChoiceSelect(cat,skus,0,'isPresent',skus.animatedChoice)}}> + {ST.No} + + + + + {isPresent!='1' && + {ST.SelectReason} + + {} + } + {(isPresent=='1' && displayCheckList.length>0) && + displayCheckList.map((dclist_Item,dclist_index)=>{ + const dclist=dclist_Item; + + const skud=SKUStockData.find(ci=>ci.SubCategoryId==cat.SubCategoryId && ci.DisplayId==skus.DisplayId) || {}; + const skud_ckecklist=skud['Checklist'] || []; + let checkedItem=skud_ckecklist.find(c=>c.ChecklistId==dclist.ChecklistId) || {}; + + let dclist_answerid=checkedItem['AnswerId'] || '0'; + let dclist_answer=checkedItem['Answer'] || ''; + const dclist_options=[{'dcItem':'No','dcItemId':'0'},{'dcItem':'Yes','dcItemId':'1'}]; + return( + + {dclist.ChecklistName} + {} + + ); + }) + + } + {(isPresent=='1' && ( (isCamera1Enable=='true' || isCamera1Enable==1) || (isCamera2Enable=='true' || isCamera2Enable==1) )) && + + {ST.CaptureImage} + + { (isCamera1Enable=='true' || isCamera1Enable==1) && + + { (Image1=='' || Image1==null) && + {openCamera(cat,skus,'1')}}> + + + } + { (Image1!='' && Image1!=null) && + + + {openCamera(cat,skus,'1')}}> + + + + } + + } + { (isCamera2Enable=='true' || isCamera2Enable==1) && + + { (Image2=='' || Image2==null) && + {openCamera(cat,skus,'2')}}> + + + } + { (Image2!='' && Image2!=null) && + + + {openCamera(cat,skus,'2')}}> + + + + } + + } + + + + } + + + + + {openImageRefView(RefImage)}}> + + + + ) + }}/> + } + + + ); + }} + /> + } + + {submitOpeningStock()}}/> + + + + + {show_zoomImage && + + null} + /> + + } + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(PaidVisibility); \ No newline at end of file diff --git a/src/screens/PaidVisibility2.js b/src/screens/PaidVisibility2.js new file mode 100644 index 0000000..4fdc70f --- /dev/null +++ b/src/screens/PaidVisibility2.js @@ -0,0 +1,1814 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, Animated} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, FontAwesome, Fontisto, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector' +import { CustomPicker, CustomPicker2 } from '../components/CustomPicker'; +import CustomCamera from '../components/Camera'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import DateTimePicker from '@react-native-community/datetimepicker'; + + +import cameraImg from '../assets/performics/camera_front_image.svg' +import MultiSelect from 'react-native-multiple-select'; + +function PaidVisibility(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const animatedChoice=useRef(new Animated.Value(0)).current; + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + const [rerenderdata3, setrerenderdata3]= useState(0); + const [rerenderdata4, setrerenderdata4]= useState(0); + + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + + const [WindowData, setWindowData] = useState([]); + const [reasons_list, setReasons_list] = useState([]); + const [Windows, setWindows] = useState([]); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [showAlert, setShowAlert] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const zoomView=useRef(null); + const [showRating, setShowRating] = useState(false); + const [RatingQtn, setRatingQtn] = useState({}); + const [RatingWindow, setRatingWindow] = useState({}); + const [RatingOrder, setRatingOrder] = useState([]); + + const [Products, setProducts] = useState([]); + const [DisplayList, setDisplayList] = useState([]); + const [toRemoveId,setToRemoveId]= useState(''); + const [toRemoveItem,setToRemoveItem]= useState({}); + const [showRemoveConfirm_M,setshowRemoveConfirm_M]= useState(false); + const [showRAllC_M,setShowRAllC_M]= useState(false); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + function onRemoveScreen(e){ + Alert.alert( + "", + "Do you really want to exit the screen?", + [ + { + text: "Cancel", + onPress: () => {}, + style: "cancel" + }, + { text: "OK", onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + + async function getData(storeData1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + await db.transaction(async function (txn) { + + + let q3=`Select * From Master_NonVisibility`; + await txn.executeSql(q3,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i0){ + let arr=[];let images=[],allWindowsData=[]; + for(var i=0;i0){ + let arr=[],images=[],allWindowsData=[]; + for(var i=0;i{ + + db.transaction(async function (txn) { + + let q=`select * from ${AppTables.WINDOW_IMAGES} where WINDOW_HEADER_ID='${window.windowHeaderId}' and STORE_ID='${storeData1.StoreId}' `; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return WindowSplits_def; + }); + } + + async function getWindowQuestions(window,storeData1,isInserted=false){ + let obj={'WindowQA':{},'WindowQuestions':[]} + return new Promise((resolve,reject)=>{ + + db.transaction(async function (txn) { + var q='',selectlist='',join='',join2=''; + if(isInserted==true){ + selectlist=` DISTINCT q.QUESTION_ID as WindowQuestionId,q.QUESTION_CODE as WindowQuestionCode,wq.WindowQuestionName,wq.QuestionType,wq.WQShowCamera,wq.WQCameraMandatory,wq.WQLengthValidationRequired,wq.WQMinimumChar,wq.WQMaximumChar,wq.WQDecimalPoint,wq.WQDateRangeMin,wq.WQDateRangeMax,wq.WQVoiceLengthInMinutes,wq.WQDefaultQuestionEnable,q.ANSWER as Answer,q.ANSWER_ID as AnswerId,q.MULTI_OPTIONS_IDS as multi_op_ids,q.IMAGE_ALLOW1 as WAShowCamera,q.IMAGE1 as Image1 `; + join2=` inner join Mapping_WindowQuestion mq on mq.WindowQuestionId=wq.WindowQuestionId `; + join=` inner join Master_WindowQuestion wq on wq.WindowQuestionId=q.QUESTION_ID `; + q=`select ${selectlist} from ${AppTables.WINDOW_CHILD_DATA} q ${join} ${join2} where q.STORE_ID='${storeData1.StoreId}' and q.WINDOW_DEFINITION_ID='${window.WindowDefinitionId}' and q.WINDOW_ID='${window.WindowId}' order by wq.WindowQuestionSequence `; + } + else{ + selectlist=` DISTINCT wq.WindowQuestionId,wq.WindowQuestionCode,wq.WindowQuestionName,wq.QuestionType,wq.WQShowCamera,wq.WQCameraMandatory,wq.WQLengthValidationRequired,wq.WQMinimumChar,wq.WQMaximumChar,wq.WQDecimalPoint,wq.WQDateRangeMin,wq.WQDateRangeMax,wq.WQVoiceLengthInMinutes,wq.WQDefaultQuestionEnable `; + join=` inner join Mapping_WindowQuestion mq on mq.WindowQuestionId=wq.WindowQuestionId `; + q=`select ${selectlist} from Master_WindowQuestion wq ${join} where mq.WindowDefinitionId='${window.WindowDefinitionId}' order by wq.WindowQuestionSequence `; + } + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + let wqa_obj={}; + for(var i=0;i0){ + for(var k=0;k=0)){ + showImageTag=true; + } + } + } + } + + if(showImageTag && data.Answer!=null){ + let imgPath=(Platform.OS=='ios'?'file://':'')+common_ImagePath+data.Image1; + wqa_obj[imgname_key]=data.Image1; + wqa_obj[img_key]=imgPath; + } + + + + if(data.QuestionType=='Date' && data.Answer!=null){ + let dayonly=moment().format('DD'); + let actual_date=data.Answer?data.Answer.split('/'):[]; + let month=actual_date[0],year=actual_date[1]; + let fulldate=month+'/'+dayonly+'/'+year; + wqa_obj[date_key]=fulldate; + + } + + arr.push(data); + if(i==txnres2.rows.length-1){ + obj['WindowQuestions']=arr; + obj['WindowQA']=wqa_obj; + resolve(obj) + } + } + } + else{ + resolve(obj) + } + },function (txn2, txnerr) { console.log(txnerr); resolve(obj) },); + }); + }).then((val)=>{ + return val + }).catch((err)=>{ + console.log(err); + return obj; + }); + } + + + async function getWindowAnswers(qtn){ + + return new Promise((resolve,reject)=>{ + + db.transaction(async function (txn) { + var q='',selectlist=''; + selectlist=` DISTINCT WindowAnswerId as AnswerId,WindowAnswerName as Answer,WAShowCamera,WACameraMandatory,WAQuestionEnable,WAQuestionDisable `; + q=`select ${selectlist} from Master_WindowQuestion where WindowQuestionId='${qtn.WindowQuestionId}' order by WASequence `; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return []; + }); + } + + async function getWindowStockData(window,storeData1,isInserted=false){ + let obj={'WStocks':[],'WStocksData':[]} + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + var q='',selectlist='',join=''; + let checkassrt=window.WindowElementCheckAssortment=='true' || window.WindowElementCheckAssortment==1?true:false; + + if(isInserted==true){ + if(checkassrt){ + join=` inner join Mapping_ProductAssortment a on a.ProductId=s.WINDOW_STOCK_VALUE `; + } + selectlist=` s.WINDOW_STOCK_DEFINITION_ID as WindowStockDefinitionId, s.WINDOW_DEFINITION_ID as WindowDefinitionId,s.WINDOW_STOCK_TABLE as WindowStockTable,s.WINDOW_STOCK_FIELD as WindowStockField,s.WINDOW_STOCK_VALUE as WindowStockValue,s.WINDOW_STOCK_MBQ as WindowStockMBQ,s.PRODUCT_NAME as ProductName, s.STOCK as Stock `; + q=`select ${selectlist} from ${AppTables.WINDOW_STOCK_DATA} s ${join} where s.WINDOW_DEFINITION_ID='${window.WindowDefinitionId}' and s.STORE_ID='${storeData1.StoreId}' `; + }else{ + if(checkassrt){ + join=` inner join Mapping_ProductAssortment a on a.ProductId=s.WindowStockValue `; + } + selectlist=` s.WindowStockDefinitionId, s.WindowDefinitionId,s.WindowStockTable,s.WindowStockField,s.WindowStockValue,s.WindowStockMBQ,s.ProductName `; + q=`select ${selectlist} from Master_WindowStockDefinition s ${join} where s.WindowDefinitionId='${window.WindowDefinitionId}' `; + } + if(checkassrt){ + q+=` and a.StateId='${storeData1.StateId}' `; + } + q+=isInserted?` order by s.PRODUCT_NAME `:` order by s.ProductName `; + + + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[],WStocksData=[]; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return obj; + }); + } + + + + + + async function getImage(imgdata){ + let type=getImageProps.type || ''; + let window=getImageProps.window || {}; + let splitItem=getImageProps.splitItem || {}; + let splitItemIndex=getImageProps.splitItemIndex || 0; + let qtn=getImageProps.qtn || {}; + let cameraType=getImageProps.cameraType!=null?getImageProps.cameraType:'1'; + + if(typeof imgdata=='object' && imgdata.errorCode=='camera_unavailable'){ + notify('Camera unavailable'); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: Window'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+window.WindowDefinitionId+'_'+window.WindowId+'_'+(props.UserId || '')+'_WindowImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let allData=WindowData; + let defData={'WindowId':window.WindowId,'WindowDefinitionId':window.WindowDefinitionId}; + const wind_index=allData.findIndex(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId) ; + let wind=wind_index>=0?allData[wind_index]:defData; + + if(cameraType=='2'){ + var QD=wind.WindowQA || {}; + var image_key=qtn.WindowQuestionId+'_ImageName1'; + var image_key_path=qtn.WindowQuestionId+'_ImagePath1'; + QD[image_key]=filename; + } + else if(cameraType=='3'){ + var image_key='NAImage1'; + var image_key_path='NAImage1Path'; + wind[image_key]=filename; + } + else{ + var WindowSplits=wind.WindowSplits || []; + var image_key=type=='1'?'Image1Name':'Image2Name'; + var image_key_path=type=='1'?'Image1':'Image2'; + splitItem[image_key]=filename; + } + + + + // renamefile + let imagePath=`${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker:',uri); + + if(cameraType=='2'){ + QD[image_key_path]=uri; + wind.WindowQA=QD; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata3(!rerenderdata3); + } + else if(cameraType=='3'){ + wind[image_key_path]=uri; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + else{ + console.log('split image updated'); + splitItem[image_key_path]=uri; + splitItemIndex>=0?WindowSplits[splitItemIndex]=splitItem:WindowSplits.push(splitItem); + wind.WindowSplits=WindowSplits; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata2(!rerenderdata2); + } + + + + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(window,splitItem,splitItemIndex,type='1',cameraType='1',qtn={}){ + setGetImageProps({'window':window,'splitItem':splitItem,'splitItemIndex':splitItemIndex,'type':type,'cameraType':cameraType,'qtn':qtn}); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + + async function onSubmitData(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + let d1n=new Date(); + let d3=moment(d1n).format('MM/DD/YYYY'); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + // remove old data + await txn.executeSql(`DELETE FROM ${AppTables.WINDOW_HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window hdr data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.WINDOW_CHILD_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window child data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.WINDOW_IMAGES} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window images data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.WINDOW_STOCK_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window stock data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + // add data + var values='',childV='',imageV='',stockV=''; + + for (const wi in Windows){ + const window=Windows[wi]; + let isImage1=window.WindowImage1=='true' || window.WindowImage1==1?1:0; + let isImage2=window.WindowImage2=='true' || window.WindowImage2==1?1:0; + let isNAImageAvl=window.WindowNotExistCamera=='true' || window.WindowNotExistCamera==1?1:0; + let isNAReasonEnable=window.WindowNotExistReasonEnable=='true' || window.WindowNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.WindowExistReasonEnable=='true' || window.WindowExistReasonEnable==1? 1:0; + let isStockReq=window.WindowElementStockRequired=='true' || window.WindowElementStockRequired==1?1:0; + let WindowQuestions=window.WindowQuestions || []; + let WindowStocks=window.WindowStocks || []; + + + const wind=WindowData.find(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:0; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let WindowSplits=wind.WindowSplits || []; + let QD=wind.WindowQA || {}; + let WStocksData=wind.WStocksData || []; + + let WINDOW_HEADER_ID='WIND'+wi+(Math.floor(Math.random()*1000)+1); + let {WindowDefinitionId,WindowId,WindowName,WindowTable,WindowField,WindowValue,ChildName}=window; + + + values+=values!=''?' , ':''; + values+=` ('${WINDOW_HEADER_ID}','${StoreId}','${d3}','${WindowDefinitionId}','${WindowId}','${WindowName}','${WindowTable}','${WindowField}','${WindowValue}','${ChildName}','${isPresent}','${NAImage1}','${ReasonId}','${Reason}','${d3}') `; + + if(isPresent==1){ + for(const qtnIndex in WindowQuestions){ + const qtn=WindowQuestions[qtnIndex]; + + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + let multi_key=qtn.WindowQuestionId+'_MultiOption'; + let date_key=qtn.WindowQuestionId+'_Date'; + let img_key=qtn.WindowQuestionId+'_ImagePath1'; + let imgname_key=qtn.WindowQuestionId+'_ImageName1'; + let rating_key=qtn.WindowQuestionId+'_Rating'; + let list_mcdata=[]; + + let {WindowQuestionId,WindowQuestionCode,QuestionType,WAShowCamera}=qtn + let answer=QD[ans_key] || 0; + let answerId=QD[id_key] || ''; + let multi_options_ids=QD[multi_key] || ''; + let isImage1All=WAShowCamera=='true' || WAShowCamera==1?1:0; + let Image1=isImage1All==1?QD[imgname_key]:''; + + + childV+=childV!=''?' , ':''; + childV+=` ('${WINDOW_HEADER_ID}','${StoreId}','${d3}','${WindowDefinitionId}','${WindowId}','${WindowQuestionId}','${WindowQuestionCode}','${QuestionType}','${answer}','${answerId}','${multi_options_ids}','${Image1}','${isImage1All}','${d3}') `; + } + for(const splitItemIndex in WindowSplits){ + const splitItem=WindowSplits[splitItemIndex]; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image2Name=splitItem['Image2Name']!=null && splitItem['Image2Name']!=''?splitItem['Image2Name']:''; + Image1Name=isImage1==1?Image1Name:''; + Image2Name=isImage2==1?Image2Name:''; + + imageV+=imageV!=''?' , ':''; + imageV+=` ('${WINDOW_HEADER_ID}','${StoreId}','${d3}','${WindowDefinitionId}','${WindowId}','${Image1Name}','${Image2Name}','${d3}') `; + } + for(const stockProdIndex in WindowStocks){ + const stockProd=WindowStocks[stockProdIndex]; + let sd=WStocksData.find(i=> i.ProductId==stockProd.WindowStockValue) || {}; + let stock=sd.Stock!=null?sd.Stock:(sd.Stock==0?sd.Stock:''); + let {WindowStockDefinitionId, WindowDefinitionId,WindowStockTable,WindowStockField,WindowStockValue,WindowStockMBQ,ProductName} =stockProd + stockV+=stockV!=''?' , ':''; + stockV+=` ('${WINDOW_HEADER_ID}','${StoreId}','${d3}','${WindowDefinitionId}','${WindowId}','${WindowStockDefinitionId}','${WindowStockTable}','${WindowStockField}','${WindowStockValue}','${WindowStockMBQ}','${ProductName}','${stock}','${d3}') `; + } + + } + } + + console.log('values:',values); + + + let add_hdr_data=`INSERT INTO ${AppTables.WINDOW_HDR_DATA} (WINDOW_HEADER_ID,STORE_ID,VISIT_DATE,WINDOW_DEFINITION_ID,WINDOW_ID,WINDOW_NAME,WINDOW_TABLE,WINDOW_FIELD,WINDOW_VALUE,CHILD_NAME,IS_PRESENT,WINDOW_NA_IMAGE,REASON_ID,REASON,ADDED_DATE) VALUES ${values} `; + let add_child_data=`INSERT INTO ${AppTables.WINDOW_CHILD_DATA} (WINDOW_HEADER_ID,STORE_ID,VISIT_DATE,WINDOW_DEFINITION_ID,WINDOW_ID,QUESTION_ID,QUESTION_CODE,QUESTION_TYPE,ANSWER,ANSWER_ID,MULTI_OPTIONS_IDS,IMAGE1,IMAGE_ALLOW1,ADDED_DATE) VALUES ${childV} `; + let add_images_data=`INSERT INTO ${AppTables.WINDOW_IMAGES} (WINDOW_HEADER_ID,STORE_ID,VISIT_DATE,WINDOW_DEFINITION_ID,WINDOW_ID,IMAGE1,IMAGE2,ADDED_DATE) VALUES ${imageV} `; + let add_stock_data=`INSERT INTO ${AppTables.WINDOW_STOCK_DATA} (WINDOW_HEADER_ID,STORE_ID,VISIT_DATE,WINDOW_DEFINITION_ID,WINDOW_ID,WINDOW_STOCK_DEFINITION_ID,WINDOW_STOCK_TABLE,WINDOW_STOCK_FIELD,WINDOW_STOCK_VALUE,WINDOW_STOCK_MBQ,PRODUCT_NAME,STOCK,ADDED_DATE) VALUES ${stockV} `; + + await txn.executeSql(add_hdr_data,[],async function (txn2, txnres) { + console.log('window header data added'); + var isSplitImageAdded=true,isStockAdded=true,isChildAdded=true; + if(imageV!=''){ + isSplitImageAdded=await executeQuery(add_images_data); + } + if(stockV!=''){ + isStockAdded=await executeQuery(add_stock_data); + } + if(childV!=''){ + isChildAdded=await executeQuery(add_child_data); + } + + if(!isSplitImageAdded){ + setProcessing(false);notify('Cannot add split window images'); + } + else if(!isStockAdded){ + setProcessing(false);notify('Cannot add window stock data'); + } + else if(!isChildAdded){ + setProcessing(false);notify('Cannot add window questions data'); + } + else{ + setProcessing(false);notify('Window data updated successfully'); + props.navigation.goBack(); + } + + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot add window data'); },); + }); + } catch (err) { + console.log(err); + } + } + + async function executeQuery(q){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres2) { + resolve(true); + },function(txn2,txnerr){console.log(txnerr);resolve(false) }); + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }) + } + + + + async function validate(){ + let isValid=true; + + return new Promise((resolve,reject)=>{ + for (const wi in Windows){ + const window=Windows[wi]; + let isImage1=window.WindowImage1=='true' || window.WindowImage1==1?1:0; + let isImage2=window.WindowImage2=='true' || window.WindowImage2==1?1:0; + let isNAImageAvl=window.WindowNotExistCamera=='true' || window.WindowNotExistCamera==1?1:0; + let isNAReasonEnable=window.WindowNotExistReasonEnable=='true' || window.WindowNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.WindowExistReasonEnable=='true' || window.WindowExistReasonEnable==1? 1:0; + let isStockReq=window.WindowElementStockRequired=='true' || window.WindowElementStockRequired==1?1:0; + let WindowQuestions=window.WindowQuestions || []; + let WindowStocks=window.WindowStocks || []; + + + const wind=WindowData.find(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let WindowSplits=wind.WindowSplits || []; + let QD=wind.WindowQA || {}; + let WStocksData=wind.WStocksData || []; + + if(isPresent=='1'){ + if(isReasonEnable==true && ReasonId=='' ){ + notify(`Please select reason for ${window.WindowName} `,'LONG'); + resolve(false);return; + } + else{ + if(window.NoOfSplit>0 && WindowSplits.length>0 && (isImage1==1 || isImage2==1)) + { + for(const splitItemIndex in WindowSplits){ + const splitItem=WindowSplits[splitItemIndex]; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image2Name=splitItem['Image2Name']!=null && splitItem['Image2Name']!=''?splitItem['Image2Name']:''; + console.log('Image2Name',Image2Name,isImage2); + if(isImage1==1 && Image1Name==''){ + notify(`Please click all images for ${window.WindowName}`,'LONG'); + resolve(false);return; + } + else if(isImage2==1 && Image2Name==''){ + notify(`Please click all images for ${window.WindowName}`,'LONG'); + resolve(false);return; + } + } + } + + if(isStockReq==1){ + for(const stockProdIndex in WindowStocks){ + const stockProd=WindowStocks[stockProdIndex]; + let sd=WStocksData.find(i=> i.ProductId==stockProd.WindowStockValue) || {}; + let stock=sd.Stock!=null?sd.Stock:(sd.Stock==0?sd.Stock:''); + + if(stock==''){ + notify(`Please enter stock for ${window.WindowName} ( ${stockProd.ProductName} ) `,'LONG'); + resolve(false);return; + } + } + } + + if(WindowQuestions.length>0){ + for(const qtnIndex in WindowQuestions){ + const qtn=WindowQuestions[qtnIndex]; + + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + let multi_key=qtn.WindowQuestionId+'_MultiOption'; + let date_key=qtn.WindowQuestionId+'_Date'; + let img_key=qtn.WindowQuestionId+'_ImagePath1'; + let imgname_key=qtn.WindowQuestionId+'_ImageName1'; + let rating_key=qtn.WindowQuestionId+'_Rating'; + let list_mcdata=[]; + + let isImgAllowed=(qtn.WQShowCamera=='true' || qtn.WQShowCamera==1); + let checkForAnsKey=(qtn.QuestionType=='Decimal' || qtn.QuestionType=='Number' || qtn.QuestionType=='Text' || qtn.QuestionType=='Date' || qtn.QuestionType=='Rating') ; + if(qtn.QuestionType=='Single choice list') + { + selansid=QD[id_key]; + } + else if(qtn.QuestionType=='Multi choice list') + { + selansid=QD[multi_key]!=null && QD[multi_key]!=''?QD[multi_key].split(','):[]; + } + + + if(qtn.QuestionType=='Multi choice list' && selansid.length<=0){ + notify(`Please select options for the required field in ${window.WindowName}`,'SHORT'); + resolve(false);return; + } + else if( checkForAnsKey && (Object.keys(QD).indexOf(ans_key)<0 || (Object.keys(QD).indexOf(ans_key)>=0 && QD[ans_key]===''))){ + let msg=( qtn.QuestionType=='Date'?`Please pick a date for the required field in ${window.WindowName}`:(qtn.QuestionType=='Rating'?`Please select rating for the required field in ${window.WindowName}`:`Please fill all the required field in ${window.WindowName}`)); + notify(msg,'SHORT'); + resolve(false);return; + } + else if(Object.keys(QD).indexOf(id_key)<0 || (Object.keys(QD).indexOf(id_key)>=0 && (QD[id_key]==='' || (QD[id_key]===0 && qtn.isDisabled===false) ))){ + notify(`Please fill all the required field in ${window.WindowName}`,'SHORT'); + resolve(false);return; + } + else if(isImgAllowed && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + notify(`Please add images in ${window.WindowName}`,'SHORT'); + resolve(false);return; + }else{ + console.log('no condition found'); + } + + if((qtn.QuestionType=='Single choice list' || qtn.QuestionType=='Multi choice list' )){ + if (qtn.Answers && qtn.Answers.length>0){ + for(var j=0;j=0)){ + showImageTag=true; + } + } + } + } + + if(showImageTag && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + notify(`Please add images in ${window.WindowName}`,'SHORT'); + resolve(false);return; + } + } + } + + } + } + else{ + if(isNAReasonEnable==true && ReasonId=='' ){ + notify(`Please select reason for ${window.WindowName} `,'LONG'); + resolve(false);return; + } + else if(isNAImageAvl==true && NAImage1=='' ){ + notify(`Please click image for ${window.WindowName}`,'LONG'); + resolve(false);return; + } + } + + if(wi==(Windows.length-1)){ + resolve(true);return; + } + + } + + }).then((val)=>{return val}) + .catch((err)=>{console.log(err); return false}); + + } + + + function onselectionChange(option,keyLbl,keyVal,otherData){ + let item=otherData.window; + let allData=WindowData; + let defData={'WindowId':item.WindowId,'WindowDefinitionId':item.WindowDefinitionId}; + const win_index=allData.findIndex(i=>i.WindowId==item.WindowId && i.WindowDefinitionId==item.WindowDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[keyVal]=option.value; + wind[keyLbl]=option.label; + + win_index>=0?allData[win_index]=wind:allData.push(wind); + console.log('allData:',allData); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onselectionChange2(option,qtn,window){ + let allData=WindowData; + let defData={'WindowId':window.WindowId,'WindowDefinitionId':window.WindowDefinitionId}; + const wind_index=allData.findIndex(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let data=wind.WindowQA || {}; + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + data[id_key]=option.value; + data[ans_key]=option.label; + + + wind['WindowQA']=data; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + + let aq_ans=qtn.Answers!=null?qtn.Answers:[]; + let ans_obj=aq_ans.find(i=>i.AnswerId==option.value) || {}; + let EQtns=ans_obj.WAQuestionEnable!=null && ans_obj.WAQuestionEnable!=''?ans_obj.WAQuestionEnable.replace(' ','').split(','):[]; + let DQtns=ans_obj.WAQuestionDisable!=null && ans_obj.WAQuestionDisable!=''?ans_obj.WAQuestionDisable.replace(' ','').split(','):[]; + + let sqtns=window.WindowQuestions || [] + + if(EQtns.length>0){ + enableQtns(sqtns,EQtns,DQtns,data,wind,wind_index,allData,window) + } + else if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data,wind,wind_index,allData,window) + } + else{ + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + } + + async function disableQtns(sqtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + + if(DQtns.length>0){ + new Promise.all( + DQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.WindowQuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=true + sqtns[s_qtnindex]=s_qtn; + let id_key=s_qtn.WindowQuestionId+'_AnswerId'; + let ans_key=s_qtn.WindowQuestionId+'_Answer'; + data[id_key]=0; + data[ans_key]=''; + + wind['WindowQA']=data; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + return false + }) + ).then(async (val)=>{ + + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.WindowDefinitionId==window.WindowDefinitionId && i.WindowId==window.WindowId) + if(windowIndex>0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindowData(allData); + setWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + }) + } + } + + async function enableQtns(sqtns,EQtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + new Promise.all( + EQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.WindowQuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=false + sqtns[s_qtnindex]=s_qtn; + return false + }) + ).then(async (val)=>{ + if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data,wind,wind_index,allData,window) + } + else{ + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.WindowDefinitionId==window.WindowDefinitionId && i.WindowId==window.WindowId) + if(windowIndex>0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + } + }) + } + + async function setMultiSelectValue(selectedItems=[],qtn={},window={}) { + console.log('setMultiSelectValue',selectedItems); + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + let multi_key=qtn.WindowQuestionId+'_MultiOption'; + + let allData=WindowData; + let defData={'WindowId':window.WindowId,'WindowDefinitionId':window.WindowDefinitionId}; + const wind_index=allData.findIndex(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + obj[id_key]=0; + obj[multi_key]=selectedItems.join(','); + let anss=[]; + selectedItems.map((itemValue)=>{ + let ans = qtn.Answers.find(c1 => c1.AnswerId == itemValue); + if(ans.Answer){anss.push(ans.Answer)} + }); + obj[ans_key]=anss.join(','); + console.log('obj:',obj); + + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function setTextValue(value,qtn,window) { + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + + let allData=WindowData; + let defData={'WindowId':window.WindowId,'WindowDefinitionId':window.WindowDefinitionId}; + const wind_index=allData.findIndex(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + if(qtn.QuestionType=='Date' ){ + let date_key=qtn.WindowQuestionId+'_Date'; + let d=value!=null?new Date(value):new Date(); + let mfdate=moment(d).format('MM/YYYY'); + showQtnDatePicker(qtn,window,false); + obj[id_key]=0; + obj[ans_key]=mfdate; + obj[date_key]=moment(d).format('MM/DD/YYYY'); + } + else{ + obj[id_key]=0; + obj[ans_key]=value; + } + + console.log(value,obj); + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function showQtnDatePicker(qtn,window,show=false){ + let allQtns=window.WindowQuestions || []; + let newqtnIndex=allQtns.findIndex(q=>q.WindowQuestionId==qtn.WindowQuestionId); + + if(newqtnIndex>=0){ + let newqtn=allQtns[newqtnIndex]; + newqtn.showDatePicker=show; + allQtns[newqtnIndex]=newqtn; + window['WindowQuestions']=allQtns; + let allWindows=Windows; + const winIndex=allWindows.findIndex(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId) || {}; + allWindows[winIndex]=window; + setWindows(allWindows); + + if(show==true) setrerenderdata(!rerenderdata); + } + } + + function setRatingValue(data){ + setRatingOrder(data); + } + + function onRatingCancel(){ + setShowRating(false); + } + + function onRatingSave(){ + setShowRating(false); + let qtn=RatingQtn; + let window=RatingWindow; + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + let rating_key=qtn.WindowQuestionId+'_Rating'; + let ids=[],anss=[]; + RatingOrder.map((item,index)=>{ + ids.push(item.AnswerId); + anss.push(item.Answer); + }) + + let allData=WindowData; + let defData={'WindowId':window.WindowId,'WindowDefinitionId':window.WindowDefinitionId}; + const wind_index=allData.findIndex(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + obj[rating_key]=ids.join(','); + obj[id_key]=0; + obj[ans_key]=anss.join(','); + + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function onChoiceSelect(item,val,key,animatedChoice){ + console.log('onChoiceSelect',animatedChoice) + var val1=0; + val==1?val1=1:''; + + if(animatedChoice!=null){ + Animated.timing(animatedChoice, { + toValue: val1, + duration:400, + useNativeDriver:false, + }).start(); + } + onWindowDataChange(item,val,key) + } + + function onWindowDataChange(item,val,key){ + let allData=WindowData; + let defData={'WindowId':item.WindowId,'WindowDefinitionId':item.WindowDefinitionId}; + const win_index=allData.findIndex(i=>i.WindowId==item.WindowId && i.WindowDefinitionId==item.WindowDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[key]=val; + + if(key=='ReasonId'){ + let rsn=reasons_list.find(r=>r.ReasonId==val) || {}; + wind['Reason']=rsn.Reason || ''; + } + + win_index>=0?allData[win_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function setWindowStockVal(val,window,stockProd){ + let allData=WindowData; + let defData={'WindowId':window.WindowId,'WindowDefinitionId':window.WindowDefinitionId}; + const win_index=allData.findIndex(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + let sdIndex=WStocksData.findIndex(i=> i.ProductId==stockProd.WindowStockValue); + let sd=sdIndex>=0?WStocksData[sdIndex]:{'ProductId':stockProd.WindowStockValue,'Stock':''}; + sd['Stock']=val; + sdIndex>=0?WStocksData[sdIndex]=sd:WStocksData.push(sd); + wind['WStocksData']=WStocksData; + win_index>=0?allData[win_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata4(!rerenderdata4); + } + + function onSaveCancel(){ + setShowAlert(false); + } + + + + function openImageRefView(RefImage=''){ + setShow_zoomImage(true); + } + + function renderRatingView(){ + let qtn=RatingQtn; + let Answers=qtn.Answers; + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + let rating_key=qtn.WindowQuestionId+'_Rating'; + + let newarr=RatingOrder; + if(RatingOrder.length<=0){ + newarr=Answers; + } + + return ( + + + Drag Items In Order + Press and hold to drag + {setRatingValue(data)}} + keyExtractor={(item) => item.AnswerId} + renderItem={renderItem} + /> + + {onRatingCancel()}}> + Cancel + + {onRatingSave()}}> + Save + + + + + ) + } + + function render_Picker(label_key,value_key,onChange=()=>{},selected_data={}){ + var data=[]; + let qtn=selected_data.qtn || {}; + let window=selected_data.window || {}; + let isQtnDisabled=qtn.isDisabled!=null || qtn.isDisabled!=''?false:true; + let allAnswers=qtn.Answers || []; + + allAnswers.map((item,index)=>{ + let obj={ key: index, label: item[label_key],value:item[value_key] }; + if(selected_data.value==item[label_key]) + obj['component']= {item[label_key]}; + data.push(obj); + }); + + return ( + {onChange(option,qtn,window) }} + overlayStyle={customStyle.addVisPickerOverlay} + cancelContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + optionStyle={customStyle.addvis_opStyle} + optionTextStyle={customStyle.addvis_opTextStyle} + optionContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + selectedKey={'1'} + disabled={isQtnDisabled} + > + {(selected_data.value!=null && selected_data.value!=''?selected_data.value: '-select-')} + + ) + } + + function renderDatePicker(qtn,window){ + let qtnn=qtn; + let DateRange=qtn.DateRange; + let maxDate=moment().add(10,'years').format('MM/DD/YYYY'); + let minDate=moment().subtract(10,'years').format('MM/DD/YYYY'); + if(DateRange=='RFD'){ + maxDate=moment().format('MM/DD/YYYY'); + } + else if(DateRange=='RPD'){ + minDate=moment().format('MM/DD/YYYY'); + } + + return ( + {setTextValue(selectedDate,qtnn,window)}} + maximumDate={new Date(maxDate)} + minimumDate={new Date(minDate)} + /> + ); + } + + function _renderWindow(){ + return ( + `window_${index.toString()}`} + renderItem={({item,index})=>{ + const window=item; + + let isImage1=window.WindowImage1=='true' || window.WindowImage1==1?1:0; + let isImage2=window.WindowImage2=='true' || window.WindowImage2==1?1:0; + let isNAImageAvl=window.WindowNotExistCamera=='true' || window.WindowNotExistCamera==1?1:0; + let isNAReasonEnable=window.WindowNotExistReasonEnable=='true' || window.WindowNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.WindowExistReasonEnable=='true' || window.WindowExistReasonEnable==1? 1:0; + let isStockReq=window.WindowElementStockRequired=='tre' || window.WindowElementStockRequired==1?1:0; + // let isStock_CheckAssrt=window.WindowElementCheckAssortment=='true' || window.WindowElementCheckAssortment==1?1:0; + let RefImage=window.WindowRefImage; + let camera1Label=window.WindowImage1Lable || ''; + let camera2Label=window.WindowImage2Lable || ''; + let WindowQuestions=window.WindowQuestions || []; + let WindowStocks=window.WindowStocks || []; + + const wind=WindowData.find(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let WindowSplits=wind.WindowSplits || []; + let QuestionsData=wind.WindowQA || {}; + let WStocksData=wind.WStocksData || []; + + // console.log('camera2Label:',window.WindowId,window.WindowDefinitionId,camera2Label); + + + var xpos=isPresent=='1'?-75:0; + if(window.animatedChoice!=null ){ + xpos=window.animatedChoice.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + return( + + + + {window.WindowName} + {openImageRefView(RefImage)}}> + + + + + + + + + {'Is Present'} + + + + {onChoiceSelect(window,1,'isPresent',window.animatedChoice)}}> + Yes + + {onChoiceSelect(window,0,'isPresent',window.animatedChoice)}}> + No + + + + + {((isPresent!='1' && isNAReasonEnable==true) || (isPresent=='1' && isReasonEnable==true)) && + + Select Reason + {} + + } + + + {(isPresent!='1' && isNAImageAvl==true) && + + + + {'Capture Image'} + + + + + + { (NAImage1Path=='' || NAImage1Path==null) && + {openCamera(window,{},0,'1','3')}}> + + + } + { (NAImage1Path!='' && NAImage1Path!=null) && + + + {openCamera(window,{},0,'1','3')}}> + + + + } + + + + + } + + + + {(isPresent=='1') && + + {(isStockReq==true && WindowStocks.length>0) && + + + {'Enter Stocks'} + + `wstock_${index.toString()}`} + renderItem={({item,index})=>{ + let stockProd=item; + let stockProdIndex=index; + let sd=WStocksData.find(i=> i.ProductId==stockProd.WindowStockValue) || {}; + let stock=sd.Stock!=null?sd.Stock:''; + return( + + {stockProd.ProductName} + + + Stock + + + + {setWindowStockVal(val,window,stockProd)}} + autoComplete='off' + /> + + + + + ); + }} + /> + + } + {( window.NoOfSplit>0 && WindowSplits.length>0 && (isImage1==1 || isImage2==1)) && + + + {'Capture Window Images'} + + `spliItem_${index.toString()}`} + renderItem={({item,index})=>{ + let splitItem=item; + let splitItemIndex=index; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image2Name=splitItem['Image2Name']!=null && splitItem['Image2Name']!=''?splitItem['Image2Name']:''; + let Image1=splitItem['Image1']!=null && splitItem['Image1']!=''?splitItem['Image1']:''; + let Image2=splitItem['Image2']!=null && splitItem['Image2']!=''?splitItem['Image2']:''; + + return( + + {isImage1==1 && + + { (Image1=='' || Image1==null) && + {openCamera(window,splitItem,splitItemIndex,'1')}}> + + + } + { (Image1!='' && Image1!=null) && + + + {openCamera(window,splitItem,splitItemIndex,'1')}}> + + + + } + {camera1Label} + + } + {isImage2==1 && + + { (Image2=='' || Image2==null) && + {openCamera(window,splitItem,splitItemIndex,'2')}}> + + + } + { (Image2!='' && Image2!=null) && + + + {openCamera(window,splitItem,splitItemIndex,'2')}}> + + + + } + {console.log('camera2Label 2:',camera2Label)} + {camera2Label} + + } + + ); + }} + /> + + } + + {(WindowQuestions.length>0) && + + + {'Window Questions'} + + {WindowQuestions.map((item,index)=>{ + + let qtn=item; + let qtnIndex=index; + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + let multi_key=qtn.WindowQuestionId+'_MultiOption'; + let date_key=qtn.WindowQuestionId+'_Date'; + let img_key=qtn.WindowQuestionId+'_ImagePath1'; + let imgname_key=qtn.WindowQuestionId+'_ImageName1'; + let rating_key=qtn.WindowQuestionId+'_Rating'; + + let list_mcdata=[]; + + if(qtn.QuestionType=='Single choice list') + { + selansid=QuestionsData[id_key]!=null ?QuestionsData[id_key] :''; + selanswer=QuestionsData[ans_key]!=null ?QuestionsData[ans_key] :''; + } + else if(qtn.QuestionType=='Multi choice list') + { + if(qtn.Answers!=null){ + for(var i=0;i0){ + // let arr=[]; + // for(var i=0;i0){ + for(var i=0;i=0)){ + showImageTag=true; + } + + } + } + } + + if(showImageTag){ + selimg=QuestionsData[img_key]!=null && QuestionsData[img_key]!=''?'file://'+QuestionsData[img_key]:''; + } + + return( + + {qtn.WindowQuestionName} + {qtn.QuestionType=='Single choice list' && qtn.Answers && + render_Picker('Answer','AnswerId',onselectionChange2,{value:selanswer,qtn:qtn,window:window}) + } + {qtn.QuestionType=='Multi choice list' && qtn.Answers && + { setMultiSelectValue(selectedItems,qtn,window) }} //setMultiSelectValue(selectedItems,qtn) + selectedItems={selansid} + selectText="Pick Items" + searchInputPlaceholderText="Search Items..." + // onChangeInput={ (text)=> console.log(text)} + tagRemoveIconColor={PrimaryTheme.$primary_color} + tagBorderColor={PrimaryTheme.$primary_color} + tagTextColor={PrimaryTheme.$primary_color} + selectedItemTextColor={PrimaryTheme.$primary_color} + selectedItemIconColor={PrimaryTheme.$primary_color} + itemTextColor={PrimaryTheme.$text_color} + displayKey="Answer" + searchInputStyle={{ color: '#CCC' }} + submitButtonColor={PrimaryTheme.$primary_color} + submitButtonText="Submit" + /> + } + { (qtn.QuestionType=='Number' || qtn.QuestionType=='Decimal' || qtn.QuestionType=='Text') && + {setTextValue(val,qtn,window)}} + autoComplete='off' + /> + } + { + (qtn.QuestionType=='Date') && + + {selansid!=''?selansid:'MM/YYYY'} + {setDateValue(selanswer);showQtnDatePicker(qtn,window,true)}}> + + + + } + { ((qtn.showDatePicker==true || qtn.showDatePicker=='true') && (qtn.QuestionType=='Date') ) && + renderDatePicker(qtn,window) + } + { + (qtn.QuestionType=='Rating') && + + {selanswer} + {setRatingQtn(qtn);setRatingWindow(window);setShowRating(true);}}> + + + + } + + { + // (qtn.QuestionType=='Audio') && + // + // {selanswer} + // {show_recorder(qtn);}}> + // + // + // + } + + { + showImageTag && + + + {openCamera(window,{},0,'1','2',qtn)}}> + + + + } + + + + ) + })} + + } + + + + } + + + + + + + ); + }} + /> + ) + } + + function _renderHeader(currentIndex){ + return( + + {/* {`${(currentIndex+1)}/${zoomImageUrl.length}`} */} + {console.log('tsth');setShow_zoomImage(false) }}> + + + + ) + } + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + { Object.keys(storeData).length>0 && + + {_renderWindow()} + + } + + {onSubmitData()}}/> + + + + + { showRating==true && + renderRatingView() + } + {show_zoomImage && + + null} + /> + + } + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(PaidVisibility); \ No newline at end of file diff --git a/src/screens/PaidVisibilityOneApp.js b/src/screens/PaidVisibilityOneApp.js new file mode 100644 index 0000000..e784907 --- /dev/null +++ b/src/screens/PaidVisibilityOneApp.js @@ -0,0 +1,2103 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, Animated} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,getKPIFields,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, FontAwesome, Fontisto, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector' +import { CustomPicker, CustomPicker2 } from '../components/CustomPicker'; +import CustomCamera from '../components/Camera'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import DateTimePicker from '@react-native-community/datetimepicker'; +import CheckBox from '@react-native-community/checkbox'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import MultiSelect from 'react-native-multiple-select'; + +function PaidVisibilityOneApp(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const animatedChoice=useRef(new Animated.Value(0)).current; + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [StoreCameraAllow, setStoreCameraAllow] = useState(true); + const [currentMenu, setCurrentMenu] = useState({}); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + const [rerenderdata3, setrerenderdata3]= useState(0); + const [rerenderdata4, setrerenderdata4]= useState(0); + + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + + const [WindowData, setWindowData] = useState([]); + const [reasons_list, setReasons_list] = useState([]); + const [Windows, setWindows] = useState([]); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [showAlert, setShowAlert] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const zoomView=useRef(null); + const [showRating, setShowRating] = useState(false); + const [RatingQtn, setRatingQtn] = useState({}); + const [RatingWindow, setRatingWindow] = useState({}); + const [RatingOrder, setRatingOrder] = useState([]); + + const [Products, setProducts] = useState([]); + const [DisplayList, setDisplayList] = useState([]); + const [toRemoveId,setToRemoveId]= useState(''); + const [toRemoveItem,setToRemoveItem]= useState({}); + const [showRemoveConfirm_M,setshowRemoveConfirm_M]= useState(false); + const [showRAllC_M,setShowRAllC_M]= useState(false); + const [searchedItem, setSearchedItem]= useState(''); + const [globalWindows, setGlobalWindows] = useState([]); + const [KPIFields, setKPIFields] = useState([]); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + let cameraAllow=storeData1.CameraAllow=='true' || storeData1.CameraAllow==1?true:false; + setStoreCameraAllow(cameraAllow); + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + function onRemoveScreen(e){ + Alert.alert( + "", + ST.Doyoureallywanttoexitthescreen, + [ + { + text: ST.Cancel, + onPress: () => {}, + style: "cancel" + }, + { text: ST.OK, onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + + async function getData(storeData1,menu1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + let AllKPIFields=await getKPIFields(menu1); + setKPIFields(AllKPIFields); + + await db.transaction(async function (txn) { + + + let q3=`Select VisibilityReasonId as ReasonId,VisibilityReason as Reason From Master_VisibilityReason`; + await txn.executeSql(q3,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i0){ + let arr=[];let images=[],allWindowsData=[]; + for(var i=0;i0){ + let arr=[],images=[],allWindowsData=[]; + for(var i=0;i{ + + db.transaction(async function (txn) { + + let q=`select * from ${AppTables.PAIDVIS_IMAGES} where PVIS_HEADER_ID='${window.PVisHeaderId}' and STORE_ID='${storeData1.StoreId}' `; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return WindowSplits_def; + }); + } + + async function getWindowQuestions(window,storeData1,isInserted=false){ + let obj={'WindowQA':{},'WindowQuestions':[]} + return new Promise((resolve,reject)=>{ + + db.transaction(async function (txn) { + var q='',selectlist='',join='',join2=''; + if(isInserted==true){ + selectlist=` DISTINCT q.QUESTION_ID as VisibilityQuestionId,q.QUESTION_CODE as VisibilityQuestionCode,wq.VisibilityQuestionName,wq.QuestionType,wq.VQShowCamera,wq.VQCameraMandatory,wq.VQLengthValidationRequired,wq.VQMinimumChar,wq.VQMaximumChar,wq.VQDecimalPoint,wq.VQDateRangeMin,wq.VQDateRangeMax,wq.VQVoiceLengthInMinutes,wq.VQDefaultQuestionEnable,q.ANSWER as Answer,q.ANSWER_ID as AnswerId,q.MULTI_OPTIONS_IDS as multi_op_ids,q.IMAGE_ALLOW1 as VAShowCamera,q.IMAGE1 as Image1 `; + join2=` inner join Mapping_VisibilityQuestion mq on mq.VisibilityQuestionId=wq.VisibilityQuestionId `; + join=` inner join Master_VisibilityQuestion wq on wq.VisibilityQuestionId=q.QUESTION_ID `; + q=`select ${selectlist} from ${AppTables.PAIDVIS_CHILD_DATA} q ${join} ${join2} where q.STORE_ID='${storeData1.StoreId}' and q.PVIS_DEFINITION_ID='${window.VisibilityDefinitionId}' and q.PVIS_ID='${window.VisibilityId}' order by wq.VisibilityQuestionSequence `; + } + else{ + selectlist=` DISTINCT wq.VisibilityQuestionId,wq.VisibilityQuestionCode,wq.VisibilityQuestionName,wq.QuestionType,wq.VQShowCamera,wq.VQCameraMandatory,wq.VQLengthValidationRequired,wq.VQMinimumChar,wq.VQMaximumChar,wq.VQDecimalPoint,wq.VQDateRangeMin,wq.VQDateRangeMax,wq.VQVoiceLengthInMinutes,wq.VQDefaultQuestionEnable `; + join=` inner join Mapping_VisibilityQuestion mq on mq.VisibilityQuestionId=wq.VisibilityQuestionId `; + q=`select ${selectlist} from Master_VisibilityQuestion wq ${join} where mq.VisibilityDefinitionId='${window.VisibilityDefinitionId}' order by wq.VisibilityQuestionSequence `; + } + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + let wqa_obj={}; + for(var i=0;i0){ + for(var k=0;k=0)){ + showImageTag=true; + } + } + } + } + + if(showImageTag && data.Answer!=null){ + let imgPath=(Platform.OS=='ios'?'file://':'')+common_ImagePath+data.Image1; + wqa_obj[imgname_key]=data.Image1; + wqa_obj[img_key]=imgPath; + } + + + + if(data.QuestionType=='Date' && data.Answer!=null){ + let dayonly=moment().format('DD'); + let actual_date=data.Answer?data.Answer.split('/'):[]; + let month=actual_date[0],year=actual_date[1]; + let fulldate=month+'/'+dayonly+'/'+year; + wqa_obj[date_key]=fulldate; + + } + + arr.push(data); + if(i==txnres2.rows.length-1){ + obj['WindowQuestions']=arr; + obj['WindowQA']=wqa_obj; + resolve(obj) + } + } + } + else{ + resolve(obj) + } + },function (txn2, txnerr) { console.log(txnerr); resolve(obj) },); + }); + }).then((val)=>{ + return val + }).catch((err)=>{ + console.log(err); + return obj; + }); + } + + + async function getWindowAnswers(qtn){ + + return new Promise((resolve,reject)=>{ + + db.transaction(async function (txn) { + var q='',selectlist=''; + selectlist=` DISTINCT VisibilityAnswerId as AnswerId,VisibilityAnswerName as Answer,VAShowCamera,VACameraMandatory,VAQuestionEnable,VAQuestionDisable `; + q=`select ${selectlist} from Master_VisibilityQuestion where VisibilityQuestionId='${qtn.VisibilityQuestionId}' order by VASequence `; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return []; + }); + } + + async function getWindowStockData(window,storeData1,isInserted=false){ + let obj={'WStocks':[],'WStocksData':[],'isAllChecked':0} + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let checkassrt=window.VisibilityElementCheckAssortment=='true' || window.VisibilityElementCheckAssortment==1?true:false; + let join='',join2=''; + if(checkassrt){ + join=` inner join Mapping_ProductAssortment a on a.ProductId=s.PVIS_STOCK_VALUE `; + } + let selectlist1=` s.PVIS_STOCK_DEFINITION_ID as VisibilityStockDefinitionId, s.PVIS_DEFINITION_ID as VisibilityDefinitionId,s.PVIS_STOCK_TABLE as VisibilityStockTable,s.PVIS_STOCK_FIELD as VisibilityStockField,s.PVIS_STOCK_VALUE as VisibilityStockValue,s.PVIS_STOCK_MBQ as VisibilityStockMBQ,s.PRODUCT_NAME as ProductName, s.STOCK as Stock,s.IS_PVIS_PRESENT as isPVisPresent `; + let q=`select ${selectlist1} from ${AppTables.PAIDVIS_STOCK_DATA} s ${join} where s.PVIS_DEFINITION_ID='${window.VisibilityDefinitionId}' and s.STORE_ID='${storeData1.StoreId}' `; + if(checkassrt){ + q+=` and a.StateId='${storeData1.StateId}' `; + } + q+=` order by s.PRODUCT_NAME `; + + if(checkassrt){ + join2=` inner join Mapping_ProductAssortment a on a.ProductId=s.VisibilityStockValue `; + } + let selectlist2=` s.VisibilityStockDefinitionId, s.VisibilityDefinitionId,s.VisibilityStockTable,s.VisibilityStockField,s.VisibilityStockValue,s.VisibilityStockMBQ,s.ProductName `; + let q2=`select ${selectlist2} from Master_VisibilityStockDefinition s ${join2} where s.VisibilityDefinitionId='${window.VisibilityDefinitionId}' `; + + if(checkassrt){ + q2+=` and a.StateId='${storeData1.StateId}' `; + } + q2+=` order by s.ProductName `; + + + console.log(q); + await txn.executeSql(q,[],async function (txn2, txnres2) { + + if(txnres2.rows.length>0){ + let arr=[],WStocksData=[]; + let isAllChecked=1; + for(var i=0;i0){ + let arr=[],WStocksData=[]; + let isAllChecked=1; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return obj; + }); + } + + + async function getImage(imgdata){ + let type=getImageProps.type || ''; + let window=getImageProps.window || {}; + let splitItem=getImageProps.splitItem || {}; + let splitItemIndex=getImageProps.splitItemIndex || 0; + let qtn=getImageProps.qtn || {}; + let cameraType=getImageProps.cameraType!=null?getImageProps.cameraType:'1'; + + if(typeof imgdata=='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: Shelf Talker'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+window.VisibilityDefinitionId+'_'+window.VisibilityId+'_'+(props.UserId || '')+'_STImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let allData=WindowData; + let defData={'VisibilityId':window.VisibilityId,'VisibilityDefinitionId':window.VisibilityDefinitionId}; + const wind_index=allData.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId) ; + let wind=wind_index>=0?allData[wind_index]:defData; + + if(cameraType=='2'){ + var QD=wind.WindowQA || {}; + var image_key=qtn.VisibilityQuestionId+'_ImageName1'; + var image_key_path=qtn.VisibilityQuestionId+'_ImagePath1'; + QD[image_key]=filename; + } + else if(cameraType=='3'){ + var image_key='NAImage1'; + var image_key_path='NAImage1Path'; + wind[image_key]=filename; + } + else{ + var WindowSplits=wind.WindowSplits || []; + var image_key=type=='1'?'Image1Name':'Image2Name'; + var image_key_path=type=='1'?'Image1':'Image2'; + splitItem[image_key]=filename; + } + + + + // renamefile + let imagePath=`${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker:',uri); + + if(cameraType=='2'){ + QD[image_key_path]=uri; + wind.WindowQA=QD; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata3(!rerenderdata3); + } + else if(cameraType=='3'){ + wind[image_key_path]=uri; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + else{ + console.log('split image updated'); + splitItem[image_key_path]=uri; + splitItemIndex>=0?WindowSplits[splitItemIndex]=splitItem:WindowSplits.push(splitItem); + wind.WindowSplits=WindowSplits; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata2(!rerenderdata2); + } + + + + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(window,splitItem,splitItemIndex,type='1',cameraType='1',qtn={}){ + setGetImageProps({'window':window,'splitItem':splitItem,'splitItemIndex':splitItemIndex,'type':type,'cameraType':cameraType,'qtn':qtn}); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function onSubmitData(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData+'...'); + setProcessing(true); + let d1n=new Date(); + let d3=moment(d1n).format('MM/DD/YYYY'); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + // remove old data + await txn.executeSql(`DELETE FROM ${AppTables.PAIDVIS_HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window hdr data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.PAIDVIS_CHILD_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window child data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.PAIDVIS_IMAGES} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window images data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.PAIDVIS_STOCK_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window stock data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + + + // add data + var values='',childV='',imageV='',stockV=''; + + for (const wi in globalWindows){ + const window=globalWindows[wi]; + let isImage1=window.VisibilityImage1=='true' || window.VisibilityImage1==1?1:0; + let isImage2=window.VisibilityImage2=='true' || window.VisibilityImage2==1?1:0; + let isNAImageAvl=window.VisibilityNotExistCamera=='true' || window.VisibilityNotExistCamera==1?1:0; + let isNAReasonEnable=window.VisibilityNotExistReasonEnable=='true' || window.VisibilityNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.VisibilityExistReasonEnable=='true' || window.VisibilityExistReasonEnable==1? 1:0; + let isStockReq=window.VisibilityElementStockRequired=='true' || window.VisibilityElementStockRequired==1?1:0; + let WindowQuestions=window.WindowQuestions || []; + let WindowStocks=window.WindowStocks || []; + + + const wind=WindowData.find(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:0; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let remark=wind.remark!=null?wind.remark:''; + let WindowSplits=wind.WindowSplits || []; + let QD=wind.WindowQA || {}; + let WStocksData=wind.WStocksData || []; + + let PVIS_HEADER_ID='WIND'+wi+(Math.floor(Math.random()*1000)+1); + let {VisibilityDefinitionId,VisibilityId,VisibilityName,VisibilityTable,VisibilityField,VisibilityValue,ChildName}=window; + + + values+=values!=''?' , ':''; + values+=` ('${PVIS_HEADER_ID}','${StoreId}','${d3}','${VisibilityDefinitionId}','${VisibilityId}','${VisibilityName}','${VisibilityTable}','${VisibilityField}','${VisibilityValue}','${ChildName}','${isPresent}','${NAImage1}','${ReasonId}','${Reason}','${(remark || '')}','${d3}') `; + + if(isPresent==1){ + for(const qtnIndex in WindowQuestions){ + const qtn=WindowQuestions[qtnIndex]; + + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.VisibilityQuestionId+'_AnswerId'; + let ans_key=qtn.VisibilityQuestionId+'_Answer'; + let multi_key=qtn.VisibilityQuestionId+'_MultiOption'; + let date_key=qtn.VisibilityQuestionId+'_Date'; + let img_key=qtn.VisibilityQuestionId+'_ImagePath1'; + let imgname_key=qtn.VisibilityQuestionId+'_ImageName1'; + let rating_key=qtn.VisibilityQuestionId+'_Rating'; + let list_mcdata=[]; + + let {VisibilityQuestionId,VisibilityQuestionCode,QuestionType,VQShowCamera}=qtn + let answer=QD[ans_key] || 0; + let answerId=QD[id_key] || ''; + let multi_options_ids=QD[multi_key] || ''; + + if(qtn.QuestionType=='Number' || qtn.QuestionType=='Text' || qtn.QuestionType=='Decimal' || qtn.QuestionType=='Date') + { + showImageTag=(qtn.VQShowCamera==1 || qtn.VQShowCamera=='true'); + } + else if((qtn.QuestionType=='Single choice list' || qtn.QuestionType=='Multi choice list' )){ + if (qtn.Answers && qtn.Answers.length>0){ + for(var i=0;i=0)){ + showImageTag=true; + } + + } + } + } + + let Image1=showImageTag==1?QD[imgname_key]:''; + + + childV+=childV!=''?' , ':''; + childV+=` ('${PVIS_HEADER_ID}','${StoreId}','${d3}','${VisibilityDefinitionId}','${VisibilityId}','${VisibilityQuestionId}','${VisibilityQuestionCode}','${QuestionType}','${answer}','${answerId}','${multi_options_ids}','${Image1}','${showImageTag}','${d3}') `; + } + for(const splitItemIndex in WindowSplits){ + const splitItem=WindowSplits[splitItemIndex]; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image2Name=splitItem['Image2Name']!=null && splitItem['Image2Name']!=''?splitItem['Image2Name']:''; + Image1Name=isImage1==1?Image1Name:''; + Image2Name=isImage2==1?Image2Name:''; + + imageV+=imageV!=''?' , ':''; + imageV+=` ('${PVIS_HEADER_ID}','${StoreId}','${d3}','${VisibilityDefinitionId}','${VisibilityId}','${Image1Name}','${Image2Name}','${d3}') `; + } + for(const stockProdIndex in WindowStocks){ + const stockProd=WindowStocks[stockProdIndex]; + let sd=WStocksData.find(i=> i.ProductId==stockProd.VisibilityStockValue) || {}; + let stock=sd.Stock!=null?sd.Stock:(sd.Stock==0?sd.Stock:''); + let isPVisPresent=sd.isPVisPresent!=null?sd.isPVisPresent:0; + let {VisibilityStockDefinitionId, VisibilityDefinitionId,VisibilityStockTable,VisibilityStockField,VisibilityStockValue,VisibilityStockMBQ,ProductName} =stockProd + stockV+=stockV!=''?' , ':''; + stockV+=` ('${PVIS_HEADER_ID}','${StoreId}','${d3}','${VisibilityDefinitionId}','${VisibilityId}','${VisibilityStockDefinitionId}','${VisibilityStockTable}','${VisibilityStockField}','${VisibilityStockValue}','${VisibilityStockMBQ}','${ProductName}','${stock}','${isPVisPresent}','${d3}') `; + } + + } + } + + console.log('values:',values); + + + let add_hdr_data=`INSERT INTO ${AppTables.PAIDVIS_HDR_DATA} (PVIS_HEADER_ID,STORE_ID,VISIT_DATE,PVIS_DEFINITION_ID,PVIS_ID,PVIS_NAME,PVIS_TABLE,PVIS_FIELD,PVIS_VALUE,CHILD_NAME,IS_PRESENT,PVIS_NA_IMAGE,REASON_ID,REASON,REMARK,ADDED_DATE) VALUES ${values} `; + let add_child_data=`INSERT INTO ${AppTables.PAIDVIS_CHILD_DATA} (PVIS_HEADER_ID,STORE_ID,VISIT_DATE,PVIS_DEFINITION_ID,PVIS_ID,QUESTION_ID,QUESTION_CODE,QUESTION_TYPE,ANSWER,ANSWER_ID,MULTI_OPTIONS_IDS,IMAGE1,IMAGE_ALLOW1,ADDED_DATE) VALUES ${childV} `; + let add_images_data=`INSERT INTO ${AppTables.PAIDVIS_IMAGES} (PVIS_HEADER_ID,STORE_ID,VISIT_DATE,PVIS_DEFINITION_ID,PVIS_ID,IMAGE1,IMAGE2,ADDED_DATE) VALUES ${imageV} `; + let add_stock_data=`INSERT INTO ${AppTables.PAIDVIS_STOCK_DATA} (PVIS_HEADER_ID,STORE_ID,VISIT_DATE,PVIS_DEFINITION_ID,PVIS_ID,PVIS_STOCK_DEFINITION_ID,PVIS_STOCK_TABLE,PVIS_STOCK_FIELD,PVIS_STOCK_VALUE,PVIS_STOCK_MBQ,PRODUCT_NAME,STOCK,IS_PVIS_PRESENT,ADDED_DATE) VALUES ${stockV} `; + + + + await txn.executeSql(add_hdr_data,[],async function (txn2, txnres) { + console.log('st header data added'); + var isSplitImageAdded=true,isStockAdded=true,isChildAdded=true; + if(imageV!=''){ + isSplitImageAdded=await executeQuery(add_images_data); + } + if(stockV!=''){ + isStockAdded=await executeQuery(add_stock_data); + } + if(childV!=''){ + isChildAdded=await executeQuery(add_child_data); + } + + if(!isSplitImageAdded){ + setProcessing(false);notify('Cannot add paid visibility images'); + } + else if(!isStockAdded){ + setProcessing(false);notify('Cannot add paid visibility stock data'); + } + else if(!isChildAdded){ + setProcessing(false);notify('Cannot add paid visibility questions data'); + } + else{ + setProcessing(false);notify('Paid visibility updated successfully'); + props.navigation.goBack(); + } + + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot add paid visibility data'); },); + }); + } catch (err) { + console.log(err); + } + } + + async function executeQuery(q){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres2) { + resolve(true); + },function(txn2,txnerr){console.log(txnerr);resolve(false) }); + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }) + } + + async function validate(){ + let isValid=true; + + return new Promise((resolve,reject)=>{ + for (const wi in globalWindows){ + const window=globalWindows[wi]; + let isImage1=window.VisibilityImage1=='true' || window.VisibilityImage1==1?1:0; + let isImage2=window.VisibilityImage2=='true' || window.VisibilityImage2==1?1:0; + let isNAImageAvl=window.VisibilityNotExistCamera=='true' || window.VisibilityNotExistCamera==1?1:0; + let isNAReasonEnable=window.VisibilityNotExistReasonEnable=='true' || window.VisibilityNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.VisibilityExistReasonEnable=='true' || window.VisibilityExistReasonEnable==1? 1:0; + let isStockReq=window.VisibilityElementStockRequired=='true' || window.VisibilityElementStockRequired==1?1:0; + let StockQtyRequired=window.StockQtyRequired=='true' || window.StockQtyRequired==1?1:0; + let WindowQuestions=window.WindowQuestions || []; + let WindowStocks=window.WindowStocks || []; + + + const wind=WindowData.find(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let remark=wind.remark!=null?wind.remark:''; + let WindowSplits=wind.WindowSplits || []; + let QD=wind.WindowQA || {}; + let WStocksData=wind.WStocksData || []; + + if(isPresent=='1'){ + if(isReasonEnable==true && ReasonId=='' ){ + notify(`${ST.Pleaseselectreasonfor} ${window.VisibilityName} `,'LONG'); + resolve(false);return; + } + // else if(remark==''){ + // notify(`Please enter remark for ${window.VisibilityName} `,'LONG'); + // resolve(false);return; + // } + else{ + if(StoreCameraAllow && window.NoOfSplit>0 && WindowSplits.length>0 && (isImage1==1 || isImage2==1)) + { + for(const splitItemIndex in WindowSplits){ + const splitItem=WindowSplits[splitItemIndex]; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image2Name=splitItem['Image2Name']!=null && splitItem['Image2Name']!=''?splitItem['Image2Name']:''; + console.log('Image2Name',Image2Name,isImage2); + if(isImage1==1 && Image1Name==''){ + notify(`${ST.Pleaseclickallimagesfor} ${window.VisibilityName}`,'LONG'); + resolve(false);return; + } + else if(isImage2==1 && Image2Name==''){ + notify(`${ST.Pleaseclickallimagesfor} ${window.VisibilityName}`,'LONG'); + resolve(false);return; + } + } + } + + if(isStockReq==1){ + let isProductSelected=false; + for(const stockProdIndex in WindowStocks){ + const stockProd=WindowStocks[stockProdIndex]; + + let sd=WStocksData.find(i=> i.ProductId==stockProd.VisibilityStockValue) || {}; + let stock=sd.Stock!=null?sd.Stock:(sd.Stock==0?sd.Stock:''); + let isPVisPresent=sd.isPVisPresent!=null?sd.isPVisPresent:0; + + if(isPVisPresent==1){ + isProductSelected=true; + } + + if(isPVisPresent==1 && StockQtyRequired==1 && stock==''){ + notify(`${ST.Pleaseenterstockfor} ${window.VisibilityName} ( ${stockProd.ProductName} ) `,'LONG'); + resolve(false);return; + } + + if(stockProdIndex==WindowStocks.length-1){ + if(!isProductSelected){ + notify(`${ST.PleaseselectatleastoneSKUfor} ${window.VisibilityName} `,'LONG'); + resolve(false);return; + } + } + + } + } + + if(WindowQuestions.length>0){ + for(const qtnIndex in WindowQuestions){ + const qtn=WindowQuestions[qtnIndex]; + + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.VisibilityQuestionId+'_AnswerId'; + let ans_key=qtn.VisibilityQuestionId+'_Answer'; + let multi_key=qtn.VisibilityQuestionId+'_MultiOption'; + let date_key=qtn.VisibilityQuestionId+'_Date'; + let img_key=qtn.VisibilityQuestionId+'_ImagePath1'; + let imgname_key=qtn.VisibilityQuestionId+'_ImageName1'; + let rating_key=qtn.VisibilityQuestionId+'_Rating'; + let list_mcdata=[]; + + let isImgAllowed=(qtn.VQShowCamera=='true' || qtn.VQShowCamera==1); + let checkForAnsKey=(qtn.QuestionType=='Decimal' || qtn.QuestionType=='Number' || qtn.QuestionType=='Text' || qtn.QuestionType=='Date' || qtn.QuestionType=='Rating') ; + if(qtn.QuestionType=='Single choice list') + { + selansid=QD[id_key]; + } + else if(qtn.QuestionType=='Multi choice list') + { + selansid=QD[multi_key]!=null && QD[multi_key]!=''?QD[multi_key].split(','):[]; + } + + + if(qtn.QuestionType=='Multi choice list' && selansid.length<=0){ + notify(`${Pleaseselectoptionsfortherequiredfield} ${ST.In} ${window.VisibilityName}`,'SHORT'); + resolve(false);return; + } + else if( checkForAnsKey && (Object.keys(QD).indexOf(ans_key)<0 || (Object.keys(QD).indexOf(ans_key)>=0 && QD[ans_key]===''))){ + let msg=( qtn.QuestionType=='Date'?`${ST.Pleasepickadatefortherequiredfield} ${ST.In} ${window.VisibilityName}`:(qtn.QuestionType=='Rating'?`${Pleaseselectratingfortherequiredfield} ${ST.In} ${window.VisibilityName}`:`${ST.Pleasefillalltherequiredfield} ${ST.In} ${window.VisibilityName}`)); + notify(msg,'SHORT'); + resolve(false);return; + } + else if(Object.keys(QD).indexOf(id_key)<0 || (Object.keys(QD).indexOf(id_key)>=0 && (QD[id_key]==='' || (QD[id_key]===0 && qtn.isDisabled===false) ))){ + notify(`${ST.Pleasefillalltherequiredfield} ${ST.In} ${window.VisibilityName}`,'SHORT'); + resolve(false);return; + } + else if(isImgAllowed && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + notify(`${ST.Pleaseaddimages} ${ST.In} ${window.VisibilityName}`,'SHORT'); + resolve(false);return; + }else{ + console.log('no condition found'); + } + + if((qtn.QuestionType=='Single choice list' || qtn.QuestionType=='Multi choice list' )){ + if (qtn.Answers && qtn.Answers.length>0){ + for(var j=0;j=0)){ + showImageTag=true; + } + } + } + } + + if(showImageTag && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + notify(`${ST.Pleaseaddimages} ${ST.In} ${window.VisibilityName}`,'SHORT'); + resolve(false);return; + } + } + } + + } + } + else{ + if(isNAReasonEnable==true && ReasonId=='' ){ + notify(`${ST.Pleaseselectreasonfor} ${window.VisibilityName} `,'LONG'); + resolve(false);return; + } + else if(StoreCameraAllow && isNAImageAvl==true && NAImage1=='' ){ + notify(`${ST.Pleaseclickimagefor} ${window.VisibilityName}`,'LONG'); + resolve(false);return; + } + } + + if(wi==(Windows.length-1)){ + resolve(true);return; + } + + } + + }).then((val)=>{return val}) + .catch((err)=>{console.log(err); return false}); + + } + + + function onselectionChange(option,keyLbl,keyVal,otherData){ + let item=otherData.window; + let allData=WindowData; + let defData={'VisibilityId':item.VisibilityId,'VisibilityDefinitionId':item.VisibilityDefinitionId}; + const win_index=allData.findIndex(i=>i.VisibilityId==item.VisibilityId && i.VisibilityDefinitionId==item.VisibilityDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[keyVal]=option.value; + wind[keyLbl]=option.label; + + win_index>=0?allData[win_index]=wind:allData.push(wind); + console.log('allData:',allData); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onselectionChange2(option,qtn,window){ + let allData=WindowData; + let defData={'VisibilityId':window.VisibilityId,'VisibilityDefinitionId':window.VisibilityDefinitionId}; + const wind_index=allData.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let data=wind.WindowQA || {}; + let id_key=qtn.VisibilityQuestionId+'_AnswerId'; + let ans_key=qtn.VisibilityQuestionId+'_Answer'; + data[id_key]=option.value; + data[ans_key]=option.label; + + + wind['WindowQA']=data; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + + let aq_ans=qtn.Answers!=null?qtn.Answers:[]; + let ans_obj=aq_ans.find(i=>i.AnswerId==option.value) || {}; + let EQtns=ans_obj.VAQuestionEnable!=null && ans_obj.VAQuestionEnable!=''?ans_obj.VAQuestionEnable.replace(' ','').split(','):[]; + let DQtns=ans_obj.VAQuestionDisable!=null && ans_obj.VAQuestionDisable!=''?ans_obj.VAQuestionDisable.replace(' ','').split(','):[]; + + let sqtns=window.WindowQuestions || [] + + if(EQtns.length>0){ + enableQtns(sqtns,EQtns,DQtns,data,wind,wind_index,allData,window) + } + else if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data,wind,wind_index,allData,window) + } + else{ + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + } + + async function disableQtns(sqtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + + if(DQtns.length>0){ + new Promise.all( + DQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.VisibilityQuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=true + sqtns[s_qtnindex]=s_qtn; + let id_key=s_qtn.VisibilityQuestionId+'_AnswerId'; + let ans_key=s_qtn.VisibilityQuestionId+'_Answer'; + data[id_key]=0; + data[ans_key]=''; + + wind['WindowQA']=data; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + return false + }) + ).then(async (val)=>{ + + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.VisibilityDefinitionId==window.VisibilityDefinitionId && i.VisibilityId==window.VisibilityId) + if(windowIndex>0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindowData(allData); + setWindows(allwindows); + setGlobalWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + }) + } + } + + async function enableQtns(sqtns,EQtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + new Promise.all( + EQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.VisibilityQuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=false + sqtns[s_qtnindex]=s_qtn; + return false + }) + ).then(async (val)=>{ + if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data,wind,wind_index,allData,window) + } + else{ + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.VisibilityDefinitionId==window.VisibilityDefinitionId && i.VisibilityId==window.VisibilityId) + if(windowIndex>0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindows(allwindows); + setGlobalWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + } + }) + } + + async function setMultiSelectValue(selectedItems=[],qtn={},window={}) { + console.log('setMultiSelectValue',selectedItems); + let id_key=qtn.VisibilityQuestionId+'_AnswerId'; + let ans_key=qtn.VisibilityQuestionId+'_Answer'; + let multi_key=qtn.VisibilityQuestionId+'_MultiOption'; + + let allData=WindowData; + let defData={'VisibilityId':window.VisibilityId,'VisibilityDefinitionId':window.VisibilityDefinitionId}; + const wind_index=allData.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + obj[id_key]=0; + obj[multi_key]=selectedItems.join(','); + let anss=[]; + selectedItems.map((itemValue)=>{ + let ans = qtn.Answers.find(c1 => c1.AnswerId == itemValue); + if(ans.Answer){anss.push(ans.Answer)} + }); + obj[ans_key]=anss.join(','); + console.log('obj:',obj); + + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function setTextValue(value,qtn,window) { + let id_key=qtn.VisibilityQuestionId+'_AnswerId'; + let ans_key=qtn.VisibilityQuestionId+'_Answer'; + + let allData=WindowData; + let defData={'VisibilityId':window.VisibilityId,'VisibilityDefinitionId':window.VisibilityDefinitionId}; + const wind_index=allData.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + if(qtn.QuestionType=='Date' ){ + let date_key=qtn.VisibilityQuestionId+'_Date'; + let d=value!=null?new Date(value):new Date(); + let mfdate=moment(d).format('MM/YYYY'); + showQtnDatePicker(qtn,window,false); + obj[id_key]=0; + obj[ans_key]=mfdate; + obj[date_key]=moment(d).format('MM/DD/YYYY'); + } + else{ + obj[id_key]=0; + obj[ans_key]=value; + } + + console.log(value,obj); + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function showQtnDatePicker(qtn,window,show=false){ + let allQtns=window.WindowQuestions || []; + let newqtnIndex=allQtns.findIndex(q=>q.VisibilityQuestionId==qtn.VisibilityQuestionId); + + if(newqtnIndex>=0){ + let newqtn=allQtns[newqtnIndex]; + newqtn.showDatePicker=show; + allQtns[newqtnIndex]=newqtn; + window['WindowQuestions']=allQtns; + let allWindows=Windows; + const winIndex=allWindows.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId) || {}; + allWindows[winIndex]=window; + setWindows(allWindows); + setGlobalWindows(allwindows); + if(show==true) setrerenderdata(!rerenderdata); + } + } + + function setRatingValue(data){ + setRatingOrder(data); + } + + function onRatingCancel(){ + setShowRating(false); + } + + function onRatingSave(){ + setShowRating(false); + let qtn=RatingQtn; + let window=RatingWindow; + let id_key=qtn.VisibilityQuestionId+'_AnswerId'; + let ans_key=qtn.VisibilityQuestionId+'_Answer'; + let rating_key=qtn.VisibilityQuestionId+'_Rating'; + let ids=[],anss=[]; + RatingOrder.map((item,index)=>{ + ids.push(item.AnswerId); + anss.push(item.Answer); + }) + + let allData=WindowData; + let defData={'VisibilityId':window.VisibilityId,'VisibilityDefinitionId':window.VisibilityDefinitionId}; + const wind_index=allData.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + obj[rating_key]=ids.join(','); + obj[id_key]=0; + obj[ans_key]=anss.join(','); + + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function onChoiceSelect(item,val,key,animatedChoice){ + + var val1=0; + val==1?val1=1:''; + + if(animatedChoice!=null){ + Animated.timing(animatedChoice, { + toValue: val1, + duration:400, + useNativeDriver:false, + }).start(); + } + onWindowDataChange(item,val,key) + } + + function onWindowDataChange(item,val,key){ + let allData=WindowData; + let defData={'VisibilityId':item.VisibilityId,'VisibilityDefinitionId':item.VisibilityDefinitionId}; + const win_index=allData.findIndex(i=>i.VisibilityId==item.VisibilityId && i.VisibilityDefinitionId==item.VisibilityDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[key]=val; + + if(key=='ReasonId'){ + let rsn=reasons_list.find(r=>r.ReasonId==val) || {}; + wind['Reason']=rsn.Reason || ''; + } + + win_index>=0?allData[win_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + async function setWindowStockVal(val,window,stockProd,key,type=''){ + if(type=='numeric' && val!=''){ + const regex = new RegExp(/^\d+$/); + let isNUmeric=regex.test(val); + if(!isNUmeric){ + notify(ST.Pleaseenterwholenumbersonly,'SHORT'); + return; + } + } + + let allData=WindowData; + let defData={'VisibilityId':window.VisibilityId,'VisibilityDefinitionId':window.VisibilityDefinitionId}; + const win_index=allData.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + let sdIndex=WStocksData.findIndex(i=> i.ProductId==stockProd.VisibilityStockValue); + let sd=sdIndex>=0?WStocksData[sdIndex]:{'ProductId':stockProd.VisibilityStockValue,'Stock':''}; + sd[key]=val; + sdIndex>=0?WStocksData[sdIndex]=sd:WStocksData.push(sd); + wind['WStocksData']=WStocksData; + win_index>=0?allData[win_index]=wind:allData.push(wind); + if(key=='isPVisPresent'){ + let isAllChecked = await verifyAllChecked(val,window,stockProd,key); + wind['isAllSKUChecked']=isAllChecked; + } + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata4(!rerenderdata4); + } + + async function onCatTextChange(window,key,val){ + let item=window; + let allData=WindowData; + let defData={'VisibilityId':item.VisibilityId,'VisibilityDefinitionId':item.VisibilityDefinitionId}; + const win_index=allData.findIndex(i=>i.VisibilityId==item.VisibilityId && i.VisibilityDefinitionId==item.VisibilityDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[key]=val; + + win_index>=0?allData[win_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + async function verifyAllChecked(val,window,stockProd,key){ + return await new Promise((resolve,reject)=>{ + let WindowStocks=window.WindowStocks || []; + let allData=WindowData; + const win_index=allData.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + if(WindowStocks.length>0){ + let isAllChecked=1; + for(var i=0;i a.ProductId==stockProd.VisibilityStockValue); + let sd1=sdIndex1>=0?WStocksData[sdIndex1]:{}; + let isPVisPresent=sd1.isPVisPresent; + if(isPVisPresent==null || isPVisPresent=='' || isPVisPresent==0 || isPVisPresent=='0'){ + isAllChecked=0 + } + + if(i==WindowStocks.length-1){ + resolve(isAllChecked); + } + } + } + else{ + resolve(0); + } + + }).catch((err)=>{ + console.log(err); + return 0; + }); + } + + function checkAllSKUs(val,window){ + + let WindowStocks=window.WindowStocks || []; + let allData=WindowData; + let defData={'VisibilityId':window.VisibilityId,'VisibilityDefinitionId':window.VisibilityDefinitionId}; + const win_index=allData.findIndex(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + console.log('WStocksData before:',WStocksData) + for(var i=0;i a.ProductId==stockProd.VisibilityStockValue); + let sd=sdIndex>=0?WStocksData[sdIndex]:{'ProductId':stockProd.VisibilityStockValue,'Stock':''}; + let isPVisPresent=(val==1 || val=='1')?1:0; + sd['isPVisPresent']=isPVisPresent; + + sdIndex>=0?(WStocksData[sdIndex]=sd):(WStocksData.push(sd)); + } + + + wind['WStocksData']=WStocksData; + wind['isAllSKUChecked']=val==1?1:0; + console.log('wind updated'); + win_index>=0?allData[win_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onSaveCancel(){ + setShowAlert(false); + } + + + + function openImageRefView(RefImage=''){ + setShow_zoomImage(true); + } + + function FilterStores(searchedQry){ + searchedQry=searchedQry.toLowerCase(); + console.log('searchedQry',searchedQry); + let arr=[]; + let newWindows=[]; + if(searchedQry!=null && searchedQry!=''){ + + for(let i=0;i + + {ST.DragItemsInOrder} + {ST.Pressandholdtodrag} + {setRatingValue(data)}} + keyExtractor={(item) => item.AnswerId} + renderItem={renderItem} + /> + + {onRatingCancel()}}> + {ST.Cancel} + + {onRatingSave()}}> + {ST.Save} + + + + + ) + } + + function render_Picker(label_key,value_key,onChange=()=>{},selected_data={}){ + var data=[]; + let qtn=selected_data.qtn || {}; + let window=selected_data.window || {}; + let isQtnDisabled=qtn.isDisabled!=null || qtn.isDisabled!=''?false:true; + let allAnswers=qtn.Answers || []; + + allAnswers.map((item,index)=>{ + let obj={ key: index, label: item[label_key],value:item[value_key] }; + if(selected_data.value==item[label_key]) + obj['component']= {item[label_key]}; + data.push(obj); + }); + + return ( + {onChange(option,qtn,window) }} + overlayStyle={customStyle.addVisPickerOverlay} + cancelContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + optionStyle={customStyle.addvis_opStyle} + optionTextStyle={customStyle.addvis_opTextStyle} + optionContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + selectedKey={'1'} + disabled={isQtnDisabled} + > + {(selected_data.value!=null && selected_data.value!=''?selected_data.value: '-'+ST.select+'-')} + + ) + } + + function renderDatePicker(qtn,window){ + let qtnn=qtn; + let DateRange=qtn.DateRange; + let maxDate=moment().add(10,'years').format('MM/DD/YYYY'); + let minDate=moment().subtract(10,'years').format('MM/DD/YYYY'); + if(DateRange=='RFD'){ + maxDate=moment().format('MM/DD/YYYY'); + } + else if(DateRange=='RPD'){ + minDate=moment().format('MM/DD/YYYY'); + } + + return ( + {setTextValue(selectedDate,qtnn,window)}} + maximumDate={new Date(maxDate)} + minimumDate={new Date(minDate)} + /> + ); + } + + function _renderWindow(){ + let RemarkEnableIndex=KPIFields.findIndex(i=>i.KPIFieldName=='RemarkEnable') + let RemarkEnableKPIObj=RemarkEnableIndex>=0?KPIFields[RemarkEnableIndex]:{}; + let RemarkEnable=RemarkEnableIndex>=0?RemarkEnableKPIObj['KPIFieldEnable']:false; + + return ( + `window_${index.toString()}`} + renderItem={({item,index})=>{ + const window=item; + + let isImage1=window.VisibilityImage1=='true' || window.VisibilityImage1==1?1:0; + let isImage2=window.VisibilityImage2=='true' || window.VisibilityImage2==1?1:0; + let isNAImageAvl=window.VisibilityNotExistCamera=='true' || window.VisibilityNotExistCamera==1?1:0; + let isNAReasonEnable=window.VisibilityNotExistReasonEnable=='true' || window.VisibilityNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.VisibilityExistReasonEnable=='true' || window.VisibilityExistReasonEnable==1? 1:0; + let isStockReq=window.VisibilityElementStockRequired=='true' || window.VisibilityElementStockRequired==1?1:0; + let StockQtyRequired=window.StockQtyRequired=='true' || window.StockQtyRequired==1?1:0; + let PromoTitleEnable=window.PromoDefinitionTitleEnable=='true' || window.PromoDefinitionTitleEnable==1? 1:0; + let PromoTitle=window.PromoDefinitionTitle!=null && window.PromoDefinitionTitle!='undefined'? window.PromoDefinitionTitle:""; + + // let isStock_CheckAssrt=window.VisibilityElementCheckAssortment=='true' || window.VisibilityElementCheckAssortment==1?1:0; + let RefImage=window.VisibilityRefImage; + let camera1Label=window.VisibilityImage1Lable || ''; + let camera2Label=window.VisibilityImage2Lable || ''; + let WindowQuestions=window.WindowQuestions || []; + let WindowStocks=window.WindowStocks || []; + + + const wind=WindowData.find(i=>i.VisibilityId==window.VisibilityId && i.VisibilityDefinitionId==window.VisibilityDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let remark=wind.remark!=null?wind.remark:''; + let WindowSplits=wind.WindowSplits || []; + let QuestionsData=wind.WindowQA || {}; + let WStocksData=wind.WStocksData || []; + let isAllSKUChecked=wind.isAllSKUChecked==1 || wind.isAllSKUChecked=="1"; + + // console.log('camera2Label:',window.VisibilityId,window.VisibilityDefinitionId,camera2Label); + + + var xpos=isPresent=='1'?-75:0; + if(window.animatedChoice!=null ){ + xpos=window.animatedChoice.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + + return( + + + + {window.VisibilityName} + {(PromoTitleEnable==1 && PromoTitle!=null && PromoTitle!='') && {PromoTitle}} + {openImageRefView(RefImage)}}> + + + + + + + + + {ST.IsPresent} + + + + {onChoiceSelect(window,1,'isPresent',window.animatedChoice)}}> + {ST.Yes} + + {onChoiceSelect(window,0,'isPresent',window.animatedChoice)}}> + {ST.No} + + + + + {((isPresent!='1' && isNAReasonEnable==true) || (isPresent=='1' && isReasonEnable==true)) && + + {ST.SelectReason} + {} + + } + + + {(isPresent!='1' && isNAImageAvl==true) && + + + + {ST.CaptureImage} + + + + + + { (NAImage1Path=='' || NAImage1Path==null) && + {openCamera(window,{},0,'1','3')}}> + + + } + { (NAImage1Path!='' && NAImage1Path!=null) && + + + {openCamera(window,{},0,'1','3')}}> + + + + } + + + + + + } + + + + {(isPresent=='1') && + + + {(isStockReq==true && WindowStocks.length>0) && + + + {ST.SelectProducts} + + + + {checkAllSKUs((isAllSKUChecked==1?0:1),window)}}> + {let val1=(val==true)?1:0; checkAllSKUs(val1,window) }} + style={[customStyle.WStkHdr_checkbox,(Platform.OS=='ios'?{height:20,width:20,marginLeft:5}:{})]} + tintColors={{ true:PageTheme.$primary_color, false:PageTheme.$text_color_light }} + /> + {ST.SelectAll} + + + `wstock_${index.toString()}`} + renderItem={({item,index})=>{ + let stockProd=item; + let stockProdIndex=index; + let sd=WStocksData.find(i=> i.ProductId==stockProd.VisibilityStockValue) || {}; + let stock=sd.Stock!=null?sd.Stock:''; + let isPVisPresent=sd.isPVisPresent!=null?sd.isPVisPresent:0; + + return( + + {/* {stockProd.ProductName} */} + + + {let val1=(val==true)?1:0; setWindowStockVal(val1,window,stockProd,'isPVisPresent') }} + style={[customStyle.WStkHdr_checkbox,(Platform.OS=='ios'?{height:20,width:20,marginTop:5,marginLeft:5,}:{})]} + tintColors={{ true:PageTheme.$primary_color, false:PageTheme.$text_color_light }} + /> + + {stockProd.ProductName} + + {StockQtyRequired==1 && isPVisPresent==1 && + + + + Stock + + + + {setWindowStockVal(val,window,stockProd,'Stock','numeric')}} + autoComplete='off' + /> + + + + } + + ); + }} + /> + + } + {( window.NoOfSplit>0 && WindowSplits.length>0 && (isImage1==1 || isImage2==1)) && + + + {'Paid Visibility Images'} + + `spliItem_${index.toString()}`} + renderItem={({item,index})=>{ + let splitItem=item; + let splitItemIndex=index; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image2Name=splitItem['Image2Name']!=null && splitItem['Image2Name']!=''?splitItem['Image2Name']:''; + let Image1=splitItem['Image1']!=null && splitItem['Image1']!=''?splitItem['Image1']:''; + let Image2=splitItem['Image2']!=null && splitItem['Image2']!=''?splitItem['Image2']:''; + + return( + + {isImage1==1 && + + { (Image1=='' || Image1==null) && + {openCamera(window,splitItem,splitItemIndex,'1')}}> + + + } + { (Image1!='' && Image1!=null) && + + + {openCamera(window,splitItem,splitItemIndex,'1')}}> + + + + } + {camera1Label} + + } + {isImage2==1 && + + { (Image2=='' || Image2==null) && + {openCamera(window,splitItem,splitItemIndex,'2')}}> + + + } + { (Image2!='' && Image2!=null) && + + + {openCamera(window,splitItem,splitItemIndex,'2')}}> + + + + } + {console.log('camera2Label 2:',camera2Label)} + {camera2Label} + + } + + ); + }} + /> + + } + + {(WindowQuestions.length>0) && + + + {'Paid Visibility Questions'} + + {WindowQuestions.map((item,index)=>{ + + let qtn=item; + let qtnIndex=index; + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.VisibilityQuestionId+'_AnswerId'; + let ans_key=qtn.VisibilityQuestionId+'_Answer'; + let multi_key=qtn.VisibilityQuestionId+'_MultiOption'; + let date_key=qtn.VisibilityQuestionId+'_Date'; + let img_key=qtn.VisibilityQuestionId+'_ImagePath1'; + let imgname_key=qtn.VisibilityQuestionId+'_ImageName1'; + let rating_key=qtn.VisibilityQuestionId+'_Rating'; + + let list_mcdata=[]; + + if(qtn.QuestionType=='Single choice list') + { + selansid=QuestionsData[id_key]!=null ?QuestionsData[id_key] :''; + selanswer=QuestionsData[ans_key]!=null ?QuestionsData[ans_key] :''; + } + else if(qtn.QuestionType=='Multi choice list') + { + if(qtn.Answers!=null){ + for(var i=0;i0){ + // let arr=[]; + // for(var i=0;i0){ + for(var i=0;i=0)){ + showImageTag=true; + } + + } + } + } + + if(showImageTag){ + selimg=QuestionsData[img_key]!=null && QuestionsData[img_key]!=''?'file://'+QuestionsData[img_key]:''; + } + + return( + + {qtn.VisibilityQuestionName} + {qtn.QuestionType=='Single choice list' && qtn.Answers && + render_Picker('Answer','AnswerId',onselectionChange2,{value:selanswer,qtn:qtn,window:window}) + } + {qtn.QuestionType=='Multi choice list' && qtn.Answers && + { setMultiSelectValue(selectedItems,qtn,window) }} //setMultiSelectValue(selectedItems,qtn) + selectedItems={selansid} + selectText="Pick Items" + searchInputPlaceholderText={ST.SearchItems+"..."} + // onChangeInput={ (text)=> console.log(text)} + tagRemoveIconColor={PrimaryTheme.$primary_color} + tagBorderColor={PrimaryTheme.$primary_color} + tagTextColor={PrimaryTheme.$primary_color} + selectedItemTextColor={PrimaryTheme.$primary_color} + selectedItemIconColor={PrimaryTheme.$primary_color} + itemTextColor={PrimaryTheme.$text_color} + displayKey="Answer" + searchInputStyle={{ color: '#CCC' }} + submitButtonColor={PrimaryTheme.$primary_color} + submitButtonText={ST.Submit} + /> + } + { (qtn.QuestionType=='Number' || qtn.QuestionType=='Decimal' || qtn.QuestionType=='Text') && + {setTextValue(val,qtn,window)}} + autoComplete='off' + /> + } + { + (qtn.QuestionType=='Date') && + + {selansid!=''?selansid:'MM/YYYY'} + {setDateValue(selanswer);showQtnDatePicker(qtn,window,true)}}> + + + + } + { ((qtn.showDatePicker==true || qtn.showDatePicker=='true') && (qtn.QuestionType=='Date') ) && + renderDatePicker(qtn,window) + } + { + (qtn.QuestionType=='Rating') && + + {selanswer} + {setRatingQtn(qtn);setRatingWindow(window);setShowRating(true);}}> + + + + } + + { + // (qtn.QuestionType=='Audio') && + // + // {selanswer} + // {show_recorder(qtn);}}> + // + // + // + } + + { + showImageTag && + + + {openCamera(window,{},0,'1','2',qtn)}}> + + + + } + + + + ) + })} + + } + { RemarkEnable==true && + + {ST.Remark} + {onCatTextChange(window,'remark',val)}} + autoComplete='off' + /> + + } + + + } + + + + + + + ); + }} + /> + ) + } + + function _renderHeader(currentIndex){ + return( + + {/* {`${(currentIndex+1)}/${zoomImageUrl.length}`} */} + {console.log('tsth');setShow_zoomImage(false) }}> + + + + ) + } + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + + {setSearchedItem(val); FilterStores(val)}} + autoComplete='off' + /> + {FilterStores(searchedItem)}}> + + + + { Object.keys(storeData).length>0 && + + {_renderWindow()} + + } + + {onSubmitData()}}/> + + + + + { showRating==true && + renderRatingView() + } + {show_zoomImage && + + null} + /> + + } + + ); +} + + +export default connect(mapStateToProps, mapDispatchToProps)(PaidVisibilityOneApp); \ No newline at end of file diff --git a/src/screens/PeopleDetail.js b/src/screens/PeopleDetail.js new file mode 100644 index 0000000..be277e3 --- /dev/null +++ b/src/screens/PeopleDetail.js @@ -0,0 +1,690 @@ +import React, { useState, useEffect, memo, useRef, useCallback, useMemo } from 'react'; +import { useRoute } from '@react-navigation/native'; +import { View, Text, TouchableOpacity, Image, FlatList, Platform, ScrollView,Modal, TextInput, StyleSheet } from 'react-native'; +import { connect } from 'react-redux'; +import moment from 'moment'; +import Container from '../components/container'; +import CustomLoader from '../components/CustomLoader'; +import CustomHeader from '../components/customHeader'; +import NoDataComponent from '../components/NoDataComponent'; +import LinearGradient from 'react-native-linear-gradient'; +import { notify } from '../components/notify'; +import { globalStyles, customStyles, GetPageTheme, WP} from "../styles/Global"; +import { mapDispatchToProps, mapStateToProps } from '../reducers/contextProvider'; +import { db } from '../constants/constants'; +import {AntDesign, MaterialCommunityIcons, Feather} from '../components/icons'; +import { get_item } from '../components/localStorage'; +import { getMethodName, METHODS } from '../constants/methodNames'; +import { getDownloadJson1 ,get_rowColSettings} from '../controller/functions'; +import { ProgressChart } from 'react-native-chart-kit'; +import cross_icon from '../assets/icons/crossmodal.svg'; +import { SvgXml } from 'react-native-svg'; + +const PeopleDetail = (props) => { + const route = useRoute(); + const { DarkMode, baseurl, StaticText: ST = {} } = props; + const PageTheme = GetPageTheme(DarkMode, route.name); + const customStyle = customStyles(DarkMode, route.name); + const globalStyle=globalStyles(props.DarkMode,route.name); + + + const timerRef = useRef(null); + + const [processing, setProcessing] = useState(false); + const [isDataFound, setisDataFound] = useState(false); + const [AllReports, setAllReports] = useState([]); + const [loaderTitle, setLoaderTitle] = useState(); + const [peoplesarray, setPeoplesArray] = useState([]); + const [uniquetabD, setUniqueTabD] = useState([]); + const [activeTab, setActiveTab] = useState(0); + const [empdata , setEmpData] = useState({}); + + const [modaldata, setModalData] = useState({colname: '', colValue:'', 'row':{}, item :{}}); + + // modal + const [modalVisible, setModalVisible] = useState(false); + const toggleModal = (colname, colValue, row , item) => { + setModalVisible(!modalVisible); + setModalData({colname:colname , colValue: colValue, row:row, item : item}) + }; + + + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let reportdata = params?.Reportdata ; + let peopledata = params?.peopledata; + console.log("peopledata",peopledata?.NAME) + let EmpId = peopledata?.EmpId ; + setEmpData(peopledata); + getData(EmpId ,reportdata); + + }, [activeTab]); + + + // get data of particular persion based on emdId + async function getPeopleDetailData(EmpId, reportdata ,peoplearray , UniqueTabD) { + + try { + let allData = await DownloadReport(EmpId,reportdata,peoplearray , UniqueTabD); + + if (allData.length > 0) { + + let allCols = []; + let columnWidth = '50%'; + let keylen = Object.keys(allData[0] || {}).length; + for (let row of allData) { + let i = 0; + for (let key in row) { + if (i < keylen) { + let obj = { 'actual_colname': key }; + + + let colname = key.replace(/[$$]/g, ' ').replace(/Percent/g, '%'); + obj['colname'] = colname; + + + let dontShowCol = ( + colname === 'Srno' || + colname === 'AdKPIId' || + colname === 'Color' || + colname === 'DisplayOrder' || + colname === 'KPIDrilldown' + ); + + // Add unique columns to display + if (!dontShowCol && !allCols.some(col => col.actual_colname === key)) { + allCols.push(obj); + } + } + i++; + } + } + + + if (allCols.length > 0) { + let colLen = allCols.length; + columnWidth = (94 / colLen) + '%'; + } + + + let defData = { + "success": true, + "data": { + "report_data": allData, + "report_colWidth": columnWidth, + "report_cols": allCols + } + }; + + // console.log("defData?.data",defData?.data) + setAllReports(defData?.data); + setProcessing(false); + setisDataFound(true); + } else { + // notify(ST.Nodatafound); + setAllReports([]); + setProcessing(false); + setisDataFound(false); + } + } catch (err) { + console.error('Error fetching data:', err); + setAllReports([]); + setProcessing(false); + setisDataFound(false); + }} + + + async function DownloadReport(EmpId, reportdata,peoplearray, UniqueTabD){ + + let downloadKey = UniqueTabD[0]?.DownloadKey; + + // console.log("downloadKey--->>>", downloadKey ,"--unique tabbb --",UniqueTabD) + + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url=props.baseurl+getMethodName(METHODS.DOWNLOADJSON_METHOD); + let data={ + Downloadtype:downloadKey ? downloadKey : 'Sup_Dashboard_PeopleBrandwiseFTM', + Username: loginDetails.UserId, + Param1: EmpId, + Param2: '', + }; + + console.log(url,data); + return await getDownloadJson1(url,data) + .then(async(res)=>{ + if (res[downloadKey]) { + let data_arr = res[downloadKey] || []; + return data_arr; + } + else{ + return []; + } + }) + .catch((err)=>{ + console.log('onPage Team error',err); + return []; + }); + } + + + //end + + + // tabs + + const peopleScreenTabs = peoplesarray?.filter(item => item?.DashboardSection == "PeopleDetailScreen")?.map(item => item?.TabName)?.filter(tabName => tabName); + + + const uniqueTabs = [...new Set(peopleScreenTabs)]; + + const tabs = uniqueTabs.map((tabName) => ({ + title: tabName, + // content: '' , + })); + + const [filteredUniqueTabD, setFilteredUniqueTabD] = useState([]); + + useEffect(() => { + if (peoplesarray.length > 0) { + const filtered = peoplesarray.filter((item) => + item?.TabName?.includes(tabs[activeTab]?.title) + ); + setFilteredUniqueTabD(filtered); + + let params=props.route.params? props.route.params:{}; + let reportdata = params?.Reportdata ; + let peopledata = params?.peopledata; + let EmpId = peopledata?.EmpId ; + + if (filtered.length > 0) { + getPeopleDetailData(EmpId, reportdata, peoplesarray,filtered); + } + } + }, [peoplesarray, activeTab]) + + + async function getData(EmpId ,reportdata){ + let {DashboardId,DashboardName,ParentId}= reportdata[0] ; + setProcessing(true); + console.log("getData called-->") + + try { + + db.transaction(async function (txn) { + // get data for report + let q=`Select * from Sup_MenuAppDashboard where ParentId='${DashboardId}' order by DisplayOrder`; + console.log("people Detailed reports q:",q); + txn.executeSql(q,[],async function (txn2, txnres2) { + console.log("Detailed reports count:",txnres2.rows.length); + if(txnres2.rows.length>0){ + + let arr=[]; + for(var i=0;i 0) { + + filteredUniqueTabD = peoplesarray?.filter((item) => item?.TabName?.includes(tabs[activeTab]?.title)); + // console.log("after-",filteredUniqueTabD); + // if (filteredUniqueTabD.length > 0) { + // getPeopleDetailData(EmpId , reportdata , arr , filteredUniqueTabD); + // } + } + + } + } + }else{ + setisDataFound(false); + setPeoplesArray([]); + setProcessing(false); + } + },function (txnE,txnerr) { console.log(txnerr); setPeoplesArray([]); setProcessing(false);},); + + }); + + + } catch (err) { + setProcessing(false); + console.log(err); + } + } + + const filteredData = peoplesarray?.filter((item) => item?.TabName?.includes(tabs[activeTab]?.title)); + + // renderitems + + function _renderTabularReport(item){ + + let reportContentObj= AllReports ; + + // {"report_data":data_arr,"report_colWidth":columnWidth,"report_cols":allCols} + let report_data=reportContentObj['report_data']!=null?reportContentObj['report_data']:[]; + let report_colWidth=reportContentObj['report_colWidth']!=null?reportContentObj['report_colWidth']:'50%'; + let report_cols=reportContentObj['report_cols']!=null?reportContentObj['report_cols']:[]; + // console.log("report_cols:",report_cols); + + return ( + + {/* render No data */} + {report_data.length<=0 && No Data} + {report_data.length>0 && + {/* render columns */} + + {/* render header */} + + {report_cols.map((column,index)=>{ + return( + + {column.colname} + + ) + })} + + {/* render content */} + + + {report_data.map((row,row_index)=>{ + + return( + {props.navigation.navigate("PeopleDrilldown",{"ReportData":row,"empdata":empdata,"AdKPIId":row["AdKPIId"] , "data" : filteredData})}} + > + + {report_cols.map((column,index)=>{ + let colValue=row[column.actual_colname]!=null?row[column.actual_colname]:''; + + let color_obj=get_rowColSettings(colValue,column.actual_colname,row); + + let cust_style={},bg_style={}; + if(color_obj.color!=null && color_obj.color!=''){ + bg_style["backgroundColor"]=color_obj.color; + cust_style["color"]='#fff' + } + if(color_obj.fontsize!=null && color_obj.fontsize!=''){ + cust_style["fontSize"]=color_obj.fontsize + } + if(color_obj.bold==1){ + cust_style["fontWeight"]="600" + } + + return( + toggleModal(column.colname,colValue, row , item)} + onPress={()=>{props.navigation.navigate("PeopleDrilldown",{"ReportData":row,"empdata":empdata,"AdKPIId":row["AdKPIId"] , "data" : filteredData})}} + > + {colValue} + + ) + })} + + ) + })} + + + + + } + + ) + } + + + function _renderCardReport(item,index){ + + let reportContentObj= AllReports ; + let report_data=reportContentObj['report_data']!=null?reportContentObj['report_data']:[]; + let report_colWidth=reportContentObj['report_colWidth']!=null?reportContentObj['report_colWidth']:'50%'; + let report_cols=reportContentObj['report_cols']!=null?reportContentObj['report_cols']:[]; + let ShowGraph = item?.ShowGraph; + // console.log("report_cols:",report_cols); + + // render item + const renderItemcardNew = (item, index, ShowGraph,isLastItem, isOdd) => { + let gset_obj = item["Color"] != null && item["Color"] !== '' ? item["Color"] : {}; + + console.log("item_obj carddd",item); + const chartConfig = { + backgroundGradientFrom: "#fff", + backgroundGradientTo: "#fff", + color: (opacity = 1, dataIndex) => { + // If there's a color available for the current dataIndex, use it, else set it transparent + const color = gset_obj; // Get the color based on index + return color ? `${color}${Math?.floor(opacity * 255)?.toString(16)?.padStart(2, '0')}` : `rgba(255, 255, 255, 0)`; + }, + strokeWidth: 2, + barPercentage: 0.5, + useShadowColorFromDataset: false , + }; + + let label=[]; + let labelVal=[]; + let barColor=[]; + + label.push(item?.KPI); + let percentage = item?.PER?.replace('%', ''); + + if(percentage > 100) { + labelVal.push(parseFloat(100) / 100); + } else { + labelVal.push(parseFloat(item?.PER) / 100); + } + + barColor.push(() => item?.Color); + + let showgraph = ShowGraph ? ShowGraph : false; + // let itemStyle = isOdd && isLastItem ? { flex: 0, marginLeft: 'auto', marginRight: 'auto', width: '95%' } : { flex: 0}; + + return( + { + props.navigation.navigate("PeopleDrilldown", { + "ReportData": item, + "AdKPIId": item["AdKPIId"], + "empdata": empdata, + "data" : filteredData + }); + }} + > + + + + {item?.KPI != null && item?.KPI != undefined && {item?.KPI}} + {item.KPIDrilldown && } + + + {item?.TGT != null && item?.TGT != undefined && + + Target: + {item?.TGT} + + } + + {item?.ACT != null && item?.ACT != undefined && ( + !showgraph ? ( + + + {item?.ACT} + Achievement + + + {item?.PER} + + + ) : ( + + + {item?.ACT} + Achievement + + + + + {item?.PER} + + + + ) + )} + + + + + ) + } + + return ( + + {report_data.length > 0 ? ( + + + renderItemcardNew(item, index, ShowGraph, index === report_data.length - 1, report_data.length % 2 !== 0) + } + ItemSeparatorComponent={} + keyExtractor={(item, index) => index.toString()} + numColumns={2} + columnWrapperStyle={{ justifyContent: 'space-between' }} + contentContainerStyle={{ marginHorizontal: 0 }} + /> + + ) : ( + + No Data + + )} + + + ) + } + + const renderItem = ( item, index) => { + + return ( + + + {/*{item.DashboardName}*/} + {empdata.NAME} + + {/* Render custom view for Attendance reports */} + {item.DashboardType === 'Card' && _renderCardReport(item,index)} + + {item.DashboardType === 'Tabular' && _renderTabularReport(item,index)} + + + + + ); + }; + + const excludeKeys = ['AdKPIId', 'Color', 'KPIDrilldown', 'DisplayOrder']; + + return ( + + {processing && } + + + {<> + + + {!props.isDataDownloaded && } + + + + {/* Custom Tab Bar */} + + {tabs.map((tab, index) => ( + setActiveTab(index)} + > + + {tab.title} + + + ))} + + + {/* Screen Content */} + + renderItem(item, index, filteredData)} + keyExtractor={(item, index) => index.toString()} + contentContainerStyle={{ paddingBottom: 0 }} + /> + + + + { + Alert.alert('Modal has been closed.'); + setModalVisible(!modalVisible); + }}> + + + + + setModalVisible(false)}> + {modaldata?.item.DashboardName+' Detail'} + + + + + {Object.entries(modaldata?.row) + .filter(([key]) => !excludeKeys.includes(key)) // Filter out excluded keys + .map(([key, value]) => ( + + {key}: + {value.toString()} + + ))} + + + + + + + + + + + + + } + + + ); +}; + +export default connect(mapStateToProps, mapDispatchToProps)(PeopleDetail); + + +const styles = StyleSheet.create({ + container: { + // backgroundColor: '#F5F5F5', + }, + tabBar: { + flexDirection: 'row', + justifyContent: 'space-around', + backgroundColor: '#b1e4de', + paddingVertical:10 + }, + tabButton: { + paddingHorizontal: 30, + paddingVertical:10, + + }, + tabText: { + fontSize: 16, + color: '#000', + }, + activeTab: { + borderWidth: 2, + borderColor: '#00968e', + borderRadius : 5, + backgroundColor: '#00968e', + + }, + activeTabText: { + color: '#FFF', + }, + inActiveTab: { + borderWidth: 2, + borderColor: '#00968e', + borderRadius : 5, + backgroundColor: 'transparent' + }, + inActiveTabText: { + color: '#000', + }, + //KPI's + + listContainer: { + paddingHorizontal: 20, + paddingVertical: 10, + }, + itemContainer: { + borderBottomWidth: 1, + borderBottomColor: '#ccc', + paddingVertical: 15, + }, + row: { + flexDirection: 'row', + justifyContent: 'space-between', + }, + kpiTitle: { + fontWeight: 'bold', + fontSize: 16, + flex: 1, + }, + value: { + fontSize: 16, + flex: 0.5, + textAlign: 'right', + }, + //header + headerContainer: { + borderBottomWidth: 2, + borderBottomColor: '#000', + paddingVertical: 10, + }, + headerText: { + fontWeight: 'bold', + fontSize: 16, + flex: 1, + textAlign: 'center', + }, + chartContainer: { + position: 'relative', + alignItems: 'center', + marginTop:10 + }, + percentageContainer: { + position: 'absolute', + top: '50%', + left: '50%', + transform: [{ translateX: -18 }, { translateY: -12 }], + }, +}); diff --git a/src/screens/PeopleDrilldown.js b/src/screens/PeopleDrilldown.js new file mode 100644 index 0000000..3cad325 --- /dev/null +++ b/src/screens/PeopleDrilldown.js @@ -0,0 +1,361 @@ + +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme, WP } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Modal, StyleSheet, Pressable} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,DownloadData, getDownloadJson1, get_rowColSettings} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl, db} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign, MaterialCommunityIcons} from '../components/icons'; +import { WebView } from 'react-native-webview'; +import CustomLoader from '../components/CustomLoader'; +import NoDataComponent from '../components/NoDataComponent'; +import LinearGradient from 'react-native-linear-gradient'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; +import cross_icon from '../assets/icons/crossmodal.svg'; +import { SvgXml } from 'react-native-svg'; + + +function PeopleDrilldown(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + + const [processing, setProcessing] = useState(true); + const [isDataFound, setisDataFound] = useState(false); + const [AllReports, setAllReports] = useState([]); + const [aggrData, setAggrData] = useState({}); + const [cols, setcols] = useState([]); + const [colWidth, setColWidth] = useState('100%'); + const [currentReportMenu, setCurrentReportMenu] = useState({}); + const [KPIId, setKPIId] = useState(""); + const [modaldata, setModalData] = useState({colname: '', colValue:'', 'row':{}}); + + + // modal + const [modalVisible, setModalVisible] = useState(false); + const toggleModal = (colname, colValue, row) => { + setModalVisible(!modalVisible); + setModalData({colname:colname , colValue: colValue, row:row}) + }; + + const [designation, setDesignation] = useState(''); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let ReportMenu=params.ReportData || {}; + let AdKPIId=params.AdKPIId || ""; + let data = params?.data || []; + let empdata = params?.empdata || {}; + + // console.log("ReportMenu",ReportMenu ,"AdKPIId",AdKPIId , "data------ ", data[0] , "empdata--",empdata) + setCurrentReportMenu(ReportMenu); + setKPIId(AdKPIId); + getData(AdKPIId ,data, empdata); + + }, []); + + async function getData(AdKPIId ,data,empdata){ + setProcessing(true); + + try { + let {DashboardId,DashboardName,ParentId}=data[0] ; + db.transaction(async function (txn) { + // get data for report + let q=`Select * from Sup_MenuAppDashboard where ParentId='${DashboardId}' `; + console.log("people brandwise reports q:",q); + txn.executeSql(q,[],async function (txn2, txnres2) { + console.log("people brandwise reports count:",txnres2.rows.length); + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i 0) { + + let allCols = []; + let columnWidth = '50%'; + let keylen = Object.keys(allData[0] || {}).length; + for (let row of allData) { + let i = 0; + for (let key in row) { + if (i < keylen) { + let obj = { 'actual_colname': key }; + + + let colname = key.replace(/[$$]/g, ' ').replace(/Percent/g, '%'); + obj['colname'] = colname; + + + let dontShowCol = ( + colname === 'Srno' || + colname === 'AdKPIId' || + colname === 'Color' || + colname === 'DisplayOrder' || + colname === 'KPIDrilldown' + ); + + // Add unique columns to display + if (!dontShowCol && !allCols.some(col => col.actual_colname === key)) { + allCols.push(obj); + } + } + i++; + } + } + + + if (allCols.length > 0) { + let colLen = allCols.length; + columnWidth = (94 / colLen) + '%'; + } + + + let defData = { + "success": true, + "data": { + "report_data": allData, + "report_colWidth": columnWidth, + "report_cols": allCols + } + }; + + + setAllReports(defData?.data); + setProcessing(false); + setisDataFound(true); + } else { + notify(ST.Nodatafound); + setAllReports([]); + setProcessing(false); + setisDataFound(false); + } + } catch (err) { + console.error('Error fetching data:', err); + setAllReports([]); + setProcessing(false); + setisDataFound(false); + }} + + + async function DownloadReport(AdKPIId, data1, empdata){ + + let downloadKey = data1[0]?.DownloadKey; + + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url=props.baseurl+getMethodName(METHODS.DOWNLOADJSON_METHOD); + let data={ + Downloadtype:downloadKey, + Username: loginDetails.UserId, + Param1: AdKPIId, + Param2: empdata?.EmpId, + }; + + console.log(url,data); + return await getDownloadJson1(url,data) + .then(async(res)=>{ + if (res[downloadKey]) { + let data_arr = res[downloadKey] || []; + return data_arr; + } + else{ + return []; + } + }) + .catch((err)=>{ + console.log('onPage Team error',err); + return []; + }); + } + + + //end + + + function _renderTabularReport(){ + + let filtered_data=AllReports?.report_data?.length>0?AllReports?.report_data.filter(i=>i.AdKPIId==KPIId):[]; + + return ( + + + {/* render columns */} + + {/* render header */} + + {AllReports?.report_cols?.map((column,index)=>{ + return( + + {column.colname} + + ) + })} + + {/* render content */} + + + {filtered_data.map((row,row_index)=>{ + + return( + + {AllReports?.report_cols.map((column,index)=>{ + let colValue=row[column.actual_colname]!=null?row[column.actual_colname]:''; + + let color_obj=get_rowColSettings(colValue,column.actual_colname,row); + + let cust_style={},bg_style={}; + if(color_obj.color!=null && color_obj.color!=''){ + bg_style["backgroundColor"]=color_obj.color; + cust_style["color"]='#fff' + } + if(color_obj.fontsize!=null && color_obj.fontsize!=''){ + cust_style["fontSize"]=color_obj.fontsize + } + if(color_obj.bold==1){ + cust_style["fontWeight"]="600" + } + return( + toggleModal(column.colname,colValue, row)}> + {colValue} + + + ) + })} + + ) + })} + + + + + + + ) + } + + function _renderDashboardReports(){ + return ( + + { + _renderTabularReport() + } + + ) + } + + const excludeKeys = ['AdKPIId']; + + return ( + + {processing && } + + + + + {currentReportMenu.KPI+' Detail'} + + + + { isDataFound==false && + + {ST.NoDataAvailable} + + } + + {isDataFound==true && + + {_renderDashboardReports()} + + { + Alert.alert('Modal has been closed.'); + setModalVisible(!modalVisible); + }}> + + + + + setModalVisible(false)}> + {currentReportMenu.KPI+' Detail'} + + + + + {Object.entries(modaldata?.row) + .filter(([key]) => !excludeKeys.includes(key)) // Filter out excluded keys + .map(([key, value]) => ( + + {key}: + {value.toString()} + + ))} + + + + + + + + } + + + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(PeopleDrilldown); + + +const styles = StyleSheet.create({ + // modal +}) \ No newline at end of file diff --git a/src/screens/PersonalDocument.js b/src/screens/PersonalDocument.js new file mode 100644 index 0000000..45b264b --- /dev/null +++ b/src/screens/PersonalDocument.js @@ -0,0 +1,58 @@ +import React, {useState, useEffect} from 'react'; +import Container from '../components/container'; +import {useRoute} from '@react-navigation/native'; +import {globalStyles, customStyles, GetPageTheme} from '../styles/Global'; +import { StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList,} from 'react-native'; +import {ReactReduxContext,connect,useSelector,useDispatch,} from 'react-redux'; +import {mapStateToProps, mapDispatchToProps} from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,DownloadData} from '../controller/functions'; +import {get_item, set_item, clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db,} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { FontAwesome, Fontisto, Ionicons, MaterialCommunityIcons } from '../components/icons'; +import NoDataComponent from '../components/NoDataComponent'; + +function PersonalDocument(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const globalStyle = globalStyles(props.DarkMode, route.name); + + + const [processing, setProcessing] = useState(false); + + useEffect(() => { + + }, []); + + + + return ( + + {processing && } + + + + { !props.isDataDownloaded && } + { props.isDataDownloaded==true && + + + + } + + + + + ); +} + +export default connect(mapStateToProps, mapDispatchToProps)(PersonalDocument); diff --git a/src/screens/Project.js b/src/screens/Project.js new file mode 100644 index 0000000..be80bdd --- /dev/null +++ b/src/screens/Project.js @@ -0,0 +1,221 @@ +import React, { useEffect, useContext, useState, useRef } from 'react'; +import SplashScreen from 'react-native-splash-screen'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import CustomButton from '../components/customButton'; +import GradientButton from '../components/gradientButton'; +import { globalStyles, customStyles, GetPageTheme, HP, WP } from "../styles/Global"; +import { StatusBar, Image, TextInput, View, Text, ScrollView, Platform, PermissionsAndroid, Animated, Keyboard } from 'react-native'; +import { SvgFromUri, SvgFromXml, SvgUri, SvgXml, Image as SvgImage, SvgCss } from 'react-native-svg'; +import { ReactReduxContext, connect, useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps, mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import { notify } from '../components/notify'; +import moment from 'moment'; +import { getProjectData, getProjectInfo } from '../controller/functions'; +import { get_item, set_item, clear_item } from '../components/localStorage'; +import { version, sloganline, appname, copyrightText, logoImage } from '../constants/constants'; +import { checkPermissions, requestMultiplePerms } from '../components/geolocation'; +import CustomLoader from '../components/CustomLoader'; +import { Ionicons } from '../components/icons'; +import LinearGradient from 'react-native-linear-gradient'; +import { baseurl } from '../constants/constants'; +import { SafeAreaView } from 'react-native-safe-area-context'; + +import Graphic1 from '../assets/performics/product_id.svg'; + +//Project Page +function Project(props) { + + // get dynamic styles based on dark theme or pageactive + const route = useRoute(); + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const globalStyle = globalStyles(props.DarkMode, route.name); + const [processing, setProcessing] = useState(false); + const animatedEffects = useRef(new Animated.Value(0)).current; + + // get and define props and states + const [state, setState] = useState({ projectid: '' }); + // const labelAnim = useRef(new Animated.Value(0)).current; + + useEffect(() => { + SplashScreen.hide(); + requestMultiplePerms(); // check for permissions + + const keyboardDidShowListener = Keyboard.addListener( + 'keyboardDidShow', + () => { + + Animated.timing(animatedEffects, { + toValue: 1, + duration: 400, + useNativeDriver: (Platform.OS == 'ios' ? false : true), + }).start(); + } + ); + const keyboardDidHideListener = Keyboard.addListener( + 'keyboardDidHide', + () => { + Animated.timing(animatedEffects, { + toValue: 0, + duration: 400, + useNativeDriver: (Platform.OS == 'ios' ? false : true), + }).start(); + } + ); + return () => { + keyboardDidHideListener.remove(); + keyboardDidShowListener.remove(); + }; + }, []); + + // async function setGlobalData(){ + //set project info in global reducer + // const pdata={pid:'',pname:'',pcode:'',alldata:{},baseurl:baseurl,companylogo:logoImage,imageUploadUrl:''}; + // let pi={baseurl:baseurl,companylogo:logoImage}; + + // props.set_project(pdata); + + // //set project info in encryted local storage + // set_item('firsttime','done'); + // set_item('projectCode',''); + // set_item('projectInfo',JSON.stringify(pi)); + // } + + const update_project = async () => { + // open login screen + // await setGlobalData(); + // props.navigation.navigate('Login'); + + const { projectid } = state; + if (projectid != '' && projectid != null) { + setProcessing(true); + await getProjectData(projectid) + .then((res) => { + console.log('PROJECT RESPONSE ==============>', res); + setProcessing(false); + if (res.success && res.projectName != null) { + //set project info in global + const pdata = getProjectInfo(res, projectid); + // const pdata={pid:projectid,pname:res.projectName,pcode:res.ProjectCode,alldata:res,baseurl:res.baseURL,companylogo:res.login_logo_Url,imageUploadUrl:res.imageUploadURL+'/',GeoFenceEnable:(res.GeoFenceEnable_checkin!=null && res.GeoFenceEnable_checkin==1),GeoFenceRadius:(res.GeoFenceRadius_checkin || 0) ,GFEnable_checkout:(res.GeoFenceEnable_checkout!=null && res.GeoFenceEnable_checkout==1),GFRadius_checkout:(res.GeoFenceRadius_checkout || 0),CheckOut_PhotoReq:res.PhotoRequired_Checkout }; + props.set_project(pdata); + //set project info in encryted local storage + set_item('firsttime', 'done'); + set_item('projectCode', projectid); + set_item('projectInfo', JSON.stringify(res)); + + + // open login screen + props.navigation.navigate('Login'); + } + else if (res.projectName == null) { + notify('Project not found, ensure if you have entered correct project Id', 'SHORT'); + } + }) + .catch((err) => { + setProcessing(false); + console.log('onPage Project error', err); + }); + } + else { + notify('Please enter Project Id', 'SHORT'); + } + } + + function _renderAnimPart() { + let pl_scale = 1, illus_scale = 1, illus_ty = 0, formty = 0; + if (animatedEffects != null) { + pl_scale = animatedEffects.interpolate({ + inputRange: [0, 1], + outputRange: [1, 0.7], + }); + illus_scale = animatedEffects.interpolate({ + inputRange: [0, 1], + outputRange: [1, 0.5], + }); + illus_ty = animatedEffects.interpolate({ + inputRange: [0, 1], + outputRange: [0, -150], + }); + formty = animatedEffects.interpolate({ + inputRange: [0, 1], + outputRange: [0, -120], + }); + } + return ( + + + + + + + + + Hey There + Enter your Project Id + + setState({ projectid: val })} + onSubmitEditing={(val) => { update_project(); }} + autoComplete='off' + keyboardType='numeric' + /> + + + + + + + + + + ) + } + + return ( + + {processing && } + + {_renderAnimPart()} + + + + + {version} + {copyrightText} + {/* */} + + + + + ); +} + +export default connect(mapStateToProps, mapDispatchToProps)(Project) \ No newline at end of file diff --git a/src/screens/Promotion.js b/src/screens/Promotion.js new file mode 100644 index 0000000..a8658ff --- /dev/null +++ b/src/screens/Promotion.js @@ -0,0 +1,761 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, Animated} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, FontAwesome, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility, Q_getpromotionmappingList } from '../constants/ConstantQueries'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import { ConfirmSaveAlert } from '../components/alert'; +import CustomCamera from '../components/Camera'; + +function Promotion(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [promotionData, setPromotionData] = useState([]); + const [globalPromoData, setGlobalPromoData] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + + const [SKUStockData, setSKUStockData] = useState([]); + const [showAlert, setShowAlert] = useState(false); + const [reasons_list, setReasons_list] = useState([]); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + + const [searchedItem, setSearchedItem]= useState(''); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + const zoomView=useRef(null); + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + + function onRemoveScreen(e){ + Alert.alert( + "", + ST.Doyoureallywanttoexitthescreen, + [ + { + text: ST.Cancel, + onPress: () => {}, + style: "cancel" + }, + { text: ST.OK, onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + async function getData(storeData1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + let allCats=[]; + await db.transaction(async function (txn) { + let q2=Q_getpromotionmappingList(storeData1); + // let q2=Q_getpaidvisibility(storeData1); + + await txn.executeSql(q2,[],async function (txn2, txnres2) { + console.log('promotion cats',txnres2.rows.length); + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i { + let seletlist=`p.PROMOTION_ID as PromoId,p.PROMOTION as Promotion,p.POS_AVL,p.STOCK_AVL,p.PROMOTALK_AVL,p.IMAGE1`; + let sku_q=`SELECT ${seletlist} FROM ${AppTables.PROMOTION_DATA} p WHERE p.STORE_ID='${StoreId}' and p.VISIT_DATE='${d2}' and p.SUB_CATEGORY_ID='${item.SubCategoryId}' `; + + let sku_q2=`SELECT DISTINCT m.PromoId as PromoId,m.Promotion as Promotion FROM Mapping_Promotion m where m.SubCategoryId='${item.SubCategoryId}' and m.ChainId='${ChainId}' and m.StoreTypeId='${StoreTypeId}'and m.StateId='${StateId}'`; + + return await txn.executeSql(sku_q,[],async function (txn2, txnres) { + console.log('inserted data:',txnres.rows.length); + if(txnres.rows.length>0){ + let arr=[]; + + for(var i=0;i0){ + let arr=[]; + console.log('avlbl prmotions:',txnres2.rows.length); + for(var i=0;i{ + + }); + }); + } catch (err) { + console.log(err); + } + } + + + + async function getImage(imgdata){ + let cat=getImageProps.cat || ''; + let skuItem=getImageProps.skuItem || ''; + let type=getImageProps.type || ''; + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: Promotion'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+(props.UserId || '')+'_PromotionImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let allData=SKUStockData; + let defData={'SubCategoryId':cat.SubCategoryId,'PromoId':skuItem.PromoId}; + const cindex=allData.findIndex(ci=>ci.SubCategoryId==cat.SubCategoryId && ci.PromoId==skuItem.PromoId); + const imgData=cindex>=0?(allData[cindex] || defData):defData; + let image_key=type=='2'?'Image2':'Image1'; + let image_path_key=type=='2'?'Image2Path':'Image1Path'; + imgData[image_key]=filename; + + // renamefile + let imagePath=common_ImagePath+filename; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker',uri); + imgData[image_path_key]=uri; + console.log(imgData); + cindex>=0?allData[cindex]=imgData:allData.push(imgData); + + setSKUStockData(allData); + setHasUnsavedChanges(true); + setrerenderdata2(!rerenderdata2); + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(cat,skuItem,type='1'){ + setGetImageProps({'cat':cat,'skuItem':skuItem,'type':type}); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function submitOpeningStock(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData+'...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + let q=`DELETE FROM ${AppTables.PROMOTION_HEADER_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + let q2=`DELETE FROM ${AppTables.PROMOTION_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // remove old data + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('promotions hdr data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('promotions data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + + let seq_q=` select seq from sqlite_sequence where name="${AppTables.PROMOTION_HEADER_DATA}" `; + await txn.executeSql(seq_q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let data=txnres.rows.item(0); + let seq=data.seq; + insertData(seq); + } + else{ + insertData(0); + } + },function (txn2, txnerr) { console.log(txnerr); insertData(0); },); + + + }); + } catch (err) { + console.log(err); + } + } + + async function insertData(seq=0){ + try { + console.log(seq); + let {StoreId,ChainId,StateId,StoreTypeId,ExpiryStock}=storeData; + + await db.transaction(async function (txn) { + var values='',child_values='',checklist_values=''; + + for(var i=0;ici.SubCategoryId==item.SubCategoryId && ci.PromoId==skuItem.PromoId); + const skud=skud_index>=0?(allSKUData[skud_index] || {}) : {}; + + child_values+=` ('${seq}','${StoreId}','${d2}','${item.SubCategoryName}','${item.SubCategoryId}','${skuItem.Promotion}','${skuItem.PromoId}','${skud.isStockAvlbl}','${skud.isPromoTalkerAvlbl}','${skud.isPresent}','${skud.Image1}','${d2}') `; + } + } + + let add_HdrData=`INSERT INTO ${AppTables.PROMOTION_HEADER_DATA} (STORE_ID,VISIT_DATE,SUB_CATEGORY,SUB_CATEGORY_ID,ADDED_DATE) VALUES ${values} `; + + let add_ChildData=`INSERT INTO ${AppTables.PROMOTION_DATA} (COMMON_ID,STORE_ID,VISIT_DATE,SUB_CATEGORY,SUB_CATEGORY_ID,PROMOTION,PROMOTION_ID,STOCK_AVL,PROMOTALK_AVL,POS_AVL,IMAGE1,ADDED_DATE) VALUES ${child_values} `; + + + await txn.executeSql(add_HdrData,[],async function (txn2, txnres) { + console.log('promotion header added'); + await txn.executeSql(add_ChildData,[],async function (txn2, txnres) { + console.log('promotion child added'); + notify(ST.Promotionupdatedsuccessfully); + setProcessing(false); + props.navigation.goBack(); + + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify(ST.CannotupdatePromotion) },); + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify(ST.CannotupdatePromotion) },); + }); + } catch (err) { + console.log(err); + } + } + + + async function validate(){ + let isValid=true; + await Promise.all( + promotionData.map(async (item,index) => { + if(isValid){ + + let promotionlist=item.promotionlist || []; + if(promotionlist.length>0){ + await Promise.all( + promotionlist.map(async (skuItem,skuIndex) => { + if(isValid){ + let skuData=SKUStockData.find(ci=>ci.SubCategoryId==item.SubCategoryId && ci.PromoId==skuItem.PromoId) || {}; + if(skuData.isPresent!=0 && (skuData.isPresent==null || skuData.isPresent=='')){ + notify(ST.Pleaseselectifpromotionpresentornotfor+' '+item.SubCategoryName+' '+skuItem.Promotion,'SHORT'); + isValid=false; + }else if(skuData.isStockAvlbl!=0 && (skuData.isStockAvlbl==null || skuData.isStockAvlbl=='')){ + notify(ST.Pleaseselectifstockisavailablefor+' '+item.SubCategoryName+' '+skuItem.Promotion,'SHORT'); + isValid=false; + }else if(skuData.isPromoTalkerAvlbl!=0 && (skuData.isPromoTalkerAvlbl==null || skuData.isPromoTalkerAvlbl=='')){ + notify(ST.Pleaseselectifstockisavailablefor+' '+item.SubCategoryName+' '+skuItem.Promotion,'SHORT'); + isValid=false; + }else if((skuData.isPresent==1 || skuData.isPromoTalkerAvlbl==1 || skuData.isStockAvlbl==1 ) && ((skuData.Image1==null || skuData.Image1==''))){ + notify('Please click all images for '+item.SubCategoryName+' '+skuItem.Promotion,'SHORT'); + isValid=false; + } + } + }) + ); + } + } + }) + ); + + console.log('isValid:',isValid); + return isValid; + } + + function onStockValChange(item,skuItem,val,key,isChoiceSelect=0){ + let allSKUData=SKUStockData; + let defData={'SubCategoryId':item.SubCategoryId,'PromoId':skuItem.PromoId}; + const skud_index=allSKUData.findIndex(i=>i.SubCategoryId==item.SubCategoryId && i.PromoId==skuItem.PromoId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + skud[key]=val; + + if(isChoiceSelect==1 && (skud.isPresent!=1 && skud.isPromoTalkerAvlbl!=1 && skud.isStockAvlbl!=1 )){ + skud.Image1=''; + skud.Image1Path=''; + } + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function onChoiceSelect(item,skuItem,val,key,animatedChoice){ + var val1=0; + if(val==1){ + val1=1; + } + + if(animatedChoice!=null){ + Animated.timing(animatedChoice, { + toValue: val1, + duration:400, + useNativeDriver:false, + }).start(); + } + onStockValChange(item,skuItem,val,key,1) + } + + function onSaveCancel(){ + setShowAlert(false); + } + + function FilterStores(searchedQry){ + searchedQry=searchedQry.toLowerCase(); + console.log('searchedQry',searchedQry); + let arr=[]; + var arr2=[]; + if(searchedQry!=null && searchedQry!=''){ + + for(let i=0;i0){ + arr.push(arr2); + } + } + } + + + } + } + else{ + arr=globalPromoData; + } + + setPromotionData(arr); + setrerenderdata(!rerenderdata) + setrerenderdata2(!rerenderdata2) + } + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + + {setSearchedItem(val); FilterStores(val)}} + autoComplete='off' + /> + {FilterStores(searchedItem)}}> + + + + { Object.keys(storeData).length>0 && + { + const cat=item; + + return( + + + + {item.SubCategoryName} + + + + + + { + + { + const skus=item; + const sku_index=index; + let thisCatSkuData_i=SKUStockData.findIndex(i=>i.SubCategoryId==cat.SubCategoryId && i.PromoId==skus.PromoId); + let thisCatSkuData=thisCatSkuData_i>=0?(SKUStockData[thisCatSkuData_i] || {}):{}; + let isPresent=thisCatSkuData.isPresent!=null?thisCatSkuData.isPresent:'0'; + let isStockAvlbl=thisCatSkuData.isStockAvlbl!=null?thisCatSkuData.isStockAvlbl:'0'; + let isPromoTalkerAvlbl=thisCatSkuData.isPromoTalkerAvlbl!=null?thisCatSkuData.isPromoTalkerAvlbl:'0'; + let Image1Path=(thisCatSkuData.Image1Path!=null && thisCatSkuData.Image1Path!='')?thisCatSkuData.Image1Path:''; + + var xpos=isPresent==1?-75:0,xposStock=isStockAvlbl==1?-75:0,xposPromo=isPromoTalkerAvlbl==1?-75:0; + if(skus.animatedChoice!=null ){ + xpos=skus.animatedChoice.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + + if(skus.animatedChoiceStock!=null ){ + xposStock=skus.animatedChoiceStock.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + + if(skus.animatedChoicePromo!=null ){ + xposPromo=skus.animatedChoicePromo.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + + return( + + {skus.Promotion} + + + + + {'Stock'} + + + + + {onChoiceSelect(cat,skus,1,'isStockAvlbl',skus.animatedChoiceStock)}}> + Yes + + {onChoiceSelect(cat,skus,0,'isStockAvlbl',skus.animatedChoiceStock)}}> + No + + + + + + {'Promo Talker'} + + + + + {onChoiceSelect(cat,skus,1,'isPromoTalkerAvlbl',skus.animatedChoicePromo)}}> + Yes + + {onChoiceSelect(cat,skus,0,'isPromoTalkerAvlbl',skus.animatedChoicePromo)}}> + No + + + + + + {'Running on POS'} + + + + + {onChoiceSelect(cat,skus,1,'isPresent',skus.animatedChoice)}}> + Yes + + {onChoiceSelect(cat,skus,0,'isPresent',skus.animatedChoice)}}> + No + + + + + + + {(isPresent=='1' || isPromoTalkerAvlbl=='1' || isStockAvlbl=='1') && + + Capture Image + + + { (Image1Path=='' || Image1Path==null) && + {openCamera(cat,skus,'1')}}> + + + } + { (Image1Path!='' && Image1Path!=null) && + + + {openCamera(cat,skus,'1')}}> + + + + } + + + + + } + + + + + + + ) + }}/> + } + + + ); + }} + /> + } + + {submitOpeningStock()}}/> + + + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(Promotion); \ No newline at end of file diff --git a/src/screens/PromotionOneApp.js b/src/screens/PromotionOneApp.js new file mode 100644 index 0000000..cf56d38 --- /dev/null +++ b/src/screens/PromotionOneApp.js @@ -0,0 +1,2143 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, Animated} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,getKPIFields,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, FontAwesome, Fontisto, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector' +import { CustomPicker, CustomPicker2 } from '../components/CustomPicker'; +import CustomCamera from '../components/Camera'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import DateTimePicker from '@react-native-community/datetimepicker'; +import CheckBox from '@react-native-community/checkbox'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import MultiSelect from 'react-native-multiple-select'; + +function PromotionOneApp(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const animatedChoice=useRef(new Animated.Value(0)).current; + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [StoreCameraAllow, setStoreCameraAllow] = useState(true); + const [currentMenu, setCurrentMenu] = useState({}); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + const [rerenderdata3, setrerenderdata3]= useState(0); + const [rerenderdata4, setrerenderdata4]= useState(0); + + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + + const [WindowData, setWindowData] = useState([]); + const [reasons_list, setReasons_list] = useState([]); + const [Windows, setWindows] = useState([]); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [showAlert, setShowAlert] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const zoomView=useRef(null); + const [showRating, setShowRating] = useState(false); + const [RatingQtn, setRatingQtn] = useState({}); + const [RatingWindow, setRatingWindow] = useState({}); + const [RatingOrder, setRatingOrder] = useState([]); + + const [Products, setProducts] = useState([]); + const [DisplayList, setDisplayList] = useState([]); + const [toRemoveId,setToRemoveId]= useState(''); + const [toRemoveItem,setToRemoveItem]= useState({}); + const [showRemoveConfirm_M,setshowRemoveConfirm_M]= useState(false); + const [showRAllC_M,setShowRAllC_M]= useState(false); + const [searchedItem, setSearchedItem]= useState(''); + const [globalWindows, setGlobalWindows] = useState([]); + const [KPIFields, setKPIFields] = useState([]); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + let cameraAllow=storeData1.CameraAllow=='true' || storeData1.CameraAllow==1?true:false; + setStoreCameraAllow(cameraAllow); + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + function onRemoveScreen(e){ + Alert.alert( + "", + ST.Doyoureallywanttoexitthescreen, + [ + { + text: ST.Cancel, + onPress: () => {}, + style: "cancel" + }, + { text: ST.OK, onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + + async function getData(storeData1,menu1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + let AllKPIFields=await getKPIFields(menu1); + setKPIFields(AllKPIFields); + + await db.transaction(async function (txn) { + + + let q3=`Select PromoReasonId as ReasonId,PromoReason as Reason From Master_PromotionReason`; + await txn.executeSql(q3,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i0){ + let arr=[];let images=[],allWindowsData=[]; + for(var i=0;i0){ + let arr=[],images=[],allWindowsData=[]; + for(var i=0;i{ + + db.transaction(async function (txn) { + + let q=`select * from ${AppTables.PROMO_IMAGES} where PROMO_HEADER_ID='${window.PromoHeaderId}' and STORE_ID='${storeData1.StoreId}' `; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return WindowSplits_def; + }); + } + + async function getWindowQuestions(window,storeData1,isInserted=false){ + let obj={'WindowQA':{},'WindowQuestions':[]} + return new Promise((resolve,reject)=>{ + + db.transaction(async function (txn) { + var q='',selectlist='',join='',join2=''; + if(isInserted==true){ + selectlist=` DISTINCT q.QUESTION_ID as PromoQuestionId,q.QUESTION_CODE as PromoQuestionCode,wq.PromoQuestionName,wq.QuestionType,wq.PromoqShowCamera,wq.PromoqCameraMandatory,wq.PromoqLengthValidationRequired,wq.PromoqMinimumChar,wq.PromoqMaximumChar,wq.PromoqDecimalPoint,wq.PromoqDateRangeMin,wq.PromoqDateRangeMax,wq.PromoqVoiceLengthInMinutes,wq.PromoqDefaultQuestionEnable,q.ANSWER as Answer,q.ANSWER_ID as AnswerId,q.MULTI_OPTIONS_IDS as multi_op_ids,q.IMAGE_ALLOW1 as PromoaShowCamera,q.IMAGE1 as Image1 `; + join2=` inner join Mapping_PromotionQuestion mq on mq.PromoQuestionId=wq.PromoQuestionId `; + join=` inner join Master_PromotionQuestion wq on wq.PromoQuestionId=q.QUESTION_ID `; + q=`select ${selectlist} from ${AppTables.PROMO_CHILD_DATA} q ${join} ${join2} where q.STORE_ID='${storeData1.StoreId}' and q.PROMO_DEFINITION_ID='${window.PromoDefinitionId}' and q.PROMO_ID='${window.PromoId}' order by wq.PromoQuestionSequence `; + + } + else{ + selectlist=` DISTINCT wq.PromoQuestionId,wq.PromoQuestionCode,wq.PromoQuestionName,wq.QuestionType,wq.PromoqShowCamera,wq.PromoqCameraMandatory,wq.PromoqLengthValidationRequired,wq.PromoqMinimumChar,wq.PromoqMaximumChar,wq.PromoqDecimalPoint,wq.PromoqDateRangeMin,wq.PromoqDateRangeMax,wq.PromoqVoiceLengthInMinutes,wq.PromoqDefaultQuestionEnable `; + join=` inner join Mapping_PromotionQuestion mq on mq.PromoQuestionId=wq.PromoQuestionId `; + q=`select ${selectlist} from Master_PromotionQuestion wq ${join} where mq.PromoDefinitionId='${window.PromoDefinitionId}' order by wq.PromoQuestionSequence `; + } + + + + await txn.executeSql(q,[],async function (txn2, txnres2) { + + if(txnres2.rows.length>0){ + let arr=[]; + let wqa_obj={}; + for(var i=0;i0){ + for(var k=0;k=0)){ + showImageTag=true; + } + } + } + } + + if(showImageTag && data.Answer!=null){ + let imgPath=(Platform.OS=='ios'?'file://':'')+common_ImagePath+data.Image1; + console.log('imgPath:',imgPath); + wqa_obj[imgname_key]=data.Image1; + wqa_obj[img_key]=imgPath; + } + + + + if(data.QuestionType=='Date' && data.Answer!=null){ + let dayonly=moment().format('DD'); + let actual_date=data.Answer?data.Answer.split('/'):[]; + let month=actual_date[0],year=actual_date[1]; + let fulldate=month+'/'+dayonly+'/'+year; + wqa_obj[date_key]=fulldate; + + } + + arr.push(data); + if(i==txnres2.rows.length-1){ + obj['WindowQuestions']=arr; + obj['WindowQA']=wqa_obj; + resolve(obj) + } + } + } + else{ + resolve(obj) + } + },function (txn2, txnerr) { console.log(txnerr); resolve(obj) },); + }); + }).then((val)=>{ + return val + }).catch((err)=>{ + console.log(err); + return obj; + }); + } + + + async function getWindowAnswers(qtn){ + + return new Promise((resolve,reject)=>{ + + db.transaction(async function (txn) { + var q='',selectlist=''; + selectlist=` DISTINCT PromoAnswerId as AnswerId,PromoAnswerName as Answer,PromoaShowCamera,PromoaCameraMandatory,PromoaQuestionEnable,PromoaQuestionDisable `; + q=`select ${selectlist} from Master_PromotionQuestion where PromoQuestionId='${qtn.PromoQuestionId}' order by PromoaSequence `; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return []; + }); + } + + async function getWindowStockData(window,storeData1,isInserted=false){ + let obj={'WStocks':[],'WStocksData':[],'isAllChecked':0} + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let checkassrt=window.PromoElementCheckAssortment=='true' || window.PromoElementCheckAssortment==1?true:false; + + let join='',join2=''; + if(checkassrt){ + join=` inner join Mapping_ProductAssortment a on a.ProductId=s.PROMO_STOCK_VALUE `; + } + let selectlist1=` s.PROMO_STOCK_DEFINITION_ID as PromoStockDefinitionId, s.PROMO_DEFINITION_ID as PromoDefinitionId,s.PROMO_STOCK_TABLE as PromoStockTable,s.PROMO_STOCK_FIELD as PromoStockField,s.PROMO_STOCK_VALUE as PromoStockValue,s.PROMO_STOCK_MBQ as PromoStockMBQ,s.PRODUCT_NAME as ProductName, s.STOCK as Stock,s.IS_PROMO_PRESENT as isPromoPresent `; + let q=`select ${selectlist1} from ${AppTables.PROMO_STOCK_DATA} s ${join} where s.PROMO_DEFINITION_ID='${window.PromoDefinitionId}' and s.STORE_ID='${storeData1.StoreId}' `; + if(checkassrt){ + q+=` and a.StateId='${storeData1.StateId}' `; + } + q+=` order by s.PRODUCT_NAME `; + + + + if(checkassrt){ + join2=` inner join Mapping_ProductAssortment a on a.ProductId=s.PromoStockValue `; + } + let selectlist2=` s.PromoStockDefinitionId, s.PromoDefinitionId,s.PromoStockTable,s.PromoStockField,s.PromoStockValue,s.PromoStockMBQ,s.ProductName `; + let q2=`select ${selectlist2} from Master_PromotionStockDefinition s ${join2} where s.PromoDefinitionId='${window.PromoDefinitionId}' `; + if(checkassrt){ + q2+=` and a.StateId='${storeData1.StateId}' `; + } + q2+=` order by s.ProductName `; + + + await txn.executeSql(q,[],async function (txn2, txnres2) { + + if(txnres2.rows.length>0){ + let arr=[],WStocksData=[]; + let isAllChecked=1; + for(var i=0;i0){ + let arr=[],WStocksData=[]; + let isAllChecked=1; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return obj; + }); + } + + + async function getImage(imgdata){ + let type=getImageProps.type || ''; + let window=getImageProps.window || {}; + let splitItem=getImageProps.splitItem || {}; + let splitItemIndex=getImageProps.splitItemIndex || 0; + let qtn=getImageProps.qtn || {}; + let cameraType=getImageProps.cameraType!=null?getImageProps.cameraType:'1'; + + console.log('getImage cameraType:',cameraType); + if(typeof imgdata=='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: Shelf Talker'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+window.PromoDefinitionId+'_'+window.PromoId+'_'+(props.UserId || '')+'_STImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let allData=WindowData; + let defData={'PromoId':window.PromoId,'PromoDefinitionId':window.PromoDefinitionId}; + const wind_index=allData.findIndex(i=>i.PromoId==window.PromoId && i.PromoDefinitionId==window.PromoDefinitionId) ; + let wind=wind_index>=0?allData[wind_index]:defData; + + if(cameraType=='2'){ + var QD=wind.WindowQA || {}; + var image_key=qtn.PromoQuestionId+'_ImageName1'; + var image_key_path=qtn.PromoQuestionId+'_ImagePath1'; + QD[image_key]=filename; + } + else if(cameraType=='3'){ + var image_key='NAImage1'; + var image_key_path='NAImage1Path'; + wind[image_key]=filename; + } + else{ + var WindowSplits=wind.WindowSplits || []; + console.log('WindowSplits:',WindowSplits); + var image_key=type=='1'?'Image1Name':'Image2Name'; + var image_key_path=type=='1'?'Image1':'Image2'; + splitItem[image_key]=filename; + } + + + + // renamefile + let imagePath=`${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker:',uri); + + if(cameraType=='2'){ + QD[image_key_path]=uri; + wind.WindowQA=QD; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata3(!rerenderdata3); + } + else if(cameraType=='3'){ + wind[image_key_path]=uri; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + else{ + console.log('split image updated'); + splitItem[image_key_path]=uri; + splitItemIndex>=0?WindowSplits[splitItemIndex]=splitItem:WindowSplits.push(splitItem); + wind.WindowSplits=WindowSplits; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata2(!rerenderdata2); + } + + + + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(window,splitItem,splitItemIndex,type='1',cameraType='1',qtn={}){ + setGetImageProps({'window':window,'splitItem':splitItem,'splitItemIndex':splitItemIndex,'type':type,'cameraType':cameraType,'qtn':qtn}); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function onSubmitData(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData+'...'); + setProcessing(true); + let d1n=new Date(); + let d3=moment(d1n).format('MM/DD/YYYY'); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + // remove old data + await txn.executeSql(`DELETE FROM ${AppTables.PROMO_HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window hdr data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.PROMO_CHILD_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window child data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.PROMO_IMAGES} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window images data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.PROMO_STOCK_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window stock data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + // add data + var values='',childV='',imageV='',stockV=''; + + for (const wi in globalWindows){ + const window=globalWindows[wi]; + let isImage1=window.PromoImage1=='true' || window.PromoImage1==1?1:0; + let isImage2=window.PromoImage2=='true' || window.PromoImage2==1?1:0; + let isNAImageAvl=window.PromoNotExistCamera=='true' || window.PromoNotExistCamera==1?1:0; + let isNAReasonEnable=window.PromoNotExistReasonEnable=='true' || window.PromoNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.PromoExistReasonEnable=='true' || window.PromoExistReasonEnable==1? 1:0; + let isStockReq=window.PromoElementStockRequired=='true' || window.PromoElementStockRequired==1?1:0; + let WindowQuestions=window.WindowQuestions || []; + let WindowStocks=window.WindowStocks || []; + + + const wind=WindowData.find(i=>i.PromoId==window.PromoId && i.PromoDefinitionId==window.PromoDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:0; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let remark=wind.remark!=null?wind.remark:''; + let WindowSplits=wind.WindowSplits || []; + let QD=wind.WindowQA || {}; + let WStocksData=wind.WStocksData || []; + + let PROMO_HEADER_ID='WIND'+wi+(Math.floor(Math.random()*1000)+1); + let {PromoDefinitionId,PromoId,PromoName,PromoTable,PromoField,PromoValue,ChildName}=window; + + + values+=values!=''?' , ':''; + values+=` ('${PROMO_HEADER_ID}','${StoreId}','${d3}','${PromoDefinitionId}','${PromoId}','${PromoName}','${PromoTable}','${PromoField}','${PromoValue}','${ChildName}','${isPresent}','${NAImage1}','${ReasonId}','${Reason}','${(remark || '')}','${d3}') `; + + if(isPresent==1){ + for(const qtnIndex in WindowQuestions){ + const qtn=WindowQuestions[qtnIndex]; + + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.PromoQuestionId+'_AnswerId'; + let ans_key=qtn.PromoQuestionId+'_Answer'; + let multi_key=qtn.PromoQuestionId+'_MultiOption'; + let date_key=qtn.PromoQuestionId+'_Date'; + let img_key=qtn.PromoQuestionId+'_ImagePath1'; + let imgname_key=qtn.PromoQuestionId+'_ImageName1'; + let rating_key=qtn.PromoQuestionId+'_Rating'; + let list_mcdata=[]; + + let {PromoQuestionId,PromoQuestionCode,QuestionType,PromoqShowCamera}=qtn + let answer=QD[ans_key] || 0; + let answerId=QD[id_key] || ''; + let multi_options_ids=QD[multi_key] || ''; + + if(qtn.QuestionType=='Number' || qtn.QuestionType=='Text' || qtn.QuestionType=='Decimal' || qtn.QuestionType=='Date') + { + showImageTag=(qtn.PromoqShowCamera==1 || qtn.PromoqShowCamera=='true'); + } + else if((qtn.QuestionType=='Single choice list' || qtn.QuestionType=='Multi choice list' )){ + if (qtn.Answers && qtn.Answers.length>0){ + for(var i=0;i=0)){ + showImageTag=true; + } + + } + } + } + + let Image1=showImageTag==1?QD[imgname_key]:''; + + childV+=childV!=''?' , ':''; + childV+=` ('${PROMO_HEADER_ID}','${StoreId}','${d3}','${PromoDefinitionId}','${PromoId}','${PromoQuestionId}','${PromoQuestionCode}','${QuestionType}','${answer}','${answerId}','${multi_options_ids}','${Image1}','${showImageTag}','${d3}') `; + } + for(const splitItemIndex in WindowSplits){ + const splitItem=WindowSplits[splitItemIndex]; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image2Name=splitItem['Image2Name']!=null && splitItem['Image2Name']!=''?splitItem['Image2Name']:''; + Image1Name=isImage1==1?Image1Name:''; + Image2Name=isImage2==1?Image2Name:''; + + imageV+=imageV!=''?' , ':''; + imageV+=` ('${PROMO_HEADER_ID}','${StoreId}','${d3}','${PromoDefinitionId}','${PromoId}','${Image1Name}','${Image2Name}','${d3}') `; + } + for(const stockProdIndex in WindowStocks){ + const stockProd=WindowStocks[stockProdIndex]; + let sd=WStocksData.find(i=> i.ProductId==stockProd.PromoStockValue) || {}; + let stock=sd.Stock!=null?sd.Stock:(sd.Stock==0?sd.Stock:''); + let isPromoPresent=sd.isPromoPresent!=null?sd.isPromoPresent:0; + let {PromoStockDefinitionId, PromoDefinitionId,PromoStockTable,PromoStockField,PromoStockValue,PromoStockMBQ,ProductName} =stockProd + stockV+=stockV!=''?' , ':''; + stockV+=` ('${PROMO_HEADER_ID}','${StoreId}','${d3}','${PromoDefinitionId}','${PromoId}','${PromoStockDefinitionId}','${PromoStockTable}','${PromoStockField}','${PromoStockValue}','${PromoStockMBQ}','${ProductName}','${stock}','${isPromoPresent}','${d3}') `; + } + + } + } + + + + + let add_hdr_data=`INSERT INTO ${AppTables.PROMO_HDR_DATA} (PROMO_HEADER_ID,STORE_ID,VISIT_DATE,PROMO_DEFINITION_ID,PROMO_ID,PROMO_NAME,PROMO_TABLE,PROMO_FIELD,PROMO_VALUE,CHILD_NAME,IS_PRESENT,PROMO_NA_IMAGE,REASON_ID,REASON,REMARK,ADDED_DATE) VALUES ${values} `; + let add_child_data=`INSERT INTO ${AppTables.PROMO_CHILD_DATA} (PROMO_HEADER_ID,STORE_ID,VISIT_DATE,PROMO_DEFINITION_ID,PROMO_ID,QUESTION_ID,QUESTION_CODE,QUESTION_TYPE,ANSWER,ANSWER_ID,MULTI_OPTIONS_IDS,IMAGE1,IMAGE_ALLOW1,ADDED_DATE) VALUES ${childV} `; + let add_images_data=`INSERT INTO ${AppTables.PROMO_IMAGES} (PROMO_HEADER_ID,STORE_ID,VISIT_DATE,PROMO_DEFINITION_ID,PROMO_ID,IMAGE1,IMAGE2,ADDED_DATE) VALUES ${imageV} `; + let add_stock_data=`INSERT INTO ${AppTables.PROMO_STOCK_DATA} (PROMO_HEADER_ID,STORE_ID,VISIT_DATE,PROMO_DEFINITION_ID,PROMO_ID,PROMO_STOCK_DEFINITION_ID,PROMO_STOCK_TABLE,PROMO_STOCK_FIELD,PROMO_STOCK_VALUE,PROMO_STOCK_MBQ,PRODUCT_NAME,STOCK,IS_PROMO_PRESENT,ADDED_DATE) VALUES ${stockV} `; + + + + await txn.executeSql(add_hdr_data,[],async function (txn2, txnres) { + console.log('st header data added'); + var isSplitImageAdded=true,isStockAdded=true,isChildAdded=true; + if(imageV!=''){ + isSplitImageAdded=await executeQuery(add_images_data); + } + if(stockV!=''){ + isStockAdded=await executeQuery(add_stock_data); + } + if(childV!=''){ + isChildAdded=await executeQuery(add_child_data); + } + + if(!isSplitImageAdded){ + setProcessing(false);notify(ST.Cannotaddpromotionimages); + } + else if(!isStockAdded){ + setProcessing(false);notify(ST.Cannotaddpromotionstockdata); + } + else if(!isChildAdded){ + setProcessing(false);notify(ST.Cannotaddpromotionquestionsdata); + } + else{ + setProcessing(false);notify(ST.Promotiondataupdatedsuccessfully); + props.navigation.goBack(); + } + + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify(ST.Cannotaddpromotiondata); },); + }); + } catch (err) { + console.log(err); + } + } + + async function executeQuery(q){ + + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres2) { + resolve(true); + },function(txn2,txnerr){console.log(txnerr);resolve(false) }); + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }) + } + + async function validate(){ + let isValid=true; + let PromotionValidationRequiredI=KPIFields.findIndex(i=>i.KPIFieldName=='PromotionValidationRequired') + let PromotionValidationRequiredObj=PromotionValidationRequiredI>=0?KPIFields[PromotionValidationRequiredI]:{}; + let PromotionValidationRequired=PromotionValidationRequiredI>=0?PromotionValidationRequiredObj['KPIFieldEnable']:true; + console.log('PromotionValidationRequired:',PromotionValidationRequired); + if(PromotionValidationRequired==false){ + return isValid; + } + // validate only if permit + return new Promise((resolve,reject)=>{ + for (const wi in globalWindows){ + const window=globalWindows[wi]; + let isImage1=window.PromoImage1=='true' || window.PromoImage1==1?1:0; + let isImage2=window.PromoImage2=='true' || window.PromoImage2==1?1:0; + let isNAImageAvl=window.PromoNotExistCamera=='true' || window.PromoNotExistCamera==1?1:0; + let isNAReasonEnable=window.PromoNotExistReasonEnable=='true' || window.PromoNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.PromoExistReasonEnable=='true' || window.PromoExistReasonEnable==1? 1:0; + let isStockReq=window.PromoElementStockRequired=='true' || window.PromoElementStockRequired==1?1:0; + let StockQtyRequired=window.StockQtyRequired=='true' || window.StockQtyRequired==1?1:0; + let WindowQuestions=window.WindowQuestions || []; + let WindowStocks=window.WindowStocks || []; + + + const wind=WindowData.find(i=>i.PromoId==window.PromoId && i.PromoDefinitionId==window.PromoDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let remark=wind.remark!=null?wind.remark:''; + let WindowSplits=wind.WindowSplits || []; + let QD=wind.WindowQA || {}; + let WStocksData=wind.WStocksData || []; + + if(isPresent=='1'){ + if(isReasonEnable==true && ReasonId=='' ){ + notify(`${ST.Pleaseselectreasonfor} ${window.PromoName} `,'LONG'); + resolve(false);return; + } + // else if(remark==''){ + // notify(`Please enter remark for ${window.PromoName} `,'LONG'); + // resolve(false);return; + // } + else{ + if(StoreCameraAllow && window.NoOfSplit>0 && WindowSplits.length>0 && (isImage1==1 || isImage2==1)) + { + for(const splitItemIndex in WindowSplits){ + const splitItem=WindowSplits[splitItemIndex]; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image2Name=splitItem['Image2Name']!=null && splitItem['Image2Name']!=''?splitItem['Image2Name']:''; + console.log('Image2Name',Image2Name,isImage2); + if(isImage1==1 && Image1Name==''){ + notify(`${ST.Pleaseclickallimagesfor} ${window.PromoName}`,'LONG'); + resolve(false);return; + } + else if(isImage2==1 && Image2Name==''){ + notify(`${ST.Pleaseclickallimagesfor} ${window.PromoName}`,'LONG'); + resolve(false);return; + } + } + } + + if(isStockReq==1){ + let isProductSelected=false; + for(const stockProdIndex in WindowStocks){ + const stockProd=WindowStocks[stockProdIndex]; + + let sd=WStocksData.find(i=> i.ProductId==stockProd.PromoStockValue) || {}; + let stock=sd.Stock!=null?sd.Stock:(sd.Stock==0?sd.Stock:''); + let isPromoPresent=sd.isPromoPresent!=null?sd.isPromoPresent:0; + + if(isPromoPresent==1){ + isProductSelected=true; + } + + if(isPromoPresent==1 && StockQtyRequired==1 && stock==''){ + notify(`${ST.Pleaseenterstockfor} ${window.PromoName} ( ${stockProd.ProductName} ) `,'LONG'); + resolve(false);return; + } + + if(stockProdIndex==WindowStocks.length-1){ + if(!isProductSelected){ + notify(`${ST.PleaseselectatleastoneSKUfor} ${window.PromoName} `,'LONG'); + resolve(false);return; + } + } + + } + } + + if(WindowQuestions.length>0){ + for(const qtnIndex in WindowQuestions){ + const qtn=WindowQuestions[qtnIndex]; + + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.PromoQuestionId+'_AnswerId'; + let ans_key=qtn.PromoQuestionId+'_Answer'; + let multi_key=qtn.PromoQuestionId+'_MultiOption'; + let date_key=qtn.PromoQuestionId+'_Date'; + let img_key=qtn.PromoQuestionId+'_ImagePath1'; + let imgname_key=qtn.PromoQuestionId+'_ImageName1'; + let rating_key=qtn.PromoQuestionId+'_Rating'; + let list_mcdata=[]; + + let isImgAllowed=(qtn.PromoqShowCamera=='true' || qtn.PromoqShowCamera==1); + let checkForAnsKey=(qtn.QuestionType=='Decimal' || qtn.QuestionType=='Number' || qtn.QuestionType=='Text' || qtn.QuestionType=='Date' || qtn.QuestionType=='Rating') ; + if(qtn.QuestionType=='Single choice list') + { + selansid=QD[id_key]; + } + else if(qtn.QuestionType=='Multi choice list') + { + selansid=QD[multi_key]!=null && QD[multi_key]!=''?QD[multi_key].split(','):[]; + } + + + if(qtn.QuestionType=='Multi choice list' && selansid.length<=0){ + notify(`${Pleaseselectoptionsfortherequiredfield} ${ST.In} ${window.PromoName}`,'SHORT'); + resolve(false);return; + } + else if( checkForAnsKey && (Object.keys(QD).indexOf(ans_key)<0 || (Object.keys(QD).indexOf(ans_key)>=0 && QD[ans_key]===''))){ + let msg=( qtn.QuestionType=='Date'?`${ST.Pleasepickadatefortherequiredfield} ${ST.In} ${window.PromoName}`:(qtn.QuestionType=='Rating'?`${Pleaseselectratingfortherequiredfield} ${ST.In} ${window.PromoName}`:`${ST.Pleasefillalltherequiredfield} ${ST.In} ${window.PromoName}`)); + notify(msg,'SHORT'); + resolve(false);return; + } + else if(Object.keys(QD).indexOf(id_key)<0 || (Object.keys(QD).indexOf(id_key)>=0 && (QD[id_key]==='' || (QD[id_key]===0 && qtn.isDisabled===false) ))){ + notify(`${ST.Pleasefillalltherequiredfield} ${ST.In} ${window.PromoName}`,'SHORT'); + resolve(false);return; + } + else if(isImgAllowed && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + notify(`${ST.Pleaseaddimages} ${ST.In} ${window.PromoName}`,'SHORT'); + resolve(false);return; + }else{ + console.log('no condition found'); + } + + if((qtn.QuestionType=='Single choice list' || qtn.QuestionType=='Multi choice list' )){ + if (qtn.Answers && qtn.Answers.length>0){ + for(var j=0;j=0)){ + showImageTag=true; + } + } + } + } + + if(showImageTag && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + notify(`${ST.Pleaseaddimages} ${ST.In} ${window.PromoName}`,'SHORT'); + resolve(false);return; + } + } + } + + } + } + else{ + if(isNAReasonEnable==true && ReasonId=='' ){ + notify(`${ST.Pleaseselectreasonfor} ${window.PromoName} `,'LONG'); + resolve(false);return; + } + else if(StoreCameraAllow && isNAImageAvl==true && NAImage1=='' ){ + notify(`${ST.Pleaseclickimagefor} ${window.PromoName}`,'LONG'); + resolve(false);return; + } + } + + if(wi==(Windows.length-1)){ + resolve(true);return; + } + + } + + }).then((val)=>{return val}) + .catch((err)=>{console.log(err); return false}); + + } + + + function onselectionChange(option,keyLbl,keyVal,otherData){ + let item=otherData.window; + let allData=WindowData; + let defData={'PromoId':item.PromoId,'PromoDefinitionId':item.PromoDefinitionId}; + const win_index=allData.findIndex(i=>i.PromoId==item.PromoId && i.PromoDefinitionId==item.PromoDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[keyVal]=option.value; + wind[keyLbl]=option.label; + + win_index>=0?allData[win_index]=wind:allData.push(wind); + console.log('allData:',allData); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onselectionChange2(option,qtn,window){ + let allData=WindowData; + let defData={'PromoId':window.PromoId,'PromoDefinitionId':window.PromoDefinitionId}; + const wind_index=allData.findIndex(i=>i.PromoId==window.PromoId && i.PromoDefinitionId==window.PromoDefinitionId); + console.log('onselectionChange2 wind_index:',wind_index); + let wind=wind_index>=0?allData[wind_index]:defData; + let data=wind.WindowQA || {}; + let id_key=qtn.PromoQuestionId+'_AnswerId'; + let ans_key=qtn.PromoQuestionId+'_Answer'; + data[id_key]=option.value; + data[ans_key]=option.label; + + + wind['WindowQA']=data; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + + let aq_ans=qtn.Answers!=null?qtn.Answers:[]; + let ans_obj=aq_ans.find(i=>i.AnswerId==option.value) || {}; + let EQtns=ans_obj.PromoaQuestionEnable!=null && ans_obj.PromoaQuestionEnable!=''?ans_obj.PromoaQuestionEnable.replace(' ','').split(','):[]; + let DQtns=ans_obj.PromoaQuestionDisable!=null && ans_obj.PromoaQuestionDisable!=''?ans_obj.PromoaQuestionDisable.replace(' ','').split(','):[]; + + let sqtns=window.WindowQuestions || [] + + if(EQtns.length>0){ + enableQtns(sqtns,EQtns,DQtns,data,wind,wind_index,allData,window) + } + else if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data,wind,wind_index,allData,window) + } + else{ + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + } + + async function disableQtns(sqtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + + if(DQtns.length>0){ + new Promise.all( + DQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.PromoQuestionId==qid) || {}; + if(s_qtnindex>=0) + { + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=true + sqtns[s_qtnindex]=s_qtn; + let id_key=s_qtn.PromoQuestionId+'_AnswerId'; + let ans_key=s_qtn.PromoQuestionId+'_Answer'; + data[id_key]=0; + data[ans_key]=''; + + wind['WindowQA']=data; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + } + return false + }) + ).then(async (val)=>{ + + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.PromoDefinitionId==window.PromoDefinitionId && i.PromoId==window.PromoId) + if(windowIndex>0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindowData(allData); + setWindows(allwindows); + setGlobalWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + else{ + setrerenderdata(!rerenderdata); + } + + }) + } + } + + async function enableQtns(sqtns,EQtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + new Promise.all( + EQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.PromoQuestionId==qid) || {}; + if(s_qtnindex>=0){ + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=false + sqtns[s_qtnindex]=s_qtn; + } + return false + }) + ).then(async (val)=>{ + if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data,wind,wind_index,allData,window) + } + else{ + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.PromoDefinitionId==window.PromoDefinitionId && i.PromoId==window.PromoId) + if(windowIndex>0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindows(allwindows); + setGlobalWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + else{ + setrerenderdata(!rerenderdata); + } + } + }) + } + + async function setMultiSelectValue(selectedItems=[],qtn={},window={}) { + console.log('setMultiSelectValue',selectedItems); + let id_key=qtn.PromoQuestionId+'_AnswerId'; + let ans_key=qtn.PromoQuestionId+'_Answer'; + let multi_key=qtn.PromoQuestionId+'_MultiOption'; + + let allData=WindowData; + let defData={'PromoId':window.PromoId,'PromoDefinitionId':window.PromoDefinitionId}; + const wind_index=allData.findIndex(i=>i.PromoId==window.PromoId && i.PromoDefinitionId==window.PromoDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + obj[id_key]=0; + obj[multi_key]=selectedItems.join(','); + let anss=[]; + selectedItems.map((itemValue)=>{ + let ans = qtn.Answers.find(c1 => c1.AnswerId == itemValue); + if(ans.Answer){anss.push(ans.Answer)} + }); + obj[ans_key]=anss.join(','); + console.log('obj:',obj); + + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function setTextValue(value,qtn,window) { + let id_key=qtn.PromoQuestionId+'_AnswerId'; + let ans_key=qtn.PromoQuestionId+'_Answer'; + + let allData=WindowData; + let defData={'PromoId':window.PromoId,'PromoDefinitionId':window.PromoDefinitionId}; + const wind_index=allData.findIndex(i=>i.PromoId==window.PromoId && i.PromoDefinitionId==window.PromoDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + if(qtn.QuestionType=='Date' ){ + let date_key=qtn.PromoQuestionId+'_Date'; + let d=value!=null?new Date(value):new Date(); + let mfdate=moment(d).format('MM/YYYY'); + showQtnDatePicker(qtn,window,false); + obj[id_key]=0; + obj[ans_key]=mfdate; + obj[date_key]=moment(d).format('MM/DD/YYYY'); + } + else{ + obj[id_key]=0; + obj[ans_key]=value; + } + + console.log(value,obj); + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function showQtnDatePicker(qtn,window,show=false){ + let allQtns=window.WindowQuestions || []; + let newqtnIndex=allQtns.findIndex(q=>q.PromoQuestionId==qtn.PromoQuestionId); + + if(newqtnIndex>=0){ + let newqtn=allQtns[newqtnIndex]; + newqtn.showDatePicker=show; + allQtns[newqtnIndex]=newqtn; + window['WindowQuestions']=allQtns; + let allWindows=Windows; + const winIndex=allWindows.findIndex(i=>i.PromoId==window.PromoId && i.PromoDefinitionId==window.PromoDefinitionId) || {}; + allWindows[winIndex]=window; + setWindows(allWindows); + setGlobalWindows(allwindows); + if(show==true) setrerenderdata(!rerenderdata); + } + } + + function setRatingValue(data){ + setRatingOrder(data); + } + + function onRatingCancel(){ + setShowRating(false); + } + + function onRatingSave(){ + setShowRating(false); + let qtn=RatingQtn; + let window=RatingWindow; + let id_key=qtn.PromoQuestionId+'_AnswerId'; + let ans_key=qtn.PromoQuestionId+'_Answer'; + let rating_key=qtn.PromoQuestionId+'_Rating'; + let ids=[],anss=[]; + RatingOrder.map((item,index)=>{ + ids.push(item.AnswerId); + anss.push(item.Answer); + }) + + let allData=WindowData; + let defData={'PromoId':window.PromoId,'PromoDefinitionId':window.PromoDefinitionId}; + const wind_index=allData.findIndex(i=>i.PromoId==window.PromoId && i.PromoDefinitionId==window.PromoDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + obj[rating_key]=ids.join(','); + obj[id_key]=0; + obj[ans_key]=anss.join(','); + + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function onChoiceSelect(item,val,key,animatedChoice){ + + var val1=0; + val==1?val1=1:''; + + if(animatedChoice!=null){ + Animated.timing(animatedChoice, { + toValue: val1, + duration:400, + useNativeDriver:false, + }).start(); + } + onWindowDataChange(item,val,key) + } + + function onWindowDataChange(item,val,key){ + let allData=WindowData; + let defData={'PromoId':item.PromoId,'PromoDefinitionId':item.PromoDefinitionId}; + const win_index=allData.findIndex(i=>i.PromoId==item.PromoId && i.PromoDefinitionId==item.PromoDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[key]=val; + + if(key=='ReasonId'){ + let rsn=reasons_list.find(r=>r.ReasonId==val) || {}; + wind['Reason']=rsn.Reason || ''; + } + + win_index>=0?allData[win_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + async function setWindowStockVal(val,window,stockProd,key,type=''){ + if(type=='numeric' && val!=''){ + const regex = new RegExp(/^\d+$/); + let isNUmeric=regex.test(val); + if(!isNUmeric){ + notify(ST.Pleaseenterwholenumbersonly,'SHORT'); + return; + } + } + + let allData=WindowData; + let defData={'PromoId':window.PromoId,'PromoDefinitionId':window.PromoDefinitionId}; + const win_index=allData.findIndex(i=>i.PromoId==window.PromoId && i.PromoDefinitionId==window.PromoDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + let sdIndex=WStocksData.findIndex(i=> i.ProductId==stockProd.PromoStockValue); + let sd=sdIndex>=0?WStocksData[sdIndex]:{'ProductId':stockProd.PromoStockValue,'Stock':''}; + sd[key]=val; + sdIndex>=0?WStocksData[sdIndex]=sd:WStocksData.push(sd); + wind['WStocksData']=WStocksData; + win_index>=0?allData[win_index]=wind:allData.push(wind); + if(key=='isPromoPresent'){ + let isAllChecked = await verifyAllChecked(val,window,stockProd,key); + wind['isAllSKUChecked']=isAllChecked; + } + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata4(!rerenderdata4); + } + + async function onCatTextChange(window,key,val){ + let item=window; + let allData=WindowData; + let defData={'PromoId':item.PromoId,'PromoDefinitionId':item.PromoDefinitionId}; + const win_index=allData.findIndex(i=>i.PromoId==item.PromoId && i.PromoDefinitionId==item.PromoDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[key]=val; + + win_index>=0?allData[win_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + async function verifyAllChecked(val,window,stockProd,key){ + return await new Promise((resolve,reject)=>{ + let WindowStocks=window.WindowStocks || []; + let allData=WindowData; + const win_index=allData.findIndex(i=>i.PromoId==window.PromoId && i.PromoDefinitionId==window.PromoDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + if(WindowStocks.length>0){ + let isAllChecked=1; + for(var i=0;i a.ProductId==stockProd.PromoStockValue); + let sd1=sdIndex1>=0?WStocksData[sdIndex1]:{}; + let isPromoPresent=sd1.isPromoPresent; + if(isPromoPresent==null || isPromoPresent=='' || isPromoPresent==0 || isPromoPresent=='0'){ + isAllChecked=0 + } + + if(i==WindowStocks.length-1){ + resolve(isAllChecked); + } + } + } + else{ + resolve(0); + } + + }).catch((err)=>{ + console.log(err); + return 0; + }); + } + + function checkAllSKUs(val,window){ + + let WindowStocks=window.WindowStocks || []; + let allData=WindowData; + let defData={'PromoId':window.PromoId,'PromoDefinitionId':window.PromoDefinitionId}; + const win_index=allData.findIndex(i=>i.PromoId==window.PromoId && i.PromoDefinitionId==window.PromoDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + console.log('WStocksData before:',WStocksData) + for(var i=0;i a.ProductId==stockProd.PromoStockValue); + let sd=sdIndex>=0?WStocksData[sdIndex]:{'ProductId':stockProd.PromoStockValue,'Stock':''}; + let isPromoPresent=(val==1 || val=='1')?1:0; + sd['isPromoPresent']=isPromoPresent; + + sdIndex>=0?(WStocksData[sdIndex]=sd):(WStocksData.push(sd)); + } + + + wind['WStocksData']=WStocksData; + wind['isAllSKUChecked']=val==1?1:0; + console.log('wind updated'); + win_index>=0?allData[win_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onSaveCancel(){ + setShowAlert(false); + } + + + + function openImageRefView(RefImage=''){ + setShow_zoomImage(true); + } + + function FilterStores(searchedQry){ + searchedQry=searchedQry.toLowerCase(); + console.log('searchedQry',searchedQry); + let arr=[]; + let newWindows=[]; + if(searchedQry!=null && searchedQry!=''){ + + for(let i=0;i + + {ST.DragItemsInOrder} + {ST.Pressandholdtodrag} + {setRatingValue(data)}} + keyExtractor={(item) => item.AnswerId} + renderItem={renderItem} + /> + + {onRatingCancel()}}> + {ST.Cancel} + + {onRatingSave()}}> + {ST.Save} + + + + + ) + } + + function render_Picker(label_key,value_key,onChange=()=>{},selected_data={}){ + var data=[]; + let qtn=selected_data.qtn || {}; + let window=selected_data.window || {}; + let isQtnDisabled=qtn.isDisabled!=null || qtn.isDisabled!=''?false:true; + let allAnswers=qtn.Answers || []; + + allAnswers.map((item,index)=>{ + let obj={ key: index, label: item[label_key],value:item[value_key] }; + if(selected_data.value==item[label_key]) + obj['component']= {item[label_key]}; + data.push(obj); + }); + + return ( + {onChange(option,qtn,window) }} + overlayStyle={customStyle.addVisPickerOverlay} + cancelContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + optionStyle={customStyle.addvis_opStyle} + optionTextStyle={customStyle.addvis_opTextStyle} + optionContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + selectedKey={'1'} + disabled={isQtnDisabled} + > + {(selected_data.value!=null && selected_data.value!=''?selected_data.value: '-'+ST.select+'-')} + + ) + } + + function renderDatePicker(qtn,window){ + let qtnn=qtn; + let DateRange=qtn.DateRange; + let maxDate=moment().add(10,'years').format('MM/DD/YYYY'); + let minDate=moment().subtract(10,'years').format('MM/DD/YYYY'); + if(DateRange=='RFD'){ + maxDate=moment().format('MM/DD/YYYY'); + } + else if(DateRange=='RPD'){ + minDate=moment().format('MM/DD/YYYY'); + } + + return ( + {setTextValue(selectedDate,qtnn,window)}} + maximumDate={new Date(maxDate)} + minimumDate={new Date(minDate)} + /> + ); + } + + function _renderWindow(){ + let RemarkEnableIndex=KPIFields.findIndex(i=>i.KPIFieldName=='RemarkEnable') + let RemarkEnableKPIObj=RemarkEnableIndex>=0?KPIFields[RemarkEnableIndex]:{}; + let RemarkEnable=RemarkEnableIndex>=0?RemarkEnableKPIObj['KPIFieldEnable']:false; + + return ( + `window_${index.toString()}`} + renderItem={({item,index})=>{ + const window=item; + + let isImage1=window.PromoImage1=='true' || window.PromoImage1==1?1:0; + let isImage2=window.PromoImage2=='true' || window.PromoImage2==1?1:0; + let isNAImageAvl=window.PromoNotExistCamera=='true' || window.PromoNotExistCamera==1?1:0; + let isNAReasonEnable=window.PromoNotExistReasonEnable=='true' || window.PromoNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.PromoExistReasonEnable=='true' || window.PromoExistReasonEnable==1? 1:0; + let isStockReq=window.PromoElementStockRequired=='true' || window.PromoElementStockRequired==1?1:0; + let StockQtyRequired=window.StockQtyRequired=='true' || window.StockQtyRequired==1?1:0; + let PromoTitleEnable=window.PromoDefinitionTitleEnable=='true' || window.PromoDefinitionTitleEnable==1? 1:0; + let PromoTitle=window.PromoDefinitionTitle!=null && window.PromoDefinitionTitle!='undefined'? window.PromoDefinitionTitle:""; + + // let isStock_CheckAssrt=window.PromoElementCheckAssortment=='true' || window.PromoElementCheckAssortment==1?1:0; + let RefImage=window.PromoRefImage; + let camera1Label=window.PromoImage1Lable || ''; + let camera2Label=window.PromoImage2Lable || ''; + let WindowQuestions=window.WindowQuestions || []; + let WindowStocks=window.WindowStocks || []; + + + const wind=WindowData.find(i=>i.PromoId==window.PromoId && i.PromoDefinitionId==window.PromoDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let remark=wind.remark!=null?wind.remark:''; + let WindowSplits=wind.WindowSplits || []; + let QuestionsData=wind.WindowQA || {}; + let WStocksData=wind.WStocksData || []; + let isAllSKUChecked=wind.isAllSKUChecked==1 || wind.isAllSKUChecked=="1"; + + // console.log('camera2Label:',window.PromoId,window.PromoDefinitionId,camera2Label);\ + var xpos=isPresent=='1'?-75:0; + if(window.animatedChoice!=null ){ + xpos=window.animatedChoice.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + + return( + + + + {window.PromoName} + {(PromoTitleEnable==1 && PromoTitle!=null && PromoTitle!='') && {PromoTitle}} + {openImageRefView(RefImage)}}> + + + + + + + + + {ST.IsPresent} + + + + {onChoiceSelect(window,1,'isPresent',window.animatedChoice)}}> + {ST.Yes} + + {onChoiceSelect(window,0,'isPresent',window.animatedChoice)}}> + {ST.No} + + + + + {((isPresent!='1' && isNAReasonEnable==true) || (isPresent=='1' && isReasonEnable==true)) && + + {ST.SelectReason} + {} + + } + + + {(isPresent!='1' && isNAImageAvl==true) && + + + + {ST.CaptureImage} + + + + + + { (NAImage1Path=='' || NAImage1Path==null) && + {openCamera(window,{},0,'1','3')}}> + + + } + { (NAImage1Path!='' && NAImage1Path!=null) && + + + {openCamera(window,{},0,'1','3')}}> + + + + } + + + + + + } + + + + {(isPresent=='1') && + + + {(isStockReq==true && WindowStocks.length>0) && + + + {ST.SelectProducts} + + + + {checkAllSKUs((isAllSKUChecked==1?0:1),window)}}> + {let val1=(val==true)?1:0; checkAllSKUs(val1,window) }} + style={[customStyle.WStkHdr_checkbox,(Platform.OS=='ios'?{height:20,width:20,marginLeft:5}:{})]} + tintColors={{ true:PageTheme.$primary_color, false:PageTheme.$text_color_light }} + /> + {ST.SelectAll} + + + `wstock_${index.toString()}`} + renderItem={({item,index})=>{ + let stockProd=item; + let stockProdIndex=index; + let sd=WStocksData.find(i=> i.ProductId==stockProd.PromoStockValue) || {}; + let stock=sd.Stock!=null?sd.Stock:''; + let isPromoPresent=sd.isPromoPresent!=null?sd.isPromoPresent:0; + + return( + + {/* {stockProd.ProductName} */} + + + {let val1=(val==true)?1:0; setWindowStockVal(val1,window,stockProd,'isPromoPresent') }} + style={[customStyle.WStkHdr_checkbox,(Platform.OS=='ios'?{height:20,width:20,marginTop:5,marginLeft:5,}:{})]} + tintColors={{ true:PageTheme.$primary_color, false:PageTheme.$text_color_light }} + /> + + {stockProd.ProductName} + + {StockQtyRequired==1 && isPromoPresent==1 && + + + + Stock + + + + {setWindowStockVal(val,window,stockProd,'Stock','numeric')}} + autoComplete='off' + /> + + + + } + + ); + }} + /> + + } + {( window.NoOfSplit>0 && WindowSplits.length>0 && (isImage1==1 || isImage2==1)) && + + + {ST.CapturePromotionImages} + + `spliItem_${index.toString()}`} + renderItem={({item,index})=>{ + let splitItem=item; + let splitItemIndex=index; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image2Name=splitItem['Image2Name']!=null && splitItem['Image2Name']!=''?splitItem['Image2Name']:''; + let Image1=splitItem['Image1']!=null && splitItem['Image1']!=''?splitItem['Image1']:''; + let Image2=splitItem['Image2']!=null && splitItem['Image2']!=''?splitItem['Image2']:''; + + return( + + {isImage1==1 && + + { (Image1=='' || Image1==null) && + {openCamera(window,splitItem,splitItemIndex,'1')}}> + + + } + { (Image1!='' && Image1!=null) && + + + {openCamera(window,splitItem,splitItemIndex,'1')}}> + + + + } + {camera1Label} + + } + {isImage2==1 && + + { (Image2=='' || Image2==null) && + {openCamera(window,splitItem,splitItemIndex,'2')}}> + + + } + { (Image2!='' && Image2!=null) && + + + {openCamera(window,splitItem,splitItemIndex,'2')}}> + + + + } + {console.log('camera2Label 2:',camera2Label)} + {camera2Label} + + } + + ); + }} + /> + + } + + {(WindowQuestions.length>0) && + + + {ST.PromotionQuestions} + + {WindowQuestions.map((item,index)=>{ + + let qtn=item; + let qtnIndex=index; + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.PromoQuestionId+'_AnswerId'; + let ans_key=qtn.PromoQuestionId+'_Answer'; + let multi_key=qtn.PromoQuestionId+'_MultiOption'; + let date_key=qtn.PromoQuestionId+'_Date'; + let img_key=qtn.PromoQuestionId+'_ImagePath1'; + let imgname_key=qtn.PromoQuestionId+'_ImageName1'; + let rating_key=qtn.PromoQuestionId+'_Rating'; + + let list_mcdata=[]; + + if(qtn.QuestionType=='Single choice list') + { + selansid=QuestionsData[id_key]!=null ?QuestionsData[id_key] :''; + selanswer=QuestionsData[ans_key]!=null ?QuestionsData[ans_key] :''; + } + else if(qtn.QuestionType=='Multi choice list') + { + if(qtn.Answers!=null){ + for(var i=0;i0){ + // let arr=[]; + // for(var i=0;i0){ + for(var i=0;i=0)){ + showImageTag=true; + } + + } + } + } + + if(showImageTag){ + selimg=QuestionsData[img_key]!=null && QuestionsData[img_key]!=''?'file://'+QuestionsData[img_key]:''; + } + + return( + + {qtn.PromoQuestionName} + {qtn.QuestionType=='Single choice list' && qtn.Answers && + render_Picker('Answer','AnswerId',onselectionChange2,{value:selanswer,qtn:qtn,window:window}) + } + {qtn.QuestionType=='Multi choice list' && qtn.Answers && + { setMultiSelectValue(selectedItems,qtn,window) }} //setMultiSelectValue(selectedItems,qtn) + selectedItems={selansid} + selectText="Pick Items" + searchInputPlaceholderText={ST.SearchItems+"..."} + // onChangeInput={ (text)=> console.log(text)} + tagRemoveIconColor={PrimaryTheme.$primary_color} + tagBorderColor={PrimaryTheme.$primary_color} + tagTextColor={PrimaryTheme.$primary_color} + selectedItemTextColor={PrimaryTheme.$primary_color} + selectedItemIconColor={PrimaryTheme.$primary_color} + itemTextColor={PrimaryTheme.$text_color} + displayKey="Answer" + searchInputStyle={{ color: '#CCC' }} + submitButtonColor={PrimaryTheme.$primary_color} + submitButtonText={ST.Submit} + /> + } + { (qtn.QuestionType=='Number' || qtn.QuestionType=='Decimal' || qtn.QuestionType=='Text') && + {setTextValue(val,qtn,window)}} + autoComplete='off' + /> + } + { + (qtn.QuestionType=='Date') && + + {selansid!=''?selansid:'MM/YYYY'} + {setDateValue(selanswer);showQtnDatePicker(qtn,window,true)}}> + + + + } + { ((qtn.showDatePicker==true || qtn.showDatePicker=='true') && (qtn.QuestionType=='Date') ) && + renderDatePicker(qtn,window) + } + { + (qtn.QuestionType=='Rating') && + + {selanswer} + {setRatingQtn(qtn);setRatingWindow(window);setShowRating(true);}}> + + + + } + + { + // (qtn.QuestionType=='Audio') && + // + // {selanswer} + // {show_recorder(qtn);}}> + // + // + // + } + + { + showImageTag && + + + {openCamera(window,{},0,'1','2',qtn)}}> + + + + } + + + + ) + })} + + } + { RemarkEnable==true && + + {ST.Remark} + {onCatTextChange(window,'remark',val)}} + autoComplete='off' + /> + + } + + + } + + + + + + + ); + }} + /> + ) + } + + function _renderHeader(currentIndex){ + return( + + {/* {`${(currentIndex+1)}/${zoomImageUrl.length}`} */} + {console.log('tsth');setShow_zoomImage(false) }}> + + + + ) + } + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + + {setSearchedItem(val); FilterStores(val)}} + autoComplete='off' + /> + {FilterStores(searchedItem)}}> + + + + { Object.keys(storeData).length>0 && + + {_renderWindow()} + + } + + {onSubmitData()}}/> + + + + + { showRating==true && + renderRatingView() + } + {show_zoomImage && + + null} + /> + + } + + ); +} + + +export default connect(mapStateToProps, mapDispatchToProps)(PromotionOneApp); \ No newline at end of file diff --git a/src/screens/QuestionsScreen.js b/src/screens/QuestionsScreen.js new file mode 100644 index 0000000..cafe552 --- /dev/null +++ b/src/screens/QuestionsScreen.js @@ -0,0 +1,1799 @@ +import React,{useState,useEffect, useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { customStyles,GetPageTheme, STATUSBAR_HEIGHT } from "../styles/Global"; +import {Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,FlatList, Alert, Dimensions,Animated, Easing} from 'react-native'; +import { connect } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {marktext1,marktext2} from '../controller/functions'; +import {db, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {AntDesign, Entypo, FontAwesome, FontAwesome5, Fontisto, MaterialCommunityIcons} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector'; +import MultiSelect from 'react-native-multiple-select'; +import { PrimaryTheme } from '../styles/Themes'; +import DateTimePicker from '@react-native-community/datetimepicker'; +import DraggableFlatList,{ScaleDecorator} from 'react-native-draggable-flatlist' +// import AudioRecorderPlayer, { AudioEncoderAndroidType, AudioSourceAndroidType, AVEncoderAudioQualityIOSType, AVEncodingOption, AVModeIOSOption } from 'react-native-audio-recorder-player'; +import CustomCamera from '../components/Camera'; + +const {height, width} = Dimensions.get('window'); +const topbarht=STATUSBAR_HEIGHT+50; +const actualWindowHt=parseInt((height-topbarht)+10); + +function QuestionsScreen(props) { + const route = useRoute(); + const audioRecorderPlayer = "";//new AudioRecorderPlayer(); + const AudioSet = {} + // { + // AudioEncoderAndroid: AudioEncoderAndroidType.AAC, + // AudioSourceAndroid: AudioSourceAndroidType.MIC, + // AVModeIOS: AVModeIOSOption.measurement, + // AVEncoderAudioQualityKeyIOS: AVEncoderAudioQualityIOSType.high, + // AVNumberOfChannelsKeyIOS: 2, + // AVFormatIDKeyIOS: AVEncodingOption.aac, + // }; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [showRating, setShowRating] = useState(false); + const [RatingQtn, setRatingQtn] = useState({}); + const [RatingOrder, setRatingOrder] = useState([]); + const [showRecorder, setShowRecorder] = useState(false); + const [VRS, setVRS] = useState({}); + const [RecorderTimer, setRecorderTimer] = useState({}); + const [playerTimer, setPlayerTimer] = useState({}); + const [rerenderView, setRerenderView] = useState(0); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [VoiceRecorderStatus, setVoiceRecorderStatus] = useState('Press mic to start recording voice'); + const [RecFilePath, setRecFilePath] = useState({}); + const [dateValue, setDateValue] = useState(''); + const [openDatePicker, setOpenDatePicker]= useState(0); + const [storeData, setStoreData] = useState({}); + const [ShowCat, setShowCat] = useState(false); + const [ActiveSurvey, setActiveSurvey]= useState({}); + const [ActiveCategory, setActiveCategory]= useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [rerenderdata, setrerenderdata]= useState(0); + const [SurveySubCats, setSurveySubCats]= useState([]); + const [SurveyQuestions, setSurveyQuestions]= useState([]); + const [QuestionsData,setQuestionsData]=useState({}); + const [showAlert, setShowAlert] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + + const [isFeedbackView,setIsFeedbackView]= useState(false); + + + const animatedRipple=useRef(new Animated.Value(0)).current; + const animatedRipple2=useRef(new Animated.Value(0.5)).current; + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let surveydata=params.surveyData || {}; + let catData=params.catData || {}; + let menu1=params.menu || {}; + let ShowCat1=params.ShowCat || false; + let isAdhoc=params.isAdhocScreen || false; + let fbv1=params.FeedbackView || false; + setIsFeedbackView(fbv1); + setShowCat(ShowCat1); + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setActiveSurvey(surveydata) + setCurrentMenu(menu1); + setActiveCategory(catData) + + if(fbv1==true){ + getSurveyData2(storeData1); + }else{ + getSurveyData(surveydata,catData,storeData1,ShowCat1); + } + + props.navigation.addListener('beforeRemove', onBeforeRemove); + return (()=>{ + // audioRecorderPlayer.removePlayBackListener(); + // audioRecorderPlayer.removeRecordBackListener(); + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }); + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + + + function onRemoveScreen(e){ + Alert.alert( + "", + "Do you really want to exit the screen?", + [ + { + text: "Cancel", + onPress: () => {}, + style: "cancel" + }, + { text: "OK", onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + // async function getData(surveydata,catData={},storeData1){ + + // try { + // let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + // let surveyQtns=require('../constants/s_qtns.json'); + // let subcats=[],qtns=[]; + // for(const i in surveyQtns){ + // let item=surveyQtns[i] + // let {ShowCat,AnswerId,Answer,AnswerSequence,ImageAllow,EnableQuestion,DisableQuestion,SubCategoryId,SubCategory,SubCategorySequence}=item; + // let addqtn=false; + + // // let obj={MaxLength,MinLength,SubCategoryId,SubCategory,LengthValidation,QuestionImageAllow,DateRange,Question,QuestionId,QuestionType,OTP,Answer,AnswerId,ImageAllow,MULTI_OPTIONS_IDS:[]} + // if(ShowCat==0 && item.SurveyId==surveydata.SurveyId && qtns.findIndex(a=>a.QuestionId==item.QuestionId)<0) + // { + // qtns.push(item); + // } + // else if(ShowCat==1 && Object.keys(catData).length>0 && item.SurveyId==surveydata.SurveyId && item.CategoryId==catData.CategoryId && qtns.findIndex(a=>a.QuestionId==item.QuestionId)<0) + // { + // qtns.push(item); + // } + + // let s_obj={SubCategory,SubCategoryId,SubCategorySequence}; + // if(ShowCat==0 && item.SurveyId==surveydata.SurveyId && subcats.findIndex(a=>a.SubCategoryId==item.SubCategoryId)<0){ + // subcats.push(s_obj); + // } + // else if(ShowCat==1 && Object.keys(catData).length>0 && item.SurveyId==surveydata.SurveyId && item.CategoryId==catData.CategoryId && subcats.findIndex(a=>a.SubCategoryId==item.SubCategoryId)<0){ + // subcats.push(s_obj); + // } + + + // let sc_index=subcats.findIndex(a=>a.SubCategoryId==item.SubCategoryId); + // if(sc_index>=0){ + // let sc=subcats[sc_index]; + // let Questions=sc['Questions'] || []; + // if(ShowCat==0 && item.SurveyId==surveydata.SurveyId && Questions.findIndex(a=>a.QuestionId==item.QuestionId)<0) + // { + // Questions.push(item); + // } + // else if(ShowCat==1 && Object.keys(catData).length>0 && item.SurveyId==surveydata.SurveyId && item.CategoryId==catData.CategoryId && Questions.findIndex(a=>a.QuestionId==item.QuestionId)<0) + // { + // Questions.push(item); + // } + + // sc['Questions']=Questions; + // subcats[sc_index]=sc; + // let q_index=Questions.findIndex(a=>a.QuestionId==item.QuestionId); + // let q_index2=qtns.findIndex(a=>a.QuestionId==item.QuestionId); + + // // if(q_index>=0){ + // // let data=item; + // // let qn=Questions[q_index]; + // // if(data.QuestionType=='List_Multi_Choice' || data.QuestionType=='List_Single_Choice' || data.QuestionType=='Rating'){ + // // let allanswers=qn['Answers'] || []; + // // let ansobj={AnswerId,Answer,AnswerSequence,ImageAllow,EnableQuestion,DisableQuestion} + // // allanswers.push(ansobj); + // // qn['Answers']=allanswers; + // // } + // // else if(data.QuestionType=='Date'){ + // // qn.showDatePicker=false; + // // } + // // Questions[q_index]=qn; + // // } + + + // if(q_index2>=0){ + // let data=item; + // let qn=qtns[q_index2]; + // if(data.QuestionType=='List_Multi_Choice' || data.QuestionType=='List_Single_Choice' || data.QuestionType=='Rating'){ + // let allanswers=qn['Answers'] || []; + // let ansobj={AnswerId,Answer,AnswerSequence,ImageAllow,EnableQuestion,DisableQuestion} + // if(allanswers.findIndex(a=>a.AnswerId==data.AnswerId)<0) + // allanswers.push(ansobj); + + // console.log('allanswers:',allanswers.length) + // qn['Answers']=allanswers; + // } + // else if(data.QuestionType=='Date'){ + // qn.showDatePicker=false; + // } + // qtns[q_index]=qn; + // } + + // } + // } + // setSurveySubCats(subcats); + // setSurveyQuestions(qtns); + // setProcessing(false); + + // } catch (err) { + // console.log(err); + // } + // } + + async function getSurveyData(item,catData={},storeData1,ShowCat1){ + try { + let {StoreId}=storeData1; + let {CategoryId}=catData; + let {SurveyId}= item; + + await db.transaction(async function (txn) { + + + let q2=`SELECT DISTINCT T.SubCategory,T.SubCategoryId,T.SubCategorySequence FROM Sup_Master_SurveyQuestion T INNER JOIN Mapping_SurveySup M ON T.SurveyId=M.SurveyId WHERE M.StoreId='${StoreId}' and T.SurveyId='${SurveyId}' `; + if(ShowCat1==true){ + q2+=` and T.CategoryId='${CategoryId}' `; + } + q2+=` order by T.CategorySequence`; + + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('survey subcats:',txnres.rows.length); + if(txnres.rows.length>0){ + let arr=[],allQtns=[]; + for(var i=0;i0){ + let arr=[],allQtns=[]; + for(var i=0;i{ + try { + let {StoreId}=storeData1; + let {CategoryId}=catData; + let {SurveyId}= item; + let {SubCategoryId}=subCat; + + db.transaction(async function (txn) { + let q2=''; + if(fbv1==true){ + // get inserted audit + let selectlist=` DISTINCT T.MaxLength as MaxLength,T.MinLength as MinLength,T.CategoryId,T.Category,T.SubCategoryId,T.SubCategory,T.LengthValidation as LengthValidation,T.QuestionImageAllow as QuestionImageAllow,T.DateRange as DateRange,T.Question as Question,T.QuestionId as QuestionId,T.QuestionType as QuestionType,T.OTP as OTP,T1.ANSWER As Answer, T1.ANSWER_ID as AnswerId,T1.IMAGE_ALLOW1 as ImageAllow1,T1.IMAGE1 as Image1,T1.IMAGE_ALLOW2 as ImageAllow2,T1.IMAGE2 as Image2,T1.MULTI_OPTIONS_IDS as multi_op_ids,T1.IS_DISABLED as isDisabled `; + let join=` INNER JOIN Mapping_SurveySup M on T.SurveyId=M.SurveyId`; + let join2=` INNER JOIN ${AppTables.SURVEY} T1 on T.SurveyId=T1.SURVEY_ID and T.CategoryId=T1.CATEGORY_ID and T.SubCategoryId=T1.SUB_CATEGORY_ID And T.QuestionId=T1.QUESTION_ID`; + q2=`Select ${selectlist} FROM Sup_Master_SurveyQuestion T ${join} ${join2} WHERE T1.STORE_ID='${StoreId}' AND T1.VISIT_DATE= '${d2}' AND T1.SUB_CATEGORY_ID='${SubCategoryId}' `; + q2+=` ORDER BY T.SubCategorySequence `; + } + else{ + // get inserted audit + let selectlist=` DISTINCT T.MaxLength as MaxLength,T.MinLength as MinLength,T.CategoryId,T.Category,T.SubCategoryId,T.SubCategory,T.LengthValidation as LengthValidation,T.QuestionImageAllow as QuestionImageAllow,T.DateRange as DateRange,T.Question as Question,T.QuestionId as QuestionId,T.QuestionType as QuestionType,T.OTP as OTP,T1.ANSWER As Answer, T1.ANSWER_ID as AnswerId,T1.IMAGE_ALLOW1 as ImageAllow1,T1.IMAGE1 as Image1,T1.IMAGE_ALLOW2 as ImageAllow2,T1.IMAGE2 as Image2,T1.MULTI_OPTIONS_IDS as multi_op_ids,T1.IS_DISABLED as isDisabled `; + let join=` INNER JOIN Mapping_SurveySup M on T.SurveyId=M.SurveyId`; + let join2=` INNER JOIN ${AppTables.SURVEY} T1 on T.SurveyId=T1.SURVEY_ID and T.CategoryId=T1.CATEGORY_ID and T.SubCategoryId=T1.SUB_CATEGORY_ID And T.QuestionId=T1.QUESTION_ID`; + q2=`Select ${selectlist} FROM Sup_Master_SurveyQuestion T ${join} ${join2} WHERE T1.STORE_ID='${StoreId}' AND T1.VISIT_DATE= '${d2}' AND T1.SURVEY_ID=${SurveyId} AND T1.SUB_CATEGORY_ID='${SubCategoryId}' `; + if(ShowCat1==true){ + q2+=` AND T1.CATEGORY_ID=${CategoryId} `; + } + q2+=` ORDER BY T.SubCategorySequence `; + } + + + + + await txn.executeSql(q2,[],async function (txn2, txnres) { + + if(txnres.rows.length>0){ + let arr=[]; + var QD=QuestionsData; + for(var i=0;i0){ + for(var k=0;k=0)){ + showImageTag=true; + } + + if(qtn.QuestionType=='List_Single_Choice' && (isandImgAl2 && ansss.AnswerId==selansid)){ + showImageTag2=true; + } + else if(qtn.QuestionType=='List_Multi_Choice' && (isandImgAl2 && selansid.indexOf(ansss.AnswerId)>=0)){ + showImageTag2=true; + } + + } + } + } + + if(showImageTag){ + let imgPath=(Platform.OS=='ios'?'file://':'')+common_ImagePath+data.Image1; + QD[imgname_key]=data.Image1; + QD[img_key]=imgPath; + } + + if(showImageTag2){ + let imgPath=(Platform.OS=='ios'?'file://':'')+common_ImagePath+data.Image2; + QD[imgname_key2]=data.Image2; + QD[img_key2]=imgPath; + } + + + + if(qtn.QuestionType=='Audio'){ + let voicefile_path=(Platform.OS=='ios'?'file://':'')+common_ImagePath+'Recordings/'+data.Answer; + QD[voiceClip_key]={'path':voicefile_path,'filename':data.Answer}; + } + + if(qtn.QuestionType=='Date'){ + let dayonly=moment().format('DD'); + let actual_date=data.Answer?data.Answer.split('/'):[]; + let month=actual_date[0],year=actual_date[1]; + let fulldate=month+'/'+dayonly+'/'+year; + QD[date_key]=fulldate; + + } + arr.push(data); + if(i==txnres.rows.length-1){ + setQuestionsData(QD); + resolve(arr); + // setSurveyQuestions(arr); + // setProcessing(false); + } + } + } + else{ + let q=''; + if(fbv1==true){ + let sl=` DISTINCT T.CategoryId,T.Category,T.SubCategoryId,T.SubCategory,T.MaxLength,T.MinLength,T.LengthValidation,T.Question,T.QuestionId,T.QuestionType,T.OTP,T.QuestionImageAllow,T.DateRange`; + q=` SELECT ${sl} FROM Sup_Master_SurveyQuestion T INNER JOIN Mapping_SurveySup M on T.SurveyId=M.SurveyId WHERE M.StoreId='${StoreId}' and T.SubCategoryId='${SubCategoryId}' `; + q+=` order by T.SubCategorySequence `; + } + else{ + let sl=` DISTINCT T.CategoryId,T.Category,T.SubCategoryId,T.SubCategory,T.MaxLength,T.MinLength,T.LengthValidation,T.Question,T.QuestionId,T.QuestionType,T.OTP,T.QuestionImageAllow,T.DateRange`; + q=` SELECT ${sl} FROM Sup_Master_SurveyQuestion T INNER JOIN Mapping_SurveySup M on T.SurveyId=M.SurveyId WHERE M.StoreId='${StoreId}' and T.SurveyId='${SurveyId}' and T.SubCategoryId='${SubCategoryId}' `; + if(ShowCat1==true){ + q+=` and T.CategoryId='${CategoryId}' `; + } + q+=` order by T.SubCategorySequence `; + } + + + + await txn.executeSql(q,[],async function (txn2, txnres2) { + + let arr=[]; + if(txnres2.rows.length>0){ + for(var i=0;i{ + db.transaction(async function (txn) { + // get inserted audit + let q2=''; + if(fbv1==true){ + let selectlist=` DISTINCT T.Answer,T.AnswerId,T.ImageAllow1,T.ImageAllow2,T.EnableQuestion,T.DisableQuestion`; + let join=` INNER JOIN Mapping_SurveySup M on T.SurveyId=M.SurveyId`; + q2=`Select ${selectlist} FROM Sup_Master_SurveyQuestion T ${join} WHERE T.QuestionId='${qtn.QuestionId}' AND M.StoreId = '${StoreId}' AND T.SubCategoryId='${qtn.SubCategoryId}' ORDER BY T.AnswerSequence `; + } + else{ + let selectlist=` DISTINCT T.Answer,T.AnswerId,T.ImageAllow1,T.ImageAllow2,T.EnableQuestion,T.DisableQuestion`; + let join=` INNER JOIN Mapping_SurveySup M on T.SurveyId=M.SurveyId`; + q2=`Select ${selectlist} FROM Sup_Master_SurveyQuestion T ${join} WHERE T.QuestionId='${qtn.QuestionId}' AND M.StoreId = '${StoreId}' AND T.SurveyId==${SurveyId} AND T.SubCategoryId='${qtn.SubCategoryId}' ORDER BY T.AnswerSequence `; + } + + await txn.executeSql(q2,[],async function (txn2, txnres) { + // console.log('answers len',txnres.rows.length); + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return {'Answers':val,'Success':true}; + }).catch((err)=>{ + console.log(err); + return {'Success':false,'Error':err} + }); + } + + async function getImage(imgdata){ + let qtn=getImageProps.qtn || ''; + let type=getImageProps.type || '1'; + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify('Camera unavailable'); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | Survey Id:'+ActiveSurvey.SurveyId+' | Question Id :'+qtn.QuestionId+' | Image Type: Survey'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+ActiveSurvey.SurveyId+'_'+qtn.QuestionId+'_SurveyImg_'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let qd=QuestionsData; + let img_key=type=='1'?qtn.QuestionId+'_ImagePath1':qtn.QuestionId+'_ImagePath2'; + let imgname_key=type=='1'?qtn.QuestionId+'_ImageName1':qtn.QuestionId+'_ImageName2'; + qd[imgname_key]=filename; + + // renamefile + let imagePath=`${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker',uri); + qd[img_key]=uri; + + setQuestionsData(qd); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(qtn,type){ + setGetImageProps({'qtn':qtn,'type':type}); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function disableQtns(sqtns,DQtns,data,isreturn=false){ + + if(DQtns.length>0){ + new Promise.all( + DQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.QuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=true + sqtns[s_qtnindex]=s_qtn; + let id_key=s_qtn.QuestionId+'_AnswerId'; + let ans_key=s_qtn.QuestionId+'_Answer'; + data[id_key]=0; + data[ans_key]=''; + return false + }) + ).then(async (val)=>{ + setSurveyQuestions(sqtns); + setQuestionsData(data); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + }) + } + } + + async function enableQtns(sqtns,EQtns,DQtns,data){ + new Promise.all( + EQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.QuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=false + sqtns[s_qtnindex]=s_qtn; + return false + }) + ).then(async (val)=>{ + if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data) + } + else{ + setSurveyQuestions(sqtns); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + }) + } + + function onselectionChange(option,qtn){ + let data=QuestionsData; + let id_key=qtn.QuestionId+'_AnswerId'; + let ans_key=qtn.QuestionId+'_Answer'; + data[id_key]=option.value; + data[ans_key]=option.label; + + setQuestionsData(data); + + let aq_ans=qtn.Answers!=null?qtn.Answers:[]; + let ans_obj=aq_ans.find(i=>i.AnswerId==option.value) || {}; + let EQtns=ans_obj.EnableQuestion!=null && ans_obj.EnableQuestion!=''?ans_obj.EnableQuestion.replace(' ','').split(','):[]; + let DQtns=ans_obj.DisableQuestion!=null && ans_obj.DisableQuestion!=''?ans_obj.DisableQuestion.replace(' ','').split(','):[]; + + let sqtns=SurveyQuestions + if(EQtns.length>0){ + enableQtns(sqtns,EQtns,DQtns,data) + } + else if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data) + } + else{ + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + + } + + function setTextValue(value,qtn) { + let id_key=qtn.QuestionId+'_AnswerId'; + let ans_key=qtn.QuestionId+'_Answer'; + + let obj=QuestionsData; + if(qtn.QuestionType=='Date' ){ + let date_key=qtn.QuestionId+'_Date'; + let d=value!=null?new Date(value):new Date(); + let mfdate=moment(d).format('MM/YYYY'); + showQtnDatePicker(qtn,false); + obj[id_key]=0; + obj[ans_key]=mfdate; + obj[date_key]=moment(d).format('MM/DD/YYYY'); + } + else{ + obj[id_key]=0; + obj[ans_key]=value; + } + console.log(value,obj); + setQuestionsData(obj); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function setRatingValue(data){ + // let ids=[]; + // data.map((item,index)=>{ + // ids.push(item.AnswerId); + // }) + setRatingOrder(data); + } + + + async function setMultiSelectValue(selectedItems=[],qtn) { + console.log('setMultiSelectValue',selectedItems); + let id_key=qtn.QuestionId+'_AnswerId'; + let ans_key=qtn.QuestionId+'_Answer'; + let multi_key=qtn.QuestionId+'_MultiOption'; + let obj=QuestionsData; + obj[id_key]=0; + obj[multi_key]=selectedItems.join(','); + let anss=[]; + selectedItems.map((itemValue)=>{ + let ans = qtn.Answers.find(c1 => c1.AnswerId == itemValue); + if(ans.Answer){anss.push(ans.Answer)} + }); + obj[ans_key]=anss.join(','); + console.log('obj:',obj); + setQuestionsData(obj); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function showQtnDatePicker(qtn,show=false){ + let newqtnIndex=SurveyQuestions.findIndex(q=>q.QuestionId==qtn.QuestionId); + console.log('showQtnDatePicker:',newqtnIndex); + if(newqtnIndex>=0){ + let sq=SurveyQuestions; + let newqtn=sq[newqtnIndex]; + newqtn.showDatePicker=show; + sq[newqtnIndex]=newqtn; + setSurveyQuestions(sq); + if(show==true) setrerenderdata(!rerenderdata); + } + } + + + function setShowQtnKey(qtn,key,show=false){ + if(key!=null && key!=''){ + let newqtnIndex=SurveyQuestions.findIndex(q=>q.QuestionId==qtn.QuestionId); + console.log('setShowQtnKey:',newqtnIndex); + if(newqtnIndex>=0){ + let sq=SurveyQuestions; + let newqtn=sq[newqtnIndex]; + newqtn[key]=show; + sq[newqtnIndex]=newqtn; + setSurveyQuestions(sq); + if(show==true) setrerenderdata(!rerenderdata); + } + } + } + + function onRatingCancel(){ + setShowRating(false); + + } + + function onRatingSave(){ + setShowRating(false); + + let qtn=RatingQtn; + let id_key=qtn.QuestionId+'_AnswerId'; + let ans_key=qtn.QuestionId+'_Answer'; + let rating_key=qtn.QuestionId+'_Rating'; + let ids=[],anss=[]; + RatingOrder.map((item,index)=>{ + ids.push(item.AnswerId); + anss.push(item.Answer); + }) + let obj=QuestionsData; + obj[rating_key]=ids.join(','); + obj[id_key]=0; + obj[ans_key]=anss.join(','); + + console.log(obj); + setQuestionsData(obj); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onRecordCancel(){ + setShowRecorder(false); + } + + function onRecordSave(){ + + let isRecorderPlaying=VRS.RecorderPlayStatus!=null && VRS.RecorderPlayStatus==true; + let isPlayerPlaying=VRS.PlayerPlayStatus!=null && VRS.PlayerPlayStatus==true; + + if(isRecorderPlaying){ + notify('Please stop recording first'); + return; + } + else if(isPlayerPlaying){ + stopPlayer(VRS); + // notify('Please stop playing audio first'); + // return; + } + + setShowRecorder(false); + let qtn=RatingQtn; + let id_key=qtn.QuestionId+'_AnswerId'; + let ans_key=qtn.QuestionId+'_Answer'; + let voiceClip_key=qtn.QuestionId+'_VoiceClip'; + + let obj=QuestionsData; + obj[ans_key]=RecFilePath.filename || ''; + obj[id_key]=0; + obj[voiceClip_key]=RecFilePath; + + setQuestionsData(obj); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + const RippleAnimation = (value,minValue,maxValue,delay) => + Animated.loop( + Animated.sequence([ + Animated.timing(value, { + toValue: maxValue, + duration: 1000, + delay:delay, + useNativeDriver:(Platform.OS=='ios'?false:true), + }), + Animated.timing(value, { + toValue: minValue, + duration: 1000, + delay:delay, + useNativeDriver:(Platform.OS=='ios'?false:true), + }), + ]), + + ).start(); + + const startRecorder = React.useCallback(async (storeData1,qtn,ActiveSurvey1,vrStatus) => { + try{ + console.log('startRecorder') + if(audioRecorderPlayer!=null){ + + if(vrStatus['RecorderPlayStatus']==true){ + notify('Already Recording...') + return; + } + else if(vrStatus['PlayerPlayStatus']==true){ + notify('Please stop player first!') + return; + } + + stopPlayer(vrStatus); + + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let commname=storeData1.StoreId+'_'+ActiveSurvey1.SurveyId+'_'+qtn.QuestionId+'_SurveyRecording_'+picture_clicked_date+'_'+picture_clicked_time; + let filename=Platform.OS=='ios'?commname+'.m4a':commname+'.mp3'; + + const url=Platform.OS=='ios'?'file://'+common_ImagePath+'Recordings/'+filename:common_ImagePath+'Recordings/'+filename; + const url_dir=common_ImagePath+'Recordings/'; + console.log('write file url:',url); + RNFS.mkdir(url_dir).then((res)=>{ + + RNFS.writeFile(url, '') + .then(async (success) => { + // if(success!=null){ + const path = Platform.select({ + ios: url, + android: url, + }); + + const result = await audioRecorderPlayer.startRecorder(path,AudioSet); + + if(result!=null && result!=''){ + console.log('start recording now'); + vrStatus['RecorderPlayStatus']=true; + setVRS(vrStatus); + setRecFilePath({'path':url,'filename':filename}); + // animate + RippleAnimation(animatedRipple,0,1,0); + RippleAnimation(animatedRipple2,0,1,100); + + audioRecorderPlayer.addRecordBackListener((e) => { + let recordsec=e.currentPosition; + let data={'recordSecs':recordsec,'recordTime':audioRecorderPlayer.mmssss(Math.floor(recordsec))}; + if(vrStatus['RecorderPlayStatus']==true) + { + setRecorderTimer(data); + setHasUnsavedChanges(true); + setVoiceRecorderStatus('Recording... ! Press mic to stop recording'); + } + + console.log('recordsec:',recordsec); + if(recordsec>=60*1000){ + stopRecorder(vrStatus); + notify('Maximum record time limit reached.','LONG'); + } + return; + }); + } + console.log('start recorder:',result); + // } + // else{ + // notify('Something Went Wrong! Cannot open file for recording!'); + // } + + }) + .catch((err) => { + console.log('eerriur1',err.message); + notify('Something Went Wrong! Cannot open file for recording!'); + }); + }) + .catch((err) => { + console.log('eerriur2',err.message); + notify('Something Went Wrong! Cannot open file for recording!'); + }); + + } + } + catch(e){ + console.log('error:',e); + } + + },[]); + + + + + + + const stopRecorder = React.useCallback(async (vrStatus) => { + try{ + console.log('stopRecorder'); + if(audioRecorderPlayer!=null){ + + animatedRipple.setValue(0); + animatedRipple2.setValue(0.5); + const uri = await audioRecorderPlayer.stopRecorder(); + // audioRecorderPlayer.removeRecordBackListener(); + + vrStatus['RecorderPlayStatus']=false; + vrStatus['PlayerPlayStatus']=false; + setPlayerTimer({}); + setVRS({...VRS,vrStatus}); + setVoiceRecorderStatus('Press mic to start recording voice'); + } + } + catch(e){ + console.log('error:',e); + } + + },[]); + + const startPlayer = React.useCallback(async (url,vrStatus1,type='0') => { + try{ + let vrStatus=VRS; + let qtn=RatingQtn; + if(audioRecorderPlayer!=null){ + console.log('startPlayer1',url); + if(vrStatus['PlayerPlayStatus']==true){ + notify('Already Playing...') + return; + } + else if(vrStatus['RecorderPlayStatus']==true){ + notify('Please stop recording first!') + return; + } + else if(url=='' || url==null){ + notify('File not found!') + return; + } + + const result = await audioRecorderPlayer.startPlayer(url); + if(result!=null){ + vrStatus['PlayerPlayStatus']=true; + setVRS(vrStatus); + + audioRecorderPlayer.addPlayBackListener((e) => { + let playDuration=audioRecorderPlayer.mmssss(Math.floor(e.duration)); + let vrs=VRS; + let data={'playerSecs':e.currentPosition,'totalDuration':e.duration,'playDuration':playDuration,'playTime':audioRecorderPlayer.mmssss(Math.floor(e.currentPosition),)}; + let data2={'playerSecs':'0000','totalDuration':e.duration,'playDuration':playDuration,'playTime':"00:00:00"}; + if(vrs['PlayerPlayStatus']==true) + { + setPlayerTimer(e.currentPosition<0?data2:data); + } + if(e.currentPosition<0){ + return ; + } + let wp=e.duration!=null?Math.floor((e.currentPosition/e.duration)* 100):0; + console.log('wp:',wp); + if(wp>=100 || isNaN(wp)){ + stopPlayer(vrs); + } + else if(type=='1' && wp<1){ + pausePlayer(); + } + setProcessing(false); + return; + }); + } + else{ + setProcessing(false); + } + } + } + catch(e){ + console.log('error:',e); + setProcessing(false); + } + + },[]); + + const resumePlayer = React.useCallback(async (url)=>{ + console.log('resume player') + let vrStatus=VRS; + const res=await audioRecorderPlayer.resumePlayer(); + console.log('res:',res); + if(res=='No audio playing'){ + startPlayer(url,vrStatus); + } + vrStatus['PlayerPlayStatus']=true; + setVRS({...VRS,vrStatus}); + },[]); + + + const pausePlayer = React.useCallback(()=>{ + console.log('pause player') + let vrStatus=VRS; + audioRecorderPlayer.pausePlayer(); + vrStatus['PlayerPlayStatus']=false; + setVRS({...VRS,vrStatus}); + },[]); + + const stopPlayer = React.useCallback(async (vrStatus) => { + try{ + console.log('stop player now'); + + if(audioRecorderPlayer!=null){ + const uri = await audioRecorderPlayer.stopPlayer(); + audioRecorderPlayer.removePlayBackListener(); + vrStatus['PlayerPlayStatus']=false; + setVRS({...VRS,vrStatus}); + } + } + catch(e){ + console.log('error:',e); + } + + },[]); + + async function show_recorder(qtn){ + let voiceClip_key=qtn.QuestionId+'_VoiceClip'; + let url=QuestionsData[voiceClip_key]?QuestionsData[voiceClip_key].path :''; + setRatingQtn(qtn); + if((RecorderTimer==null || Object.keys(RecorderTimer).length<=0) && (playerTimer==null || Object.keys(playerTimer).length<=0) && url!=null && url!=''){ + setLoaderTitle('Loading...'); + setProcessing(true); + await startPlayer(url,VRS,'1'); + } + setRecFilePath((QuestionsData[voiceClip_key] || {})); + setShowRecorder(true); + } + + async function onSubmitData(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + function onSaveCancel(){ + setShowAlert(false); + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + + let q=`DELETE FROM ${AppTables.SURVEY} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' and SURVEY_ID='${ActiveSurvey.SurveyId}' `; + if(ShowCat==true){ + q+=` and CATEGORY_ID='${ActiveCategory.CategoryId}' `; + } + + // remove old data + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('survey data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + + var values=''; + let {SurveyId,SurveyName} = ActiveSurvey; + for(var i=0;ii.AnswerId==selansid) + let imgallow1=ans_obj!=null && ans_obj['ImageAllow1']!=null?ans_obj.ImageAllow1:false; + let imgallow2=ans_obj!=null && ans_obj['ImageAllow2']!=null?ans_obj.ImageAllow2:false; + let f_imgalloq1=(QuestionImageAllow=='true' || QuestionImageAllow==1) || (imgallow1=='true' || imgallow1==1) + + values+=` ('${StoreId}','${d2}','${SurveyId}','${CategoryId}','${SubCategoryId}','${Question}','${QuestionId}','${QuestionType}','${selans}','${selansid}','${f_imgalloq1}','${imgName1}','${imgallow2}','${imgName2}','${multiops}','${isQtnDisabled}','${d2}') `; + } + + let add_data=`INSERT INTO ${AppTables.SURVEY} (STORE_ID,VISIT_DATE,SURVEY_ID,CATEGORY_ID,SUB_CATEGORY_ID,QUESTION,QUESTION_ID,QUESTION_TYPE,ANSWER,ANSWER_ID,IMAGE_ALLOW1,IMAGE1,IMAGE_ALLOW2,IMAGE2,MULTI_OPTIONS_IDS,IS_DISABLED,ADDED_DATE) VALUES ${values} `; + + await txn.executeSql(add_data,[],async function (txn2, txnres) { + console.log('surveys added'); + notify('Survey updated successfully','SHORT'); + setProcessing(false); + props.navigation.goBack(); + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot update survey') },); + + + }); + } catch (err) { + console.log(err); + } + } + + async function validate(){ + var isvalid=true; + const QD=QuestionsData; + console.log(SurveyQuestions.length); + for(var i=0;i=0 && QD[ans_key]===''))){ + isvalid=false; + let msg=( qtn.QuestionType=='Date'?'Please pick a date':(qtn.QuestionType=='Rating'?'Please select rating':'Please fill all details')); + notify(msg,'SHORT'); + break; + } + else if( qtn.QuestionType=='Audio' && (Object.keys(QD).indexOf(voiceClip_key)<0 || (Object.keys(QD).indexOf(voiceClip_key)>=0 && (QD[voiceClip_key]==null || QD[voiceClip_key].filename==null || QD[voiceClip_key].filename=='')))){ + isvalid=false; + notify('Please record audio clip for the required field','SHORT'); + break; + } + else if(Object.keys(QD).indexOf(id_key)<0 || (Object.keys(QD).indexOf(id_key)>=0 && (QD[id_key]==='' || (QD[id_key]===0 && qtn.isDisabled===false) ))){ + isvalid=false; + notify('Please fill all details','SHORT'); + break; + } + else if(isImgAllowed && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + isvalid=false; + notify('Please add images','SHORT'); + break; + }else{ + console.log('no condition found'); + } + + if((qtn.QuestionType=='List_Single_Choice' || qtn.QuestionType=='List_Multi_Choice' )){ + if (qtn.Answers && qtn.Answers.length>0){ + for(var j=0;j=0)){ + showImageTag=true; + } + + let isandImgAl2=(ansss.ImageAllow2==true || ansss.ImageAllow2=='true' || ansss.ImageAllow2==1); + if(qtn.QuestionType=='List_Single_Choice' && (isandImgAl2 && ansss.AnswerId==selansid)){ + showImageTag2=true; + } + else if(qtn.QuestionType=='List_Multi_Choice' && (isandImgAl2 && selansid.indexOf(ansss.AnswerId)>=0)){ + showImageTag2=true; + } + } + } + } + + if(showImageTag && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + isvalid=false; + notify('Please add images','SHORT'); + break; + } + + + if(showImageTag2 && (Object.keys(QD).indexOf(img_key2)<0 || (Object.keys(QD).indexOf(img_key2)>=0 && QD[img_key2]===''))){ + isvalid=false; + notify('Please add images','SHORT'); + break; + } + + + } + + return isvalid; + } + + function render_Picker(label_key,value_key,onChange=()=>{},selected_data={}){ + var data=[]; + let qtn=selected_data.qtn || {}; + let isQtnDisabled=qtn.isDisabled!=null && qtn.isDisabled!=''?qtn.isDisabled:false; + let allAnswers=qtn.Answers || []; + + allAnswers.map((item,index)=>{ + let obj={ key: index, label: item[label_key],value:item[value_key] }; + if(selected_data.value==item[label_key]) + obj['component']= {item[label_key]}; + data.push(obj); + }); + + return ( + {onChange(option,qtn) }} + overlayStyle={customStyle.addVisPickerOverlay} + cancelContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + optionStyle={customStyle.addvis_opStyle} + optionTextStyle={customStyle.addvis_opTextStyle} + optionContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + selectedKey={'1'} + disabled={isQtnDisabled} + > + {(selected_data.value!=null && selected_data.value!=''?selected_data.value: '-select-')} + + ) + } + + function renderDatePicker(qtn){ + let qtnn=qtn; + let DateRange=qtn.DateRange; + let maxDate=moment().add(10,'years').format('MM/DD/YYYY'); + let minDate=moment().subtract(10,'years').format('MM/DD/YYYY'); + if(DateRange=='RFD'){ + maxDate=moment().format('MM/DD/YYYY'); + } + else if(DateRange=='RPD'){ + minDate=moment().format('MM/DD/YYYY'); + } + + return ( + {setTextValue(selectedDate,qtnn)}} + maximumDate={new Date(maxDate)} + minimumDate={new Date(minDate)} + /> + ); + } + + function renderItem({ item, drag, isActive }){ + return ( + + + {item.Answer} + + + ); + }; + + function renderRatingView(){ + let qtn=RatingQtn; + let Answers=qtn.Answers; + let id_key=qtn.QuestionId+'_AnswerId'; + let ans_key=qtn.QuestionId+'_Answer'; + let rating_key=qtn.QuestionId+'_Rating'; + // let ratings=QuestionsData[rating_key]!=null?QuestionsData[rating_key].split(','):[]; + + let newarr=RatingOrder; + if(RatingOrder.length<=0){ + newarr=Answers; + } + + return ( + + + Drag Items In Order + Press and hold to drag + {setRatingValue(data)}} + keyExtractor={(item) => item.AnswerId} + renderItem={renderItem} + /> + + {onRatingCancel()}}> + Cancel + + {onRatingSave()}}> + Save + + + + + ) + } + + function renderRecorderView(){ + + let qtn=RatingQtn; + let isRecorderPlaying=VRS.RecorderPlayStatus!=null && VRS.RecorderPlayStatus==true; + let isPlayerPlaying=VRS.PlayerPlayStatus!=null && VRS.PlayerPlayStatus==true; + const scale=animatedRipple.interpolate({ + inputRange:[0,1], + outputRange:[1,1.3], + }); + + const borderColor=animatedRipple.interpolate({ + inputRange:[0,1], + outputRange:['#f5acb4c2','#fce6e9e3'], + }); + + const scale2=animatedRipple2.interpolate({ + inputRange:[0,1], + outputRange:[1,1.5], + }); + + const borderColor2=animatedRipple2.interpolate({ + inputRange:[0,1], + outputRange:['#f5acb4c2','#fce6e9e3'], + }); + + let totalDuration=RecorderTimer.recordSecs!=null?RecorderTimer.recordSecs:playerTimer.totalDuration; + let wp=totalDuration!=null?Math.floor((playerTimer.playerSecs/totalDuration)* 100):0; + let width1=wp<=100?(wp>0?wp+'%':'0%'):'100%'; + if(isNaN(wp)) width1='0%'; + + return ( + + {rerenderView==rerenderView && + + Record Voice Clip + You can record max for 60 secs + {VoiceRecorderStatus} + + + + + + {startRecorder(storeData,qtn,ActiveSurvey,VRS); }}> + + + {isRecorderPlaying && + {stopRecorder(VRS); }}> + + + } + + + + {RecorderTimer.recordTime} + { + (!isRecorderPlaying && RecFilePath.filename!=null && RecFilePath.filename!='') && + + + + + + + {`${(playerTimer.playTime || '00:00:00')} / ${playerTimer.playDuration || RecorderTimer.recordTime}`} + + + + {let url=(Platform.OS=='ios'?'file://':'')+common_ImagePath+'Recordings/'+RecFilePath.filename; (wp<100 && wp>0)? resumePlayer(url):startPlayer(url,VRS); }}> + + + {isPlayerPlaying && { wp<100?pausePlayer():stopPlayer(VRS); }}> + + } + + + } + + + + {onRecordCancel()}}> + Cancel + + {onRecordSave()}}> + Save + + + } + + ) + } + + function _renderSurveyQtns(subcat){ + const SurveyQuestions=subcat.Questions; + return ( + + { + SurveyQuestions.length>0 && + SurveyQuestions.map((item,index)=>{ + + let qtn=item; + let selansid='',selanswer='',selimg='',selimg2='',showImageTag=false,showImageTag2=false; + let id_key=qtn.QuestionId+'_AnswerId'; + let ans_key=qtn.QuestionId+'_Answer'; + let multi_key=qtn.QuestionId+'_MultiOption'; + let date_key=qtn.QuestionId+'_Date'; + let img_key=qtn.QuestionId+'_ImagePath1'; + let imgname_key=qtn.QuestionId+'_ImageName1'; + let img_key2=qtn.QuestionId+'_ImagePath2'; + let imgname_key2=qtn.QuestionId+'_ImageName2'; + let rating_key=qtn.QuestionId+'_Rating'; + let voiceClip_key=qtn.QuestionId+'_VoiceClip'; + let list_mcdata=[]; + + if(qtn.QuestionType=='List_Single_Choice') + { + selansid=QuestionsData[id_key]!=null ?QuestionsData[id_key] :''; + selanswer=QuestionsData[ans_key]!=null ?QuestionsData[ans_key] :''; + } + else if(qtn.QuestionType=='List_Multi_Choice') + { + + if(qtn.Answers!=null){ + console.log('qtn.Answers:',qtn.Answers.length); + for(var i=0;i0){ + let arr=[]; + for(var i=0;i0){ + for(var i=0;i=0)){ + showImageTag=true; + } + + if(qtn.QuestionType=='List_Single_Choice' && (isandImgAl2 && ansss.AnswerId==selansid)){ + showImageTag2=true; + } + else if(qtn.QuestionType=='List_Multi_Choice' && (isandImgAl2 && selansid.indexOf(ansss.AnswerId)>=0)){ + showImageTag2=true; + } + } + } + } + + if(showImageTag){ + selimg=QuestionsData[img_key]!=null && QuestionsData[img_key]!=''?'file://'+QuestionsData[img_key]:''; + } + + if(showImageTag2){ + selimg2=QuestionsData[img_key2]!=null && QuestionsData[img_key2]!=''?'file://'+QuestionsData[img_key2]:''; + } + + + + return( + + {qtn.Question} + {qtn.QuestionType=='List_Single_Choice' && qtn.Answers && + render_Picker('Answer','AnswerId',onselectionChange,{value:selanswer,qtn:qtn}) + } + {qtn.QuestionType=='List_Multi_Choice' && qtn.Answers && + {console.log('onSelectedItemsChange'); }} //setMultiSelectValue(selectedItems,qtn) + selectedItems={selansid} + selectText="Pick Items" + searchInputPlaceholderText="Search Items..." + // onChangeInput={ (text)=> console.log(text)} + tagRemoveIconColor={PrimaryTheme.$primary_color} + tagBorderColor={PrimaryTheme.$primary_color} + tagTextColor={PrimaryTheme.$primary_color} + selectedItemTextColor={PrimaryTheme.$primary_color} + selectedItemIconColor={PrimaryTheme.$primary_color} + itemTextColor={PrimaryTheme.$text_color} + displayKey="Answer" + searchInputStyle={{ color: '#CCC' }} + submitButtonColor={PrimaryTheme.$primary_color} + submitButtonText="Submit" + /> + } + { (qtn.QuestionType=='Number' || qtn.QuestionType=='Decimal' || qtn.QuestionType=='Text') && + {setTextValue(val,qtn)}} + autoComplete='off' + /> + } + { + (qtn.QuestionType=='Date') && + + {selansid!=''?selansid:'MM/YYYY'} + {setDateValue(selanswer);showQtnDatePicker(qtn,true)}}> + + + + } + { ((qtn.showDatePicker==true || qtn.showDatePicker=='true') && (qtn.QuestionType=='Date') ) && + renderDatePicker(qtn) + } + { + (qtn.QuestionType=='Rating') && + + {selanswer} + {setRatingQtn(qtn);setShowRating(true);}}> + + + + } + + { + (qtn.QuestionType=='Audio') && + + {selanswer} + {show_recorder(qtn);}}> + + + + } + + { + showImageTag && + + + {openCamera(qtn,'1')}}> + + + + } + { + showImageTag2 && + + + {openCamera(qtn,'2')}}> + + + + } + + ) + }) + } + + + ); + } + + // function _renderSurveyQtns(subcatItem){ + // return ( + // { + + // }} + // /> + // ) + // } + + function _renderSurveyView(){ + return ( + + { + let subcat=item,s_index=index; + + return ( + + + {subcat.SubCategory} + + { _renderSurveyQtns(subcat)} + + ) + }} + > + + + + ); + } + + + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + {isFeedbackView!=true && + + {/* {(ActiveSurvey.SurveyName!=null?(ActiveSurvey.SurveyName.length>26?ActiveSurvey.SurveyName.substring(0,26)+'...':ActiveSurvey.SurveyName) : '')} */} + {('Survey Id : '+(ActiveSurvey.SurveyId || '')+(ShowCat==true?' | '+'Category Id : '+(ActiveCategory.CategoryId || ''):''))} + + } + { + // Object.keys(ActiveSurvey).length>0 && + _renderSurveyView() + } + + {onSubmitData()}}/> + + + + { showRating==true && + renderRatingView() + } + { showRecorder==true && + renderRecorderView() + } + + ); + } + + +export default connect(mapStateToProps, mapDispatchToProps)(QuestionsScreen); \ No newline at end of file diff --git a/src/screens/ReportsMenu.js b/src/screens/ReportsMenu.js new file mode 100644 index 0000000..ed074d9 --- /dev/null +++ b/src/screens/ReportsMenu.js @@ -0,0 +1,142 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,DownloadData} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl, db} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign} from '../components/icons'; +import { WebView } from 'react-native-webview'; +import CustomLoader from '../components/CustomLoader'; +import NoDataComponent from '../components/NoDataComponent'; +import LinearGradient from 'react-native-linear-gradient'; + +function ReportsMenu(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [webviewurl, setWebviewurl] = useState(false); + const [processing, setProcessing] = useState(true); + const [isDataFound, setisDataFound] = useState(false); + const [reportData, setReportData] = useState([]); + const [designation, setDesignation] = useState(''); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + getData(); + }, []); + + + async function getData(){ + try { + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + let desg=loginDetails.Designation || ''; + setDesignation(desg); + await db.transaction(async function (txn) { + + let q=`SELECT * from Sup_Master_MenuReports`; + await txn.executeSql(q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i + {processing && } + + + + { !props.isDataDownloaded && } + { props.isDataDownloaded==true && + + + { isDataFound==false && + + {ST.NoDataAvailable} + + } + + { + isDataFound==true && + + + + {ST.Username+' :'} + {props.UserId} + + + {ST.Designation+' :'} + {designation} + + + + { + reportData.length>0 && + reportData.map((item,index)=>{ + return( + {gotoReport(item)}}> + {item.ReportName} + + ) + }) + } + + + } + + + } + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(ReportsMenu); \ No newline at end of file diff --git a/src/screens/ReportsMenuOld.js b/src/screens/ReportsMenuOld.js new file mode 100644 index 0000000..a0f26f9 --- /dev/null +++ b/src/screens/ReportsMenuOld.js @@ -0,0 +1,186 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,DownloadData} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl, db} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign} from '../components/icons'; +import { WebView } from 'react-native-webview'; +import CustomLoader from '../components/CustomLoader'; +import NoDataComponent from '../components/NoDataComponent'; +import LinearGradient from 'react-native-linear-gradient'; + +function ReportsMenu(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [webviewurl, setWebviewurl] = useState(false); + const [processing, setProcessing] = useState(true); + const [isDataFound, setisDataFound] = useState(false); + const [reportData, setReportData] = useState([]); + const [designation, setDesignation] = useState(''); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + getData(); + }, []); + + + async function getData(){ + try { + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + let desg=loginDetails.Designation || ''; + setDesignation(desg); + await db.transaction(async function (txn) { + + let q=`SELECT * from Sup_TeamList where VisitDate='${d2}'`; + await txn.executeSql(q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + setisDataFound(true); + let dd=await getReportData(); + setProcessing(false); + } + else{ + setProcessing(false); + } + },function (txn2, txnerr) { console.log(txnerr); setProcessing(false);},); + + }); + } catch (err) { + setProcessing(false); + console.log(err); + } + } + + + async function getReportData(){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q=`SELECT * from Report_PromoterMerchandiserPerformance`; + await txn.executeSql(q,[],async function (txn2, txnres) { + let arr=[] + if(txnres.rows.length>0){ + for(var i=0;i{ + return val; + }).catch((err)=>{ + return false; + }); + + } + + return ( + + {processing && } + + + + { !props.isDataDownloaded && } + { props.isDataDownloaded==true && + + + { isDataFound==false && + + {ST.NoDataAvailable} + + } + + { + isDataFound==true && + + + + {ST.Username+' :'} + {props.UserId} + + + {ST.Designation+' :'} + {designation} + + + + + {ST.Performance} + + + + + {ST.Kpi} + + + {ST.Target} + + + {ST.Achivement} + + + + { + reportData.length>0 && + reportData.map((item,index)=>{ + return( + + + {item.KPI} + + + {item.Target} + + + {item.Achivement} + + + ) + }) + } + + + + } + + + } + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(ReportsMenu); \ No newline at end of file diff --git a/src/screens/Sale.js b/src/screens/Sale.js new file mode 100644 index 0000000..2de4c7b --- /dev/null +++ b/src/screens/Sale.js @@ -0,0 +1,457 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, KeyboardAvoidingView} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_GetAvailabityDefaultData } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; + +function Sale(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [brandData, setBrandData] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + + const [SKUStockData, setSKUStockData] = useState([]); + const [showAlert, setShowAlert] = useState(false); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + + const inputRefs = useRef({}); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1); + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + function onBeforeRemove(e){ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + function onRemoveScreen(e){ + Alert.alert( + "", + "Do you really want to exit the screen?", + [ + { + text: "Cancel", + onPress: () => {}, + style: "cancel" + }, + { text: "OK", onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + + async function getData(storeData1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + await db.transaction(async function (txn) { + let q2=Q_GetAvailabityDefaultData(storeData1); + + await txn.executeSql(q2,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + console.log('inputs found'); + let arr=[]; + for(var i=0;i { + let seletlist=`s.PRODUCT as ProductName,s.PRODUCT_ID as ProductId,s.MSL,s.STOCK,o.MIDDAY_STOCK,o.OPENING_STOCK`; + let join1=` inner join ${AppTables.STOCK_DATA} o on s.PRODUCT_ID=o.PRODUCT_ID and o.STORE_ID='${StoreId}' and o.VISIT_DATE='${d2}' `; + let sku_q=`SELECT ${seletlist} FROM ${AppTables.SALES} s ${join1} WHERE s.STORE_ID='${StoreId}' and s.VISIT_DATE='${d2}' and s.CATEGORY_ID='${item.CategoryId}' `; + + + let join=` inner join Mapping_ProductAssortment m on p.ProductId=m.ProductId `; + let join2=` inner join Master_Category mc on mc.CategoryId=p.CategoryId `; + let join3=` left join ${AppTables.STOCK_DATA} o on p.ProductId=o.PRODUCT_ID and o.STORE_ID='${StoreId}' and o.VISIT_DATE='${d2}' `; + let sku_q2=`select distinct p.ProductName,p.ProductId,m.MSL,o.MIDDAY_STOCK ,o.OPENING_STOCK from Product_Master p ${join} ${join2} ${join3} where m.ChainId='${ChainId}' and m.StateId='${StateId}' and m.StoreTypeId='${StoreTypeId}' and p.CategoryId='${item.CategoryId}' and CompanyId='1' order by p.ProductSequence`; + + + return await txn.executeSql(sku_q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + + let arr=[]; + for(var i=0;i0){ + let arr=[]; + for(var i=0;i{ + + }); + }); + } catch (err) { + console.log(err); + } + } + + + async function focusToNext(cat,index,sku,sku_index,inputType='1'){ + console.log('focusToNext',index); + let data=brandData; + let ccat_index=index; + let skulist=cat.skulist || []; + if(sku_index==skulist.length-1){ // if last subcategory element + //then move to next category + console.log('move to next cat',ccat_index,data.length) + if(ccat_index==data.length-1){ + return; + } + else{ + ccat_index+=1; + console.log('move to next cat n:',ccat_index) + let cat1=data[ccat_index]; + let skulist1=cat1.skulist || []; + if(skulist1.length>0){ + let sku1=skulist1[0]; + let refIn1=inputRefs.current['input1_'+cat1.CategoryId+'_'+sku1.ProductId]; + console.log('move to next cat refIn1:','input1_'+cat1.CategoryId+'_'+sku1.ProductId) + refIn1.focus(); + } + } + } + else{ + // move to next subcategory + let sku1=skulist[sku_index+1]; + let refIn1=inputRefs.current['input1_'+cat.CategoryId+'_'+sku1.ProductId]; + refIn1.focus(); + } + + } + + async function submitData(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + let q=`DELETE FROM ${AppTables.SALES} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // remove old data + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('sales data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + var stock_values=''; + for(var i=0;ici.CategoryId==item.CategoryId && ci.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || {}) : {}; + stock_values+=` ('${StoreId}','${d2}','${item.CategoryName}','${item.CategoryId}','${ProductName}','${ProductId}','${MSL}','${skud['Stock']}','${d2}') `; + } + } + + let add_Stock=`INSERT INTO ${AppTables.SALES} (STORE_ID,VISIT_DATE,CATEGORY,CATEGORY_ID,PRODUCT,PRODUCT_ID,MSL,STOCK,ADDED_DATE) VALUES ${stock_values} `; + await txn.executeSql(add_Stock,[],async function (txn2, txnres) { + console.log('sales added'); + notify('Sales updated successfully'); + setProcessing(false); + props.navigation.goBack(); + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot update Sales') },); + + + }); + } catch (err) { + console.log(err); + } + } + + + + async function validate(){ + let isValid=true; + await Promise.all( + brandData.map(async (item,index) => { + if(isValid){ + let skulist=item.skulist || []; + if(skulist.length>0){ + await Promise.all( + skulist.map(async (skuItem,skuIndex) => { + if(isValid){ + let skuData=SKUStockData.find(ci=>ci.CategoryId==item.CategoryId && ci.ProductId==skuItem.ProductId ) || {}; + let OS=skuItem.OPENING_STOCK || 0; + let MDS=skuItem.MIDDAY_STOCK || 0; + let maxClosingStock=parseInt(OS) + parseInt(MDS); + if(skuData.Stock!==0 && (skuData.Stock==null || skuData.Stock=='')){ + notify('Please enter stock for '+skuItem.ProductName,'SHORT'); + isValid=false; + }else if(parseInt(skuData.Stock)>maxClosingStock){ + notify('Sale Should not be greater than the sum of Opening-Stock and Midday-Stock for '+skuItem.ProductName,'SHORT'); + isValid=false; + }else{ + + } + } + }) + ); + } + } + }) + ); + + console.log('isValid:',isValid); + return isValid; + } + + function onStockValChange(item,skuItem,val,key){ + if(!isNaN(val)){ + if(val.includes('.')){ + notify('Please enter whole numbers only','SHORT'); + return; + } + } + + let allSKUData=SKUStockData; + let defData={'CategoryId':item.CategoryId,'ProductId':skuItem.ProductId}; + const skud_index=allSKUData.findIndex(i=>i.CategoryId==item.CategoryId && i.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + skud[key]=val; + + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onSaveCancel(){ + setShowAlert(false); + } + + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + + + { Object.keys(storeData).length>0 && + + + { + const cat=item; + const catIndex=index; + return( + + + + {item.CategoryName} + + + + { + { + const skus=item; + const sku_index=index; + let thisCatSkuData_i=SKUStockData.findIndex(i=>i.CategoryId==cat.CategoryId && i.ProductId==skus.ProductId); + let thisCatSkuData=thisCatSkuData_i>=0?(SKUStockData[thisCatSkuData_i] || {}):{}; + let stock=thisCatSkuData.Stock!=null?thisCatSkuData.Stock:''; + return( + + {skus.ProductName} + + + {`Opening Stock + Midday Stock : (${skus.OPENING_STOCK} + ${skus.MIDDAY_STOCK}) :`} + {(parseInt(skus.MIDDAY_STOCK)+parseInt(skus.OPENING_STOCK))} + + + + { + + + + Stock + {inputRefs.current['input1_'+cat.CategoryId+'_'+skus.ProductId]=reff;}} + style={[customStyle.openStk_prd_inputStyle,customStyle.openStk_prd_flex_inputStyle]} + placeholder="" + placeholderTextColor={PageTheme.$placeholder_color} + value={(stock+'' || '')} + keyboardType='number-pad' + onSubmitEditing={()=>{focusToNext(cat,parseInt(catIndex),skus,parseInt(sku_index),'1')}} + onChangeText={(val)=>{ onStockValChange(cat,skus,val,'Stock')}} + autoComplete='off' + /> + + + + } + + + ) + }}/> + } + + + ); + }} + /> + + } + + {submitData()}}/> + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(Sale); \ No newline at end of file diff --git a/src/screens/SearchStoreList.js b/src/screens/SearchStoreList.js new file mode 100644 index 0000000..227944d --- /dev/null +++ b/src/screens/SearchStoreList.js @@ -0,0 +1,1741 @@ + +import React, { useState, useEffect, memo, useRef, useCallback } from 'react'; +import Container from '../components/container'; +import { useFocusEffect, useRoute } from '@react-navigation/native'; +import { globalStyles, customStyles, GetPageTheme } from "../styles/Global"; +import { StatusBar, Image, TextInput, View, Text, ScrollView, TouchableOpacity, TouchableHighlight, Platform, PermissionsAndroid, FlatList } from 'react-native'; +import { ReactReduxContext, connect, useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps, mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import { notify } from '../components/notify'; +import moment from 'moment'; +import { getDownloadJson, AddStore, checkRange, UploadData2, UploadData, UpdateStoreStatus, getKPIS, marktext1, marktext2, UploadFormData, getDownloadJson1, fetchProjectConfig } from '../controller/functions'; +import { get_item, set_item, clear_item } from '../components/localStorage'; +import { version, sloganline, appname, testurl, db, AppVersion } from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import { Card } from 'react-native-paper'; +import { AntDesign, Entypo, EvilIcons, Feather, FontAwesome, Fontisto, Ionicons, MaterialCommunityIcons } from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import NoDataComponent from '../components/NoDataComponent'; +import { SvgXml } from 'react-native-svg'; +import MapIcon from '../assets/performics/map_icon.svg'; +import CustomModal from '../components/CustomModal'; +import { AppTables } from '../constants/tableConstants'; +import { _checkLocationPermission } from '../components/geolocation'; +import Geolocation from 'react-native-geolocation-service'; +import { getAvailblQuery, getIfAvlbl, getIfKPIDone, getQuery, Q_MenuList } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; +import { uploadAllData, uploadAllImages, uploadStoreStatus } from '../constants/uploadData'; +import { PrimaryTheme } from '../styles/Themes'; +import NetworkStatusBar from '../components/NetworkStatusBar'; +import * as RNFS from 'react-native-fs'; + +import CameraImg2 from '../assets/performics/camera_icon.svg'; +import CustomCamera from '../components/Camera'; +import StoreItem from '../components/StoreItem'; + + +function SearchStoreList(props) { + const route = useRoute(); + + const ST = props.StaticText || {}; + + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const [loaderTitle, setLoaderTitle] = useState(); + const [processing, setProcessing] = useState(false); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); // change 18 april (night) + const [nodataFound, setNodataFound] = useState(false); + const [nodataMsg, setnodataMsg] = useState(""); + const [showStoreVisitModal, setShowStoreVisitModal] = useState(false); + const [showGeoTagModal, setShowGeoTagModal] = useState(false); + const [showDistanceModal, setShowDistanceModal] = useState(false); + const [currentStore, setCurrentStore] = useState({}); + const [storeDistance, setStoreDistance] = useState('0 M'); + const [storeDistanceinM, setStoreDistanceinM] = useState(0); + const [showAlert, setShowAlert] = useState(false); + const [checkOutStore, setCheckOutStore] = useState({}); + const [rerenderdata, setrerenderdata] = useState(false); + let [state, setState] = useState({ storeList: [] }); + const [globalStorelist, setGlobalStorelist] = useState([]); + const [cancelCheckOutStore, setCancelCheckOutStore] = useState({}); + const [showCancelCIModal, setShowCancelCIModal] = useState(false); + const [searchedItem, setSearchedItem] = useState(''); + const [isNPNDScreen, setisNPNDScreen] = useState(false); + + const [CheckOutImage, setCheckOutImage] = useState(''); + const [CheckOutImagePath, setCheckOutImagePath] = useState(''); + const [CheckOutImageModal, setCheckOutImageModal] = useState(false); + const [CheckOutLoc, setCheckOutLoc] = useState({}); + const [showImageSaveOp, setShowImageSaveOp] = useState(true); + const [showCamera, setShowCamera] = useState(false); + const showCameraRef = useRef(false); + const [GeoFenceEnable_Checkout, setGeoFenceEnable_Checkout] = useState(false); + const [GeoFenceRadius_Checkout, setGeoFenceRadius_Checkout] = useState(''); + const [CheckInStoreIds, setCheckInStoreIds] = useState([]); + const [showSearchWiseStore, setShowSearchWiseStore] = useState(false); + + const [EmpData, setEmpData] = useState([]); + const [storeData, setStoreData] = useState([]); + const [StoreObj, setStoreObj] = useState({}); + + const storeRef = useRef({ storeList: [] }) + + // emp data + + + const [empidataofteam, setEmpIdOFTeam] = useState(''); + + + // serach + + const searchRef = useRef(''); + + const empidRef = useRef(''); + + + + useEffect(() => { + + let params = props.route.params ? props.route.params : {}; + const teamlistEmpData = params.teamlistEmpData || {}; + const isAdhoc = params?.isAdhoc ? params?.isAdhoc : false; + const isNPND = params?.isNPND ? params?.isNPND : false; + + console.log("isAdhoc", isAdhoc, "isNPND", isNPND) + + // console.log("teamlistEmpData=====",teamlistEmpData?.EmpId || ''); + setIsAdhocScreen(isAdhoc); + setisNPNDScreen(isNPND); + setEmpIdOFTeam(teamlistEmpData?.EmpId); + setEmpData(teamlistEmpData) + empidRef.current = teamlistEmpData?.EmpId; + + + // let empData1 = params.empData || {}; + // let showSearchWiseStore1 = params.showSearchWiseStore != null && params.showSearchWiseStore != '' ? params.showSearchWiseStore : false; + //let ShowStoreSearch = props?.ShowStoreSearch != null ? props.ShowStoreSearch : false; + // setShowSearchWiseStore(ShowStoreSearch); + if (props.isDataDownloaded == true && !props.isAttendanceMarked) { + props.navigation.pop(); props.navigation.push('Attendance'); + } + else { + + const unsubscribe = props.navigation.addListener('beforeRemove', onBeforeRemove); + + // getData(); + return function cleanup() { + + unsubscribe(); + }; + } + }, []); + + + useFocusEffect( + useCallback(async () => { + // 🔥 This runs every time screen comes into focus (e.g. on back) + // isDoneCheck(); + console.log(empidRef.current, searchRef.current, "// DownloadPJP(searchQuery);") + + if (searchRef.current != "") { + DownloadPJP(searchRef.current, empidRef.current); + } + return () => { + // cleanup logic if required + }; + }, []) + ); + + async function isDoneCheck() { + console.log("AutoGoToPrev-----") + let AllStores = storeRef.current?.storeList || [] + const allDone = AllStores.length > 0 + ? await Promise.all( + AllStores.map(async (store) => { + console.log('Processing store:', store); // ✅ Logs each store + return getDailyMenu(store, true, false); + }) + ) + : true; + let newList = AllStores.map((itm, i) => ({ ...itm, allDone: allDone[i] })) + setState({ storeList: newList }); + console.log("newList=====", newList) + storeRef.current = { storeList: newList } + + } + + async function getAlreadyCheckedInStores(isAdhoc, isNPND) { + console.log("get already checkedin store ------") + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + + return new Promise((resolve, reject) => { + + var q = '', join_tbl = 'Sup_JourneyPlan', tb2 = AppTables.CHECKIN_DATA; + + + var join = ` left outer join ${tb2} on ${tb2}.STORE_ID=${join_tbl}.StoreId and ${tb2}.JCP_TYPE='${join_tbl}' and ${tb2}.VISIT_DATE='${d2}' and ${tb2}.EMP_ID=${join_tbl}.MerchandiserId and ${join_tbl}.UploadStatus in ('I','C','D','U','L') `; + var orderby = ` group by ${join_tbl}.StoreId,${join_tbl}.VisitDate order by ${join_tbl}.StoreName,${tb2}.KEY_ID desc`; + + // get data from PJP /adhoc table + q = `Select ${join_tbl}.*,${tb2}.CHECKIN_TIME as CheckInTime ,${tb2}.CHECKOUT_TIME as CheckOutTime from ${join_tbl} ${join} where ${join_tbl}.VisitDate='${d2}' and UploadStatus!='N' `; + q += ` ${orderby}`; + + // q=`select * from ${join_tbl}`; + console.log("storelist q:", q); + db.transaction(async function (txn) { + + + // await txn.executeSql(`delete from ${join_tbl}`,[],async function (txn2, txnres2) { + // console.log("store data deleted") + // },function(txn2,txnerr){console.log(txnerr);resolve([]);}); + + // await txn.executeSql(`delete from ${tb2}`,[],async function (txn2, txnres2) { + // console.log("checkin data deleted") + // },function(txn2,txnerr){console.log(txnerr);resolve([]);}); + + // await txn.executeSql(`delete from ${AppTables.COVERAGE_DATA}`,[],async function (txn2, txnres2) { + // console.log("COVERAGE_DATA data deleted") + // },function(txn2,txnerr){console.log(txnerr);resolve([]);}); + + await txn.executeSql(q, [], async function (txn2, txnres2) { + console.log('storelist len', txnres2.rows.length); + if (txnres2.rows.length > 0) { + // show from local + var storeArr = []; + console.log('storelist len2', txnres2.rows.length); + for (var i = 0; i <= txnres2.rows.length; i++) { + let sdata = txnres2.rows.item(i); + let { InTime, OutTime, UploadStatus, StoreId, MID } = sdata; + let time = sdata.CheckInTime != null && sdata.CheckInTime != '' ? moment(new Date(sdata.CheckInTime)).format('HH:mm:ss') : ''; + let time2 = sdata.CheckOutTime != null && sdata.CheckOutTime != '' ? moment(new Date(sdata.CheckOutTime)).format('HH:mm:ss') : ''; + let In_Time = (time == '' && UploadStatus != '' && UploadStatus != 'N') ? InTime : time; + let Out_Time = (time2 == '' && UploadStatus != '' && UploadStatus != 'N' && UploadStatus != 'I') ? OutTime : time2; + sdata.CheckInTime = In_Time; + sdata.CheckOutTime = Out_Time; + + console.log("UploadStatus=========", UploadStatus) + + console.log("MenuList=======12"); + let MenuList = await getMenuList(sdata, isAdhoc, isNPND, checkPosale = false); + console.log("MenuList=======", MenuList); + let allDone = MenuList.length > 0 ? await getDailyMenu(sdata, isAdhoc, isNPND) : true; + + sdata.allDone = allDone; + sdata.MenuList = MenuList || []; + storeArr.push(sdata); + setStoreData(sdata) + + if (i == (txnres2.rows.length - 1)) { + console.log("storeArr:", storeArr.length) + resolve(storeArr); + } + } + } + else { + resolve([]); + } + }, function (txn2, txnerr) { console.log(txnerr); resolve([]); }); + }); + }).catch((err) => { + console.log(err); + return []; + }) + + } + + async function getCheckedInData(isAdhoc, isNPND) { + console.log("getCheckedInData"); + setLoaderTitle("Loading..."); + setProcessing(true); + try { + let AllStores = await getAlreadyCheckedInStores(isAdhoc, isNPND); + console.log('AllStores:', AllStores.length); + // console.log("console 3") + setState({ storeList: AllStores }); + storeRef.current = { storeList: AllStores } + console.log("6", storeRef.current); + setGlobalStorelist(AllStores); + if (AllStores.length > 0) { + setNodataFound(false); + } + else { + setNodataFound(true); + } + setProcessing(false); + } catch (err) { + console.log("err in getCheckedInData:"); + + } + } + + async function deleteStore(storeData1) { + let { StoreId, MerchandiserId } = storeData1; + let allQueries = [ + `Delete from ${AppTables.COVERAGE_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}'`, + `Delete from ${AppTables.CHECKIN_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + `Delete from ${AppTables.GEOTAG} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + `Delete from ${AppTables.COMPETITION_VISIBILITY} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + `Delete from ${AppTables.COMPETITION_PROMOTION} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + `Delete from ${AppTables.STORE_IMAGES} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + `Delete from ${AppTables.SURVEY} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + ] + + return await Promise.all( + allQueries.map(async (q, index) => { + let isDeleted = await executeQuery(q); + return isDeleted == true; + }) + ) + .then((val) => { + // if(val.indexOf(false)<0){} + return true; + }).catch((err) => { + console.log(err); + return false; + }) + } + + async function onVisitCancel() { + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + setLoaderTitle(ST.DeletingCheckInData + '...') + setShowCancelCIModal(false); + setProcessing(true); + let { MID, StoreId, EmpId, MerchandiserId } = cancelCheckOutStore; + let postdata = ''; + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + // const storewisePjp = await fetchProjectConfig(props.ManagerAppConfig); + const { StorewisePJP: storewisePjp, StoreSearch: storeSearch } = await fetchProjectConfig(props.ManagerAppConfig); + console.log("storewisePjpSearchStoreCanc::", storeSearch, storewisePjp); + + + + console.log("MerchandiserId:", MerchandiserId); + let methodN = getMethodName(METHODS.DELETECOVERAGE_METHOD); + postdata = { 'StoreId': StoreId, "UserId": props.UserId, "MerchandiserId": MerchandiserId, "VisitDate": d2 } + + if (storewisePjp == true) { + methodN = getMethodName(METHODS.DELETECOVERAGE_METHOD_SUPWISE); + postdata = { "MId": MID, "UserId": props.UserId } + } + const url = props.baseurl + methodN; + console.log(url, postdata); + await UploadData2(url, postdata) + .then(async (res) => { + console.log('delete coverage res:', res); + if (res == '1') { + let isdeleted = await deleteStore(cancelCheckOutStore); + if (isdeleted == true) { + + let data = ''; + + if (storeSearch) { + data = { "StoreId": StoreId, UploadStatus: "N", tbname: "Sup_JourneyPlan", EmpId: MerchandiserId }; + } + else if (storewisePjp == true) { + data = { "StoreId": StoreId, UploadStatus: "N", tbname: (isAdhocScreen == true ? 'Sup_JourneyPlanStorewiseSup_Adhoc' : 'Sup_JourneyPlanStorewiseSup'), EmpId: MerchandiserId }; + } + else { + data = { "StoreId": StoreId, UploadStatus: "N", tbname: (isAdhocScreen == true ? 'Sup_AdhocJourneyPlan' : 'Sup_JourneyPlan'), EmpId: MerchandiserId }; + } + let isUpdated = await UpdateStoreStatus(props, data); + if (isUpdated == true) { + await updateStoreStatuslocal('N', cancelCheckOutStore, true); + setProcessing(false); + notify(ST.CheckInRemoved); + + if (showSearchWiseStore) { + getCheckedInData(); + DownloadPJP(searchRef.current, empidRef.current); + } + + } + else { + setProcessing(false); + notify(ST.CheckInremovedsuccessfullybutcannotupdatestatus); + } + } + else { + setProcessing(false); + notify(ST.CheckInremovedsuccessfullybutcannotupdatestatus); + } + } + else { + setProcessing(false); + notify(ST.CannotRemoveCheckIn); + } + + }).catch(err => { + console.log('onPage Team error', err); + setProcessing(false); + notify(ST.CannotRemoveCheckIn); + }); + + } + + + function _render_CancelCheckinModal() { + let storename = cancelCheckOutStore.StoreName || ''; + return ( + + + + {ST.Yourallcheckindatawillbelost} + + + + + { setShowCancelCIModal(false); }}> + {ST.Cancel} + + { onVisitCancel() }}> + {ST.OK} + + + + ) + } + + function onBeforeRemove(e) { + if (showCameraRef.current == true) { + e.preventDefault(); + ChangeShowCamera(false); + } + else { + return; + } + } + + function ChangeShowCamera(val) { + showCameraRef.current = val; + setShowCamera(val); + } + + + async function getData() { + setLoaderTitle("loading...") + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + + return new Promise((resolve, reject) => { + + + let q = `select StoreId from Sup_JourneyPlan where VisitDate='${d2}' and UploadStatus!='N' `; + db.transaction(async function (txn) { + await txn.executeSql(q, [], async function (txn2, txnres2) { + console.log('storelist len', txnres2.rows.length); + if (txnres2.rows.length > 0) { + // show from local + let arr = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let sdata = txnres2.rows.item(i); + + arr.push(sdata) + + if (i == (txnres2.rows.length - 1)) { + setCheckInStoreIds(arr); + setProcessing(false); + } + } + } + else { + setProcessing(false); + } + }, function (txn2, txnerr) { console.log(txnerr); setProcessing(false); }); + }); + }).catch((err) => { + setProcessing(false); + }) + + } + + + + async function calLocatDistance() { + if (currentStore.Latitude != '' && currentStore.Latitude != null) { + const hasPermission = await _checkLocationPermission(); + if (hasPermission == true) { + Geolocation.getCurrentPosition( + async (position) => { + let loc = { lat: position.coords.latitude, lng: position.coords.longitude }; + + var distance = checkRange(loc.lat, loc.lng, currentStore.Latitude, currentStore.Longitude); + // console.log('distance:',distance); + let dinKM = (distance / 1000); + let distanceinM = (distance == '' || distance == null || isNaN(distance)) ? ' 0 m' : (dinKM > 1 ? dinKM.toFixed(1) + ' Km' : distance + ' m'); + setStoreDistance(distanceinM); + setStoreDistanceinM(distance); + + if (props.GeoFenceEnable == true && distance > props.GeoFenceRadius) { + setShowDistanceModal(true); + } + else { + props.navigation.navigate('StoreCheckin', { storeData: currentStore, empData: EmpData, 'isAdhoc': isAdhocScreen, 'IsSearchedStore': true }); + } + }, + (error) => { + notify(ST.Cannotgetuserposition); + }, + { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + ); + } + else { + notify(ST.Pleaseallowlocationpermission); + } + } + else { + notify(ST.Storelocationnotavailable); + } + + } + + async function checkAvailability(storeData1, data, checkPosale = false) { + + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + let q2 = getAvailblQuery(data.ScreenName, storeData1, data, checkPosale); + // console.log('Executing query check availability:', q2); + if (q2 != '' && q2 != null) { + + await txn.executeSql(q2, [], async function (txn2, txnres2) { + let isAvlbl = getIfAvlbl(data.ScreenName, txnres2, storeData1); + console.log(data.ScreenName, "isAvlbl:", isAvlbl); // for check the avaliable screen + resolve(isAvlbl); + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); },); + } + else { + let isAvlbl = getIfAvlbl(data.ScreenName, {}, storeData1); + resolve(isAvlbl); + } + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log(err); + return false; + }); + } + + async function getMenuList(isAdhoc, isNPND, checkPosale = false) { + let { StoreId, ChannelId, RegionId, StoreTypeId } = storeData; + return new Promise((resolve, reject) => { + + db.transaction(async function (txn) { + let q = Q_MenuList(storeData, isAdhoc, isNPND); + + await txn.executeSql(q, [], async function (txn2, txnres) { + if (txnres.rows.length > 0) { + let arr = []; + for (var i = 0; i < txnres.rows.length; i++) { + let data = txnres.rows.item(i); + + console.log(data, "data of menu'ss") + + let isAvlbl = await checkAvailability(storeData, data, checkPosale); + console.log("checkAvailability--------2", isAvlbl) + // if(isAvlbl==true||isAvlbl=="true"){ + arr.push(data); + // } + + if (i == (txnres.rows.length - 1)) { + console.log("checkAvailability--------3", arr) + resolve(arr); + } + } + } + else { + resolve([]) + } + }, function (txn2, txnerr) { console.log(txnerr); resolve([]); },); + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log('err--------', err) + return [] + }) + } + + + async function SearchStore(searchQuery) { + console.log('SEARCH QUEARYYYYYYY', searchQuery); + + if (searchQuery.trim().length >= 3) { + DownloadPJP(searchQuery, empidRef.current); + } + else { + notify("Please enter atleat 3 letters to search!") + } + } + + + async function updateStatus(storeData1, data, isAvlbl) { + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + let q2 = getQuery(data.ScreenName, storeData1, data); + + // console.log(q2, "isdoneKPi called--->") + + if (q2 != '' && q2 != null && ((isAvlbl == true) || (isAvlbl && (isAvlbl.isAvlbl == true)))) { + await txn.executeSql(q2, [], async function (txn2, txnres2) { + let isDone = await getIfKPIDone(data.ScreenName, txnres2, storeData1, isAvlbl, data); + // console.log("isDone--->", isDone) + resolve(isDone); + + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); },); + } + else { + resolve(false); + } + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log(err); + return false; + }); + + } + + async function getDailyMenu(storeData1, isAdhoc, isNPND, checkPosale = false) { + + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + let { StoreId, ChannelId, RegionId, StoreTypeId } = storeData1; + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + let q = Q_MenuList(storeData1, isAdhoc, isNPND); + + await txn.executeSql(q, [], async function (txn2, txnres) { + + if (txnres.rows.length > 0) { + let allDone = true; + for (var i = 0; i < txnres.rows.length; i++) { + let data = txnres.rows.item(i); + let isAvlbl = await checkAvailability(storeData1, data, checkPosale); + + + let isDone = await updateStatus(storeData1, data, isAvlbl); + + if (((isAvlbl == true) || (isAvlbl.isAvlbl == true)) && !isDone) { + allDone = false; + resolve(allDone); + break; + } + if (i == (txnres.rows.length - 1)) { + resolve(allDone); + } + } + } + else { + resolve(true); + } + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); },); + + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log(err); + return false; + }); + + } + + // for show checked in btn + + async function getAlreadyCheckedInStores(isAdhoc, isNPND) { + console.log("get already checkedin store ------") + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + + return new Promise((resolve, reject) => { + + var q = '', join_tbl = 'Sup_JourneyPlan', tb2 = AppTables.CHECKIN_DATA; + + var join = ` left outer join ${tb2} on ${tb2}.STORE_ID=${join_tbl}.StoreId and ${tb2}.JCP_TYPE='${join_tbl}' and ${tb2}.VISIT_DATE='${d2}' and ${tb2}.EMP_ID=${join_tbl}.MerchandiserId and ${join_tbl}.UploadStatus in ('I','C','D','U','L') `; + var orderby = ` group by ${join_tbl}.StoreId,${join_tbl}.VisitDate order by ${join_tbl}.StoreName,${tb2}.KEY_ID desc`; + + // get data from PJP /adhoc table + q = `Select ${join_tbl}.*,${tb2}.CHECKIN_TIME as CheckInTime ,${tb2}.CHECKOUT_TIME as CheckOutTime from ${join_tbl} ${join} where ${join_tbl}.VisitDate='${d2}' and UploadStatus!='N' `; + q += ` ${orderby}`; + + // q=`select * from ${join_tbl}`; + console.log("storelist q:", q); + db.transaction(async function (txn) { + + + await txn.executeSql(q, [], async function (txn2, txnres2) { + console.log('storelist len', txnres2.rows.length); + if (txnres2.rows.length > 0) { + // show from local + var storeArr = []; + console.log('storelist len2', txnres2.rows.length); + for (var i = 0; i <= txnres2.rows.length; i++) { + let sdata = txnres2.rows.item(i); + let { InTime, OutTime, UploadStatus, StoreId, MID } = sdata; + let time = sdata.CheckInTime != null && sdata.CheckInTime != '' ? moment(new Date(sdata.CheckInTime)).format('HH:mm:ss') : ''; + let time2 = sdata.CheckOutTime != null && sdata.CheckOutTime != '' ? moment(new Date(sdata.CheckOutTime)).format('HH:mm:ss') : ''; + let In_Time = (time == '' && UploadStatus != '' && UploadStatus != 'N') ? InTime : time; + let Out_Time = (time2 == '' && UploadStatus != '' && UploadStatus != 'N' && UploadStatus != 'I') ? OutTime : time2; + sdata.CheckInTime = In_Time; + sdata.CheckOutTime = Out_Time; + + console.log("MenuList=======12"); + let MenuList = await getMenuList(sdata, isAdhoc, isNPND, checkPosale = false); + console.log("MenuList=======", MenuList); + let allDone = MenuList.length > 0 ? await getDailyMenu(sdata, isAdhoc, isNPND) : true; + + sdata.allDone = allDone; + sdata.MenuList = MenuList || []; + storeArr.push(sdata); + setStoreData(sdata) + + if (i == (txnres2.rows.length - 1)) { + console.log("storeArr:", storeArr.length) + resolve(storeArr); + } + } + } + else { + resolve([]); + } + }, function (txn2, txnerr) { console.log(txnerr); resolve([]); }); + }); + }).catch((err) => { + console.log(err); + return []; + }) + + } + + async function DownloadPJP(searchQuery, empid) { + setLoaderTitle("Searching..."); + setProcessing(true); + + + console.log("searchQuery, empid", searchQuery, empid) + + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url = props.baseurl + getMethodName(METHODS.DOWNLOADJSON_METHOD); + + let data = {}; + data = { + Downloadtype: "Sup_JourneyPlanSearch", + Username: loginDetails.UserId, + Param1: searchQuery, + Param2: empidataofteam ? empidataofteam : empid, + }; + + console.log(url, data); + await getDownloadJson1(url, data) + .then(async (res) => { + // console.log("DownloadPJP res:",res); + if (res.Sup_JourneyPlanSearch != null || res.Sup_JourneyPlanSearch != "" && typeof res.Sup_JourneyPlanSearch == "object") { + let AllStores = res.Sup_JourneyPlanSearch || []; + let allMenuList = await getMenuList(true, false, true); + + const allDone = AllStores.length > 0 + ? await Promise.all( + AllStores.map(async (store) => + getDailyMenu(store, true, false) + ) + ) + : true; + let newList = AllStores.map((itm, i) => ({ ...itm, MenuList: allMenuList, allDone: allDone[i] })) + setNodataFound(false); + setnodataMsg(""); + setState({ storeList: newList }); + storeRef.current = { storeList: [...newList] } + console.log("7", storeRef.current); + + } + // pass to the next download key if data does not exists for this Key + else if (res != null && typeof (res) == 'object' && (res[0] != null && res[0].Result != null && res[0].Result == "No Data")) { + setState({ storeList: [] }); + storeRef.current = { storeList: [] } + console.log("1", storeRef.current); + setNodataFound(true); + setnodataMsg("No results found for your search!"); + + } + // Stop Downloading and report error + else { + setState({ storeList: [] }); + storeRef.current = { storeList: [] } + console.log("2", storeRef.current); + setNodataFound(true); + setnodataMsg("" + res + ". Please ensure you are connected to the internet!"); + + } + + }).then((res) => { + setProcessing(false); + }) + .catch((err) => { + setState({ storeList: [] }); + storeRef.current = { storeList: [] } + console.log("3", storeRef.current); + + setNodataFound(true); + setnodataMsg("Cannot search data!"); + }); + } + + // // Insert PJP before check in + // async function InsertPJP(storeData1){ + + // console.log("Insert PJP store data=======>",storeData1) + + // return new Promise((resolve,reject)=>{ + + // var values=[],sql_stmnt='',all_vals=''; + // let d1=new Date(); + // let d2=moment(d1).format('MM/DD/YYYY'); + // let tbname='Sup_JourneyPlan'; + + // let {MID,ChannelId,StoreId,StoreCode,EmpId,MerchandiserId,VisitDate,ChainId,ChainName,StoreName,Address,Location,Landmark,CityId,CityName,StateId,StateName,RegionId,StoreTypeId,StoreType,Pincode,Latitude,Longitude,Phone,Mobile,ContactPerson,Email,UploadStatus,GeoTag,GeoFenceRadius,InTime,OutTime,CameraAllow}=storeData1; + // values.push(` ('${MID}', '${ChannelId}', '${StoreId}', '${StoreCode}', '${EmpId}', '${MerchandiserId}', '${VisitDate}', '${ChainId}', '${ChainName}', '${StoreName}', '${Address}', '${Location}', '${Landmark}', '${CityId}', '${CityName}', '${StateId}', '${StateName}', '${RegionId}', '${StoreTypeId}', '${StoreType}', '${Pincode}', '${Latitude}', '${Longitude}', '${Phone}', '${Mobile}', '${ContactPerson}', '${Email}', '${UploadStatus}', '${GeoTag}', '${GeoFenceRadius}', '${InTime}', '${OutTime}','${CameraAllow}')`); + // all_vals=values.join(','); + // sql_stmnt=`INSERT INTO ${tbname}(MID,ChannelId,StoreId,StoreCode,EmpId,MerchandiserId,VisitDate,ChainId,ChainName,StoreName,Address,Location,Landmark,CityId,CityName,StateId,StateName,RegionId,StoreTypeId,StoreType,Pincode,Latitude,Longitude,Phone,Mobile,ContactPerson,Email,UploadStatus,GeoTag,GeoFenceRadius,InTime,OutTime,CameraAllow) + // values ${all_vals}`; + + // let q=`select * from ${tbname} where VisitDate='${d2}' and StoreId='${StoreId}' and MerchandiserId='${MerchandiserId}' `; + + // db.transaction(async function (txn) { + // await txn.executeSql(q,[],async function (txn2, txnres) { + // if(txnres.rows.length>0){ + // // This store has already been added in storelistPJP!! + // console.log("This store has already been added in storelistPJP!!"); + // // notify("This store has already been visited!") + // resolve(false); + // } + // else{ + // // This store is not added in storelistPJP yet!! then add store + // await txn.executeSql(sql_stmnt,[],async function (txn2, txnres2) { + // resolve(true); + // },function(txn2,txnerr){ console.log(txnerr);resolve(false);}); + // } + + // },function(txn2,txnerr){console.log(txnerr);resolve(false);}); + // }) + // }).catch((err)=>{ + // console.log(err); + // return false; + // }) + + // } + + + + async function updateStoreStatuslocal(status, storeData1, updateCheckin = false, uCOut = false, cout_time = '') { + + let storeArr = state.storeList; + let sdata_index = storeArr.findIndex(i => i.StoreId == storeData1.StoreId); + if (sdata_index >= 0) { + let sdata = storeArr[sdata_index]; + sdata['UploadStatus'] = status; + if (updateCheckin == true) { + sdata['CheckInTime'] = ''; + } + if (uCOut == true) { + sdata['CheckOutTime'] = cout_time; + } + storeArr[sdata_index] = sdata; + // console.log('storeArr',storeArr) + setState({ ...state, storeArr }); + storeRef.current = { ...state, storeArr } + console.log("4", storeRef.current); + setGlobalStorelist(storeArr); + setrerenderdata(!rerenderdata); + } + } + + async function storeVisited() { + console.log('isgeotag:', currentStore.GeoTag); + setShowStoreVisitModal(false); + + if (currentStore.GeoTag == 'N') { + setShowGeoTagModal(true); + } + else if (currentStore.UploadStatus == 'N' || currentStore.UploadStatus == '') { + calLocatDistance(); + } + else { + + } + } + + async function storeNotVisited() { + setShowStoreVisitModal(false); + props.navigation.replace('StoreNonWorkingReasons', { storeData: currentStore, empData: EmpData, 'isAdhoc': isAdhocScreen, 'IsSearchedStore': true }); + } + + + + + async function executeQuery(q, type = '1') { + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + await txn.executeSql(q, [], async function (txn2, txnres2) { + if (type == '1') { + resolve(true); + } + else { + let arr = []; + if (txnres2.rows.length > 0) { + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + arr.push(data); + } + resolve(arr); + } + else { + resolve([]); + } + } + }, function (txn2, txnerr) { console.log(txnerr); type == '1' ? resolve(false) : resolve([]); }); + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log(err); + let d = type == '1' ? false : []; + return d; + }) + } + + + function _render_StoreVisitModal() { + return ( + + + { storeVisited() }}> + {ST.Yes} + + { storeNotVisited() }}> + {ST.No} + + + + ) + } + + function _render_GeoTagModal() { + return ( + + + { setShowGeoTagModal(false) }}> + {ST.Cancel} + + { setShowGeoTagModal(false); props.navigation.replace('GeoTag', { storeData: currentStore, empData: EmpData, 'isAdhoc': isAdhocScreen, 'IsSearchedStore': true }); }}> + {ST.OK} + + + + ) + + } + + + async function onDistanceM_OK() { + // const storewisePjp = await fetchProjectConfig(props.ManagerAppConfig); + const { StorewisePJP: storewisePjp, StoreSearch: storeSearch } = await fetchProjectConfig(props.ManagerAppConfig); + console.log("storewisePjponDistanceM_OK:", storewisePjp); + + + if (storewisePjp == true) { + if (props.GeoFenceEnable) { + if (storeDistanceinM > props.GeoFenceRadius) { + setShowDistanceModal(false); + notify(ST.Youcannotcheckin + ' ' + ST.Youarenotwithinthealloweddistancefromthestore + ' ' + props.GeoFenceRadius + ' m', 'LONG') + } + else { + setShowDistanceModal(false); props.navigation.navigate('StoreCheckin', { storeData: currentStore, empData: storeData, 'isAdhoc': isAdhocScreen, 'IsSearchedStore': true }); + } + } + else { + setShowDistanceModal(false); props.navigation.navigate('StoreCheckin', { storeData: currentStore, empData: storeData, 'isAdhoc': isAdhocScreen, 'IsSearchedStore': true }); + } + } + + else { + if (props.GeoFenceEnable) { + if (storeDistanceinM > props.GeoFenceRadius) { + setShowDistanceModal(false); + notify(ST.Youcannotcheckin + ' ' + ST.Youarenotwithinthealloweddistancefromthestore + ' ' + props.GeoFenceRadius + ' m', 'LONG') + } + else { + setShowDistanceModal(false); props.navigation.navigate('StoreCheckin', { storeData: currentStore, empData: EmpData, 'isAdhoc': isAdhocScreen, 'IsSearchedStore': true }); + } + } + } + } + + + function closeImageModal() { + setCheckOutImageModal(false); + } + + function cancelImage() { + setCheckOutImage(''); + setCheckOutImagePath(''); + closeImageModal(); + } + + async function openCamera() { + ChangeShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'front'}); + } + + async function getImage(imgdata) { + let storeData = checkOutStore + if (typeof imgdata == 'object' && imgdata.errorCode == 'camera_unavailable') { + notify(ST.Cameraunavailable); + } + else if (typeof imgdata == 'object' && imgdata.uri != null) { + const img = imgdata; + const imgurl = img.uri, imgWidth = img.width, imgHeight = img.height; + + + let picture_clicked_time = new Date(); + picture_clicked_time = moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1 = picture_clicked_time; + const mark_text2 = 'Store Name:' + storeData.StoreName + ' | Store Id:' + storeData.StoreId + ' | User Id:' + storeData.EmpId + ' | Image Type: Check Out' + ' | Date:' + picture_clicked_time; + + await marktext1(mark_text1, imgurl) + .then((res) => { + if (res.success) { + let uri = res.uri; + marktext2(mark_text2, uri, imgWidth, imgHeight) + .then((res) => { + if (res.success) { + let picture_clickedd = new Date(); + let picture_clicked_date = moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time = moment(picture_clickedd).format('HHmmss'); + let filename = storeData.StoreId + '_CheckoutImg-' + picture_clicked_date + '_' + picture_clicked_time + '.jpg'; + + setCheckOutImage(filename); + // renamefile + let imagePath = `${RNFS.DocumentDirectoryPath}/${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri = 'file://' + imagePath; + console.log('image marker', uri); + setCheckOutImagePath(uri); + }) + .catch(err => { + console.log(ST.Errorimagefilewritefailed + '!!!'); + console.log(err.message, err.code); + }); + + } + else { + if (res.imagenotfound) { + notify(ST.Pleasecaptureaimage); + } + else { + notify(res.error); + } + } + }); + } + else { + if (res.imagenotfound) { + notify(ST.Pleasecaptureaimage); + } + else { + notify(res.error); + } + } + }); + } + } + + async function onCheckOut(storeData1) { + console.log("storeData1--------", storeData1) + setStoreObj(storeData1) + let isAlldone = await getDailyMenu(storeData1, true, false); + // let isAlldone=await getDailyMenu(storeData1,EmpData,isAdhocScreen,isNPNDScreen); + if (isAlldone == true) { + setCheckOutStore(storeData1); + setShowAlert(true); + } + else { + notify(ST.PleasefillallKPI, false); + } + } + + + function _OpenCaptureImage_Modal() { + console.log('CheckOutImagePath:', CheckOutImageModal); + const isImageCap = (CheckOutImagePath == '' || CheckOutImagePath == null) ? false : true; + console.log('isImageCap:', isImageCap); + + + return ( + + { + !isImageCap && + + { openCamera() }}> + + + { closeImageModal() }}> + {ST.Cancel} + + + } + { + isImageCap && + + + + + { openCamera() }}> + + + {showImageSaveOp && + + { cancelImage() }}> + {ST.Cancel} + + { closeImageModal(); UpdateCheckOutStatus(CheckOutLoc); }}> + {ST.Save} + + } + {!showImageSaveOp && + { closeImageModal() }}> + {ST.Close} + + } + + + + } + + ) + } + + function _render_DistanceModal() { + return ( + + + {ST.Youneedtobeinthestore} + {ST.toCheckInCheckOut} + {`${ST.Alloweddistancefromstore}: ${(props.GeoFenceEnable == true ? props.GeoFenceRadius : '500')} m`} + {`${ST.Yourdistancefromstore}: ${storeDistance}`} + { onDistanceM_OK() }}> + Ok + + + + ) + + } + function onSaveCancel() { + setShowAlert(false); + } + + async function checkOutAfterLoc(loc) { + let CheckOut_PhotoReq = props.CheckOut_PhotoReq != null ? props.CheckOut_PhotoReq : false; + if (CheckOut_PhotoReq) { + setCheckOutLoc(loc); + setShowAlert(false); + setCheckOutImageModal(true); + } + else { + UpdateCheckOutStatus(loc); + } + } + + async function UpdateStoreCheckOut(data) { + console.log('UpdateStoreCheckOut') + let CheckOut_PhotoReq = props.CheckOut_PhotoReq != null ? props.CheckOut_PhotoReq : false; + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + let now = moment(d1).format('MM/DD/YYYY HH:mm:ss'); + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + let q2 = `UPDATE ${AppTables.COVERAGE_DATA} SET CHECKOUT_TIME='${now}', CHECKOUT_IMAGE='${CheckOut_PhotoReq ? CheckOutImage : ''}' WHERE STORE_ID='${checkOutStore.StoreId}' and EMP_ID='${checkOutStore.MerchandiserId}' and VISIT_DATE='${d2}' `; + + await txn.executeSql(q2, [], async function (txn2, txnres2) { + console.log('store coverage updated'); + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); }); + + let q = `UPDATE ${AppTables.CHECKIN_DATA} SET CHECKOUT_TIME='${now}', CHECKOUT_IMAGE='${CheckOut_PhotoReq ? CheckOutImage : ''}' WHERE STORE_ID='${checkOutStore.StoreId}' and EMP_ID='${checkOutStore.MerchandiserId}' and VISIT_DATE='${d2}' `; + await txn.executeSql(q, [], async function (txn2, txnres2) { + console.log('store checkout updated'); + resolve(true); + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); }); + + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log(err); + return false; + }); + + } + + async function UpdateCheckOutStatus(loc) { + + setLoaderTitle(ST.UpdatingCheckoutStatus + '...'); + setProcessing(true); + let { StoreId, MID, EmpId, MerchandiserId } = checkOutStore; + let CheckOut_PhotoReq = props.CheckOut_PhotoReq != null ? props.CheckOut_PhotoReq : false; + + console.log(CheckOut_PhotoReq, "CheckOut_PhotoReq") + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + + let d = new Date(); + let d2 = moment(d).format('MM/DD/YYYY'); + let d3 = moment(d).format('MM/DD/YYYY HH:mm:ss'); + let data1 = ''; + //const storewisePjp = await fetchProjectConfig(props.ManagerAppConfig); + const { StorewisePJP: storewisePjp, StoreSearch: storeSearch } = await fetchProjectConfig(props.ManagerAppConfig); + + console.log("storewisePjp:", storewisePjp); + + data1 = { + "UserId": loginDetails.UserId, + "StoreId": StoreId, + "MerchandiserId": MerchandiserId, + "Latitude": loc.lat, + "Longitude": loc.lng, + "CheckoutDate": d2, + "CheckOutImage": CheckOut_PhotoReq == true ? CheckOutImage : '', + + } + + + + // let fpath=Platform.OS=='ios'?CheckOutImagePath.replace('file://',''):CheckOutImagePath; + var data2 = new FormData(); + data2.append('file', { + uri: CheckOutImagePath, + type: 'image/jpg', + name: CheckOutImage, + }); + + let foldername = getFolderName(CheckOutImage); + data2.append('Foldername', foldername); + data2.append('Path', d2); + + const url = props.baseurl + getMethodName(METHODS.CHECKOUTDETAIL_METHOD); + const url1 = (props.imageUploadUrl || URL_IMAGE) + getMethodName(METHODS.UPLOADIMAGES_METHOD); + console.log(url, data1); + await UploadData2(url, data1) + .then(async (res) => { + console.log('StoreCheckOutSup1:', res, 'MID:', MID); + if (!res.error) { + if (res == 1) { + //Check out completed + if (CheckOut_PhotoReq) { + // Upload Image + await UploadFormData(url1, data2) + .then(async (res1) => { + console.log('checkout image upload:', res1); + cancelImage(); + }) + .catch((err) => { + console.log(err); + }); + } + + + let data = { checkout_image: '' }; + const isCheckOutUpdated = await UpdateStoreCheckOut(data); + + if (isCheckOutUpdated == true) { + let datan = ''; + + if (showSearchWiseStore) { + datan = { StoreId: StoreId, UploadStatus: 'C', tbname: 'Sup_JourneyPlan', EmpId: MerchandiserId }; + } + else if (storewisePjp == true) { + datan = { StoreId: StoreId, UploadStatus: 'C', tbname: (isAdhocScreen == true ? 'Sup_JourneyPlanStorewiseSup_Adhoc' : isNPNDScreen ? "Sup_NPNDStore" : 'Sup_JourneyPlanStorewiseSup'), EmpId: MerchandiserId }; + } + else { + datan = { StoreId: StoreId, UploadStatus: 'C', tbname: (isAdhocScreen == true ? 'Sup_AdhocJourneyPlan' : isNPNDScreen ? "Sup_NPNDStore" : 'Sup_JourneyPlan'), EmpId: MerchandiserId }; + } + const isUpdated = await UpdateStoreStatus(props, datan); + if (isUpdated == true) { + let outtime = moment(d).format('HH:mm:ss');; + await updateStoreStatuslocal('C', checkOutStore, false, true, outtime); + setLoaderTitle(ST.UploadingData + '...'); + UploadOnCheckOut(loc); + } + else { + setProcessing(false); notify(ST.Erroroccurwhilecheckout, 'LONG'); + } + } + else { + notify(ST.Erroroccurwhilecheckout, 'LONG'); + } + + } + else { + notify(ST.Somethingwentwrong, 'SHORT'); setProcessing(false); + } + } + else { + notify(ST.Somethingwentwrong, 'SHORT'); setProcessing(false); + } + }) + .catch((err) => { + console.log('onPage Team error', err); + notify(ST.Somethingwentwrong, 'SHORT'); setProcessing(false); + }); + + + } + + async function getPJPStoresData(tbname, Stores = [], d2) { + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + let join, qt; + qt = `Select * from ${AppTables.COVERAGE_DATA} t1 where t1.VISIT_DATE='${d2}' and t1.STATUS in ('C','P','D','L')` + console.log('qt', qt); + await txn.executeSql(qt, [], async function (txn2, txnres2) { + console.log('length of pjp', txnres2.rows.length); + if (txnres2.rows.length > 0) { + + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + let tempDATa = JSON.parse(data?.STORE_OBJ) + data["MerchandiserId"] = tempDATa?.MerchandiserId + data["StoreId"] = data?.STORE_ID + data["EmpId"] = tempDATa?.EmpId + Stores.push(data); + } + resolve(Stores); + } + else { + resolve(Stores); + } + }, function (txnE, txnerr) { console.log(txnerr); resolve(Stores) },); + + }); + }).then((val) => { + return val; + }) + .catch((err) => { + console.log(err); + return Stores; + }) + } + + + async function uploadAfter_P_status(index, AllStores, data, MenuList, allKPIs, JCP_TYPE) { + let { StoreName } = data; + if (MenuList.length > 0) { + // Upload data with Images + let allFilesToUpload = await uploadAllData(props, data, allKPIs, props.UserId, JCP_TYPE, true, MenuList,false); + console.log('allFilesToUpload:', allFilesToUpload.length); + await updateStoreStatuslocal('D', data); + UploadDataWithImages(index, AllStores, data, MenuList, allKPIs, JCP_TYPE, allFilesToUpload); + } + else { + // Upload statua u if no data exists + let isAllUploaded_S = await uploadStoreStatus(props, data, 'U', JCP_TYPE, EmpData); + if (isAllUploaded_S == true) { + await updateStoreStatuslocal('U', data); + notify(ST.Alldatauploadedfor + ' ' + StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + else { + if (index == AllStores.length - 1) { + setProcessing(false); notify(ST.Erroroccurwhileuploadingdata, 'LONG'); + } + } + } + } + + + async function UploadOnCheckOut(loc) { + try { + console.log('UploadOnCheckOut'); + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + let token = await get_item('loginToken'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + + let PJPStores = '', PJPStores1 = '', AllStores = ''; + + + AllStores = await getPJPStoresData('Sup_JourneyPlan', [], d2); + + // COVERAGE_DATA + + await db.transaction(async function (txn) { + console.log('stores to upload:', AllStores.length); + if (AllStores.length > 0) { + for (var i = 0; i < AllStores.length; i++) { + let data = AllStores[i]; + const index = i; + let { StoreId, StoreName, EmpId, UploadStatus, MerchandiserId, MID, STATUS, Status, VisitDate, REASON_ID, IMAGE, JCP_TYPE, ChannelId, StoreTypeId, STORE_OBJ, ChainId, CHECKOUT_IMAGE } = data; + let Deviation = 1 + + console.log(data, "dattaaaaaaa store list") + + let MenuList = await getMenuList(data, true, false, true); + console.log("checkAvailability--------4", MenuList) + let allKPIs = await getKPIS(MenuList); + console.log("checkAvailability--------5", allKPIs) + + let StoreObj = JSON.parse(STORE_OBJ) + // get all checkout ids data + // let allKPIs=['Stocks','BRS','SOS','PaidVis','AddVis','CompVis','Promotion','CompPromo','Contacts','Sale','Survey']; + let pdata = ''; + console.log("checkAvailability--------6", STATUS) + if (STATUS == 'C') { + // pdata={ + // "Mid":MID, + // "EmpId":MerchandiserId, + // "StoreId":StoreId, + // "VisitDate":d2, + // "Latitude":loc.lat, + // "Longitude":loc.lng, + // "ReasonId":REASON_ID!=''?REASON_ID:0, + // "Remark":"", + // "ImageName":IMAGE, + // "Appversion":AppVersion, + // "UploadStatus":'P', + // "CheckoutImage":IMAGE, + // "UserName":loginDetails.UserId, + // }; + + pdata = { + "StoreId": StoreObj?.StoreId, + "VisitDate": d2, + // "Mid":MID, + "MerchandiserId": StoreObj?.MerchandiserId, + "Latitude": loc.lat, + "Longitude": loc.lng, + "ReasonId": REASON_ID != '' ? REASON_ID : 0, + "Remark": "", + "CheckInImage": IMAGE, + "AppVersion": AppVersion, + "Checkout_Image": CHECKOUT_IMAGE, + "ChainId": StoreObj?.ChainId, + "StoreTypeId": StoreObj?.StoreTypeId, + "ChannelId": StoreObj?.ChannelId, + "UploadStatus": 'P', + "UserId": loginDetails.UserId, + "Deviation": Deviation, + }; + + console.log("checkAvailability--------7", pdata) + const url2 = props.baseurl + getMethodName(METHODS.GETCOVERAGE_METHOD); + console.log(url2, pdata, "data sending by me on Storelist ..........") + await UploadData2(url2, pdata) + .then(async (res) => { + console.log('status uploadres:', res, 'MID:', MID); + + if (!res.error) { + let tbname = JCP_TYPE; + let datan = { StoreId: StoreId, UploadStatus: 'P', tbname: tbname, EmpId: MerchandiserId }; + const isUpdated = await UpdateStoreStatus(props, datan); + if (isUpdated == true) { + + await updateStoreStatuslocal('P', data); + await uploadAfter_P_status(index, AllStores, data, MenuList, allKPIs, JCP_TYPE); + + } + else { + if (index == AllStores.length - 1) { + setProcessing(false); notify(ST.Erroroccurwhileuploadingdata, 'LONG'); + } + } + } + else { + if (index == AllStores.length - 1) { + setProcessing(false); notify(ST.Erroroccurwhileuploadingdata, 'LONG'); + } + } + + }) + .catch((err) => { + console.log(err); + if (index == AllStores.length - 1) { + setProcessing(false); notify(ST.Erroroccurwhileuploadingdata, 'LONG'); + } + }); + } + else if (UploadStatus == 'D') { + // this never be called if there is no KPI + let allFilesToUpload = await uploadAllData(props, data, allKPIs, props.UserId, JCP_TYPE, false, MenuList,false); + + if (allFilesToUpload.length > 0) { + await UploadDataWithImages(index, AllStores, data, MenuList, allKPIs, JCP_TYPE, allFilesToUpload); + } + else { + notify(ST.Alldatauploadedfor + ' ' + StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + } + else if (UploadStatus == 'P') { + await uploadAfter_P_status(index, AllStores, data, MenuList, allKPIs, JCP_TYPE); + } + else if (UploadStatus == 'L') { + let isAllUploaded_S = await uploadStoreStatus(props, data, 'U', JCP_TYPE, EmpData); + if (isAllUploaded_S == true) { + await updateStoreStatuslocal('U', data); + notify(ST.Alldatauploadedfor + ' ' + StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + else { + if (index == AllStores.length - 1) { + setProcessing(false); notify(ST.Erroroccurwhileuploadingdata, 'LONG'); + } + } + } + } + + } + }); + + + + } catch (err) { + console.log(err); + } + } + + async function updateStoreStatuslocal(status, storeData1, updateCheckin = false, uCOut = false, cout_time = '') { + + let storeArr = state.storeList; + let sdata_index = storeArr.findIndex(i => i.StoreId == storeData1.StoreId); + if (sdata_index >= 0) { + let sdata = storeArr[sdata_index]; + sdata['UploadStatus'] = status; + if (updateCheckin == true) { + sdata['CheckInTime'] = ''; + } + if (uCOut == true) { + sdata['CheckOutTime'] = cout_time; + } + storeArr[sdata_index] = sdata; + // console.log('storeArr',storeArr) + // console.log("console 4") + setState({ ...state, storeArr }); + // storeRef.current={storeList:newList} //add by m + console.log("5", storeRef.current); + setGlobalStorelist(storeArr); + setrerenderdata(!rerenderdata); + } + } + + async function UploadDataWithImages(index, AllStores, data, MenuList, allKPIs, JCP_TYPE, allFilesToUpload) { + let { StoreName } = data; + console.log("data============", data?.STORE_OBJ?.StoreName); + const storeObj = JSON.parse(data.STORE_OBJ); + + console.log(storeObj?.StoreName, "StoreName") + + if (allFilesToUpload.length > 0) { + setLoaderTitle(ST.UploadingImages + '...'); + console.log('set loader title'); + let isAllUploaded = await uploadAllImages(props, data, allFilesToUpload, JCP_TYPE, EmpData); + + if (isAllUploaded == true) { + await updateStoreStatuslocal('U', data); + notify(ST.Alldataandimagesuploadedfor + ' ' + storeObj?.StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } else { + notify(ST.Cannotuploadimagesfor + ' ' + storeObj?.StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + } + else { + let isupdatedU = await uploadStoreStatus(props, data, 'U', JCP_TYPE, EmpData); + console.log('on no files found to upload , isupdated::', isupdatedU); + if (isupdatedU) { + await updateStoreStatuslocal('U', data); + notify(ST.Alldatauploadedfor + ' ' + storeObj?.StoreName, 'SHORT'); + } + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + } + + async function getLocOnCheckout() { + setShowAlert(false); + setLoaderTitle(ST.Gettinglocation + '...'); + setProcessing(true); + + Geolocation.getCurrentPosition( + async (position) => { + let { latitude, longitude } = position.coords; + let loc = { lat: latitude, lng: longitude }; + var distance = checkRange(loc.lat, loc.lng, checkOutStore.Latitude, checkOutStore.Longitude); + // console.log('COut distance:',distance); + setProcessing(false); + // let dinKM=(distance / 1000); + // let distanceinM=(distance=='' || distance==null || isNaN(distance))?' 0 m':( dinKM > 1 ? dinKM.toFixed(1) + ' Km' : distance + ' m'); + if (GeoFenceEnable_Checkout == true) { + if (GeoFenceRadius_Checkout != '' && distance > GeoFenceRadius_Checkout) { + notify(ST.Youcannotcheckout + ' ' + ST.Youarenotwithinthealloweddistancefromthestore + ' ' + GeoFenceRadius_Checkout + ' m', 'LONG') + } + else { + checkOutAfterLoc(loc); + } + } + else { + checkOutAfterLoc(loc); + } + + }, + (error) => { + notify(ST.Cannotgetuserposition); + setProcessing(false); + }, + { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + ); + } + + // console.log("state.storeList on",state.storeList) + const isAlreadyCheckedIn = state?.storeList.some(item => item.UploadStatus == "I"); + + // if (isAlreadyCheckedIn) { + // notify(ST.Youarealreadycheckedintotheotherstore,'LONG'); + // } + + // "UploadStatus": "I", + + console.log("isAdhocScreen", isAdhocScreen); + + return ( + + {processing && } + + {_render_StoreVisitModal()} + {_render_GeoTagModal()} + {_render_DistanceModal()} + {_render_CancelCheckinModal()} + {_OpenCaptureImage_Modal()} + {ConfirmSaveAlert(props, showAlert, onSaveCancel, getLocOnCheckout, ST.Doyoureallywanttocheckout)} + + {console.log("showCamera--->", CheckOutImageModal)} + {/* { ChangeShowCamera(false); getImage(imgData) }} showCamera={showCamera} onHideCamera={() => { ChangeShowCamera(false); }} /> */} + + { ChangeShowCamera(false); getImage(imgData); setCheckOutImageModal(true) }} + showCamera={showCamera} + onHideCamera={() => { ChangeShowCamera(false); }} + /> + + + + + {!props.isDataDownloaded && } + + + + + + + + { setSearchedItem(val), searchRef.current = val; }} + autoComplete='off' + /> + { SearchStore(searchedItem) }}> + + + + + + Stores matching your search + + + {nodataFound && + + {ST.NoDataAvailable} + + } + {(props.isDataDownloaded == true && !nodataFound) && + + { + return ( + + ); + }} + /> + + } + + + + + + + + ); +} + +export default connect(mapStateToProps, mapDispatchToProps)(SearchStoreList); \ No newline at end of file diff --git a/src/screens/Settings.js b/src/screens/Settings.js new file mode 100644 index 0000000..af9f6c1 --- /dev/null +++ b/src/screens/Settings.js @@ -0,0 +1,295 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,DownloadData} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl, db} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign, Feather, FontAwesome, MaterialCommunityIcons} from '../components/icons'; +import { WebView } from 'react-native-webview'; +import CustomLoader from '../components/CustomLoader'; +import NoDataComponent from '../components/NoDataComponent'; +import LinearGradient from 'react-native-linear-gradient'; +// import RNExitApp from 'react-native-exit-app'; +import { ConfirmSaveAlert } from '../components/alert'; +import CustomModal from '../components/CustomModal'; +import OtpInputs from 'react-native-otp-inputs'; +import { PrimaryTheme } from '../styles/Themes'; + + + const MpinModal = ({ + visible, + onClose, + onConfirm, + mpin, + setMpin, + customStyle, + PageTheme, + ST +}) => { + if (!visible) return null; + + return ( + + + + {ST.Warning} + + + {ST.Allcacheandstoragewillbedeletedfortheapp} + + + + setMpin(code)} + numberOfInputs={4} + secureTextEntry={true} + keyboardType={"numeric"} + defaultValue={mpin} + autofillFromClipboard={false} + inputStyles={customStyle.MPinM_otp_inputStyle} + style={customStyle.MPinM_otp_field} + /> + + + + {ST.Cancel} + + + {ST.Yes} + + + + ); +}; + +function Settings(props) { + const route = useRoute(); + + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [mpin, setMpin] = useState(''); + const [processing, setProcessing] = useState(false); + const [isDataFound, setisDataFound] = useState(false); + const [showAlert, setShowAlert] = useState(false); + const [showMPinModal, setShowMPinModal] = useState(false); + + + const [reportData, setReportData] = useState([]); + const [designation, setDesignation] = useState(''); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + console.log('showMPinModal changed:',showMPinModal); + }, [showMPinModal]); + + async function exitApp(){ + console.log('exit app'); + clear_item('islogin'); + clear_item('mpin'); + clear_item('loginToken'); + clear_item('loginInfo'); + clear_item('login_credentials'); + clear_item('firsttime'); + clear_item('projectCode'); + clear_item('projectInfo'); + clear_item('loginOfDays'); + props.setGlobalData({isDataDownloaded:false}); + props.setAttendanceStatus({isAttendanceMarked:false,isEntryAllow:false}); + const pdata={islogin:false,SecurityToken:''}; + props.pageprops?props.pageprops.set_session(pdata):''; + setTimeout(()=>{ + props.navigation.reset({index: 0,routes: [{name: 'Project'}],}); + },1000); + } + + async function clearStorage(){ + setShowMPinModal(false); + let isvalid=await validate(); + if(isvalid){ + setProcessing(true); + await set_item('DataStorageCleared','1'); + try { + db.transaction(async function (txn) { + await txn.executeSql(`SELECT name FROM sqlite_schema WHERE type='table' ORDER BY name`,[],async function (txnd, txnres1) { + console.log('q exec:',txnres1.rows.length); + if(txnres1.rows.length>0){ + for(var i=0;i{ + console.log('setShowMPinModal true'); + setShowMPinModal(true); + },0); + } + + function AskForClearStorage(){ + setShowAlert(true);return; + Alert.alert( + "Performics", + ST.DoyoureallywanttoclearalldataThiswillremoveallcacheandstorage, + [ + { + text: ST.Cancel, + onPress: () => {}, + style: "cancel" + }, + { text: ST.OK, onPress: () => { clearStorage()} } + ], + ); + } + + // function _Mpin_Modal(showMPinModal){ + // console.log('render _Mpin_Modal:--12',showMPinModal); + // return ( + // + // + // + // {ST.Warning} + // + // {ST.Allcacheandstoragewillbedeletedfortheapp} + + // + // {setMpin(code);}} + // numberOfInputs={4} + // secureTextEntry={true} + // autofillFromClipboard={false} + // keyboardType={"numeric"} + // defaultValue={''} + // inputStyles={customStyle.MPinM_otp_inputStyle} + // style={customStyle.MPinM_otp_field} + // /> + // + // + + // {setShowMPinModal(false);}}> + // {ST.Cancel} + // + // {clearStorage()}}> + // {ST.Yes} + // + // + // + // ) + // } + + + + return ( + + {processing && } + + + {/* {MpinModal(showMPinModal)} */} + setShowMPinModal(false)} + onConfirm={clearStorage} + mpin={mpin} + setMpin={setMpin} + customStyle={customStyle} + PageTheme={PageTheme} + ST={ST} + /> + {showAlert && ConfirmSaveAlert(props,showAlert,()=>{setShowAlert(false)},askForMPin,ST.DoyoureallywanttoclearalldataThiswillremoveallcacheandstorage)} + + + + {/* {borderTopLeftRadius:0,borderTopRightRadius:0,} */} + + + + {AskForClearStorage() }}> + {ST.ClearDataLogout} + + + + + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(Settings); \ No newline at end of file diff --git a/src/screens/ShareOfShelf.js b/src/screens/ShareOfShelf.js new file mode 100644 index 0000000..1480abf --- /dev/null +++ b/src/screens/ShareOfShelf.js @@ -0,0 +1,787 @@ +import React,{useState,useEffect, useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, KeyboardAvoidingView} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,getKPIFields,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getdefaltShareofSelf } from '../constants/ConstantQueries'; +import CustomCamera from '../components/Camera'; + +function ShareOfShelf(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [StoreCameraAllow, setStoreCameraAllow] = useState(true); + const [currentMenu, setCurrentMenu] = useState({}); + const [brandData, setBrandData] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + + const [catImages, setCatImages] = useState([]); + const [SKUStockData, setSKUStockData] = useState([]); + const [showAlert, setShowAlert] = useState(false); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const [KPIFields, setKPIFields] = useState([]); + + const inputRefs = useRef({}); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + let cameraAllow=storeData1.CameraAllow=='true' || storeData1.CameraAllow==1?true:false; + setStoreCameraAllow(cameraAllow); + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + console.log('hasUnsavedChanges:',hasUnsavedChanges); + if (hasUnsavedChanges==true) { + console.log('hasUnsavedChanges is true'); + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + + function onRemoveScreen(e){ + Alert.alert( + "", + "Do you really want to exit the screen?", + [ + { + text: "Cancel", + onPress: () => {}, + style: "cancel" + }, + { text: "OK", onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + async function getData(storeData1,menu1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + let allCats=[]; + + let AllKPIFields=await getKPIFields(menu1); + setKPIFields(AllKPIFields); + await db.transaction(async function (txn) { + let q=Q_getdefaltShareofSelf(storeData1); + let select=` CATEGORY_ID as CategoryId,CATEGORY as CategoryName,IMAGE `; + let q2=` SELECT ${select} FROM ${AppTables.SHARE_OF_SHELF_IMAGE} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + await txn.executeSql(q2,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i0){ + let arr=[]; + for(var i=0;i { + let seletlist=`SUB_CATEGORY as SubCategoryName,SUB_CATEGORY_ID as SubCategoryId,SUB_CATEGORY_STOCK,STOCK,IMAGE1`; + let sku_q=`SELECT ${seletlist} FROM ${AppTables.SHARE_OF_SHELF_FACING_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' and CATEGORY_ID='${item.CategoryId}' `; + + let join=` INNER JOIN Mapping_ShareOfShelf m on p.SubCategoryId=m.SubCategoryId`; + let sku_q2=`SELECT DISTINCT p.SubCategoryId,p.SubCategoryName from Product_Master p ${join} where m.StateId='${StateId}' and m.ChainId='${ChainId}' and m.StoreTypeId='${StoreTypeId}' and p.CategoryId='${item.CategoryId}' order by p.SubCategorySequence`; + + return await txn.executeSql(sku_q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{setrerenderdata2(!rerenderdata2);},3000); + setProcessing(false); + } + return item; + } + } + } + else{ + return await txn.executeSql(sku_q2,[],async function (txn2, txnres2) { + + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + + }); + }); + } catch (err) { + console.log(err); + } + } + + async function getImage(imgdata){ + let cat=getImageProps.option!=null?getImageProps.option:{}; + let type=getImageProps.type!=null?getImageProps.type:'1'; + let skuItem=getImageProps.skuItem!=null?getImageProps.skuItem:{}; + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify('Camera unavailable'); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl='file://'+img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: SOS'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+(props.UserId || '')+'_SOS-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + + let allIMgs=catImages; + let defData={'CategoryId':cat.CategoryId}; + let cindex=-1,imgData=defData; + + + let allSKUData=SKUStockData; + let defData1={'CategoryId':cat.CategoryId,'SubCategoryId':skuItem.SubCategoryId}; + const skud_index=allSKUData.findIndex(i=>i.CategoryId==cat.CategoryId && i.SubCategoryId==skuItem.SubCategoryId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData1) : defData1; + + + if(type=='2'){ + skud['ImageName']=filename; + } + else{ + cindex=allIMgs.findIndex(i=>i.CategoryId==cat.CategoryId); + imgData=cindex>=0?(allIMgs[cindex] || defData):defData; + imgData.ImageName=filename; + } + + + + // renamefile + let imagePath=common_ImagePath+filename; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + + if(type=='2'){ + skud['ImagePath']=uri; + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + console.log('skud:',skud); + console.log('allSKUData:',allSKUData); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + else{ + imgData.ImagePath=uri; + cindex>=0?allIMgs[cindex]=imgData:allIMgs.push(imgData); + setCatImages(allIMgs); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(type,option,skuItem){ + setGetImageProps({'type':type,'option':option,'skuItem':skuItem}); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function onFocusChange(cat,sku,inputType='1'){ + let d={'catId':cat.CategoryId,'subcatId':sku.SubCategoryId,'inputType':inputType}; + console.log(d); + setCurrentFocusedData(d); + } + + async function focusToNext(cat,index,sku,sku_index,inputType='1'){ + console.log('focusToNext',index); + let data=brandData; + + if(inputType=='1'){ + let refIn2=inputRefs.current['input2_'+cat.CategoryId+'_'+sku.SubCategoryId]; + refIn2.focus(); + } + else{ + let ccat_index=index; + let skulist=cat.skulist || []; + if(sku_index==skulist.length-1){ // if last subcategory element + //then move to next category + console.log('move to next cat',ccat_index,data.length) + if(ccat_index==data.length-1){ + return; + } + else{ + ccat_index+=1; + console.log('move to next cat n:',ccat_index) + let cat1=data[ccat_index]; + let skulist1=cat1.skulist || []; + if(skulist1.length>0){ + let sku1=skulist1[0]; + let refIn1=inputRefs.current['input1_'+cat1.CategoryId+'_'+sku1.SubCategoryId]; + console.log('move to next cat refIn1:','input1_'+cat1.CategoryId+'_'+sku1.SubCategoryId) + refIn1.focus(); + } + } + } + else{ + // move to next subcategory + let sku1=skulist[sku_index+1]; + let refIn1=inputRefs.current['input1_'+cat.CategoryId+'_'+sku1.SubCategoryId]; + refIn1.focus(); + } + + + + } + + } + + async function submitOpeningStock(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + let q=`DELETE FROM ${AppTables.SHARE_OF_SHELF_IMAGE} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + let q2=`DELETE FROM ${AppTables.SHARE_OF_SHELF_FACING_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // remove old data + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('stock facing data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('stock facing header data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + let seq_q=` select seq from sqlite_sequence where name="${AppTables.SHARE_OF_SHELF_IMAGE}" `; + await txn.executeSql(seq_q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let data=txnres.rows.item(0); + let seq=data.seq; + insertData(seq); + } + else{ + insertData(0); + } + },function (txn2, txnerr) { console.log(txnerr); insertData(0); },); + + + }); + } catch (err) { + console.log(err); + } + } + + async function insertData(seq=0){ + try { + console.log(seq); + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + + await db.transaction(async function (txn) { + var values='',stock_values=''; + for(var i=0;ici.CategoryId==item.CategoryId) || {}; + values+=values!=''?' , ':''; + values+=` ('${StoreId}','${d2}','${item.CategoryId}','${item.CategoryName}','${cimage.ImageName || ''}','${d2}') `; + + let skulist=item['skulist'] || []; + for(var j=0;jci.CategoryId==item.CategoryId && ci.SubCategoryId==SubCategoryId); + const skud=skud_index>=0?(allSKUData[skud_index] || {}) : {}; + stock_values+=` ('${seq}','${StoreId}','${d2}','${item.CategoryName}','${item.CategoryId}','${SubCategoryName}','${SubCategoryId}','${skud['subcat_facing']}','${(skud['brand_facing'])}','${(skud['ImageName']!=null?skud['ImageName']:'')}','${d2}') `; + } + } + + let add_StockHdr=`INSERT INTO ${AppTables.SHARE_OF_SHELF_IMAGE} (STORE_ID,VISIT_DATE,CATEGORY_ID,CATEGORY,IMAGE,ADDED_DATE) VALUES ${values} `; + let add_Stock=`INSERT INTO ${AppTables.SHARE_OF_SHELF_FACING_DATA} (COMMON_ID,STORE_ID,VISIT_DATE,CATEGORY,CATEGORY_ID,SUB_CATEGORY,SUB_CATEGORY_ID,SUB_CATEGORY_STOCK,STOCK,IMAGE1,ADDED_DATE) VALUES ${stock_values} `; + + await txn.executeSql(add_StockHdr,[],async function (txn2, txnres) { + console.log('stock facing header added'); + await txn.executeSql(add_Stock,[],async function (txn2, txnres) { + console.log('stock facing added'); + notify('Stock facing updated successfully'); + setProcessing(false); + props.navigation.goBack(); + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot add stock facing') },); + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot add stock facing') },); + }); + } catch (err) { + console.log(err); + } + } + + + async function validate(){ + let isValid=true; + var i=0,j=0; + let HdrImgAllowIndex=KPIFields.findIndex(i=>i.KPIFieldName=='HeaderImageAllow'); + let HdrImgAllowObj=HdrImgAllowIndex>=0?KPIFields[HdrImgAllowIndex]:{}; + let isHdrImgAllow=HdrImgAllowIndex>=0?HdrImgAllowObj['KPIFieldEnable']:true; + + let ChildImgAllowIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ChildImageAllow'); + let ChildImageAllowObj=ChildImgAllowIndex>=0?KPIFields[ChildImgAllowIndex]:{}; + let isChildImageAllow=ChildImgAllowIndex>=0?ChildImageAllowObj['KPIFieldEnable']:false; + await Promise.all( + brandData.map(async (item,index) => { + + + if(isValid){ + let catId=item.CategoryId; + let cimgData=catImages.find(ci=>ci.CategoryId==catId) || {}; + if(StoreCameraAllow && isHdrImgAllow==true && (cimgData.ImagePath== null || cimgData.ImagePath=='')){ + notify('Please click image for '+item.CategoryName,'SHORT'); + isValid=false; + } + else{ + let skulist=item.skulist || []; + if(skulist.length>0){ + await Promise.all( + skulist.map(async (skuItem,skuIndex) => { + if(isValid){ + let skuData=SKUStockData.find(ci=>ci.CategoryId==item.CategoryId && ci.SubCategoryId==skuItem.SubCategoryId ) || {}; + + + if(StoreCameraAllow && isChildImageAllow==true && ( skuData.ImagePath== null || skuData.ImagePath=='')){ + notify('Please click image for '+skuItem.SubCategoryName,'SHORT'); + isValid=false; + } + else if(skuData.subcat_facing!==0 && (skuData.subcat_facing==null || skuData.subcat_facing=='')){ + notify('Please enter sub category facing for '+skuItem.SubCategoryName,'SHORT'); + isValid=false; + }else if(skuData.subcat_facing!==0 && (skuData.subcat_facing!=null && skuData.subcat_facing!='' && skuData.subcat_facing.includes('.'))){ + notify('Please enter sub category facing in whole number for '+skuItem.SubCategoryName,'SHORT'); + isValid=false; + }else if(skuData.brand_facing!==0 && (skuData.brand_facing==null || skuData.brand_facing=='')){ + notify('Please enter brand facing for '+skuItem.SubCategoryName,'SHORT'); + isValid=false; + }else if(skuData.brand_facing!==0 && (skuData.brand_facing!=null && skuData.brand_facing!='' && skuData.brand_facing.includes('.'))){ + notify('Please enter brand facing in whole number for '+skuItem.SubCategoryName,'SHORT'); + isValid=false; + }else if(parseInt(skuData.brand_facing)>parseInt(skuData.subcat_facing)){ + notify('Brand facing value should be less than or equal to sub category facing value for '+skuItem.SubCategoryName,'LONG'); + isValid=false; + }else{ + + } + } + }) + ); + } + } + } + }) + ); + + console.log('isValid:',isValid); + return isValid; + } + + function onStockValChange(item,skuItem,val,key,type=''){ + if(type=='numeric' && val!=''){ + const regex = new RegExp(/^\d+$/); + let isNUmeric=regex.test(val); + if(!isNUmeric){ + notify('Please enter whole numbers only','SHORT'); + return; + } + } + + let allSKUData=SKUStockData; + let defData={'CategoryId':item.CategoryId,'SubCategoryId':skuItem.SubCategoryId}; + const skud_index=allSKUData.findIndex(i=>i.CategoryId==item.CategoryId && i.SubCategoryId==skuItem.SubCategoryId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + skud[key]=val; + + + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function _render_Alert(){ + return ( + + + {setShowAlert(false)}}> + Cancel + + {saveData()}}> + Yes + + + + ) + } + + return ( + + {processing && } + + {_render_Alert()} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + { Object.keys(storeData).length>0 && + + + { + const cat=item; + const catIndex=index; + const cindex=catImages.findIndex(i=>i.CategoryId==item.CategoryId); + const cimgName=cindex>=0?(catImages[cindex]?catImages[cindex].ImageName:''):''; + const cimgPath=cindex>=0?(catImages[cindex]?catImages[cindex].ImagePath:''):''; + const showIMg=cimgPath!='' && cimgPath!=null; + + let HdrImgAllowIndex=KPIFields.findIndex(i=>i.KPIFieldName=='HeaderImageAllow'); + let HdrImgAllowObj=HdrImgAllowIndex>=0?KPIFields[HdrImgAllowIndex]:{}; + let isHdrImgAllow=HdrImgAllowIndex>=0?HdrImgAllowObj['KPIFieldEnable']:true; + + let ChildImgAllowIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ChildImageAllow'); + let ChildImageAllowObj=ChildImgAllowIndex>=0?KPIFields[ChildImgAllowIndex]:{}; + let isChildImageAllow=ChildImgAllowIndex>=0?ChildImageAllowObj['KPIFieldEnable']:false; + + + return( + + + + {item.CategoryName} + + {isHdrImgAllow==true && + + { !showIMg && + {openCamera('1',item)}}> + + + } + { showIMg && + + + {/* */} + {openCamera('1',item)}}> + + + + } + + } + + + { + + { + const skus=item; + const sku_index=index; + let thisCatSkuData_i=SKUStockData.findIndex(i=>i.CategoryId==cat.CategoryId && i.SubCategoryId==skus.SubCategoryId); + let thisCatSkuData=thisCatSkuData_i>=0?(SKUStockData[thisCatSkuData_i] || {}):{}; + let brand_facing=thisCatSkuData.brand_facing!=null?thisCatSkuData.brand_facing:''; + let subcat_facing=thisCatSkuData.subcat_facing!=null?thisCatSkuData.subcat_facing:''; + + let childImgPath=thisCatSkuData.ImagePath!=null?thisCatSkuData.ImagePath:''; + const showSubCatIMg=childImgPath!='' && childImgPath!=null; + + const input1IsFocused=skus.input1IsFocused; + const input2IsFocused=skus.input2IsFocused; + + if(input2IsFocused==1){ + console.log('set focus to ',cat.CategoryName,skus.SubCategoryName,'input 2') + } + + return( + + {skus.SubCategoryName} + + {isChildImageAllow==true && + + { !showSubCatIMg && + {openCamera('2',cat,skus)}}> + + + } + { showSubCatIMg && + + + {openCamera('2',cat,skus)}}> + + + + } + + } + + + + + Sub Category Facing + {inputRefs.current['input1_'+cat.CategoryId+'_'+skus.SubCategoryId]=reff;}} + style={[customStyle.openStk_prd_inputStyle]} + placeholder="" + placeholderTextColor={PageTheme.$placeholder_color} + value={(subcat_facing+'' || '')} + keyboardType='numeric' + onSubmitEditing={()=>{focusToNext(cat,catIndex,skus,sku_index,'1')}} + onChangeText={(val)=>{ onStockValChange(cat,skus,val,'subcat_facing','numeric')}} + autoComplete='off' + /> + + + + Brand Facing + {inputRefs.current['input2_'+cat.CategoryId+'_'+skus.SubCategoryId]=reff;}} + style={[customStyle.openStk_prd_inputStyle]} + placeholder="" + placeholderTextColor={PageTheme.$placeholder_color} + value={(brand_facing+'' || '')} + keyboardType='numeric' + onSubmitEditing={()=>{focusToNext(cat,catIndex,skus,sku_index,'2')}} + // onKeyPress={(e)=>{let isDot=e.nativeEvent.key=='.'; return isDot}} + onChangeText={(val)=>{ onStockValChange(cat,skus,val,'brand_facing','numeric')}} + autoComplete='off' + /> + + + + + + ) + }}/> + } + + + ); + }} + /> + + } + + {submitOpeningStock()}}/> + + + + + ); + } + + +export default connect(mapStateToProps, mapDispatchToProps)(ShareOfShelf); \ No newline at end of file diff --git a/src/screens/ShareOfShelfOneApp.js b/src/screens/ShareOfShelfOneApp.js new file mode 100644 index 0000000..28ffe26 --- /dev/null +++ b/src/screens/ShareOfShelfOneApp.js @@ -0,0 +1,1057 @@ + +import React,{useState,useEffect, useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, KeyboardAvoidingView} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,getKPIFields,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; + +import cameraImg from '../assets/performics/camera_icon.svg' +import cameraImg2 from '../assets/performics/camera_front_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getdefaltShareofSelf } from '../constants/ConstantQueries'; +import CustomCamera from '../components/Camera'; + +function ShareOfShelfOneApp(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [StoreCameraAllow, setStoreCameraAllow] = useState(true); + const [currentMenu, setCurrentMenu] = useState({}); + const [brandData, setBrandData] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + const [rerenderdata3, setrerenderdata3]= useState(0); + const [rerenderdata4, setrerenderdata4]= useState(0); + + + const [SOSStockData, setSOSStockData] = useState([]); + const [AllSOSData, setAllSOSData] = useState([]); + const [showAlert, setShowAlert] = useState(false); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const [KPIFields, setKPIFields] = useState([]); + + const inputRefs = useRef({}); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + let cameraAllow=storeData1.CameraAllow=='true' || storeData1.CameraAllow==1?true:false; + setStoreCameraAllow(cameraAllow); + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + console.log('hasUnsavedChanges:',hasUnsavedChanges); + if (hasUnsavedChanges==true) { + console.log('hasUnsavedChanges is true'); + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + + function onRemoveScreen(e){ + Alert.alert( + "", + "Do you really want to exit the screen?", + [ + { + text: "Cancel", + onPress: () => {}, + style: "cancel" + }, + { text: "OK", onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + async function getData(storeData1,menu1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + + let AllKPIFields=await getKPIFields(menu1); + setKPIFields(AllKPIFields); + await db.transaction(async function (txn) { + // let join2=' INNER JOIN Mapping_ProductAssortment mp on p.ProductId=mp.ProductId '; + let join1=` INNER JOIN Mapping_StoreShareOfShelf m on p.SOSDefinitionId=m.SOSDefinitionId `; + let selectlist1=` DISTINCT p.SOSHeaderTable,p.SOSHeaderField,p.SOSHeaderValue,p.HeaderName as HeaderName,p.SOSHeaderFacing,p.SOSHeaderFacingLable,p.SOSHeaderImage,p.SOSHeaderImageCount,p.SOSHeaderImageGrid`; + let q=`SELECT ${selectlist1} from Master_ShareOfShelfDefinition p ${join1} Where m.StoreId ='${StoreId}' order by p.HeaderName `; + + + let selectlist2=` DISTINCT p.SOS_HEADER_ID as SOSHeaderId,m.SOSHeaderTable,m.SOSHeaderField,p.SOS_HDR_VALUE as SOSHeaderValue,p.HEADER_NAME as HeaderName,m.SOSHeaderFacing,m.SOSHeaderFacingLable,m.SOSHeaderImage,m.SOSHeaderImageCount,m.SOSHeaderImageGrid,p.SOS_HDR_FACING as SOSHdrFacing `; + // let join3=` INNER JOIN Mapping_StoreShareOfShelf mp on m.SOSDefinitionId=mp.SOSDefinitionId `; + let join4=` INNER JOIN Master_ShareOfShelfDefinition m on p.SOS_HDR_VALUE=m.SOSHeaderValue `; + let q2=` SELECT ${selectlist2} FROM ${AppTables.SOS_HDR_DATA} p ${join4} WHERE p.STORE_ID='${StoreId}' and p.VISIT_DATE='${d2}' order by p.HEADER_NAME `; + + await txn.executeSql(q2,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[],allCats=[]; + for(var i=0;i0){ + let arr=[],allCats=[]; + for(var i=0;i{ + db.transaction(async function (txn) { + let q=` SELECT IMAGE1 as Image1 FROM ${AppTables.SOS_IMAGES} where SOS_HEADER_ID='${SOSHeaderId}' and TYPE='Header' and STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + await txn.executeSql(q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + for(var i=0;i{ + return allImages; + }) + } + + async function getChilds(storeData1,cat1){ + let defData={allChilds:[],childData:[]}; + let {StoreId} =storeData1; + let {SOSHeaderValue} =cat1; + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let selectlist=` p.SOSDefinitionId,p.SOSChildTable,p.SOSChildField,p.SOSChildValue,p.ChildName,p.SOSChildTotalFacing,p.SOSChildSelfFacing,p.SOSChildTotalFacingLable,p.SOSChildSelfFacingLable,p.SOSChildImage,p.SOSChildImageCount,p.SOSChildImageGrid`; + let join1=` INNER JOIN Mapping_StoreShareOfShelf m on p.SOSDefinitionId=m.SOSDefinitionId `; + let q=`SELECT ${selectlist} from Master_ShareOfShelfDefinition p ${join1} Where m.StoreId ='${StoreId}' and p.SOSHeaderValue='${SOSHeaderValue}' order by p.ChildName `; + + let selectlist2=` m.SOSDefinitionId,m.SOSChildTable,m.SOSChildField,p.SOS_CHILD_VALUE as SOSChildValue,p.CHILD_NAME as ChildName,m.SOSChildTotalFacing,m.SOSChildSelfFacing,m.SOSChildTotalFacingLable,m.SOSChildSelfFacingLable,m.SOSChildImage,m.SOSChildImageCount,m.SOSChildImageGrid,p.TOTAL_FACING as TotalFacing,p.SELF_FACING as SelfFacing`; + // let join3=` INNER JOIN Mapping_StoreShareOfShelf mp on m.SOSDefinitionId=mp.SOSDefinitionId `; + let join4=` INNER JOIN Master_ShareOfShelfDefinition m on p.SOS_DEFINITION_ID=m.SOSDefinitionId `; + let q2=` SELECT ${selectlist2} FROM ${AppTables.SOS_CHILD_DATA} p ${join4} WHERE p.SOS_HDR_VALUE='${SOSHeaderValue}' and p.STORE_ID='${StoreId}' and p.VISIT_DATE='${d2}' order by p.CHILD_NAME `; + + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('sossubcats added',txnres.rows.length); + if(txnres.rows.length>0){ + let arr=[],arr2=[]; + for(var i=0;i0){ + let arr=[],arr2=[]; + for(var i=0;i{ + return defData; + }); + } + + async function getChildImages(storeData1,cat1,subcat1){ + let allImages=[]; + let {StoreId} =storeData1; + let {SOSHeaderId} =cat1; + let {SOSChildValue}=subcat1; + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q=` SELECT IMAGE1 as Image1 FROM ${AppTables.SOS_IMAGES} where SOS_HEADER_ID='${SOSHeaderId}' and SOS_CHILD_VALUE='${SOSChildValue}' and TYPE='Child' and STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + await txn.executeSql(q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + for(var i=0;i{ + return allImages; + }) + } + + + + + async function getImage(imgdata){ + let type=getImageProps.type || ''; + let cat=getImageProps.cat || {}; + let splitItem=getImageProps.splitItem || {}; + let splitItemIndex=getImageProps.splitItemIndex || 0; + let skuItem=getImageProps.sku!=null?getImageProps.sku: {}; + + if(typeof imgdata=='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: Share Of Shelf'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=''; + if(type=='2'){ + filename=storeData.StoreId+'_'+cat.SOSHeaderValue+'_'+skuItem.SOSChildValue+'_'+splitItemIndex+'_'+(props.UserId || '')+'_SOSImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + } + else{ + filename=storeData.StoreId+'_'+cat.SOSHeaderValue+'_'+splitItemIndex+'_'+(props.UserId || '')+'_SOSImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + } + + console.log('filename:',filename); + + let allData=SOSStockData; + let defData={'SOSHeaderValue':cat.SOSHeaderValue,'Images':[],'SKUData':[]}; + const catDataIndex=allData.findIndex(i=>i.SOSHeaderValue==cat.SOSHeaderValue) ; + const catData=catDataIndex>=0?allData[catDataIndex]:{}; + + + if(type=='2'){ + var SKUData=catData['SKUData'] || []; + var childIndex=SKUData.findIndex(i=>i.SOSChildValue==skuItem.SOSChildValue) ; + var childData=childIndex>=0?SKUData[childIndex]:{}; + + var ChildImages=childData['ChildImages'] || []; + var image_key='Image1Name'; + var image_key_path='Image1'; + splitItem[image_key]=filename; + } + else{ + var HeaderImages=catData['Images'] || []; + var image_key='Image1Name'; + var image_key_path='Image1'; + splitItem[image_key]=filename; + } + + + + // renamefile + let imagePath=`${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker:',uri); + + if(type=='2'){ + splitItem[image_key_path]=uri; + splitItemIndex>=0?ChildImages[splitItemIndex]=splitItem:ChildImages.push(splitItem); + childData['ChildImages']=ChildImages; + childIndex>=0?SKUData[childIndex]=childData:SKUData.push(childData); + + catData['SKUData']=SKUData; + catDataIndex>=0?allData[catDataIndex]=catData:allData.push(catData); + setSOSStockData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + else{ + console.log('Hdr split image updated'); + splitItem[image_key_path]=uri; + splitItemIndex>=0?HeaderImages[splitItemIndex]=splitItem:HeaderImages.push(splitItem); + catData['Images']=HeaderImages; + catDataIndex>=0?allData[catDataIndex]=catData:allData.push(catData); + setSOSStockData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(cat,splitItem,splitItemIndex,type='1',sku){ + setGetImageProps({'cat':cat,'splitItem':splitItem,'splitItemIndex':splitItemIndex,'type':type,'sku':sku}); + setShowCamera(true); + } + + async function onFocusChange(cat,sku,inputType='1'){ + let d={'catId':cat.SOSHeaderValue,'subcatId':sku.SubSOSHeaderValue,'inputType':inputType}; + console.log(d); + setCurrentFocusedData(d); + } + + async function focusToNext(cat,index,sku,sku_index,inputType='1'){ + console.log('focusToNext',index); + let data=brandData; + + if(inputType=='1'){ + let refIn2=inputRefs.current['input2_'+cat.SOSHeaderValue+'_'+sku.SubSOSHeaderValue]; + refIn2.focus(); + } + else{ + let ccat_index=index; + let skulist=cat.skulist || []; + if(sku_index==skulist.length-1){ // if last subcategory element + //then move to next category + console.log('move to next cat',ccat_index,data.length) + if(ccat_index==data.length-1){ + return; + } + else{ + ccat_index+=1; + console.log('move to next cat n:',ccat_index) + let cat1=data[ccat_index]; + let skulist1=cat1.skulist || []; + if(skulist1.length>0){ + let sku1=skulist1[0]; + let refIn1=inputRefs.current['input1_'+cat1.SOSHeaderValue+'_'+sku1.SubSOSHeaderValue]; + console.log('move to next cat refIn1:','input1_'+cat1.SOSHeaderValue+'_'+sku1.SubSOSHeaderValue) + refIn1.focus(); + } + } + } + else{ + // move to next subcategory + let sku1=skulist[sku_index+1]; + let refIn1=inputRefs.current['input1_'+cat.SOSHeaderValue+'_'+sku1.SubSOSHeaderValue]; + refIn1.focus(); + } + + + + } + + } + + async function submitOpeningStock(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + let q=`DELETE FROM ${AppTables.SOS_HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + let q2=`DELETE FROM ${AppTables.SOS_IMAGES} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + let q3=`DELETE FROM ${AppTables.SOS_CHILD_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // remove old data + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('stock facing hdr data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('stock facing images deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q3,[],async function (txn2, txnres) { + console.log('stock facing child data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + insertData(); + + + }); + } catch (err) { + console.log(err); + } + } + + async function insertData(){ + try { + + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + + await db.transaction(async function (txn) { + var values='',stock_values='',images_values=''; + for(var i=0;ii.SOSHeaderValue==item.SOSHeaderValue); + const cobj=cindex>=0?SOSStockData[cindex]:{}; + const HeaderImages=cobj['Images'] || [] ; + let SOSHdrFacing=cobj['SOSHdrFacing']!=null?cobj['SOSHdrFacing']:''; + let this_SKUData=cobj['SKUData'] || []; + + values+=values!=''?' , ':''; + values+=` ('${SOSHeaderId}','${StoreId}','${d2}','${SOSHeaderTable}','${SOSHeaderField}','${SOSHeaderValue}','${HeaderName}','${SOSHdrFacing}','${d2}') `; + + let skulist=item['skulist'] || []; + let SOSHeaderImage1=item.SOSHeaderImage==1 || item.SOSHeaderImage=='true'?1: 0; + if(SOSHeaderImage1==true){ + for(var k=0;ki.SOSChildValue==skus.SOSChildValue); + let thisCatSkuData=thisCatSkuData_i>=0?(this_SKUData[thisCatSkuData_i] || {}):{}; + let TotalFacing=thisCatSkuData.TotalFacing!=null?thisCatSkuData.TotalFacing:''; + let SelfFacing=thisCatSkuData.SelfFacing!=null?thisCatSkuData.SelfFacing:''; + const ChildImages=thisCatSkuData['ChildImages'] || [] ; + + stock_values+=` ('${SOSHeaderId}','${StoreId}','${d2}','${SOSDefinitionId}','${SOSHeaderValue}','${SOSChildTable}','${SOSChildField}','${SOSChildValue}','${ChildName}','${TotalFacing}','${SelfFacing}','${d2}') `; + + let SOSChildImage1=SOSChildImage==1 || SOSChildImage=='true'?1: 0; + if(SOSChildImage1==true){ + for(var l=0;l{ + for (const index in AllSOSData){ + const item=AllSOSData[index]; + const cat=item; + const catIndex=index; + + let SOSHeaderImage=item.SOSHeaderImage==1 || item.SOSHeaderImage=='true'?1: 0; + let SOSHeaderFacing=item.SOSHeaderFacing==1 || item.SOSHeaderFacing=='true'?1: 0; + let SOSHeaderFacingLable=item.SOSHeaderFacingLable!=null?item.SOSHeaderFacingLable: ''; + + + const cindex=SOSStockData.findIndex(i=>i.SOSHeaderValue==item.SOSHeaderValue); + const cobj=cindex>=0?SOSStockData[cindex]:{}; + const HeaderImages=cobj['Images'] || [] ; + let SOSHdrFacing=cobj['SOSHdrFacing']!=null?cobj['SOSHdrFacing']:''; + let this_SKUData=cobj['SKUData'] || []; + let TotalSelfFacingsEntered=0; + if(SOSHeaderFacing==true && (SOSHdrFacing==null || SOSHdrFacing=='')){ + notify(`Please enter Header Facing for ${cat.HeaderName}`,'SHORT'); + resolve(false);return; + } + else{ + if(StoreCameraAllow && SOSHeaderImage==true && HeaderImages.length>0) + { + for(const splitItemIndex in HeaderImages){ + const splitItem=HeaderImages[splitItemIndex]; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + if(Image1Name==''){ + notify(`Please click all header images for ${cat.HeaderName}`,'SHORT'); + resolve(false);return; + } + } + } + let skulist=cat.skulist || []; + for(const sku_index in skulist){ + const skus=skulist[sku_index]; + + let SOSChildImage=skus.SOSChildImage==1 || skus.SOSChildImage=='true'?1: 0; + let SOSChildTotalFacing=skus.SOSChildTotalFacing==1 || skus.SOSChildTotalFacing=='true'?1: 0; + let SOSChildSelfFacing=skus.SOSChildSelfFacing==1 || skus.SOSChildSelfFacing=='true'?1: 0; + let SOSChildTotalFacingLable=skus.SOSChildTotalFacingLable!=null?skus.SOSChildTotalFacingLable: ''; + let SOSChildSelfFacingLable=skus.SOSChildSelfFacingLable!=null?skus.SOSChildSelfFacingLable: ''; + + + let thisCatSkuData_i=this_SKUData.findIndex(i=>i.SOSChildValue==skus.SOSChildValue); + let thisCatSkuData=thisCatSkuData_i>=0?(this_SKUData[thisCatSkuData_i] || {}):{}; + let TotalFacing=thisCatSkuData.TotalFacing!=null?thisCatSkuData.TotalFacing:''; + let SelfFacing=thisCatSkuData.SelfFacing!=null?thisCatSkuData.SelfFacing:''; + const ChildImages=thisCatSkuData['ChildImages'] || [] ; + if(SOSChildTotalFacing==true && (TotalFacing==null || TotalFacing=='')){ + notify(`Please enter ${SOSChildTotalFacingLable} for ${skus.ChildName} in ${cat.HeaderName}`,'SHORT'); + resolve(false);return; + } + else if(SOSChildSelfFacing==true && (SelfFacing==null || SelfFacing=='')){ + notify(`Please enter ${SOSChildSelfFacingLable} for ${skus.ChildName} in ${cat.HeaderName}`,'SHORT'); + resolve(false);return; + } + else if(SOSChildSelfFacing==true && SOSChildTotalFacing==true && (parseInt(SelfFacing)> parseInt(TotalFacing))){ + notify(`${SOSChildSelfFacingLable} should be less than or equals to ${SOSChildTotalFacingLable} for ${skus.ChildName} in ${cat.HeaderName}`,'SHORT'); + resolve(false);return; + } + else{ + TotalSelfFacingsEntered+=parseInt(SelfFacing); + if(sku_index==this_SKUData.length-1){ + if(SOSChildSelfFacing==true && SOSHeaderFacing==true && (TotalSelfFacingsEntered> parseInt(SOSHdrFacing))){ + notify(`Sum of all ${SOSChildSelfFacingLable} should be less than or equals to ${SOSHeaderFacingLable} for ${cat.HeaderName}`,'SHORT'); + resolve(false);return; + } + } + + if(StoreCameraAllow && SOSChildImage==true && ChildImages.length>0) + { + for(const splitItemIndex in ChildImages){ + const splitItem=ChildImages[splitItemIndex]; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + if(Image1Name==''){ + notify(`Please click all child images for ${skus.ChildName} in ${cat.HeaderName}`,'SHORT'); + resolve(false);return; + } + } + } + } + } + } + + if(index==(AllSOSData.length-1)){ + resolve(true);return; + } + + } + + }).then((val)=>{return val}) + .catch((err)=>{console.log(err); return false}); + + } + + function onStockValChange(item,skuItem,val,key,type=''){ + if(type=='numeric' && val!=''){ + const regex = new RegExp(/^\d+$/); + let isNUmeric=regex.test(val); + if(!isNUmeric){ + notify('Please enter whole numbers only','SHORT'); + return; + } + } + let allSKUData=SOSStockData; + let defData={'SOSHeaderValue':item.SOSHeaderValue,'Images':[],'SKUData':[]}; + const catindex=allSKUData.findIndex(i=>i.SOSHeaderValue==item.SOSHeaderValue); + const catData=catindex>=0?(allSKUData[catindex] || defData) : defData; + let AllSKUs=catData['SKUData'] ||[]; + + let defCData={'SOSChildValue':skuItem.SOSChildValue,'ChildImages':[]}; + let skud_index=AllSKUs.findIndex(i=>i.SOSChildValue==skuItem.SOSChildValue); + const skud=skud_index>=0?(AllSKUs[skud_index] || defCData) : defCData; + skud[key]=val; + skud_index>=0?AllSKUs[skud_index]=skud:AllSKUs.push(skud); + catData['SKUData']=AllSKUs; + + catindex>=0?allSKUData[catindex]=catData:allSKUData.push(catData); + setSOSStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onHdrStockValChange(item,val,key,type=''){ + if(type=='numeric' && val!=''){ + const regex = new RegExp(/^\d+$/); + let isNUmeric=regex.test(val); + if(!isNUmeric){ + notify('Please enter whole numbers only','SHORT'); + return; + } + } + + let allSKUData=SOSStockData; + let defData={'SOSHeaderValue':item.SOSHeaderValue,'Images':[],'SKUData':[]}; + const skud_index=allSKUData.findIndex(i=>i.SOSHeaderValue==item.SOSHeaderValue); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + skud[key]=val; + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + setSOSStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function _render_Alert(){ + return ( + + + {setShowAlert(false)}}> + Cancel + + {saveData()}}> + Yes + + + + ) + } + + + function _renderSOSList(){ + return ( + + + `window_${index.toString()}`} + renderItem={({item,index})=>{ + const cat=item; + const catIndex=index; + + let SOSHeaderImage=item.SOSHeaderImage==1 || item.SOSHeaderImage=='true'?1: 0; + let SOSHeaderFacing=item.SOSHeaderFacing==1 || item.SOSHeaderFacing=='true'?1: 0; + let SOSHeaderFacingLable=item.SOSHeaderFacingLable!=null?item.SOSHeaderFacingLable: ''; + + + const cindex=SOSStockData.findIndex(i=>i.SOSHeaderValue==item.SOSHeaderValue); + const cobj=cindex>=0?SOSStockData[cindex]:{}; + const HeaderImages=cobj['Images'] || [] ; + let SOSHdrFacing=cobj['SOSHdrFacing']!=null?cobj['SOSHdrFacing']:''; + let this_SKUData=cobj['SKUData'] || []; + + + + return( + + + + {item.HeaderName} + + + + + {SOSHeaderFacing==true && + + + + {SOSHeaderFacingLable} + + + + { onHdrStockValChange(cat,val,'SOSHdrFacing','numeric')}} + autoComplete='off' + /> + + + + } + {(SOSHeaderImage==true && HeaderImages.length>0) && + + + {'Capture SOS Header Images'} + + + + {(rerenderdata2==rerenderdata2) && + HeaderImages.map((item,index)=>{ + let splitItem=item; + let splitItemIndex=index; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image1=splitItem['Image1']!=null && splitItem['Image1']!=''?splitItem['Image1']:''; + + return( + + { (Image1=='' || Image1==null) && + {openCamera(cat,splitItem,splitItemIndex,'1')}}> + + + } + { (Image1!='' && Image1!=null) && + + + {openCamera(cat,splitItem,splitItemIndex,'1')}}> + + + + } + {/* {camera1Label} */} + + ); + }) + } + + + + } + + + + {'Product Facings'} + + + + + { + const skus=item; + const sku_index=index; + + let SOSChildImage=skus.SOSChildImage==1 || skus.SOSChildImage=='true'?1: 0; + let SOSChildTotalFacing=skus.SOSChildTotalFacing==1 || skus.SOSChildTotalFacing=='true'?1: 0; + let SOSChildSelfFacing=skus.SOSChildSelfFacing==1 || skus.SOSChildSelfFacing=='true'?1: 0; + let SOSChildTotalFacingLable=skus.SOSChildTotalFacingLable!=null?skus.SOSChildTotalFacingLable: ''; + let SOSChildSelfFacingLable=skus.SOSChildSelfFacingLable!=null?skus.SOSChildSelfFacingLable: ''; + + let thisCatSkuData_i=this_SKUData.findIndex(i=>i.SOSChildValue==skus.SOSChildValue); + let thisCatSkuData=thisCatSkuData_i>=0?(this_SKUData[thisCatSkuData_i] || {}):{}; + let TotalFacing=thisCatSkuData.TotalFacing!=null?thisCatSkuData.TotalFacing:''; + let SelfFacing=thisCatSkuData.SelfFacing!=null?thisCatSkuData.SelfFacing:''; + const ChildImages=thisCatSkuData['ChildImages'] || [] ; + + return( + + {skus.ChildName} + {(SOSChildImage==true && ChildImages.length>0) && + + + + {'Capture SOS Child Images'} + + + + { rerenderdata4==rerenderdata4 && + ChildImages.map((item,index)=>{ + let splitChildItem=item; + let splitChildItemIndex=index; + let Image1Name=splitChildItem['Image1Name']!=null && splitChildItem['Image1Name']!=''?splitChildItem['Image1Name']:''; + let Image1=splitChildItem['Image1']!=null && splitChildItem['Image1']!=''?splitChildItem['Image1']:''; + + return( + + { (Image1=='' || Image1==null) && + {openCamera(cat,splitChildItem,splitChildItemIndex,'2',skus)}}> + + + } + { (Image1!='' && Image1!=null) && + + + {openCamera(cat,splitChildItem,splitChildItemIndex,'2',skus)}}> + + + + } + {/* {camera1Label} */} + + ); + }) + } + + + + } + + {SOSChildTotalFacing==true && + + + + {SOSChildTotalFacingLable} + + + + { onStockValChange(cat,skus,val,'TotalFacing','numeric')}} + autoComplete='off' + /> + + + } + {SOSChildSelfFacing==true && + + + + {SOSChildSelfFacingLable} + + + { onStockValChange(cat,skus,val,'SelfFacing','numeric')}} + autoComplete='off' + /> + + + } + + + + ) + }}/> + + + + + + ); + }} + /> + + ) + } + + return ( + + {processing && } + + {_render_Alert()} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + { Object.keys(storeData).length>0 && + _renderSOSList() + } + + {submitOpeningStock()}}/> + + + + + ); +} + + +export default connect(mapStateToProps, mapDispatchToProps)(ShareOfShelfOneApp); \ No newline at end of file diff --git a/src/screens/ShelfTalker.js b/src/screens/ShelfTalker.js new file mode 100644 index 0000000..4925f11 --- /dev/null +++ b/src/screens/ShelfTalker.js @@ -0,0 +1,2035 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, Animated} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, FontAwesome, Fontisto, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector' +import { CustomPicker, CustomPicker2 } from '../components/CustomPicker'; +import CustomCamera from '../components/Camera'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import DateTimePicker from '@react-native-community/datetimepicker'; +import CheckBox from '@react-native-community/checkbox'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import MultiSelect from 'react-native-multiple-select'; + +function ShelfTalker(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const animatedChoice=useRef(new Animated.Value(0)).current; + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + const [rerenderdata3, setrerenderdata3]= useState(0); + const [rerenderdata4, setrerenderdata4]= useState(0); + + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + + const [WindowData, setWindowData] = useState([]); + const [reasons_list, setReasons_list] = useState([]); + const [Windows, setWindows] = useState([]); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [showAlert, setShowAlert] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const zoomView=useRef(null); + const [showRating, setShowRating] = useState(false); + const [RatingQtn, setRatingQtn] = useState({}); + const [RatingWindow, setRatingWindow] = useState({}); + const [RatingOrder, setRatingOrder] = useState([]); + + const [Products, setProducts] = useState([]); + const [DisplayList, setDisplayList] = useState([]); + const [toRemoveId,setToRemoveId]= useState(''); + const [toRemoveItem,setToRemoveItem]= useState({}); + const [showRemoveConfirm_M,setshowRemoveConfirm_M]= useState(false); + const [showRAllC_M,setShowRAllC_M]= useState(false); + const [searchedItem, setSearchedItem]= useState(''); + const [globalWindows, setGlobalWindows] = useState([]); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + function onRemoveScreen(e){ + Alert.alert( + "", + ST.Doyoureallywanttoexitthescreen, + [ + { + text: ST.Cancel, + onPress: () => {}, + style: "cancel" + }, + { text: ST.OK, onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + + async function getData(storeData1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + await db.transaction(async function (txn) { + + + let q3=`Select StReasonId as ReasonId,StReason as Reason From Master_ShelfTalkerReason`; + await txn.executeSql(q3,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i0){ + let arr=[];let images=[],allWindowsData=[]; + for(var i=0;i0){ + let arr=[],images=[],allWindowsData=[]; + for(var i=0;i{ + + db.transaction(async function (txn) { + + let q=`select * from ${AppTables.ST_IMAGES} where ST_HEADER_ID='${window.stHeaderId}' and STORE_ID='${storeData1.StoreId}' `; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return WindowSplits_def; + }); + } + + async function getWindowQuestions(window,storeData1,isInserted=false){ + let obj={'WindowQA':{},'WindowQuestions':[]} + return new Promise((resolve,reject)=>{ + + db.transaction(async function (txn) { + var q='',selectlist='',join='',join2=''; + if(isInserted==true){ + selectlist=` DISTINCT q.QUESTION_ID as StQuestionId,q.QUESTION_CODE as StQuestionCode,wq.StQuestionName,wq.QuestionType,wq.StqShowCamera,wq.StqCameraMandatory,wq.StqLengthValidationRequired,wq.StqMinimumChar,wq.StqMaximumChar,wq.StqDecimalPoint,wq.StqDateRangeMin,wq.StqDateRangeMax,wq.StqVoiceLengthInMinutes,wq.StqDefaultQuestionEnable,q.ANSWER as Answer,q.ANSWER_ID as AnswerId,q.MULTI_OPTIONS_IDS as multi_op_ids,q.IMAGE_ALLOW1 as StaShowCamera,q.IMAGE1 as Image1 `; + join2=` inner join Mapping_ShelfTalkerQuestion mq on mq.StQuestionId=wq.StQuestionId `; + join=` inner join Master_ShelfTalkerQuestion wq on wq.StQuestionId=q.QUESTION_ID `; + q=`select ${selectlist} from ${AppTables.ST_CHILD_DATA} q ${join} ${join2} where q.STORE_ID='${storeData1.StoreId}' and q.ST_DEFINITION_ID='${window.StDefinitionId}' and q.SHELFTALKER_ID='${window.ShelfTalkerId}' order by wq.StQuestionSequence `; + } + else{ + selectlist=` DISTINCT wq.StQuestionId,wq.StQuestionCode,wq.StQuestionName,wq.QuestionType,wq.StqShowCamera,wq.StqCameraMandatory,wq.StqLengthValidationRequired,wq.StqMinimumChar,wq.StqMaximumChar,wq.StqDecimalPoint,wq.StqDateRangeMin,wq.StqDateRangeMax,wq.StqVoiceLengthInMinutes,wq.StqDefaultQuestionEnable `; + join=` inner join Mapping_ShelfTalkerQuestion mq on mq.StQuestionId=wq.StQuestionId `; + q=`select ${selectlist} from Master_ShelfTalkerQuestion wq ${join} where mq.StDefinitionId='${window.StDefinitionId}' order by wq.StQuestionSequence `; + } + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + let wqa_obj={}; + for(var i=0;i0){ + for(var k=0;k=0)){ + showImageTag=true; + } + } + } + } + + if(showImageTag && data.Answer!=null){ + let imgPath=(Platform.OS=='ios'?'file://':'')+common_ImagePath+data.Image1; + wqa_obj[imgname_key]=data.Image1; + wqa_obj[img_key]=imgPath; + } + + + + if(data.QuestionType=='Date' && data.Answer!=null){ + let dayonly=moment().format('DD'); + let actual_date=data.Answer?data.Answer.split('/'):[]; + let month=actual_date[0],year=actual_date[1]; + let fulldate=month+'/'+dayonly+'/'+year; + wqa_obj[date_key]=fulldate; + + } + + arr.push(data); + if(i==txnres2.rows.length-1){ + obj['WindowQuestions']=arr; + obj['WindowQA']=wqa_obj; + resolve(obj) + } + } + } + else{ + resolve(obj) + } + },function (txn2, txnerr) { console.log(txnerr); resolve(obj) },); + }); + }).then((val)=>{ + return val + }).catch((err)=>{ + console.log(err); + return obj; + }); + } + + + async function getWindowAnswers(qtn){ + + return new Promise((resolve,reject)=>{ + + db.transaction(async function (txn) { + var q='',selectlist=''; + selectlist=` DISTINCT StAnswerId as AnswerId,StAnswerName as Answer,StaShowCamera,StaCameraMandatory,StaQuestionEnable,StaQuestionDisable `; + q=`select ${selectlist} from Master_ShelfTalkerQuestion where StQuestionId='${qtn.StQuestionId}' order by StaSequence `; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return []; + }); + } + + async function getWindowStockData(window,storeData1,isInserted=false){ + let obj={'WStocks':[],'WStocksData':[],'isAllChecked':0} + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + var q='',selectlist='',join=''; + let checkassrt=window.StElementCheckAssortment=='true' || window.StElementCheckAssortment==1?true:false; + + if(isInserted==true){ + if(checkassrt){ + join=` inner join Mapping_ProductAssortment a on a.ProductId=s.ST_STOCK_VALUE `; + } + + selectlist=` s.ST_STOCK_DEFINITION_ID as StStockDefinitionId, s.ST_DEFINITION_ID as StDefinitionId,s.ST_STOCK_TABLE as StStockTable,s.ST_STOCK_FIELD as StStockField,s.ST_STOCK_VALUE as StStockValue,s.ST_STOCK_MBQ as StStockMBQ,s.PRODUCT_NAME as ProductName, s.STOCK as Stock,s.IS_PROMO_PRESENT as isPromoPresent `; + q=`select ${selectlist} from ${AppTables.ST_STOCK_DATA} s ${join} where s.ST_DEFINITION_ID='${window.StDefinitionId}' and s.STORE_ID='${storeData1.StoreId}' `; + }else{ + if(checkassrt){ + join=` inner join Mapping_ProductAssortment a on a.ProductId=s.StStockValue `; + } + selectlist=` s.StStockDefinitionId, s.StDefinitionId,s.StStockTable,s.StStockField,s.StStockValue,s.StStockMBQ,s.ProductName `; + q=`select ${selectlist} from Master_ShelfTalkerStockDefinition s ${join} where s.StDefinitionId='${window.StDefinitionId}' `; + } + if(checkassrt){ + q+=` and a.StateId='${storeData1.StateId}' `; + } + q+=isInserted?` order by s.PRODUCT_NAME `:` order by s.ProductName `; + + + + await txn.executeSql(q,[],async function (txn2, txnres2) { + + if(txnres2.rows.length>0){ + let arr=[],WStocksData=[]; + let isAllChecked=1; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return obj; + }); + } + + + async function getImage(imgdata){ + let type=getImageProps.type || ''; + let window=getImageProps.window || {}; + let splitItem=getImageProps.splitItem || {}; + let splitItemIndex=getImageProps.splitItemIndex || 0; + let qtn=getImageProps.qtn || {}; + let cameraType=getImageProps.cameraType!=null?getImageProps.cameraType:'1'; + + if(typeof imgdata=='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: Shelf Talker'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+window.StDefinitionId+'_'+window.ShelfTalkerId+'_'+(props.UserId || '')+'_STImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let allData=WindowData; + let defData={'ShelfTalkerId':window.ShelfTalkerId,'StDefinitionId':window.StDefinitionId}; + const wind_index=allData.findIndex(i=>i.ShelfTalkerId==window.ShelfTalkerId && i.StDefinitionId==window.StDefinitionId) ; + let wind=wind_index>=0?allData[wind_index]:defData; + + if(cameraType=='2'){ + var QD=wind.WindowQA || {}; + var image_key=qtn.StQuestionId+'_ImageName1'; + var image_key_path=qtn.StQuestionId+'_ImagePath1'; + QD[image_key]=filename; + } + else if(cameraType=='3'){ + var image_key='NAImage1'; + var image_key_path='NAImage1Path'; + wind[image_key]=filename; + } + else{ + var WindowSplits=wind.WindowSplits || []; + var image_key=type=='1'?'Image1Name':'Image2Name'; + var image_key_path=type=='1'?'Image1':'Image2'; + splitItem[image_key]=filename; + } + + + + // renamefile + let imagePath=`${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker:',uri); + + if(cameraType=='2'){ + QD[image_key_path]=uri; + wind.WindowQA=QD; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata3(!rerenderdata3); + } + else if(cameraType=='3'){ + wind[image_key_path]=uri; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + else{ + console.log('split image updated'); + splitItem[image_key_path]=uri; + splitItemIndex>=0?WindowSplits[splitItemIndex]=splitItem:WindowSplits.push(splitItem); + wind.WindowSplits=WindowSplits; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata2(!rerenderdata2); + } + + + + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(window,splitItem,splitItemIndex,type='1',cameraType='1',qtn={}){ + setGetImageProps({'window':window,'splitItem':splitItem,'splitItemIndex':splitItemIndex,'type':type,'cameraType':cameraType,'qtn':qtn}); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function onSubmitData(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData+'...'); + setProcessing(true); + let d1n=new Date(); + let d3=moment(d1n).format('MM/DD/YYYY'); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + // remove old data + await txn.executeSql(`DELETE FROM ${AppTables.ST_HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window hdr data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.ST_CHILD_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window child data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.ST_IMAGES} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window images data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.ST_STOCK_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window stock data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + // add data + var values='',childV='',imageV='',stockV=''; + + for (const wi in globalWindows){ + const window=globalWindows[wi]; + let isImage1=window.StImage1=='true' || window.StImage1==1?1:0; + let isImage2=window.StImage2=='true' || window.StImage2==1?1:0; + let isNAImageAvl=window.StNotExistCamera=='true' || window.StNotExistCamera==1?1:0; + let isNAReasonEnable=window.StNotExistReasonEnable=='true' || window.StNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.StExistReasonEnable=='true' || window.StExistReasonEnable==1? 1:0; + let isStockReq=window.StElementStockRequired=='true' || window.StElementStockRequired==1?1:0; + let WindowQuestions=window.WindowQuestions || []; + let WindowStocks=window.WindowStocks || []; + + + const wind=WindowData.find(i=>i.ShelfTalkerId==window.ShelfTalkerId && i.StDefinitionId==window.StDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:0; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let remark=wind.remark!=null?wind.remark:''; + let WindowSplits=wind.WindowSplits || []; + let QD=wind.WindowQA || {}; + let WStocksData=wind.WStocksData || []; + + let ST_HEADER_ID='WIND'+wi+(Math.floor(Math.random()*1000)+1); + let {StDefinitionId,ShelfTalkerId,StName,StTable,StField,StValue,ChildName}=window; + + + values+=values!=''?' , ':''; + values+=` ('${ST_HEADER_ID}','${StoreId}','${d3}','${StDefinitionId}','${ShelfTalkerId}','${StName}','${StTable}','${StField}','${StValue}','${ChildName}','${isPresent}','${NAImage1}','${ReasonId}','${Reason}','${remark}','${d3}') `; + + if(isPresent==1){ + for(const qtnIndex in WindowQuestions){ + const qtn=WindowQuestions[qtnIndex]; + + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.StQuestionId+'_AnswerId'; + let ans_key=qtn.StQuestionId+'_Answer'; + let multi_key=qtn.StQuestionId+'_MultiOption'; + let date_key=qtn.StQuestionId+'_Date'; + let img_key=qtn.StQuestionId+'_ImagePath1'; + let imgname_key=qtn.StQuestionId+'_ImageName1'; + let rating_key=qtn.StQuestionId+'_Rating'; + let list_mcdata=[]; + + let {StQuestionId,StQuestionCode,QuestionType,StaShowCamera}=qtn + let answer=QD[ans_key] || 0; + let answerId=QD[id_key] || ''; + let multi_options_ids=QD[multi_key] || ''; + let isImage1All=StaShowCamera=='true' || StaShowCamera==1?1:0; + let Image1=isImage1All==1?QD[imgname_key]:''; + + + childV+=childV!=''?' , ':''; + childV+=` ('${ST_HEADER_ID}','${StoreId}','${d3}','${StDefinitionId}','${ShelfTalkerId}','${StQuestionId}','${StQuestionCode}','${QuestionType}','${answer}','${answerId}','${multi_options_ids}','${Image1}','${isImage1All}','${d3}') `; + } + for(const splitItemIndex in WindowSplits){ + const splitItem=WindowSplits[splitItemIndex]; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image2Name=splitItem['Image2Name']!=null && splitItem['Image2Name']!=''?splitItem['Image2Name']:''; + Image1Name=isImage1==1?Image1Name:''; + Image2Name=isImage2==1?Image2Name:''; + + imageV+=imageV!=''?' , ':''; + imageV+=` ('${ST_HEADER_ID}','${StoreId}','${d3}','${StDefinitionId}','${ShelfTalkerId}','${Image1Name}','${Image2Name}','${d3}') `; + } + for(const stockProdIndex in WindowStocks){ + const stockProd=WindowStocks[stockProdIndex]; + let sd=WStocksData.find(i=> i.ProductId==stockProd.StStockValue) || {}; + let stock=sd.Stock!=null?sd.Stock:(sd.Stock==0?sd.Stock:''); + let isPromoPresent=sd.isPromoPresent!=null?sd.isPromoPresent:0; + let {StStockDefinitionId, StDefinitionId,StStockTable,StStockField,StStockValue,StStockMBQ,ProductName} =stockProd + stockV+=stockV!=''?' , ':''; + stockV+=` ('${ST_HEADER_ID}','${StoreId}','${d3}','${StDefinitionId}','${ShelfTalkerId}','${StStockDefinitionId}','${StStockTable}','${StStockField}','${StStockValue}','${StStockMBQ}','${ProductName}','${stock}','${isPromoPresent}','${d3}') `; + } + + } + } + + console.log('values:',values); + + + let add_hdr_data=`INSERT INTO ${AppTables.ST_HDR_DATA} (ST_HEADER_ID,STORE_ID,VISIT_DATE,ST_DEFINITION_ID,SHELFTALKER_ID,ST_NAME,ST_TABLE,ST_FIELD,ST_VALUE,CHILD_NAME,IS_PRESENT,ST_NA_IMAGE,REASON_ID,REASON,REMARK,ADDED_DATE) VALUES ${values} `; + let add_child_data=`INSERT INTO ${AppTables.ST_CHILD_DATA} (ST_HEADER_ID,STORE_ID,VISIT_DATE,ST_DEFINITION_ID,SHELFTALKER_ID,QUESTION_ID,QUESTION_CODE,QUESTION_TYPE,ANSWER,ANSWER_ID,MULTI_OPTIONS_IDS,IMAGE1,IMAGE_ALLOW1,ADDED_DATE) VALUES ${childV} `; + let add_images_data=`INSERT INTO ${AppTables.ST_IMAGES} (ST_HEADER_ID,STORE_ID,VISIT_DATE,ST_DEFINITION_ID,SHELFTALKER_ID,IMAGE1,IMAGE2,ADDED_DATE) VALUES ${imageV} `; + let add_stock_data=`INSERT INTO ${AppTables.ST_STOCK_DATA} (ST_HEADER_ID,STORE_ID,VISIT_DATE,ST_DEFINITION_ID,SHELFTALKER_ID,ST_STOCK_DEFINITION_ID,ST_STOCK_TABLE,ST_STOCK_FIELD,ST_STOCK_VALUE,ST_STOCK_MBQ,PRODUCT_NAME,STOCK,IS_PROMO_PRESENT,ADDED_DATE ) VALUES ${stockV} `; + + await txn.executeSql(add_hdr_data,[],async function (txn2, txnres) { + console.log('st header data added'); + var isSplitImageAdded=true,isStockAdded=true,isChildAdded=true; + if(imageV!=''){ + isSplitImageAdded=await executeQuery(add_images_data); + } + if(stockV!=''){ + isStockAdded=await executeQuery(add_stock_data); + } + if(childV!=''){ + isChildAdded=await executeQuery(add_child_data); + } + + if(!isSplitImageAdded){ + setProcessing(false);notify(ST.Cannotaddsplitshelftalkerimages); + } + else if(!isStockAdded){ + setProcessing(false);notify(ST.Cannotaddshelftalkerstockdata); + } + else if(!isChildAdded){ + setProcessing(false);notify(ST.Cannotaddshelftalkerquestionsdata); + } + else{ + setProcessing(false);notify(ST.ShelfTalkerdataupdatedsuccessfully); + props.navigation.goBack(); + } + + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify(ST.Cannotaddshelftalkerdata); },); + }); + } catch (err) { + console.log(err); + } + } + + async function executeQuery(q){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres2) { + resolve(true); + },function(txn2,txnerr){console.log(txnerr);resolve(false) }); + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }) + } + + async function validate(){ + let isValid=true; + + + return new Promise((resolve,reject)=>{ + for (const wi in globalWindows){ + const window=globalWindows[wi]; + let isImage1=window.StImage1=='true' || window.StImage1==1?1:0; + let isImage2=window.StImage2=='true' || window.StImage2==1?1:0; + let isNAImageAvl=window.StNotExistCamera=='true' || window.StNotExistCamera==1?1:0; + let isNAReasonEnable=window.StNotExistReasonEnable=='true' || window.StNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.StExistReasonEnable=='true' || window.StExistReasonEnable==1? 1:0; + let isStockReq=window.StElementStockRequired=='true' || window.StElementStockRequired==1?1:0; + let StockQtyRequired=window.StockQtyRequired=='true' || window.StockQtyRequired==1?1:0; + let WindowQuestions=window.WindowQuestions || []; + let WindowStocks=window.WindowStocks || []; + + + const wind=WindowData.find(i=>i.ShelfTalkerId==window.ShelfTalkerId && i.StDefinitionId==window.StDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let remark=wind.remark!=null?wind.remark:''; + let WindowSplits=wind.WindowSplits || []; + let QD=wind.WindowQA || {}; + let WStocksData=wind.WStocksData || []; + + if(isPresent=='1'){ + if(isReasonEnable==true && ReasonId=='' ){ + notify(`${ST.Pleaseselectreasonfor} ${window.StName} `,'LONG'); + resolve(false);return; + } + // else if(remark==''){ + // notify(`Please enter remark for ${window.StName} `,'LONG'); + // resolve(false);return; + // } + else{ + if(window.NoOfSplit>0 && WindowSplits.length>0 && (isImage1==1 || isImage2==1)) + { + for(const splitItemIndex in WindowSplits){ + const splitItem=WindowSplits[splitItemIndex]; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image2Name=splitItem['Image2Name']!=null && splitItem['Image2Name']!=''?splitItem['Image2Name']:''; + console.log('Image2Name',Image2Name,isImage2); + if(isImage1==1 && Image1Name==''){ + notify(`${ST.Pleaseclickallimagesfor} ${window.StName}`,'LONG'); + resolve(false);return; + } + else if(isImage2==1 && Image2Name==''){ + notify(`${ST.Pleaseclickallimagesfor} ${window.StName}`,'LONG'); + resolve(false);return; + } + } + } + + if(isStockReq==1){ + let isProductSelected=false; + for(const stockProdIndex in WindowStocks){ + const stockProd=WindowStocks[stockProdIndex]; + + let sd=WStocksData.find(i=> i.ProductId==stockProd.StStockValue) || {}; + let stock=sd.Stock!=null?sd.Stock:(sd.Stock==0?sd.Stock:''); + let isPromoPresent=sd.isPromoPresent!=null?sd.isPromoPresent:0; + + if(isPromoPresent==1){ + isProductSelected=true; + } + + if(isPromoPresent==1 && StockQtyRequired==1 && stock==''){ + notify(`${ST.Pleaseenterstockfor} ${window.StName} ( ${stockProd.ProductName} ) `,'LONG'); + resolve(false);return; + } + + if(stockProdIndex==WindowStocks.length-1){ + if(!isProductSelected){ + notify(`${ST.PleaseselectatleastoneSKUfor} ${window.StName} `,'LONG'); + resolve(false);return; + } + } + + } + } + + if(WindowQuestions.length>0){ + for(const qtnIndex in WindowQuestions){ + const qtn=WindowQuestions[qtnIndex]; + + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.StQuestionId+'_AnswerId'; + let ans_key=qtn.StQuestionId+'_Answer'; + let multi_key=qtn.StQuestionId+'_MultiOption'; + let date_key=qtn.StQuestionId+'_Date'; + let img_key=qtn.StQuestionId+'_ImagePath1'; + let imgname_key=qtn.StQuestionId+'_ImageName1'; + let rating_key=qtn.StQuestionId+'_Rating'; + let list_mcdata=[]; + + let isImgAllowed=(qtn.StqShowCamera=='true' || qtn.StqShowCamera==1); + let checkForAnsKey=(qtn.QuestionType=='Decimal' || qtn.QuestionType=='Number' || qtn.QuestionType=='Text' || qtn.QuestionType=='Date' || qtn.QuestionType=='Rating') ; + if(qtn.QuestionType=='Single choice list') + { + selansid=QD[id_key]; + } + else if(qtn.QuestionType=='Multi choice list') + { + selansid=QD[multi_key]!=null && QD[multi_key]!=''?QD[multi_key].split(','):[]; + } + + + if(qtn.QuestionType=='Multi choice list' && selansid.length<=0){ + notify(`${Pleaseselectoptionsfortherequiredfield} ${ST.In} ${window.StName}`,'SHORT'); + resolve(false);return; + } + else if( checkForAnsKey && (Object.keys(QD).indexOf(ans_key)<0 || (Object.keys(QD).indexOf(ans_key)>=0 && QD[ans_key]===''))){ + let msg=( qtn.QuestionType=='Date'?`${ST.Pleasepickadatefortherequiredfield} ${ST.In} ${window.StName}`:(qtn.QuestionType=='Rating'?`${Pleaseselectratingfortherequiredfield} ${ST.In} ${window.StName}`:`${ST.Pleasefillalltherequiredfield} ${ST.In} ${window.StName}`)); + notify(msg,'SHORT'); + resolve(false);return; + } + else if(Object.keys(QD).indexOf(id_key)<0 || (Object.keys(QD).indexOf(id_key)>=0 && (QD[id_key]==='' || (QD[id_key]===0 && qtn.isDisabled===false) ))){ + notify(`${ST.Pleasefillalltherequiredfield} ${ST.In} ${window.StName}`,'SHORT'); + resolve(false);return; + } + else if(isImgAllowed && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + notify(`${ST.Pleaseaddimages} ${ST.In} ${window.StName}`,'SHORT'); + resolve(false);return; + }else{ + console.log('no condition found'); + } + + if((qtn.QuestionType=='Single choice list' || qtn.QuestionType=='Multi choice list' )){ + if (qtn.Answers && qtn.Answers.length>0){ + for(var j=0;j=0)){ + showImageTag=true; + } + } + } + } + + if(showImageTag && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + notify(`${ST.Pleaseaddimages} ${ST.In} ${window.StName}`,'SHORT'); + resolve(false);return; + } + } + } + + } + } + else{ + if(isNAReasonEnable==true && ReasonId=='' ){ + notify(`${ST.Pleaseselectreasonfor} ${window.StName} `,'LONG'); + resolve(false);return; + } + else if(isNAImageAvl==true && NAImage1=='' ){ + notify(`${ST.Pleaseclickimagefor} ${window.StName}`,'LONG'); + resolve(false);return; + } + } + + if(wi==(Windows.length-1)){ + resolve(true);return; + } + + } + + }).then((val)=>{return val}) + .catch((err)=>{console.log(err); return false}); + + } + + + function onselectionChange(option,keyLbl,keyVal,otherData){ + let item=otherData.window; + let allData=WindowData; + let defData={'ShelfTalkerId':item.ShelfTalkerId,'StDefinitionId':item.StDefinitionId}; + const win_index=allData.findIndex(i=>i.ShelfTalkerId==item.ShelfTalkerId && i.StDefinitionId==item.StDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[keyVal]=option.value; + wind[keyLbl]=option.label; + + win_index>=0?allData[win_index]=wind:allData.push(wind); + console.log('allData:',allData); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onselectionChange2(option,qtn,window){ + let allData=WindowData; + let defData={'ShelfTalkerId':window.ShelfTalkerId,'StDefinitionId':window.StDefinitionId}; + const wind_index=allData.findIndex(i=>i.ShelfTalkerId==window.ShelfTalkerId && i.StDefinitionId==window.StDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let data=wind.WindowQA || {}; + let id_key=qtn.StQuestionId+'_AnswerId'; + let ans_key=qtn.StQuestionId+'_Answer'; + data[id_key]=option.value; + data[ans_key]=option.label; + + + wind['WindowQA']=data; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + + let aq_ans=qtn.Answers!=null?qtn.Answers:[]; + let ans_obj=aq_ans.find(i=>i.AnswerId==option.value) || {}; + let EQtns=ans_obj.StaQuestionEnable!=null && ans_obj.StaQuestionEnable!=''?ans_obj.StaQuestionEnable.replace(' ','').split(','):[]; + let DQtns=ans_obj.StaQuestionDisable!=null && ans_obj.StaQuestionDisable!=''?ans_obj.StaQuestionDisable.replace(' ','').split(','):[]; + + let sqtns=window.WindowQuestions || [] + + if(EQtns.length>0){ + enableQtns(sqtns,EQtns,DQtns,data,wind,wind_index,allData,window) + } + else if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data,wind,wind_index,allData,window) + } + else{ + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + } + + async function disableQtns(sqtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + + if(DQtns.length>0){ + new Promise.all( + DQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.StQuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=true + sqtns[s_qtnindex]=s_qtn; + let id_key=s_qtn.StQuestionId+'_AnswerId'; + let ans_key=s_qtn.StQuestionId+'_Answer'; + data[id_key]=0; + data[ans_key]=''; + + wind['WindowQA']=data; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + return false + }) + ).then(async (val)=>{ + + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.StDefinitionId==window.StDefinitionId && i.ShelfTalkerId==window.ShelfTalkerId) + if(windowIndex>0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindowData(allData); + setWindows(allwindows); + setGlobalWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + }) + } + } + + async function enableQtns(sqtns,EQtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + new Promise.all( + EQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.StQuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=false + sqtns[s_qtnindex]=s_qtn; + return false + }) + ).then(async (val)=>{ + if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data,wind,wind_index,allData,window) + } + else{ + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.StDefinitionId==window.StDefinitionId && i.ShelfTalkerId==window.ShelfTalkerId) + if(windowIndex>0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindows(allwindows); + setGlobalWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + } + }) + } + + async function setMultiSelectValue(selectedItems=[],qtn={},window={}) { + console.log('setMultiSelectValue',selectedItems); + let id_key=qtn.StQuestionId+'_AnswerId'; + let ans_key=qtn.StQuestionId+'_Answer'; + let multi_key=qtn.StQuestionId+'_MultiOption'; + + let allData=WindowData; + let defData={'ShelfTalkerId':window.ShelfTalkerId,'StDefinitionId':window.StDefinitionId}; + const wind_index=allData.findIndex(i=>i.ShelfTalkerId==window.ShelfTalkerId && i.StDefinitionId==window.StDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + obj[id_key]=0; + obj[multi_key]=selectedItems.join(','); + let anss=[]; + selectedItems.map((itemValue)=>{ + let ans = qtn.Answers.find(c1 => c1.AnswerId == itemValue); + if(ans.Answer){anss.push(ans.Answer)} + }); + obj[ans_key]=anss.join(','); + console.log('obj:',obj); + + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function setTextValue(value,qtn,window) { + let id_key=qtn.StQuestionId+'_AnswerId'; + let ans_key=qtn.StQuestionId+'_Answer'; + + let allData=WindowData; + let defData={'ShelfTalkerId':window.ShelfTalkerId,'StDefinitionId':window.StDefinitionId}; + const wind_index=allData.findIndex(i=>i.ShelfTalkerId==window.ShelfTalkerId && i.StDefinitionId==window.StDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + if(qtn.QuestionType=='Date' ){ + let date_key=qtn.StQuestionId+'_Date'; + let d=value!=null?new Date(value):new Date(); + let mfdate=moment(d).format('MM/YYYY'); + showQtnDatePicker(qtn,window,false); + obj[id_key]=0; + obj[ans_key]=mfdate; + obj[date_key]=moment(d).format('MM/DD/YYYY'); + } + else{ + obj[id_key]=0; + obj[ans_key]=value; + } + + console.log(value,obj); + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function showQtnDatePicker(qtn,window,show=false){ + let allQtns=window.WindowQuestions || []; + let newqtnIndex=allQtns.findIndex(q=>q.StQuestionId==qtn.StQuestionId); + + if(newqtnIndex>=0){ + let newqtn=allQtns[newqtnIndex]; + newqtn.showDatePicker=show; + allQtns[newqtnIndex]=newqtn; + window['WindowQuestions']=allQtns; + let allWindows=Windows; + const winIndex=allWindows.findIndex(i=>i.ShelfTalkerId==window.ShelfTalkerId && i.StDefinitionId==window.StDefinitionId) || {}; + allWindows[winIndex]=window; + setWindows(allWindows); + setGlobalWindows(allwindows); + if(show==true) setrerenderdata(!rerenderdata); + } + } + + function setRatingValue(data){ + setRatingOrder(data); + } + + function onRatingCancel(){ + setShowRating(false); + } + + function onRatingSave(){ + setShowRating(false); + let qtn=RatingQtn; + let window=RatingWindow; + let id_key=qtn.StQuestionId+'_AnswerId'; + let ans_key=qtn.StQuestionId+'_Answer'; + let rating_key=qtn.StQuestionId+'_Rating'; + let ids=[],anss=[]; + RatingOrder.map((item,index)=>{ + ids.push(item.AnswerId); + anss.push(item.Answer); + }) + + let allData=WindowData; + let defData={'ShelfTalkerId':window.ShelfTalkerId,'StDefinitionId':window.StDefinitionId}; + const wind_index=allData.findIndex(i=>i.ShelfTalkerId==window.ShelfTalkerId && i.StDefinitionId==window.StDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + obj[rating_key]=ids.join(','); + obj[id_key]=0; + obj[ans_key]=anss.join(','); + + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function onChoiceSelect(item,val,key,animatedChoice){ + console.log('onChoiceSelect',animatedChoice) + var val1=0; + val==1?val1=1:''; + + if(animatedChoice!=null){ + Animated.timing(animatedChoice, { + toValue: val1, + duration:400, + useNativeDriver:false, + }).start(); + } + onWindowDataChange(item,val,key) + } + + function onWindowDataChange(item,val,key){ + let allData=WindowData; + let defData={'ShelfTalkerId':item.ShelfTalkerId,'StDefinitionId':item.StDefinitionId}; + const win_index=allData.findIndex(i=>i.ShelfTalkerId==item.ShelfTalkerId && i.StDefinitionId==item.StDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[key]=val; + + if(key=='ReasonId'){ + let rsn=reasons_list.find(r=>r.ReasonId==val) || {}; + wind['Reason']=rsn.Reason || ''; + } + + win_index>=0?allData[win_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + async function setWindowStockVal(val,window,stockProd,key){ + if(key=='Stock'){ + if(val.includes('.')){ + notify(ST.Pleaseenterwholenumbersonly,'SHORT'); + return; + } + } + + let allData=WindowData; + let defData={'ShelfTalkerId':window.ShelfTalkerId,'StDefinitionId':window.StDefinitionId}; + const win_index=allData.findIndex(i=>i.ShelfTalkerId==window.ShelfTalkerId && i.StDefinitionId==window.StDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + let sdIndex=WStocksData.findIndex(i=> i.ProductId==stockProd.StStockValue); + let sd=sdIndex>=0?WStocksData[sdIndex]:{'ProductId':stockProd.StStockValue,'Stock':''}; + sd[key]=val; + sdIndex>=0?WStocksData[sdIndex]=sd:WStocksData.push(sd); + wind['WStocksData']=WStocksData; + win_index>=0?allData[win_index]=wind:allData.push(wind); + if(key=='isPromoPresent'){ + let isAllChecked = await verifyAllChecked(val,window,stockProd,key); + wind['isAllSKUChecked']=isAllChecked; + } + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata4(!rerenderdata4); + } + + async function onCatTextChange(window,key,val){ + let item=window; + let allData=WindowData; + let defData={'ShelfTalkerId':item.ShelfTalkerId,'StDefinitionId':item.StDefinitionId}; + const win_index=allData.findIndex(i=>i.ShelfTalkerId==item.ShelfTalkerId && i.StDefinitionId==item.StDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[key]=val; + + win_index>=0?allData[win_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + async function verifyAllChecked(val,window,stockProd,key){ + return await new Promise((resolve,reject)=>{ + let WindowStocks=window.WindowStocks || []; + let allData=WindowData; + const win_index=allData.findIndex(i=>i.ShelfTalkerId==window.ShelfTalkerId && i.StDefinitionId==window.StDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + if(WindowStocks.length>0){ + let isAllChecked=1; + for(var i=0;i a.ProductId==stockProd.StStockValue); + let sd1=sdIndex1>=0?WStocksData[sdIndex1]:{}; + let isPromoPresent=sd1.isPromoPresent; + if(isPromoPresent==null || isPromoPresent=='' || isPromoPresent==0 || isPromoPresent=='0'){ + isAllChecked=0 + } + + if(i==WindowStocks.length-1){ + resolve(isAllChecked); + } + } + } + else{ + resolve(0); + } + + }).catch((err)=>{ + console.log(err); + return 0; + }); + } + + function checkAllSKUs(val,window){ + + let WindowStocks=window.WindowStocks || []; + let allData=WindowData; + let defData={'ShelfTalkerId':window.ShelfTalkerId,'StDefinitionId':window.StDefinitionId}; + const win_index=allData.findIndex(i=>i.ShelfTalkerId==window.ShelfTalkerId && i.StDefinitionId==window.StDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + console.log('WStocksData before:',WStocksData) + for(var i=0;i a.ProductId==stockProd.StStockValue); + let sd=sdIndex>=0?WStocksData[sdIndex]:{'ProductId':stockProd.StStockValue,'Stock':''}; + let isPromoPresent=(val==1 || val=='1')?1:0; + sd['isPromoPresent']=isPromoPresent; + + sdIndex>=0?(WStocksData[sdIndex]=sd):(WStocksData.push(sd)); + } + + + wind['WStocksData']=WStocksData; + wind['isAllSKUChecked']=val==1?1:0; + console.log('wind updated'); + win_index>=0?allData[win_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onSaveCancel(){ + setShowAlert(false); + } + + + + function openImageRefView(RefImage=''){ + setShow_zoomImage(true); + } + + function FilterStores(searchedQry){ + searchedQry=searchedQry.toLowerCase(); + console.log('searchedQry',searchedQry); + let arr=[]; + let newWindows=[]; + if(searchedQry!=null && searchedQry!=''){ + + for(let i=0;i + + {ST.DragItemsInOrder} + {ST.Pressandholdtodrag} + {setRatingValue(data)}} + keyExtractor={(item) => item.AnswerId} + renderItem={renderItem} + /> + + {onRatingCancel()}}> + {ST.Cancel} + + {onRatingSave()}}> + {ST.Save} + + + + + ) + } + + function render_Picker(label_key,value_key,onChange=()=>{},selected_data={}){ + var data=[]; + let qtn=selected_data.qtn || {}; + let window=selected_data.window || {}; + let isQtnDisabled=qtn.isDisabled!=null || qtn.isDisabled!=''?false:true; + let allAnswers=qtn.Answers || []; + + allAnswers.map((item,index)=>{ + let obj={ key: index, label: item[label_key],value:item[value_key] }; + if(selected_data.value==item[label_key]) + obj['component']= {item[label_key]}; + data.push(obj); + }); + + return ( + {onChange(option,qtn,window) }} + overlayStyle={customStyle.addVisPickerOverlay} + cancelContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + optionStyle={customStyle.addvis_opStyle} + optionTextStyle={customStyle.addvis_opTextStyle} + optionContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + selectedKey={'1'} + disabled={isQtnDisabled} + > + {(selected_data.value!=null && selected_data.value!=''?selected_data.value: '-'+ST.select+'-')} + + ) + } + + function renderDatePicker(qtn,window){ + let qtnn=qtn; + let DateRange=qtn.DateRange; + let maxDate=moment().add(10,'years').format('MM/DD/YYYY'); + let minDate=moment().subtract(10,'years').format('MM/DD/YYYY'); + if(DateRange=='RFD'){ + maxDate=moment().format('MM/DD/YYYY'); + } + else if(DateRange=='RPD'){ + minDate=moment().format('MM/DD/YYYY'); + } + + return ( + {setTextValue(selectedDate,qtnn,window)}} + maximumDate={new Date(maxDate)} + minimumDate={new Date(minDate)} + /> + ); + } + + function _renderWindow(){ + return ( + `window_${index.toString()}`} + renderItem={({item,index})=>{ + const window=item; + + let isImage1=window.StImage1=='true' || window.StImage1==1?1:0; + let isImage2=window.StImage2=='true' || window.StImage2==1?1:0; + let isNAImageAvl=window.StNotExistCamera=='true' || window.StNotExistCamera==1?1:0; + let isNAReasonEnable=window.StNotExistReasonEnable=='true' || window.StNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.StExistReasonEnable=='true' || window.StExistReasonEnable==1? 1:0; + let isStockReq=window.StElementStockRequired=='true' || window.StElementStockRequired==1?1:0; + let StockQtyRequired=window.StockQtyRequired=='true' || window.StockQtyRequired==1?1:0; + + // let isStock_CheckAssrt=window.StElementCheckAssortment=='true' || window.StElementCheckAssortment==1?1:0; + let RefImage=window.StRefImage; + let camera1Label=window.StImage1Lable || ''; + let camera2Label=window.StImage2Lable || ''; + let WindowQuestions=window.WindowQuestions || []; + let WindowStocks=window.WindowStocks || []; + + + const wind=WindowData.find(i=>i.ShelfTalkerId==window.ShelfTalkerId && i.StDefinitionId==window.StDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let remark=wind.remark!=null?wind.remark:''; + let WindowSplits=wind.WindowSplits || []; + let QuestionsData=wind.WindowQA || {}; + let WStocksData=wind.WStocksData || []; + let isAllSKUChecked=wind.isAllSKUChecked==1 || wind.isAllSKUChecked=="1"; + + // console.log('camera2Label:',window.ShelfTalkerId,window.StDefinitionId,camera2Label); + + + var xpos=isPresent=='1'?-75:0; + if(window.animatedChoice!=null ){ + xpos=window.animatedChoice.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + + + + return( + + + + {window.StName} + {openImageRefView(RefImage)}}> + + + + + + + + + {ST.IsPresent} + + + + {onChoiceSelect(window,1,'isPresent',window.animatedChoice)}}> + {ST.Yes} + + {onChoiceSelect(window,0,'isPresent',window.animatedChoice)}}> + {ST.No} + + + + + {((isPresent!='1' && isNAReasonEnable==true) || (isPresent=='1' && isReasonEnable==true)) && + + {ST.SelectReason} + {} + + } + + + {(isPresent!='1' && isNAImageAvl==true) && + + + + {ST.CaptureImage} + + + + + + { (NAImage1Path=='' || NAImage1Path==null) && + {openCamera(window,{},0,'1','3')}}> + + + } + { (NAImage1Path!='' && NAImage1Path!=null) && + + + {openCamera(window,{},0,'1','3')}}> + + + + } + + + + + + } + + + + {(isPresent=='1') && + + {(isStockReq==true && WindowStocks.length>0) && + + + {ST.SelectProducts} + + + + {checkAllSKUs((isAllSKUChecked==1?0:1),window)}}> + {let val1=(val==true)?1:0; checkAllSKUs(val1,window) }} + style={[customStyle.WStkHdr_checkbox,(Platform.OS=='ios'?{height:20,width:20,marginLeft:5}:{})]} + tintColors={{ true:PageTheme.$primary_color, false:PageTheme.$text_color_light }} + /> + {ST.SelectAll} + + + `wstock_${index.toString()}`} + renderItem={({item,index})=>{ + let stockProd=item; + let stockProdIndex=index; + let sd=WStocksData.find(i=> i.ProductId==stockProd.StStockValue) || {}; + let stock=sd.Stock!=null?sd.Stock:''; + let isPromoPresent=sd.isPromoPresent!=null?sd.isPromoPresent:0; + + return( + + {/* {stockProd.ProductName} */} + + + {let val1=(val==true)?1:0; setWindowStockVal(val1,window,stockProd,'isPromoPresent') }} + style={[customStyle.WStkHdr_checkbox,(Platform.OS=='ios'?{height:20,width:20,marginTop:5,marginLeft:5,}:{})]} + tintColors={{ true:PageTheme.$primary_color, false:PageTheme.$text_color_light }} + /> + + {stockProd.ProductName} + + {StockQtyRequired==1 && isPromoPresent==1 && + + + + Stock + + + + {setWindowStockVal(val,window,stockProd,'Stock')}} + autoComplete='off' + /> + + + + } + + ); + }} + /> + + } + {( window.NoOfSplit>0 && WindowSplits.length>0 && (isImage1==1 || isImage2==1)) && + + + {ST.CaptureShelfTalkerImages} + + `spliItem_${index.toString()}`} + renderItem={({item,index})=>{ + let splitItem=item; + let splitItemIndex=index; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image2Name=splitItem['Image2Name']!=null && splitItem['Image2Name']!=''?splitItem['Image2Name']:''; + let Image1=splitItem['Image1']!=null && splitItem['Image1']!=''?splitItem['Image1']:''; + let Image2=splitItem['Image2']!=null && splitItem['Image2']!=''?splitItem['Image2']:''; + + return( + + {isImage1==1 && + + { (Image1=='' || Image1==null) && + {openCamera(window,splitItem,splitItemIndex,'1')}}> + + + } + { (Image1!='' && Image1!=null) && + + + {openCamera(window,splitItem,splitItemIndex,'1')}}> + + + + } + {camera1Label} + + } + {isImage2==1 && + + { (Image2=='' || Image2==null) && + {openCamera(window,splitItem,splitItemIndex,'2')}}> + + + } + { (Image2!='' && Image2!=null) && + + + {openCamera(window,splitItem,splitItemIndex,'2')}}> + + + + } + {console.log('camera2Label 2:',camera2Label)} + {camera2Label} + + } + + ); + }} + /> + + } + + {(WindowQuestions.length>0) && + + + {ST.ShelfTalkerQuestions} + + {WindowQuestions.map((item,index)=>{ + + let qtn=item; + let qtnIndex=index; + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.StQuestionId+'_AnswerId'; + let ans_key=qtn.StQuestionId+'_Answer'; + let multi_key=qtn.StQuestionId+'_MultiOption'; + let date_key=qtn.StQuestionId+'_Date'; + let img_key=qtn.StQuestionId+'_ImagePath1'; + let imgname_key=qtn.StQuestionId+'_ImageName1'; + let rating_key=qtn.StQuestionId+'_Rating'; + + let list_mcdata=[]; + + if(qtn.QuestionType=='Single choice list') + { + selansid=QuestionsData[id_key]!=null ?QuestionsData[id_key] :''; + selanswer=QuestionsData[ans_key]!=null ?QuestionsData[ans_key] :''; + } + else if(qtn.QuestionType=='Multi choice list') + { + if(qtn.Answers!=null){ + for(var i=0;i0){ + // let arr=[]; + // for(var i=0;i0){ + for(var i=0;i=0)){ + showImageTag=true; + } + + } + } + } + + if(showImageTag){ + selimg=QuestionsData[img_key]!=null && QuestionsData[img_key]!=''?'file://'+QuestionsData[img_key]:''; + } + + return( + + {qtn.StQuestionName} + {qtn.QuestionType=='Single choice list' && qtn.Answers && + render_Picker('Answer','AnswerId',onselectionChange2,{value:selanswer,qtn:qtn,window:window}) + } + {qtn.QuestionType=='Multi choice list' && qtn.Answers && + { setMultiSelectValue(selectedItems,qtn,window) }} //setMultiSelectValue(selectedItems,qtn) + selectedItems={selansid} + selectText="Pick Items" + searchInputPlaceholderText={ST.SearchItems+"..."} + // onChangeInput={ (text)=> console.log(text)} + tagRemoveIconColor={PrimaryTheme.$primary_color} + tagBorderColor={PrimaryTheme.$primary_color} + tagTextColor={PrimaryTheme.$primary_color} + selectedItemTextColor={PrimaryTheme.$primary_color} + selectedItemIconColor={PrimaryTheme.$primary_color} + itemTextColor={PrimaryTheme.$text_color} + displayKey="Answer" + searchInputStyle={{ color: '#CCC' }} + submitButtonColor={PrimaryTheme.$primary_color} + submitButtonText={ST.Submit} + /> + } + { (qtn.QuestionType=='Number' || qtn.QuestionType=='Decimal' || qtn.QuestionType=='Text') && + {setTextValue(val,qtn,window)}} + autoComplete='off' + /> + } + { + (qtn.QuestionType=='Date') && + + {selansid!=''?selansid:'MM/YYYY'} + {setDateValue(selanswer);showQtnDatePicker(qtn,window,true)}}> + + + + } + { ((qtn.showDatePicker==true || qtn.showDatePicker=='true') && (qtn.QuestionType=='Date') ) && + renderDatePicker(qtn,window) + } + { + (qtn.QuestionType=='Rating') && + + {selanswer} + {setRatingQtn(qtn);setRatingWindow(window);setShowRating(true);}}> + + + + } + + { + // (qtn.QuestionType=='Audio') && + // + // {selanswer} + // {show_recorder(qtn);}}> + // + // + // + } + + { + showImageTag && + + + {openCamera(window,{},0,'1','2',qtn)}}> + + + + } + + + + ) + })} + + } + + + {ST.Remark} + {onCatTextChange(window,'remark',val)}} + autoComplete='off' + /> + + + + + } + + + + + + + ); + }} + /> + ) + } + + function _renderHeader(currentIndex){ + return( + + {/* {`${(currentIndex+1)}/${zoomImageUrl.length}`} */} + {console.log('tsth');setShow_zoomImage(false) }}> + + + + ) + } + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + + {setSearchedItem(val); FilterStores(val)}} + autoComplete='off' + /> + {FilterStores(searchedItem)}}> + + + + { Object.keys(storeData).length>0 && + + {_renderWindow()} + + } + + {onSubmitData()}}/> + + + + + { showRating==true && + renderRatingView() + } + {show_zoomImage && + + null} + /> + + } + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(ShelfTalker); \ No newline at end of file diff --git a/src/screens/ShowMap.js b/src/screens/ShowMap.js new file mode 100644 index 0000000..87de234 --- /dev/null +++ b/src/screens/ShowMap.js @@ -0,0 +1,264 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme, WP } from "../styles/Global"; +import {Image,View,Text,ScrollView,TouchableOpacity,Platform,FlatList} from 'react-native'; +import { connect} from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {checkRange,marktext1,marktext2, UploadData, UploadData2, UploadFormData} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {db, gMap_key} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {AntDesign, Entypo} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import {SvgXml} from 'react-native-svg'; +import MapView,{ Marker,AnimatedRegion,Polyline,PROVIDER_GOOGLE } from 'react-native-maps'; +import { _checkLocationPermission } from '../components/geolocation'; +// import Geolocation from '@react-native-community/geolocation'; +import Geolocation from 'react-native-geolocation-service'; +import { useRef } from 'react'; +import GradientButton from '../components/gradientButton'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import { AppTables } from '../constants/tableConstants'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; + +function ShowMap(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const [processing, setProcessing] = useState(false); + + const [storeData, setStoreData] = useState({}); + const [StoreImage, setStoreImage] = useState(''); + const [StoreImgPath, setStoreImgPath] = useState(''); + + const [currentLocation, setCurrentLocation] = useState({}); + const [markerCoordinate, setMarkerCoordinate] = useState(); + const [markerPos, setMarkerPos] = useState({}); + const [markerTitle, setMarkerTitle] = useState(''); + const [markerPlaceText, setMarkerPlaceText] = useState(''); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeDistanceText, setStoreDistanceText] = useState('0 m'); + const [storeDistance, setStoreDistance] = useState(0); + + const MyMap=useRef(null); + const MyMarker=useRef(null); + const isCancelled = useRef(false); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + getCurrentPosition(storeData1); + getLocationUpdates(storeData1); + return () => {isCancelled.current = true; Geolocation.clearWatch()}; + }, []); + + async function getCurrentPosition(storeData1){ + Geolocation.getCurrentPosition( + async (position) => { + OnLocation(position,storeData1); + + // let coords={latitude:position.coords.latitude,longitude:position.coords.longitude} + // animateCamera(coords); + }, + (error) => { + notify('Cannot get user position'); + }, + { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + ); + } + + async function getLocationUpdates(storeData1){ + Geolocation.watchPosition( + async (position) => { + OnLocation(position,storeData1); + + }, + (error) => { + notify('Cannot get user position'); + }, + { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000, } + ) + } + + async function OnLocation(position,storeData1){ + let loc={lat:position.coords.latitude,lng:position.coords.longitude}; + let storeLat=parseFloat(storeData1.Latitude),storeLng=parseFloat(storeData1.Longitude); + setMarkerPos({ lat:storeLat, lng: storeLng }); + + setMarkerCoordinate(new AnimatedRegion({ latitude:storeLat, longitude: storeLng })); + setMarkerInfo({ latitude:storeLat, longitude: storeLng }); + setCurrentLocation(loc); + + + var distance = checkRange(loc.lat,loc.lng,storeData1.Latitude,storeData1.Longitude); + // console.log('distance:',distance); + let dinKM=(distance / 1000); + let distanceinM=(distance=='' || distance==null || isNaN(distance))?' 0 m':( dinKM > 1 ? dinKM.toFixed(1) + ' Km' : distance + ' m'); + setStoreDistanceText(distanceinM); + setStoreDistance(distance); + + + } + + async function setMarkerInfo(coords){ + if(MyMap.current!=null){ + MyMap.current.addressForCoordinate(coords) + .then((res)=>{ + + if(res!=null){ + let title=res.name; + let placeText=`${res.subLocality}, ${res.locality}, ${res.administrativeArea} ${res.postalCode}`; + setMarkerTitle(title); + setMarkerPlaceText(placeText); + } + }) + } + } + + async function animateCamera(coords) { + if(MyMap.current!=null){ + const camera = await MyMap.current.getCamera(); + camera.heading = 7; + camera.pitch = 7; + camera.altitude = 100; + camera.zoom = 19; + camera.center.latitude = coords.latitude; + camera.center.longitude = coords.longitude; + MyMap.current.animateCamera(camera, { duration: 2000 }); + console.log('animate camera'); + } + } + + + function _renderMap(){ + const lat =currentLocation.lat?currentLocation.lat:28.579660; + const lng=currentLocation.lng?currentLocation.lng:77.321110; + + if(currentLocation.lat!=null) + { + return ( + + + + + + + + + + ); + } + else{ + return() + } + } + + + + return ( + + {processing && } + + + + { Object.keys(storeData).length>0 && + + + + + + + + {storeData.StoreName} + + + + + + Store Id: + {storeData.StoreId} + + + Store Code: + {storeData.StoreCode} + + + + + Address: + {storeData.Address} + + + + + + + { _renderMap()} + + { + + {`You are ${storeDistanceText} away from the store!`} + + } + + + } + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(ShowMap); \ No newline at end of file diff --git a/src/screens/SimplePromotion.js b/src/screens/SimplePromotion.js new file mode 100644 index 0000000..2bf06ea --- /dev/null +++ b/src/screens/SimplePromotion.js @@ -0,0 +1,780 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, Animated} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, FontAwesome, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility, Q_getpromotionmappingList } from '../constants/ConstantQueries'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import { ConfirmSaveAlert } from '../components/alert'; +import CustomCamera from '../components/Camera'; +import { CustomPicker2 } from '../components/CustomPicker'; + +function SimplePromotion(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [promotionData, setPromotionData] = useState([]); + const [globalPromoData, setGlobalPromoData] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + + const [SKUStockData, setSKUStockData] = useState([]); + const [showAlert, setShowAlert] = useState(false); + const [reasons_list, setReasons_list] = useState([]); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const [searchedItem, setSearchedItem]= useState(''); + const [KPIFields, setKPIFields] = useState([]); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + const zoomView=useRef(null); + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + + function onRemoveScreen(e){ + Alert.alert( + "", + ST.Doyoureallywanttoexitthescreen, + [ + { + text: ST.Cancel, + onPress: () => {}, + style: "cancel" + }, + { text: ST.OK, onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + async function getData(storeData1,menu1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + let allCats=[]; + await getKPIFields(menu1); + await db.transaction(async function (txn) { + let q2=Q_getpromotionmappingList(storeData1); + // let q2=Q_getpaidvisibility(storeData1); + let q=`Select * From Master_NonVisibility`; + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i0){ + let arr=[]; + for(var i=0;i{ + db.transaction(async function (txn) { + let q=`select * from Mapping_MenuConfiguration_Sup where ScreenName='${menu1.ScreenName}'`; + await txn.executeSql(q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + } + + async function getPromotion(prom_mappings=[],storeData1={}){ + + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + await db.transaction(async function (txn) { + let allSKUData=[]; + let completed_tasks=0; + await Promise.all( + prom_mappings.map(async (item,index) => { + let seletlist=`p.PROMOTION_ID as PromoId,p.PROMOTION as Promotion,p.IS_PRESENT as IsPresent,p.REASON_ID as ReasonId,p.REASON as Reason,p.IMAGE1 as Image1,m.Promotion_Line2,m.PromotionType,m.Camera1Enable,m.Camera2Enable`; + let sku_q=`SELECT ${seletlist} FROM ${AppTables.SIMPLE_PROMOTION_DATA} p Inner Join Mapping_Promotion m on m.PromoId=p.PROMOTION_ID WHERE p.STORE_ID='${StoreId}' and p.VISIT_DATE='${d2}' and p.SUB_CATEGORY_ID='${item.SubCategoryId}' `; + + let sku_q2=`SELECT DISTINCT m.PromoId as PromoId,m.Promotion as Promotion,m.Promotion_Line2,m.PromotionType,m.Camera1Enable,m.Camera2Enable FROM Mapping_Promotion m where m.SubCategoryId='${item.SubCategoryId}' and m.ChainId='${ChainId}' and m.StoreTypeId='${StoreTypeId}'and m.StateId='${StateId}'`; + + return await txn.executeSql(sku_q,[],async function (txn2, txnres) { + console.log('inserted data:',txnres.rows.length); + if(txnres.rows.length>0){ + let arr=[]; + + for(var i=0;i0){ + let arr=[]; + console.log('avlbl prmotions:',txnres2.rows.length); + for(var i=0;i{ + + }); + }); + } catch (err) { + console.log(err); + } + } + + + + async function getImage(imgdata){ + let cat=getImageProps.cat || ''; + let skuItem=getImageProps.skuItem || ''; + let type=getImageProps.type || ''; + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: Promotion'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+(props.UserId || '')+'_PromotionImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let allData=SKUStockData; + let defData={'SubCategoryId':cat.SubCategoryId,'PromoId':skuItem.PromoId}; + const cindex=allData.findIndex(ci=>ci.SubCategoryId==cat.SubCategoryId && ci.PromoId==skuItem.PromoId); + const imgData=cindex>=0?(allData[cindex] || defData):defData; + let image_key=type=='2'?'Image2':'Image1'; + let image_path_key=type=='2'?'Image2Path':'Image1Path'; + imgData[image_key]=filename; + + // renamefile + let imagePath=common_ImagePath+filename; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker',uri); + imgData[image_path_key]=uri; + console.log(imgData); + cindex>=0?allData[cindex]=imgData:allData.push(imgData); + + setSKUStockData(allData); + setHasUnsavedChanges(true); + setrerenderdata2(!rerenderdata2); + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(cat,skuItem,type='1'){ + setGetImageProps({'cat':cat,'skuItem':skuItem,'type':type}); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function submitOpeningStock(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData+'...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + let q=`DELETE FROM ${AppTables.SIMPLE_PROMOHDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + let q2=`DELETE FROM ${AppTables.SIMPLE_PROMOTION_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // remove old data + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('promotions hdr data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('promotions data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + + let seq_q=` select seq from sqlite_sequence where name="${AppTables.SIMPLE_PROMOHDR_DATA}" `; + await txn.executeSql(seq_q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let data=txnres.rows.item(0); + let seq=data.seq; + insertData(seq); + } + else{ + insertData(0); + } + },function (txn2, txnerr) { console.log(txnerr); insertData(0); },); + + + }); + } catch (err) { + console.log(err); + } + } + + async function insertData(seq=0){ + try { + console.log(seq); + let {StoreId,ChainId,StateId,StoreTypeId,ExpiryStock}=storeData; + + await db.transaction(async function (txn) { + var values='',child_values='',checklist_values=''; + + for(var i=0;ici.SubCategoryId==item.SubCategoryId && ci.PromoId==skuItem.PromoId); + const skud=skud_index>=0?(allSKUData[skud_index] || {}) : {}; + + child_values+=` ('${seq}','${StoreId}','${d2}','${item.SubCategoryName}','${item.SubCategoryId}','${skuItem.Promotion}','${skuItem.PromoId}','${skud.isPresent}','${(skud.ReasonId || 0)}','${(skud.Reason || '')}','${(skud.Image1)}','${d2}') `; + } + } + + let add_HdrData=`INSERT INTO ${AppTables.SIMPLE_PROMOHDR_DATA} (STORE_ID,VISIT_DATE,SUB_CATEGORY,SUB_CATEGORY_ID,ADDED_DATE) VALUES ${values} `; + + let add_ChildData=`INSERT INTO ${AppTables.SIMPLE_PROMOTION_DATA} (COMMON_ID,STORE_ID,VISIT_DATE,SUB_CATEGORY,SUB_CATEGORY_ID,PROMOTION,PROMOTION_ID,IS_PRESENT,REASON_ID,REASON,IMAGE1,ADDED_DATE ) VALUES ${child_values} `; + + + await txn.executeSql(add_HdrData,[],async function (txn2, txnres) { + console.log('promotion header added'); + await txn.executeSql(add_ChildData,[],async function (txn2, txnres) { + console.log('promotion child added'); + notify(ST.Promotionupdatedsuccessfully); + setProcessing(false); + props.navigation.goBack(); + + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify(ST.CannotupdatePromotion) },); + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify(ST.CannotupdatePromotion) },); + }); + } catch (err) { + console.log(err); + } + } + + + async function validate(){ + let isValid=true; + await Promise.all( + promotionData.map(async (item,index) => { + if(isValid){ + + let promotionlist=item.promotionlist || []; + if(promotionlist.length>0){ + await Promise.all( + promotionlist.map(async (skuItem,skuIndex) => { + let Camera1Enable=(skuItem.Camera1Enable==1 || skuItem.Camera1Enable=='true')?true:false; + if(isValid){ + let skuData=SKUStockData.find(ci=>ci.SubCategoryId==item.SubCategoryId && ci.PromoId==skuItem.PromoId) || {}; + if(skuData.isPresent!=0 && (skuData.isPresent==null || skuData.isPresent=='')){ + notify(ST.Pleaseselectifpromotionpresentornotfor+' '+item.SubCategoryName+' '+skuItem.Promotion,'SHORT'); + isValid=false; + }else if((skuData.isPresent==1) && Camera1Enable==true && ((skuData.Image1==null || skuData.Image1==''))){ + notify(ST.Pleaseclickallimagesfor+' '+item.SubCategoryName+' '+skuItem.Promotion,'SHORT'); + isValid=false; + } + else if((skuData.isPresent!=1) && ((skuData.ReasonId==null || skuData.ReasonId==''))){ + notify(ST.Pleaseselectreasonfor+' '+item.SubCategoryName+' '+skuItem.Promotion,'SHORT'); + isValid=false; + } + } + }) + ); + } + } + }) + ); + + console.log('isValid:',isValid); + return isValid; + } + + function onStockValChange(item,skuItem,val,key,isChoiceSelect=0){ + let allSKUData=SKUStockData; + let defData={'SubCategoryId':item.SubCategoryId,'PromoId':skuItem.PromoId}; + const skud_index=allSKUData.findIndex(i=>i.SubCategoryId==item.SubCategoryId && i.PromoId==skuItem.PromoId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + skud[key]=val; + + if(isChoiceSelect==1 && (skud.isPresent!=1 && skud.isPromoTalkerAvlbl!=1 && skud.isStockAvlbl!=1 )){ + skud.Image1=''; + skud.Image1Path=''; + } + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function onChoiceSelect(item,skuItem,val,key,animatedChoice){ + var val1=0; + if(val==1){ + val1=1; + } + + if(animatedChoice!=null){ + Animated.timing(animatedChoice, { + toValue: val1, + duration:400, + useNativeDriver:false, + }).start(); + } + onStockValChange(item,skuItem,val,key,1) + } + + function onselectionChange(option,keyLbl,keyVal,otherData){ + let skuItem=otherData.skus,item=otherData.cat; + let allSKUData=SKUStockData; + let defData={'SubCategoryId':item.SubCategoryId,'DisplayId':skuItem.DisplayId}; + const skud_index=allSKUData.findIndex(i=>i.SubCategoryId==item.SubCategoryId && i.DisplayId==skuItem.DisplayId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + skud[keyVal]=option.value; + skud[keyLbl]=option.label; + + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + console.log('allSKUData:',allSKUData); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onSaveCancel(){ + setShowAlert(false); + } + + function FilterStores(searchedQry){ + searchedQry=searchedQry.toLowerCase(); + console.log('searchedQry',searchedQry); + let arr=[]; + var arr2=[]; + if(searchedQry!=null && searchedQry!=''){ + + for(let i=0;i0){ + arr.push(arr2); + } + } + } + + + } + } + else{ + arr=globalPromoData; + } + + setPromotionData(arr); + setrerenderdata(!rerenderdata) + setrerenderdata2(!rerenderdata2) + } + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + + {setSearchedItem(val); FilterStores(val)}} + autoComplete='off' + /> + {FilterStores(searchedItem)}}> + + + + { Object.keys(storeData).length>0 && + { + const cat=item; + + return( + + + + {item.SubCategoryName} + + + + + + { + + { + const skus=item; + const sku_index=index; + let thisCatSkuData_i=SKUStockData.findIndex(i=>i.SubCategoryId==cat.SubCategoryId && i.PromoId==skus.PromoId); + let thisCatSkuData=thisCatSkuData_i>=0?(SKUStockData[thisCatSkuData_i] || {}):{}; + let isPresent=thisCatSkuData.isPresent!=null?thisCatSkuData.isPresent:'0'; + let Image1Path=(thisCatSkuData.Image1Path!=null && thisCatSkuData.Image1Path!='')?thisCatSkuData.Image1Path:''; + let ReasonId=thisCatSkuData.ReasonId!=null?thisCatSkuData.ReasonId:''; + let Reason=thisCatSkuData.Reason!=null?thisCatSkuData.Reason:''; + + let Camera1Enable=(item.Camera1Enable==1 || item.Camera1Enable=='true')?true:false; + + var xpos=isPresent==1?-75:0; + if(skus.animatedChoice!=null ){ + xpos=skus.animatedChoice.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + + + // let isCamera1EnableIndex=KPIFields.findIndex(i=>i.KPIFieldName=='Camera1Enable') + // let isCamera1EnableKPIObj=isCamera1EnableIndex>=0?KPIFields[isCamera1EnableIndex]:{}; + // let isCamera1Enable=isCamera1EnableIndex>=0?isCamera1EnableKPIObj['KPIFieldEnable']:true; + + // let isCamera2EnableIndex=KPIFields.findIndex(i=>i.KPIFieldName=='Camera2Enable') + // let isCamera2EnableKPIObj=isCamera2EnableIndex>=0?KPIFields[isCamera2EnableIndex]:{}; + // let isCamera2Enable=isCamera2EnableIndex>=0?isCamera2EnableKPIObj['KPIFieldEnable']:true; + + + return( + + {skus.Promotion} + + {(skus.Promotion_Line2!=null && skus.Promotion_Line2!='undefined' && skus.Promotion_Line2!='') && {(skus.Promotion_Line2 || '')}} + + + + + {ST.IsPresent} + + + + + {onChoiceSelect(cat,skus,1,'isPresent',skus.animatedChoice)}}> + {ST.Yes} + + {onChoiceSelect(cat,skus,0,'isPresent',skus.animatedChoice)}}> + {ST.No} + + + + + {isPresent!='1' && + {ST.SelectReason} + {} + } + + {(isPresent=='1' && Camera1Enable==true) && + + {ST.CaptureImage} + + + { (Image1Path=='' || Image1Path==null) && + {openCamera(cat,skus,'1')}}> + + + } + { (Image1Path!='' && Image1Path!=null) && + + + {openCamera(cat,skus,'1')}}> + + + + } + + + + } + + + + + + + ) + }}/> + } + + + ); + }} + /> + } + + {submitOpeningStock()}}/> + + + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(SimplePromotion); \ No newline at end of file diff --git a/src/screens/SplashScreen.js b/src/screens/SplashScreen.js new file mode 100644 index 0000000..0d17f93 --- /dev/null +++ b/src/screens/SplashScreen.js @@ -0,0 +1,73 @@ +import React, { useEffect,useContext ,useState} from 'react'; +import SplashScreen from 'react-native-splash-screen'; +import Container from '../components/container'; +import { useRoute} from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,Platform,PermissionsAndroid} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import { baseurl, logoImage } from '../constants/constants'; + + +//Splash Screen +function Splash (props) { + + // get dynamic styles based on dark theme or pageactive + const route = useRoute(); + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [state, setState] = useState({islogin:false,firsttime:true}); + + useEffect(() => { + get_token_from_local(); + }, []); + + + async function get_token_from_local(){ + // await clear_item('islogin'); + // await clear_item('loginToken'); + let token=await get_item('loginToken'); + let is_login=await get_item('islogin'); + let mpin=await get_item('mpin'); + let firsttime=await get_item('firsttime'); + let ft=(firsttime=='done'?false:true); + let isl=((is_login=='done' && token!='' && token!=null && token!=undefined)?true:false); + let is_mpin=(mpin!='' && mpin!=undefined && mpin!=null)?true:false; + + setState({...state,firsttime:ft,islogin:isl}) + const pdata={firsttime:ft,islogin:isl,securityToken:token}; + props.set_session(pdata); + navigateToScreen(ft,isl,is_mpin); + } + + async function navigateToScreen(firsttime,islogin,ismpinavlbl){ + console.log(firsttime,islogin); + var routename=''; + if(firsttime){ + routename='Project'; + } + else if(islogin && ismpinavlbl){ + routename='MpinLogin';//'MpinLogin'; + } + else if(islogin){ + routename='Mpin';//'MpinLogin'; + } + else{ + routename='Login';//'MpinLogin'; + } + + //clear stack and navigate + props.navigation.reset({index: 0,routes: [{name: routename}],}); + // SplashScreen.hide(); + } + + return ( + + + + ); +} + +export default connect(mapStateToProps, mapDispatchToProps)(Splash) \ No newline at end of file diff --git a/src/screens/Stock.js b/src/screens/Stock.js new file mode 100644 index 0000000..6d88841 --- /dev/null +++ b/src/screens/Stock.js @@ -0,0 +1,1826 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, KeyboardAvoidingView, BackHandler, Keyboard, Animated} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, Fontisto, Ionicons, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import CheckBox from '@react-native-community/checkbox'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { ConfirmSaveAlert, ExitScreenAlert } from '../components/alert'; +import CustomCamera from '../components/Camera'; +import Accordion from 'react-native-collapsible/Accordion'; +import DateTimePicker from '@react-native-community/datetimepicker'; +import { createFalse } from 'typescript'; +import CustomModal2 from '../components/CustomModal2'; + +function Stock(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [StoreCameraAllow, setStoreCameraAllow] = useState(true); + const [currentMenu, setCurrentMenu] = useState({}); + const [brandData, setBrandData] = useState([]); + const [globalBrandData, setGlobalBrandData] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + + const [catImages, setCatImages] = useState([]); + const [SKUStockData, setSKUStockData] = useState([]); + const [currentStock, setCurrentStock] = useState({}); + const [currentBrand, setCurrentBrand] = useState({}); + const [currentProduct, setCurrentProduct] = useState({}); + const [KPIFields, setKPIFields] = useState([]); + const [showAlert, setShowAlert] = useState(false); + const [showStockModal, setShowStockModal] = useState(false); + const [showDatePicker, setShowDatePicker] = useState(false); + const [rerendermodal, setrerendermodal] = useState(0); + const [toRemoveId, setToRemoveId] = useState(''); + const [toRemoveCat, setToRemoveCat] = useState({}); + const [toRemoveSKU, setToRemoveSKU] = useState({}); + const [showRemoveConfirm_M, setShowRemoveConfirm_M] = useState(false); + const [searchedItem, setSearchedItem]= useState(''); + + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const [activeSections,setActiveSections]= useState([]); + + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + let cameraAllow=storeData1.CameraAllow=='true' || storeData1.CameraAllow==1?true:false; + setStoreCameraAllow(cameraAllow); + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + + function onRemoveScreen(e){ + Alert.alert( + "", + ST.Doyoureallywanttoexitthescreen, + [ + { + text: ST.Cancel, + onPress: () => {}, + style: "cancel" + }, + { text: ST.OK, onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + async function getKPIFields(menu1){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q=`select * from Mapping_MenuConfiguration where ScreenName='${menu1.ScreenName}'`; + await txn.executeSql(q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + } + + async function getData(storeData1,menu1){ + + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + let allCats=[]; + let allSKUData=[]; + await getKPIFields(menu1); + await db.transaction(async function (txn) { + + // let dq=`DELETE FROM ${AppTables.STOCK2_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + // let dq2=`DELETE FROM ${AppTables.STOCK2HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + // let dq3=`DELETE FROM ${AppTables.STOCK2_MFD_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // // remove old data + // await txn.executeSql(dq,[],async function (txn2, txnres) { + // console.log('stock data deleted'); + // },function (txn2, txnerr) { console.log(txnerr); },); + + // await txn.executeSql(dq2,[],async function (txn2, txnres) { + // console.log('stock header data deleted'); + // },function (txn2, txnerr) { console.log(txnerr); },); + + // await txn.executeSql(dq3,[],async function (txn2, txnres) { + // console.log('stock mfd data deleted'); + // },function (txn2, txnerr) { console.log(txnerr); },); + + // let join=' INNER join Product_Master p on c.CategoryId=p.CategoryId '; + // let join2=' INNER join Mapping_ProductAssortment mp on p.ProductId=mp.ProductId '; + // let q=`SELECT DISTINCT c.CategoryId,c.CategoryName from Master_Category c ${join} ${join2} where mp.StateId='${StateId}' and mp.ChainId='${ChainId}' and mp.StoreTypeId='${StoreTypeId}' order by p.CategorySequence`; + + let join=` inner join Mapping_ProductAssortment m on p.ProductId=m.ProductId `; + let join2=` inner join Master_Category mc on mc.CategoryId=p.CategoryId `; + let q=`select distinct p.SubCategoryId,p.SubCategoryName from Product_Master p ${join} ${join2} where m.ChainId='${ChainId}' and m.StateId='${StateId}' and m.StoreTypeId='${StoreTypeId}' order by p.SubCategoryName`; + + + let q2=` SELECT SUB_CATEGORY_ID as SubCategoryId,SUB_CATEGORY as SubCategoryName,IMAGE,IMAGEPATH FROM ${AppTables.STOCK2HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('added products subcats:',txnres.rows.length) + if(txnres.rows.length>0){ + + let arr=[]; + for(var i=0;i{setrerenderdata2(!rerenderdata2);},3000); + setProcessing(false); + } + } + } + else{ + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('cats len:',txnres2.rows.length) + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{setrerenderdata2(!rerenderdata2);},3000); + setProcessing(false); + + } + } + + } + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false); },); + } + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false); },); + // setProcessing(false); + + }); + } catch (err) { + console.log(err); + } + } + + async function getBrands(storeData1,menu1,item,allSKUData=[]){ + let data_to_ret={'brands':[],'products_data':allSKUData} + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + + return await new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let join=` inner join Mapping_ProductAssortment m on p.ProductId=m.ProductId `; + let join2=` inner join Master_Category mc on mc.CategoryId=p.CategoryId `; + let brands_q=`select distinct p.BrandName,p.BrandId from Product_Master p ${join} ${join2} where m.ChainId='${ChainId}' and m.StateId='${StateId}' and m.StoreTypeId='${StoreTypeId}' and p.SubCategoryId='${item.SubCategoryId}' and CompanyId='1' order by p.BrandName`; + + + await txn.executeSql(brands_q,[],async function (txn2, txnres) { + console.log('brands len:',txnres.rows.length); + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log(err); + return data_to_ret; + }) + } + + async function getSKU(storeData1,cat,brand,allSKUData=[]){ + let sku_ret={'products':[],'products_data':allSKUData}; + let {StoreId,ChainId,StateId,StoreTypeId,ExpiryStock}=storeData1; + return await new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + // get from stored data if exists + let join3=` inner join Mapping_ProductAssortment m on p.PRODUCT_ID=m.ProductId and m.ChainId='${ChainId}' and m.StateId='${StateId}' and m.StoreTypeId='${StoreTypeId}'`; + let seletlist=`p.STOCK_UID,p.PRODUCT as ProductName,p.PRODUCT_ID as ProductId,p.BRAND as BrandName,p.BRAND_ID as BrandId,p.MSL,m.MBQ,p.STOCK,p.BACKROOM_STOCK,p.DAMAGED_STOCK,p.LOST_STOCK,p.EXPIRY_STOCK,p.IS_SKU_STOCK_PRESENT,p.NREXPIRY1_STOCK,p.NREXPIRY2_STOCK,p.NREXPIRY3_STOCK,p.OUT_OF_STOCK,p.LESS_THAN_MBQ`; + let sku_q=`SELECT ${seletlist} FROM ${AppTables.STOCK2_DATA} p ${join3} WHERE p.STORE_ID='${StoreId}' and p.SUB_CATEGORY_ID='${cat.SubCategoryId}' and p.BRAND_ID='${brand.BrandId}' `; + + // else get products from masters + let join=` inner join Mapping_ProductAssortment m on p.ProductId=m.ProductId `; + let join2=` inner join Master_Category mc on mc.CategoryId=p.CategoryId `; + let sku_q2=`select distinct p.ProductName,p.ProductId,p.BrandName,p.BrandId,m.MSL,m.MBQ from Product_Master p ${join} ${join2} where m.ChainId='${ChainId}' and m.StateId='${StateId}' and m.StoreTypeId='${StoreTypeId}' and p.SubCategoryId='${cat.SubCategoryId}' and p.BrandId='${brand.BrandId}' and CompanyId='1' order by p.ProductSequence`; + + + + await txn.executeSql(sku_q,[],async function (txn2, txnres) { + + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i0){ + let arr=[]; + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log('getSKU err:',err); + return sku_ret; + }) + + + } + + async function getMFDStockData(skud){ + + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q=`select * from ${AppTables.STOCK2_MFD_DATA} where STOCK_UID='${skud.STOCK_UID}'`; + await txn.executeSql(q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + console.log(err); + return []; + }) + } + + async function getImage(imgdata){ + let cat=getImageProps.option || ''; + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl='file://'+img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: Stock'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+(props.UserId || '')+'_Stock-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let allIMgs=catImages; + let defData={'SubCategoryId':cat.SubCategoryId}; + const cindex=allIMgs.findIndex(i=>i.SubCategoryId==cat.SubCategoryId); + const imgData=cindex>=0?(allIMgs[cindex] || defData):defData; + imgData.ImageName=filename; + + // renamefile + let imagePath='file://'+`${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri=imagePath; + console.log('image marker',uri); + imgData.ImagePath=uri; + cindex>=0?allIMgs[cindex]=imgData:allIMgs.push(imgData); + setCatImages(allIMgs); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + }) + .catch(err => { + console.log(ST.Errorimagefilewritefailed+'!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(option){ + setGetImageProps({'option':option}); + console.log('openCamera'); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function submitOpeningStock(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData+'...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + let q=`DELETE FROM ${AppTables.STOCK2_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + let q2=`DELETE FROM ${AppTables.STOCK2HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + let q3=`DELETE FROM ${AppTables.STOCK2_MFD_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // remove old data + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('stock data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('stock header data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q3,[],async function (txn2, txnres) { + console.log('stock mfd data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + + let seq_q=` select seq from sqlite_sequence where name="${AppTables.STOCK2HDR_DATA}" `; + await txn.executeSql(seq_q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let data=txnres.rows.item(0); + let seq=data.seq; + insertData(seq); + } + else{ + insertData(0); + } + },function (txn2, txnerr) { console.log(txnerr); insertData(0); },); + + + }); + } catch (err) { + console.log(err); + } + } + + async function insertData(seq=0){ + try { + console.log(seq); + let {StoreId,ChainId,StateId,StoreTypeId,ExpiryStock}=storeData; + console.log('insertData'); + await db.transaction(async function (txn) { + var values='',stock_values='',mfdStockV=''; + for(var i=0;ici.SubCategoryId==item.SubCategoryId) || {}; + values+=values!=''?' , ':''; + + + values+=` ('${StoreId}','${d2}','${item.SubCategoryName}','${item.SubCategoryId}','','${(cimage.ImageName || '')}','${(cimage.ImagePath || '')}','${d2}') `; + console.log('stock hdr values added'); + + let brandList=item.brandList || []; + for(var j=0;jci.SubCategoryId==item.SubCategoryId && ci.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || {}) : {}; + let mfdStocks=skud['mfdStocks'] || []; + + let stock=skud.Stock!=null?skud.Stock:''; + let br_stock=skud.BackRoomStock!=null?skud.BackRoomStock:''; + let ex_stock=skud.ExpiryStock!=null?skud.ExpiryStock:''; + let damage_stock=skud.DamagedStock!=null?skud.DamagedStock:''; + let lost_stock=skud.LostStock!=null?skud.LostStock:''; + let isSKUPresent=skud.isSKUPresent!=null?skud.isSKUPresent:0; + let OutOfStock=skud.OutOfStock!=null?skud.OutOfStock:'0'; + let LessThanMBQ=skud.LessThanMBQ!=null?skud.LessThanMBQ:'0'; + + let NearExpiry_stock1=skud.NearExpiry1!=null?skud.NearExpiry1:''; + let NearExpiry_stock2=skud.NearExpiry2!=null?skud.NearExpiry2:''; + let NearExpiry_stock3=skud.NearExpiry3!=null?skud.NearExpiry3:''; + + stock_values+=` ('${seq}','${SKU_UID}','${StoreId}','${d2}','${item.SubCategoryId}','${item.SubCategoryName}','${BrandId}','${BrandName}','${ProductId}','${ProductName}','${MSL}','${stock}','${br_stock}','${damage_stock}','${lost_stock}','${ex_stock}','${isSKUPresent}','${NearExpiry_stock1}','${NearExpiry_stock2}','${NearExpiry_stock3}','${OutOfStock}','${LessThanMBQ}','${d2}') `; + + for(let m=0;mi.KPIFieldName=='StockValidationRequired') + let StockValidationRequiredObj=StockValidationRequiredI>=0?KPIFields[StockValidationRequiredI]:{}; + let StockValidationRequired=StockValidationRequiredI>=0?StockValidationRequiredObj['KPIFieldEnable']:true; + console.log('StockValidationRequired:',StockValidationRequired); + if(StockValidationRequired==false){ + return isValid; + } + + // validate only if permit + + let isHdrImgIndex=KPIFields.findIndex(i=>i.KPIFieldName=='HeaderImageAllow') + let isHdrImgKPIObj=isHdrImgIndex>=0?KPIFields[isHdrImgIndex]:{}; + let isHdrImgEnable=isHdrImgIndex>=0?isHdrImgKPIObj['KPIFieldEnable']:false; + + let isListedSKUIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ListedSKU'); + let isListedSKUKPIObj=isListedSKUIndex>=0?KPIFields[isListedSKUIndex]:{}; + let isListedSKUEnable=isListedSKUIndex>=0?isListedSKUKPIObj['KPIFieldEnable']:true; + + let isStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='Stock') + let isStockKPIObj=isStockIndex>=0?KPIFields[isStockIndex]:{}; + let isStockEnable=isStockIndex>=0?isStockKPIObj['KPIFieldEnable']:true; + let isStockDis_Name=isStockIndex>=0?isStockKPIObj['KPIFieldDisplayName']:'Stock'; + + let isBRStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='BackRoomStock') + let isBRStockKPIObj=isBRStockIndex>=0?KPIFields[isBRStockIndex]:{}; + let isBRStockEnable=isBRStockIndex>=0?isBRStockKPIObj['KPIFieldEnable']:true; + let isBRStockDis_Name=isBRStockIndex>=0?isBRStockKPIObj['KPIFieldDisplayName']:''; + + let isDStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='DamageStock') + let isDStockKPIObj=isDStockIndex>=0?KPIFields[isDStockIndex]:{}; + let isDStockEnable=isDStockIndex>=0?isDStockKPIObj['KPIFieldEnable']:false; + let isDStockDis_Name=isDStockIndex>=0?isDStockKPIObj['KPIFieldDisplayName']:''; + + let isLStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='LostStock') + let isLStockKPIObj=isLStockIndex>=0?KPIFields[isLStockIndex]:{}; + let isLStockEnable=isLStockIndex>=0?isLStockKPIObj['KPIFieldEnable']:false; + let isLStockDis_Name=isLStockIndex>=0?isLStockKPIObj['KPIFieldDisplayName']:''; + + let isExStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ExpiredStock') + let isExStockKPIObj=isExStockIndex>=0?KPIFields[isExStockIndex]:{}; + let isExStockEnable=isExStockIndex>=0?isExStockKPIObj['KPIFieldEnable']:false; + let isExStockDis_Name=isExStockIndex>=0?isExStockKPIObj['KPIFieldDisplayName']:''; + + let isMFDIndex=KPIFields.findIndex(i=>i.KPIFieldName=='MFD') + let isMFD_KPIObj=isMFDIndex>=0?KPIFields[isMFDIndex]:{}; + let isMFDEnable=isMFDIndex>=0?isMFD_KPIObj['KPIFieldEnable']:false; + let isMFDDis_Name=isMFDIndex>=0?isMFD_KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry1Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry1') + let NrExpiry1KPIObj=NrExpiry1Index>=0?KPIFields[NrExpiry1Index]:{}; + let NrExpiry1Enable=NrExpiry1Index>=0?NrExpiry1KPIObj['KPIFieldEnable']:false; + let NrExpiry1_Dis_Name=NrExpiry1Index>=0?NrExpiry1KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry2Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry2') + let NrExpiry2KPIObj=NrExpiry2Index>=0?KPIFields[NrExpiry2Index]:{}; + let NrExpiry2Enable=NrExpiry2Index>=0?NrExpiry2KPIObj['KPIFieldEnable']:false; + let NrExpiry2_Dis_Name=NrExpiry2Index>=0?NrExpiry2KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry3Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry3') + let NrExpiry3KPIObj=NrExpiry1Index>=0?KPIFields[NrExpiry3Index]:{}; + let NrExpiry3Enable=NrExpiry1Index>=0?NrExpiry3KPIObj['KPIFieldEnable']:false; + let NrExpiry3_Dis_Name=NrExpiry1Index>=0?NrExpiry3KPIObj['KPIFieldDisplayName']:''; + + let MSLIndex=KPIFields.findIndex(i=>i.KPIFieldName=='MSL'); + let MSLObj=MSLIndex>=0?KPIFields[MSLIndex]:{}; + let isMSLAllow=MSLIndex>=0?MSLObj['KPIFieldEnable']:true; + + let NONMSL_Index=KPIFields.findIndex(i=>i.KPIFieldName=='ChildImageAllow'); + let NONMSL_Obj=NONMSL_Index>=0?KPIFields[NONMSL_Index]:{}; + let isNONMSL_Allow=NONMSL_Index>=0?NONMSL_Obj['KPIFieldEnable']:false; + + + + + await Promise.all( + globalBrandData.map(async (item,index) => { + if(isValid){ + let catId=item.SubCategoryId; + + let cimgData=catImages.find(ci=>ci.SubCategoryId==catId) || {}; + + + // let isCollapsed=item.isCollapsed!=null?item.isCollapsed:true; + + if(StoreCameraAllow && isHdrImgEnable==true && (cimgData.ImagePath== null || cimgData.ImagePath=='')) + { + notify(ST.Pleaseclickimagefor+' '+item.SubCategoryName,'SHORT'); + isValid=false; + } + else + { + let brandList=item.brandList || []; + + if(brandList.length>0){ + brandList.map(async (brand,brand_index) => { + let skulist=brand.skulist || []; + if(isValid==true){ + if(skulist.length>0){ + await Promise.all( + skulist.map(async (skuItem,skuIndex) => { + if(isValid==true){ + let skuData=SKUStockData.find(ci=>ci.SubCategoryId==item.SubCategoryId && ci.ProductId==skuItem.ProductId ) || {}; + let stock=skuData.Stock!=null?skuData.Stock:''; + let ex_stock=skuData.ExpiryStock!=null?skuData.ExpiryStock:''; + let damage_stock=skuData.DamagedStock!=null?skuData.DamagedStock:''; + let lost_stock=skuData.LostStock!=null?skuData.LostStock:''; + let isSKUPresent=skuData.isSKUPresent!=null?skuData.isSKUPresent:0; + let br_stock=skuData.BackRoomStock!=null?skuData.BackRoomStock:''; + let NearExpiry_stock1=skuData.NearExpiry1!=null?skuData.NearExpiry1:''; + let NearExpiry_stock2=skuData.NearExpiry2!=null?skuData.NearExpiry2:''; + let NearExpiry_stock3=skuData.NearExpiry3!=null?skuData.NearExpiry3:''; + + let isMandatory=((isMSLAllow==1 || isMSLAllow=='true') && (skuItem.MSL==1 || skuItem.MSL=='true') ) || ((isNONMSL_Allow==1 || isNONMSL_Allow=='true') && (skuItem.MSL!=1 && skuItem.MSL!='true') ) + + + + if((isListedSKUEnable==true && isSKUPresent==1) || (!isListedSKUEnable && (isMandatory)) ){ + + // let sumOfDamagedStocks=parseInt(ex_stock)+parseInt(damage_stock)+parseInt(lost_stock); + + + if(isStockEnable==true && stock!==0 && ( stock==null || stock=='')){ + notify(ST.Pleaseenter+' '+isStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(isBRStockEnable==true && br_stock!==0 && ( br_stock==null || br_stock=='')){ + notify(ST.Pleaseenter+' '+isBRStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(isDStockEnable==true && damage_stock!==0 && ( damage_stock==null || damage_stock=='')){ + notify(ST.Pleaseenter+' '+isDStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(isLStockEnable==true && lost_stock!==0 && ( lost_stock==null || lost_stock=='')){ + notify(ST.Pleaseenter+' '+isDStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(isExStockEnable==true && ex_stock!==0 && ( ex_stock==null || ex_stock=='')){ + notify(ST.Pleaseenter+' '+isExStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(NrExpiry1Enable==true && NearExpiry_stock1!==0 && ( NearExpiry_stock1==null || NearExpiry_stock1=='')){ + notify(ST.Pleaseenter+' '+NrExpiry1_Dis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(NrExpiry2Enable==true && NearExpiry_stock2!==0 && ( NearExpiry_stock2==null || NearExpiry_stock2=='')){ + notify(ST.Pleaseenter+' '+NrExpiry2_Dis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(NrExpiry3Enable==true && NearExpiry_stock3!==0 && ( NearExpiry_stock3==null ||NearExpiry_stock3=='')){ + notify(ST.Pleaseenter+' '+NrExpiry3_Dis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + // else if((isDStockEnable && isLStockEnable && isExStockEnable) && sumOfDamagedStocks>parseInt(stock)){ + // notify('Sum of '+isDStockDis_Name+','+isLStockDis_Name+' and '+isExStockDis_Name+' should be less than or equal to Stock for '+skuItem.ProductName,'LONG'); + // isValid=false; + // } + // else if((isDStockEnable && isLStockEnable) && sumOfDamagedStocks>parseInt(stock)){ + // notify('Sum of '+isDStockDis_Name+' and '+isLStockDis_Name+' should be less than or equal to '+isStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + // isValid=false; + // } + // else if((isLStockEnable && isExStockEnable) && sumOfDamagedStocks>parseInt(stock)){ + // notify('Sum of '+isLStockDis_Name+' and '+isExStockDis_Name+' should be less than or equal to '+isStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + // isValid=false; + // } + // else if((isDStockEnable && isExStockEnable) && sumOfDamagedStocks>parseInt(stock)){ + // notify('Sum of '+isDStockDis_Name+' and '+isExStockDis_Name+' should be less than or equal to '+isStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + // isValid=false; + // } + else{ + + } + + } + } + }) + ); + } + } + + }); + } + + } + } + }) + ); + + console.log('isValid:',isValid); + return isValid; + } + + function onStockValChange(item,skuItem,val,key,type=''){ + if(type=='numeric' && val!=''){ + const regex = new RegExp(/^\d+$/); + let isNUmeric=regex.test(val); + if(!isNUmeric){ + notify(ST.Pleaseenterwholenumbersonly,'SHORT'); + return; + } + } + + let allSKUData=SKUStockData; + let defData={'SubCategoryId':item.SubCategoryId,'ProductId':skuItem.ProductId}; + const skud_index=allSKUData.findIndex(i=>i.SubCategoryId==item.SubCategoryId && i.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + skud[key]=val; + + if(key=='isSKUPresent'){ + skud['showAllSKU_Fields']=val==1?true:false; + } + + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + // function checkStockVal(item,skuItem,key,old_key,old_val){ + // console.log('checkStockVal',old_val,val); + // let allSKUData=SKUStockData; + // let defData={'SubCategoryId':item.SubCategoryId,'ProductId':skuItem.ProductId}; + // const skud_index=allSKUData.findIndex(i=>i.SubCategoryId==item.SubCategoryId && i.ProductId==skuItem.ProductId); + // const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + // console.log('checkStockVal'); + // let val=skud[key] || ''; + // let val1=skud[key] || 0; + // let product_total_stock=skud['Stock']; + // if(product_total_stock!=''){ + // product_total_stock=parseInt(product_total_stock); + // let product_damage_stock=parseInt(skud['DamagedStock'] || 0); + // let product_lost_stock=parseInt(skud['LostStock'] || 0); + // let product_ex_stock=parseInt(skud['ExpiryStock'] || 0); + + // let product_stock=product_ex_stock;//product_total_stock-(product_damage_stock+product_lost_stock+product_ex_stock); + // val1=parseInt(val1); + // if(skud_index>=0){ + // let mfdStocks=skud['mfdStocks'] || []; + // let sumOfAllStocks=0 + // for(let i in mfdStocks){ + // let ds=mfdStocks[i]; + // sumOfAllStocks+=parseInt(ds.stock); + // } + + // if(sumOfAllStocks>product_stock){ + // notify('Sum of all MFD stock cannot be greater than product stock count!'); + // skud[key]=old_val; + // skud[old_key]=old_val; + // } + // else{ + // skud[old_key]=val; + // } + // } + // else{ + // skud[old_key]=val; + // } + + + // skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + // setSKUStockData(allSKUData); + // setHasUnsavedChanges(true); + // setrerenderdata(!rerenderdata); + // } + // } + + function openAddStkModal(cat,skuItem){ + setCurrentBrand(cat); + setCurrentProduct(skuItem); + let allSKUData=SKUStockData; + let defData={'SubCategoryId':cat.SubCategoryId,'ProductId':skuItem.ProductId}; + const skud_index=allSKUData.findIndex(i=>i.SubCategoryId==cat.SubCategoryId && i.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + + setShowStockModal(true); + // let mfdStocks=skud['mfdStocks'] || []; + // let product_stock=skud['Stock']; + // let product_ex_stock=skud['ExpiryStock']; + + // if(product_stock==null || product_stock==''){ + // notify('Please enter sku stock first!'); + // } + // else if(product_ex_stock==null || product_ex_stock==''){ + // notify('Please enter expiry stock first!'); + // } + // else{ + + // } + + } + + function onSaveCancel(){ + setShowAlert(false) + } + + function setStockDate(date){ + let d1=moment(date).format('DD/MM/YYYY'); + let cstock=currentStock; + cstock['date']=date; + cstock['mfd']=d1; + setCurrentStock(cstock); + setShowDatePicker(false); + } + + function setCS_Stock(key,val,type=''){ + if(type=='numeric' && val!=''){ + const regex = new RegExp(/^\d+$/); + let isNUmeric=regex.test(val); + if(!isNUmeric){ + notify(ST.Pleaseenterwholenumbersonly,'SHORT'); + return; + } + } + + let cstock=currentStock; + cstock[key]=val; + console.log(key,val) + setCurrentStock(cstock); + setrerendermodal(!rerendermodal); + } + + + + function getAllSum(mfdStocks=[],cstock={}){ + let {mfd,date,stock}=cstock + let sumOfAllStocks=parseInt(stock); + return new Promise((resolve,reject)=>{ + if(mfdStocks.length>0){ + for(let i in mfdStocks){ + let ds=mfdStocks[i]; + sumOfAllStocks+=parseInt(ds.stock); + if(i==mfdStocks.length-1){ + resolve(sumOfAllStocks) + } + } + } + else{ + resolve(sumOfAllStocks) + } + }).catch((err)=>{ + console.log(err); + return 0; + }) + } + + async function addMFDStock(){ + Keyboard.dismiss(); + let cat=currentBrand + let skuItem=currentProduct + let cstock=currentStock; + var allSKUData=SKUStockData; + let defData={'SubCategoryId':cat.SubCategoryId,'ProductId':skuItem.ProductId}; + const skud_index=allSKUData.findIndex(i=>i.SubCategoryId==cat.SubCategoryId && i.ProductId==skuItem.ProductId); + var skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + let mfdStocks=skud['mfdStocks'] || []; + let product_total_stock=skud['Stock']; + let product_damage_stock=parseInt(skud['DamagedStock'] || 0); + let product_lost_stock=parseInt(skud['LostStock'] || 0); + let product_ex_stock=parseInt(skud['ExpiryStock'] || 0); + + let product_stock=product_ex_stock;//product_total_stock-(product_damage_stock+product_lost_stock+product_ex_stock); + let {mfd,date,stock,lotno}=cstock + + + + + if(mfd==null || mfd==''){ + notify(ST.Pleaseselectdate); + return ; + } + else if(stock==null || stock==''){ + notify(ST.Pleaseenterstock); + return ; + } + else if(lotno==null || lotno==''){ + notify(ST.Pleaseenterlotno); + return ; + } + else if(mfdStocks.findIndex(i=>i.mfd==mfd)>=0){ + notify(ST.ThisdateisalreadyaddedPleaseselectdifferentdate); + return ; + } + else { + // let sumOfAllStocks=await getAllSum(mfdStocks,cstock); + // console.log('product_stock',product_stock,',sum:',sumOfAllStocks,JSON.stringify(SKUStockData)) + // if(product_stock!==0 && (product_stock==null || product_stock=='')){ + // notify('Please enter sku stock'); + // return ; + // } + // else if(sumOfAllStocks>product_stock){ + // notify('Sum of all MFD stock cannot be greater than product stock count!'); + // return ; + // }else{ + console.log('added') + mfdStocks.push(cstock); + skud['mfdStocks']=mfdStocks; + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + setCurrentStock({}); + setShowStockModal(false); + // } + + } + } + + + function removeMFDStock(){ + let cat=toRemoveCat; + let skuItem=toRemoveSKU; + let cstockIndex=toRemoveId; + let allSKUData=SKUStockData; + let defData={'SubCategoryId':cat.SubCategoryId,'ProductId':skuItem.ProductId}; + const skud_index=allSKUData.findIndex(i=>i.SubCategoryId==cat.SubCategoryId && i.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + let mfdStocks=skud['mfdStocks'] || []; + mfdStocks.splice(cstockIndex,1); + skud['mfdStocks']=mfdStocks; + + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + setShowRemoveConfirm_M(false); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function showRemoveConfirm(cat,skuItem,cstock,cstockIndex){ + setToRemoveId(cstockIndex); + setToRemoveCat(cat); + setToRemoveSKU(skuItem); + setShowRemoveConfirm_M(true); + } + + function FilterStores(searchedQry){ + searchedQry=searchedQry.toLowerCase(); + console.log('searchedQry',searchedQry); + let arr=[]; + var arr2={}; + var newBrand={}; + if(searchedQry!=null && searchedQry!=''){ + // globalBrandData.map((item,index)=>{ + for(let i=0;i0){ + newBrandList.push(newBrand); + if(j==brandList.length-1){ + arr2.brandList=newBrandList; + arr.push(arr2); + } + } + + } + } + } + + + } + } + else{ + arr=globalBrandData; + } + + console.log('globalBrandData:',globalBrandData) + setBrandData(arr); + setrerenderdata(!rerenderdata) + setrerenderdata2(!rerenderdata2) + } + + function renderDatePicker(){ + let today=new Date(); + console.log('today:',today); + let d1=Object.keys(currentStock).length>0 && currentStock.date!=null && currentStock.date!='' ?new Date(currentStock.date):new Date(); + return ( + {setStockDate(selectedDate)}} + /> + ); + } + + function _render_StockModal(){ + let mfd=Object.keys(currentStock).length>0 && currentStock.mfd!=null && currentStock.mfd!='' ?currentStock.mfd:''; + let stock=Object.keys(currentStock).length>0 && currentStock.stock!=null?currentStock.stock:''; + let lotno=Object.keys(currentStock).length>0 && currentStock.lotno!=null?currentStock.lotno:''; + + return ( + + + + {ST.ExpiryDate} + + {mfd} + + {setShowDatePicker(true);}}> + + + + {showDatePicker==true && + renderDatePicker() + } + + + {ST.Stock} + + {setCS_Stock('stock',val,'numeric')}} + autoComplete='off' + /> + + + + {ST.LotNo} + + {setCS_Stock('lotno',val,'')}} + autoComplete='off' + /> + + + + + {setCurrentStock({});setShowStockModal(false);}}> + {ST.Cancel} + + {addMFDStock()}}> + {ST.Add} + + + + + ) + } + + + function toggleCollapse(cat={},catIndex){ + let allData=brandData; + let isCollapsed=cat.isCollapsed; + cat['isCollapsed']=!isCollapsed; + allData[catIndex]=cat; + setBrandData(allData); + setGlobalBrandData(allData); + setrerenderdata(!rerenderdata); + } + + + function toggleCollapse2(cat={},catIndex,brand={},brand_index){ + let allData=brandData; + let isBrandCollapsed=brand.isBrandCollapsed; + let brandList=cat.brandList || []; + + brand['isBrandCollapsed']=!isBrandCollapsed; + brandList[brand_index]=brand; + cat['brandList']=brandList; + allData[catIndex]=cat; + setBrandData(allData); + setGlobalBrandData(allData); + setrerenderdata(!rerenderdata); + } + + function onChoiceSelect(item,skuItem,val,key,animatedChoice){ + console.log('onChoiceSelect',animatedChoice) + + var val1=0; + if(val==1){ + val1=1; + } + + if(animatedChoice!=null){ + Animated.timing(animatedChoice, { + toValue: val1, + duration:400, + useNativeDriver:false, + }).start(); + } + onStockValChange(item,skuItem,val,key,''); + } + + function _renderStocks(){ + + let isHdrImgIndex=KPIFields.findIndex(i=>i.KPIFieldName=='HeaderImageAllow') + let isHdrImgKPIObj=isHdrImgIndex>=0?KPIFields[isHdrImgIndex]:{}; + let isHdrImgEnable=isHdrImgIndex>=0?isHdrImgKPIObj['KPIFieldEnable']:false; + + + + let isListedSKUIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ListedSKU') + let isListedSKUKPIObj=isListedSKUIndex>=0?KPIFields[isListedSKUIndex]:{}; + let isListedSKUEnable=isListedSKUIndex>=0?isListedSKUKPIObj['KPIFieldEnable']:true; + + let isStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='Stock') + let isStockKPIObj=isStockIndex>=0?KPIFields[isStockIndex]:{}; + let isStockEnable=isStockIndex>=0?isStockKPIObj['KPIFieldEnable']:true; + let isStockDis_Name=isStockIndex>=0?isStockKPIObj['KPIFieldDisplayName']:''; + + let isBRStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='BackRoomStock') + let isBRStockKPIObj=isBRStockIndex>=0?KPIFields[isBRStockIndex]:{}; + let isBRStockEnable=isBRStockIndex>=0?isBRStockKPIObj['KPIFieldEnable']:true; + let isBRStockDis_Name=isBRStockIndex>=0?isBRStockKPIObj['KPIFieldDisplayName']:''; + + let isDStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='DamageStock') + let isDStockKPIObj=isDStockIndex>=0?KPIFields[isDStockIndex]:{}; + let isDStockEnable=isDStockIndex>=0?isDStockKPIObj['KPIFieldEnable']:false; + let isDStockDis_Name=isDStockIndex>=0?isDStockKPIObj['KPIFieldDisplayName']:''; + + let isLStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='LostStock') + let isLStockKPIObj=isLStockIndex>=0?KPIFields[isLStockIndex]:{}; + let isLStockEnable=isLStockIndex>=0?isLStockKPIObj['KPIFieldEnable']:false; + let isLStockDis_Name=isLStockIndex>=0?isLStockKPIObj['KPIFieldDisplayName']:''; + + let isExStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ExpiredStock') + let isExStockKPIObj=isExStockIndex>=0?KPIFields[isExStockIndex]:{}; + let isExStockEnable=isExStockIndex>=0?isExStockKPIObj['KPIFieldEnable']:false; + let isExStockDis_Name=isExStockIndex>=0?isExStockKPIObj['KPIFieldDisplayName']:''; + + let isMFDIndex=KPIFields.findIndex(i=>i.KPIFieldName=='MFD') + let isMFD_KPIObj=isMFDIndex>=0?KPIFields[isMFDIndex]:{}; + let isMFDEnable=isMFDIndex>=0?isMFD_KPIObj['KPIFieldEnable']:false; + let isMFDDis_Name=isMFDIndex>=0?isMFD_KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry1Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry1') + let NrExpiry1KPIObj=NrExpiry1Index>=0?KPIFields[NrExpiry1Index]:{}; + let NrExpiry1Enable=NrExpiry1Index>=0?NrExpiry1KPIObj['KPIFieldEnable']:false; + let NrExpiry1_Dis_Name=NrExpiry1Index>=0?NrExpiry1KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry2Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry2') + let NrExpiry2KPIObj=NrExpiry2Index>=0?KPIFields[NrExpiry2Index]:{}; + let NrExpiry2Enable=NrExpiry2Index>=0?NrExpiry2KPIObj['KPIFieldEnable']:false; + let NrExpiry2_Dis_Name=NrExpiry2Index>=0?NrExpiry2KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry3Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry3') + let NrExpiry3KPIObj=NrExpiry1Index>=0?KPIFields[NrExpiry3Index]:{}; + let NrExpiry3Enable=NrExpiry1Index>=0?NrExpiry3KPIObj['KPIFieldEnable']:false; + let NrExpiry3_Dis_Name=NrExpiry1Index>=0?NrExpiry3KPIObj['KPIFieldDisplayName']:''; + + let MSLIndex=KPIFields.findIndex(i=>i.KPIFieldName=='MSL'); + let MSLObj=MSLIndex>=0?KPIFields[MSLIndex]:{}; + let isMSLAllow=MSLIndex>=0?MSLObj['KPIFieldEnable']:true; + + let NONMSL_Index=KPIFields.findIndex(i=>i.KPIFieldName=='ChildImageAllow'); + let NONMSL_Obj=NONMSL_Index>=0?KPIFields[NONMSL_Index]:{}; + let isNONMSL_Allow=NONMSL_Index>=0?NONMSL_Obj['KPIFieldEnable']:true; + + + // yes no fields + let OutofStockI=KPIFields.findIndex(i=>i.KPIFieldName=='OutofStock') + let OutofStockObj=OutofStockI>=0?KPIFields[OutofStockI]:{}; + let OutofStockEnable=OutofStockI>=0?OutofStockObj['KPIFieldEnable']:false; + let OutofStockDisName=OutofStockI>=0?OutofStockObj['KPIFieldDisplayName']:''; + + let LessThanMBQI=KPIFields.findIndex(i=>i.KPIFieldName=='LessThanMBQ') + let LessThanMBQObj=LessThanMBQI>=0?KPIFields[LessThanMBQI]:{}; + let LessThanMBQEnable=LessThanMBQI>=0?LessThanMBQObj['KPIFieldEnable']:false; + let LessThanMBQDisName=LessThanMBQI>=0?LessThanMBQObj['KPIFieldDisplayName']:''; + + let ShowMBQLabelI=KPIFields.findIndex(i=>i.KPIFieldName=='ShowMBQ') + let ShowMBQLabelObj=ShowMBQLabelI>=0?KPIFields[ShowMBQLabelI]:{}; + let ShowMBQLabel=ShowMBQLabelI>=0?ShowMBQLabelObj['KPIFieldEnable']:false; + let ShowMBQLabelDisName=ShowMBQLabelI>=0?ShowMBQLabelObj['KPIFieldDisplayName']:''; + + + + + return ( + + + { + const cat=item; + const cindex=catImages.findIndex(i=>i.SubCategoryId==item.SubCategoryId); + const cimgName=cindex>=0?(catImages[cindex]?catImages[cindex].ImageName:''):''; + const cimgPath=cindex>=0?(catImages[cindex]?catImages[cindex].ImagePath:''):''; + const showIMg=cimgPath!='' && cimgPath!=null; + + + let isCollapsed=cat.isCollapsed!=null?item.isCollapsed:false; + + // let isHdrImgDis_Name=isHdrImgIndex>=0?isHdrImgKPIObj['KPIFieldDisplayName']:''; + return( + + + {toggleCollapse(cat,index)}}> + + {item.SubCategoryName} + + {isCollapsed==true && } + {isCollapsed==false && } + + {( !isCollapsed && isHdrImgEnable==true) && + + + { !showIMg && + {openCamera(item)}}> + + + } + { showIMg && + + + {openCamera(item)}}> + + + + } + } + + { !isCollapsed && + item.brandList!=null && item.brandList.length>0 && + item.brandList.map((brand,brand_index)=>{ + let isBrandCollapsed=brand.isBrandCollapsed!=null?brand.isBrandCollapsed:false; + + return ( + + {toggleCollapse2(cat,index,brand,brand_index)}}> + + {brand.BrandName} + + {isBrandCollapsed==true && } + {isBrandCollapsed==false && } + + + + { !isBrandCollapsed && + + { return skuIndex;}} + renderItem={({item,index})=>{ + + const skus=item; + const sku_index=index; + let thisCatSkuData_i=SKUStockData.findIndex(i=>i.SubCategoryId==cat.SubCategoryId && i.ProductId==skus.ProductId); + let thisCatSkuData=thisCatSkuData_i>=0?(SKUStockData[thisCatSkuData_i] || {}):{}; + let stock=thisCatSkuData.Stock!=null?thisCatSkuData.Stock:''; + let br_stock=thisCatSkuData.BackRoomStock!=null?thisCatSkuData.BackRoomStock:''; + let Old_Stock=thisCatSkuData.Old_Stock!=null?thisCatSkuData.Old_Stock:''; + let OldDamagedStock=thisCatSkuData.OldDamagedStock!=null?thisCatSkuData.OldDamagedStock:''; + let OldLostStock=thisCatSkuData.OldLostStock!=null?thisCatSkuData.OldLostStock:''; + let OldExStock=thisCatSkuData.OldExStock!=null?thisCatSkuData.OldExStock:''; + let isSKUPresent=thisCatSkuData.isSKUPresent!=null?thisCatSkuData.isSKUPresent:0; + let showAllSKU_Fields=thisCatSkuData.showAllSKU_Fields!=null?thisCatSkuData.showAllSKU_Fields:false; + let OutOfStock=thisCatSkuData.OutOfStock!=null?thisCatSkuData.OutOfStock:'0'; + let LessThanMBQ=thisCatSkuData.LessThanMBQ!=null?thisCatSkuData.LessThanMBQ:'0'; + + let ex_stock=thisCatSkuData.ExpiryStock!=null?thisCatSkuData.ExpiryStock:''; + let damage_stock=thisCatSkuData.DamagedStock!=null?thisCatSkuData.DamagedStock:''; + let lost_stock=thisCatSkuData.LostStock!=null?thisCatSkuData.LostStock:''; + let mfdStocks=thisCatSkuData.mfdStocks || []; + + let NearExpiry_stock1=thisCatSkuData.NearExpiry1!=null?thisCatSkuData.NearExpiry1:''; + let NearExpiry_stock2=thisCatSkuData.NearExpiry2!=null?thisCatSkuData.NearExpiry2:''; + let NearExpiry_stock3=thisCatSkuData.NearExpiry3!=null?thisCatSkuData.NearExpiry3:''; + + let isMandatory=((isMSLAllow==1 || isMSLAllow=='true') && (skus.MSL==1 || skus.MSL=='true') ) || ((isNONMSL_Allow==1 || isNONMSL_Allow=='true') && (skus.MSL!=1 && skus.MSL!='true') ) + + // console.log('skus.MSL:',skus.MSL); + + let xpos=OutOfStock==1?-75:0; + if(skus.animatedChoice!=null ){ + xpos=skus.animatedChoice.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + + let xpos1=LessThanMBQ==1?-75:0; + if(skus.animatedChoice2!=null ){ + xpos1=skus.animatedChoice2.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + + return( + + {isListedSKUEnable==true && + + + {console.log('valchange:',val); let val1=(val==true)?1:0; onStockValChange(cat,skus,val1,'isSKUPresent','') }} + style={[customStyle.openStkP_checkbox,(Platform.OS=='ios'?{height:20,width:20,marginTop:8,marginLeft:8,}:{})]} + + tintColors={{ true:PageTheme.$primary_color, false:PageTheme.$text_color_light }} + /> + + {skus.ProductName} + + } + + {isListedSKUEnable!=true && {skus.ProductName}} + {((isListedSKUEnable==true && showAllSKU_Fields==true) || isListedSKUEnable==false) && + + {ShowMBQLabel==true && + + + {'MBQ :'} + {skus.MBQ} + + + } + {OutofStockEnable==true && + {OutofStockDisName} + + + + {onChoiceSelect(cat,skus,1,'OutOfStock',skus.animatedChoice)}}> + {ST.Yes} + + {onChoiceSelect(cat,skus,0,'OutOfStock',skus.animatedChoice)}}> + {ST.No} + + + + } + + {LessThanMBQEnable==true && + {LessThanMBQDisName} + + + + {onChoiceSelect(cat,skus,1,'LessThanMBQ',skus.animatedChoice2)}}> + {ST.Yes} + + {onChoiceSelect(cat,skus,0,'LessThanMBQ',skus.animatedChoice2)}}> + {ST.No} + + + + } + + {(isStockEnable==true) && + + + {isStockDis_Name} + { onStockValChange(cat,skus,val,'Stock','numeric')}} + autoComplete='off' + // onEndEditing={(e)=>{ checkStockVal(cat,skus,'Stock','Old_Stock',Old_Stock)}} + /> + + + } + {(isBRStockEnable==true) && + + + {isBRStockDis_Name} + { onStockValChange(cat,skus,val,'BackRoomStock','numeric')}} + autoComplete='off' + // onEndEditing={(e)=>{ checkStockVal(cat,skus,'Stock','Old_Stock',Old_Stock)}} + /> + + + } + {(isDStockEnable==true) && + + + {isDStockDis_Name} + { onStockValChange(cat,skus,val,'DamagedStock','numeric')}} + autoComplete='off' + // onEndEditing={(e)=>{ checkStockVal(cat,skus,'DamagedStock','OldDamagedStock',OldDamagedStock)}} + /> + + + } + {(isLStockEnable==true) && + + + {isLStockDis_Name} + { onStockValChange(cat,skus,val,'LostStock','numeric')}} + autoComplete='off' + // onEndEditing={(e)=>{ checkStockVal(cat,skus,'LostStock','OldLostStock',OldLostStock)}} + /> + + + } + {(isExStockEnable==true ) && + // && !isMFDEnable + + + {isExStockDis_Name} + { onStockValChange(cat,skus,val,'ExpiryStock','numeric')}} + autoComplete='off' + // onEndEditing={(e)=>{ checkStockVal(cat,skus,'ExpiryStock','OldExStock',OldExStock)}} + /> + + + } + + {(NrExpiry1Enable==true ) && + + + {NrExpiry1_Dis_Name} + { onStockValChange(cat,skus,val,'NearExpiry1','numeric')}} + autoComplete='off' + /> + + + } + {(NrExpiry2Enable==true ) && + + + {NrExpiry2_Dis_Name} + { onStockValChange(cat,skus,val,'NearExpiry2','numeric')}} + autoComplete='off' + /> + + + } + {(NrExpiry3Enable==true ) && + + + {NrExpiry3_Dis_Name} + { onStockValChange(cat,skus,val,'NearExpiry3','numeric')}} + autoComplete='off' + /> + + + } + {(isMFDEnable==true) && + + {isMFDDis_Name} + {openAddStkModal(cat,skus)}}> + {ST.Add} + + + + {ST.Date} + + + {ST.Stock} + + + {ST.LotNo} + + + {ST.Actions} + + + + + { + mfdStocks.map((mfd_Item,mfd_index)=>{ + let mfd=mfd_Item.mfd || ''; + let stock=mfd_Item.stock || ''; + let lotno=mfd_Item.lotno || ''; + + return( + + + {mfd} + + + {stock} + + + {lotno} + + + {showRemoveConfirm(cat,skus,mfd_Item,mfd_index)}}> + + + + + ) + }) + } + + + } + + } + + ) + }}/> + } + + + ) + }) + } + + + ); + }} + /> + + ) + } + + + + + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showRemoveConfirm_M,()=>{setShowRemoveConfirm_M(false)},removeMFDStock,ST.Doyoureallywanttoremovethisstock)} + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {rerendermodal==rerendermodal && _render_StockModal()} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + + {setSearchedItem(val); FilterStores(val)}} + autoComplete='off' + /> + {FilterStores(searchedItem)}}> + + + + { Object.keys(storeData).length>0 && + _renderStocks() + } + + + {submitOpeningStock()}}/> + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(Stock); \ No newline at end of file diff --git a/src/screens/StockCat.js b/src/screens/StockCat.js new file mode 100644 index 0000000..aabc398 --- /dev/null +++ b/src/screens/StockCat.js @@ -0,0 +1,249 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, KeyboardAvoidingView, BackHandler, Keyboard} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,getKPIFields,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, Fontisto, Ionicons, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import CheckBox from '@react-native-community/checkbox'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { ConfirmSaveAlert, ExitScreenAlert } from '../components/alert'; +import CustomCamera from '../components/Camera'; +import Accordion from 'react-native-collapsible/Accordion'; +import DateTimePicker from '@react-native-community/datetimepicker'; +import { createFalse } from 'typescript'; +import CustomModal2 from '../components/CustomModal2'; + +function StockCat(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [productCats, setProductCats] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + + const [showAlert, setShowAlert] = useState(false); + const [rerendermodal, setrerendermodal] = useState(0); + + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + const willFocusSubscription = props.navigation.addListener('focus', () => { + console.log('onfocus'); + getData(storeData1); + }); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + return willFocusSubscription + }; + + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + + function onRemoveScreen(e){ + Alert.alert( + "", + "Do you really want to exit the screen?", + [ + { + text: "Cancel", + onPress: () => {}, + style: "cancel" + }, + { text: "OK", onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + + + async function getData(storeData1,menu1){ + + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + await db.transaction(async function (txn) { + + let join=' INNER join Product_Master p on c.CategoryId=p.CategoryId '; + let join2=' INNER join Mapping_ProductAssortment mp on p.ProductId=mp.ProductId '; + let q=`SELECT DISTINCT c.CategoryId,c.CategoryName from Master_Category c ${join} ${join2} where mp.StateId='${StateId}' and mp.ChainId='${ChainId}' and mp.StoreTypeId='${StoreTypeId}' order by p.CategorySequence`; + + // let q2=` SELECT CATEGORY_ID as CategoryId,CATEGORY as CategoryName FROM ${AppTables.STOCKWITHCAT_HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('cats len:',txnres2.rows.length) + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + db.transaction(async function (txn) { + let seletlist=`STOCK_UID,PRODUCT as ProductName,PRODUCT_ID as ProductId,BRAND as BrandName,BRAND_ID as BrandId,SUB_CATEGORY as SubCategoryName,SUB_CATEGORY_ID as SubCategoryId,MSL,STOCK,BACKROOM_STOCK,DAMAGED_STOCK,LOST_STOCK,EXPIRY_STOCK,IS_SKU_STOCK_PRESENT,NREXPIRY1_STOCK,NREXPIRY2_STOCK,NREXPIRY3_STOCK`; + let sku_q=`SELECT ${seletlist} FROM ${AppTables.STOCKWITHCAT_DATA} WHERE STORE_ID='${StoreId}' and CATEGORY_ID='${cat.CategoryId}' `; + await txn.executeSql(sku_q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + resolve(true); + }else{ + resolve(false); + } + },function (txn2, txnerr) { console.log(txnerr);resolve(false); },); + + }); + }).catch((err)=>{ + console.log(err); + return false; + }) + } + + function gotoCatProducts(cat={}){ + props.navigation.navigate('StockWithCat',{'storeData':storeData,'menu':currentMenu,'isAdhoc':isAdhocScreen,'category':cat}); + } + + + function _renderStocks(){ + return ( + + { + const cat=item; + let isDone=item.isDone; + return( + + + {gotoCatProducts(cat)}}> + + {item.CategoryName} + + {(item.isDone!=null && item.isDone==true) && } + + + + ); + }} + /> + + ) + } + + + + + + return ( + + {processing && } + + + + + + Product Categories + + {Object.keys(storeData).length>0 && + _renderStocks() + } + + + + + ); +} + +export default connect(mapStateToProps, mapDispatchToProps)(StockCat); \ No newline at end of file diff --git a/src/screens/StockWithCat.js b/src/screens/StockWithCat.js new file mode 100644 index 0000000..07c9994 --- /dev/null +++ b/src/screens/StockWithCat.js @@ -0,0 +1,1500 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, KeyboardAvoidingView, BackHandler, Keyboard} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,getKPIFields,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, Fontisto, Ionicons, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import CheckBox from '@react-native-community/checkbox'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { ConfirmSaveAlert, ExitScreenAlert } from '../components/alert'; +import CustomCamera from '../components/Camera'; +import Accordion from 'react-native-collapsible/Accordion'; +import DateTimePicker from '@react-native-community/datetimepicker'; +import { createFalse } from 'typescript'; +import CustomModal2 from '../components/CustomModal2'; + +function StockWithCat(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [Category, setCategory] = useState({}); + const [subCatData, setSubCatData] = useState([]); + const [globalSubCatData, setGlobalSubCatData] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + const [catData, setCatData] = useState({}); + const [SKUStockData, setSKUStockData] = useState([]); + + const [currentStock, setCurrentStock] = useState({}); + const [currentProduct, setCurrentProduct] = useState({}); + + const [KPIFields, setKPIFields] = useState([]); + const [showAlert, setShowAlert] = useState(false); + const [showStockModal, setShowStockModal] = useState(false); + const [showDatePicker, setShowDatePicker] = useState(false); + const [rerendermodal, setrerendermodal] = useState(0); + const [toRemoveId, setToRemoveId] = useState(''); + const [toRemoveSKU, setToRemoveSKU] = useState({}); + const [showRemoveConfirm_M, setShowRemoveConfirm_M] = useState(false); + const [searchedItem, setSearchedItem]= useState(''); + + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const [activeSections,setActiveSections]= useState([]); + + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + let cat=params.category || {}; + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCategory(cat); + setCurrentMenu(menu1); + + getData(storeData1,cat,menu1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + + function onRemoveScreen(e){ + Alert.alert( + "", + "Do you really want to exit the screen?", + [ + { + text: "Cancel", + onPress: () => {}, + style: "cancel" + }, + { text: "OK", onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + + + async function getData(storeData1,cat,menu1){ + + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + let AllKPIFields=await getKPIFields(menu1); + setKPIFields(AllKPIFields); + + await db.transaction(async function (txn) { + + // let dq=`Select * FROM ${AppTables.STOCKWITHCAT_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + // let dq2=`select * FROM ${AppTables.STOCKWITHCAT_HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + // let dq3=`select * FROM ${AppTables.STOCKWITHCAT_MFD_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // // remove old data + // await txn.executeSql(dq,[],async function (txn2, txnres) { + // console.log('stock data deleted',txnres.rows.length); + // },function (txn2, txnerr) { console.log(txnerr); },); + + // await txn.executeSql(dq2,[],async function (txn2, txnres) { + // console.log('stock header data deleted',txnres.rows.length); + // },function (txn2, txnerr) { console.log(txnerr); },); + + // await txn.executeSql(dq3,[],async function (txn2, txnres) { + // console.log('stock mfd data deleted',txnres.rows.length); + // },function (txn2, txnerr) { console.log(txnerr); },); + + let q2=` SELECT CATEGORY_ID as CategoryId,CATEGORY as CategoryName,MSL,IMAGE,IMAGEPATH FROM ${AppTables.STOCKWITHCAT_HDR_DATA} WHERE STORE_ID='${StoreId}' and CATEGORY_ID='${cat.CategoryId}' and VISIT_DATE='${d2}' `; + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('added products cats:',txnres.rows.length) + if(txnres.rows.length>0){ + let data =txnres.rows.item(0); + let defData={'CategoryId':data.CategoryId,'ImageName':data.IMAGE,'ImagePath':data.IMAGEPATH}; + + let subcats=await getSubCats(storeData1,menu1,data,true); + setCatData(defData); + setSubCatData(subcats); + setGlobalSubCatData(subcats); + setProcessing(false); + } + else{ + let subcats=await getSubCats(storeData1,menu1,cat,false); + setSubCatData(subcats); + setGlobalSubCatData(subcats); + setProcessing(false); + } + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false); },); + // setProcessing(false); + + + + }); + } catch (err) { + console.log(err); + } + } + + async function getSubCats(storeData1,menu1,item,isInserted=false){ + let allSKUData=[]; + + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + return await new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let join=` inner join Mapping_ProductAssortment m on p.ProductId=m.ProductId `; + let join2=` inner join Master_Category mc on mc.CategoryId=p.CategoryId `; + let s_q=`select distinct p.SubCategoryId,p.SubCategoryName from Product_Master p ${join} ${join2} where m.ChainId='${ChainId}' and m.StateId='${StateId}' and m.StoreTypeId='${StoreTypeId}' and p.CategoryId='${item.CategoryId}' and CompanyId='1' order by p.SubCategoryName,p.BrandName`; + await txn.executeSql(s_q,[],async function (txn2, txnres) { + console.log('SubCats len:',txnres.rows.length) + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log(err); + return []; + }) + } + + async function getSKU(storeData1,cat,subcat,allSKUData=[]){ + let sku_ret={'products':[],'products_data':allSKUData}; + let {StoreId,ChainId,StateId,StoreTypeId,ExpiryStock}=storeData1; + return await new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + // get from stored data if exists + let seletlist=`STOCK_UID,PRODUCT as ProductName,PRODUCT_ID as ProductId,BRAND as BrandName,BRAND_ID as BrandId,SUB_CATEGORY as SubCategoryName,SUB_CATEGORY_ID as SubCategoryId,MSL,STOCK,BACKROOM_STOCK,DAMAGED_STOCK,LOST_STOCK,EXPIRY_STOCK,IS_SKU_STOCK_PRESENT,NREXPIRY1_STOCK,NREXPIRY2_STOCK,NREXPIRY3_STOCK`; + let sku_q=`SELECT ${seletlist} FROM ${AppTables.STOCKWITHCAT_DATA} WHERE STORE_ID='${StoreId}' and CATEGORY_ID='${cat.CategoryId}' and SUB_CATEGORY_ID='${subcat.SubCategoryId}' `; + + // else get products from masters + let join=` inner join Mapping_ProductAssortment m on p.ProductId=m.ProductId `; + let join2=` inner join Master_Category mc on mc.CategoryId=p.CategoryId `; + let sku_q2=`select distinct p.ProductName,p.ProductId,p.BrandName,p.BrandId,p.SubCategoryName,p.SubCategoryId,m.MSL from Product_Master p ${join} ${join2} where m.ChainId='${ChainId}' and m.StateId='${StateId}' and m.StoreTypeId='${StoreTypeId}' and p.CategoryId='${cat.CategoryId}' and p.SubCategoryId='${subcat.SubCategoryId}' and CompanyId='1' order by p.ProductSequence`; + await txn.executeSql(sku_q,[],async function (txn2, txnres) { + console.log('txnres.rows.length:',txnres.rows.length); + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i0){ + let arr=[]; + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log('getSKU err:',err); + return sku_ret; + }) + + + } + + async function getMFDStockData(skud){ + + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q=`select * from ${AppTables.STOCK2_MFD_DATA} where STOCK_UID='${skud.STOCK_UID}'`; + await txn.executeSql(q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + console.log(err); + return []; + }) + } + + async function getImage(imgdata){ + let cat=getImageProps.option || ''; + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify('Camera unavailable'); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl='file://'+img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: Stock'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+(props.UserId || '')+'_Stock-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let allIMgData=catData; + allIMgData.ImageName=filename; + + // renamefile + let imagePath='file://'+`${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri=imagePath; + console.log('image marker',uri); + allIMgData.ImagePath=uri; + + setCatData(allIMgData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(option){ + setGetImageProps({'option':option}); + console.log('openCamera'); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function submitOpeningStock(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + let q=`DELETE FROM ${AppTables.STOCKWITHCAT_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' and CATEGORY_ID='${Category.CategoryId}' `; + let q2=`DELETE FROM ${AppTables.STOCKWITHCAT_HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' and CATEGORY_ID='${Category.CategoryId}'`; + let q3=`DELETE FROM ${AppTables.STOCKWITHCAT_MFD_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' and CATEGORY_ID='${Category.CategoryId}' `; + + // remove old data + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('stock data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('stock header data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q3,[],async function (txn2, txnres) { + console.log('stock mfd data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + + let seq_q=` select seq from sqlite_sequence where name="${AppTables.STOCKWITHCAT_HDR_DATA}" `; + await txn.executeSql(seq_q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let data=txnres.rows.item(0); + let seq=data.seq; + insertData(seq); + } + else{ + insertData(0); + } + },function (txn2, txnerr) { console.log(txnerr); insertData(0); },); + + + }); + } catch (err) { + console.log(err); + } + } + + async function insertData(seq=0){ + try { + console.log(seq); + let {StoreId,ChainId,StateId,StoreTypeId,ExpiryStock}=storeData; + console.log('insertData'); + await db.transaction(async function (txn) { + var values='',stock_values='',mfdStockV=''; + // values+=values!=''?' , ':''; + values+=` ('${StoreId}','${d2}','${Category.CategoryName}','${Category.CategoryId}','','${(catData.ImageName || '')}','${(catData.ImagePath || '')}','${d2}') `; + + + for(var i=0;ici.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || {}) : {}; + let mfdStocks=skud['mfdStocks'] || []; + + let stock=skud.Stock!=null?skud.Stock:''; + let br_stock=skud.BackRoomStock!=null?skud.BackRoomStock:''; + let ex_stock=skud.ExpiryStock!=null?skud.ExpiryStock:''; + let damage_stock=skud.DamagedStock!=null?skud.DamagedStock:''; + let lost_stock=skud.LostStock!=null?skud.LostStock:''; + let isSKUPresent=skud.isSKUPresent!=null?skud.isSKUPresent:0; + let NearExpiry_stock1=skud.NearExpiry1!=null?skud.NearExpiry1:''; + let NearExpiry_stock2=skud.NearExpiry2!=null?skud.NearExpiry2:''; + let NearExpiry_stock3=skud.NearExpiry3!=null?skud.NearExpiry3:''; + + stock_values+=` ('${seq}','${SKU_UID}','${StoreId}','${d2}','${Category.CategoryId}','${Category.CategoryName}','${SubCategoryId}','${SubCategoryName}','${BrandId}','${BrandName}','${ProductId}','${ProductName}','${MSL}','${stock}','${br_stock}','${damage_stock}','${lost_stock}','${ex_stock}','${isSKUPresent}','${NearExpiry_stock1}','${NearExpiry_stock2}','${NearExpiry_stock3}','${d2}') `; + + for(let m=0;mi.KPIFieldName=='HeaderImageAllow') + let isHdrImgKPIObj=isHdrImgIndex>=0?KPIFields[isHdrImgIndex]:{}; + let isHdrImgEnable=isHdrImgIndex>=0?isHdrImgKPIObj['KPIFieldEnable']:false; + + let isListedSKUIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ListedSKU'); + let isListedSKUKPIObj=isListedSKUIndex>=0?KPIFields[isListedSKUIndex]:{}; + let isListedSKUEnable=isListedSKUIndex>=0?isListedSKUKPIObj['KPIFieldEnable']:true; + + let isStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='Stock') + let isStockKPIObj=isStockIndex>=0?KPIFields[isStockIndex]:{}; + let isStockEnable=isStockIndex>=0?isStockKPIObj['KPIFieldEnable']:true; + let isStockDis_Name=isStockIndex>=0?isStockKPIObj['KPIFieldDisplayName']:'Stock'; + + let isBRStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='BackRoomStock') + let isBRStockKPIObj=isBRStockIndex>=0?KPIFields[isBRStockIndex]:{}; + let isBRStockEnable=isBRStockIndex>=0?isBRStockKPIObj['KPIFieldEnable']:true; + let isBRStockDis_Name=isBRStockIndex>=0?isBRStockKPIObj['KPIFieldDisplayName']:'Stock'; + + let isDStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='DamageStock') + let isDStockKPIObj=isDStockIndex>=0?KPIFields[isDStockIndex]:{}; + let isDStockEnable=isDStockIndex>=0?isDStockKPIObj['KPIFieldEnable']:false; + let isDStockDis_Name=isDStockIndex>=0?isDStockKPIObj['KPIFieldDisplayName']:''; + + let isLStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='LostStock') + let isLStockKPIObj=isLStockIndex>=0?KPIFields[isLStockIndex]:{}; + let isLStockEnable=isLStockIndex>=0?isLStockKPIObj['KPIFieldEnable']:false; + let isLStockDis_Name=isLStockIndex>=0?isLStockKPIObj['KPIFieldDisplayName']:''; + + let isExStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ExpiredStock') + let isExStockKPIObj=isExStockIndex>=0?KPIFields[isExStockIndex]:{}; + let isExStockEnable=isExStockIndex>=0?isExStockKPIObj['KPIFieldEnable']:false; + let isExStockDis_Name=isExStockIndex>=0?isExStockKPIObj['KPIFieldDisplayName']:''; + + let isMFDIndex=KPIFields.findIndex(i=>i.KPIFieldName=='MFD') + let isMFD_KPIObj=isMFDIndex>=0?KPIFields[isMFDIndex]:{}; + let isMFDEnable=isMFDIndex>=0?isMFD_KPIObj['KPIFieldEnable']:false; + let isMFDDis_Name=isMFDIndex>=0?isMFD_KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry1Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry1') + let NrExpiry1KPIObj=NrExpiry1Index>=0?KPIFields[NrExpiry1Index]:{}; + let NrExpiry1Enable=NrExpiry1Index>=0?NrExpiry1KPIObj['KPIFieldEnable']:false; + let NrExpiry1_Dis_Name=NrExpiry1Index>=0?NrExpiry1KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry2Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry2') + let NrExpiry2KPIObj=NrExpiry2Index>=0?KPIFields[NrExpiry2Index]:{}; + let NrExpiry2Enable=NrExpiry2Index>=0?NrExpiry2KPIObj['KPIFieldEnable']:false; + let NrExpiry2_Dis_Name=NrExpiry2Index>=0?NrExpiry2KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry3Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry3') + let NrExpiry3KPIObj=NrExpiry1Index>=0?KPIFields[NrExpiry3Index]:{}; + let NrExpiry3Enable=NrExpiry1Index>=0?NrExpiry3KPIObj['KPIFieldEnable']:false; + let NrExpiry3_Dis_Name=NrExpiry1Index>=0?NrExpiry3KPIObj['KPIFieldDisplayName']:''; + + let MSLIndex=KPIFields.findIndex(i=>i.KPIFieldName=='MSL'); + let MSLObj=MSLIndex>=0?KPIFields[MSLIndex]:{}; + let isMSLAllow=MSLIndex>=0?MSLObj['KPIFieldEnable']:true; + + let NONMSL_Index=KPIFields.findIndex(i=>i.KPIFieldName=='ChildImageAllow'); + let NONMSL_Obj=NONMSL_Index>=0?KPIFields[NONMSL_Index]:{}; + let isNONMSL_Allow=NONMSL_Index>=0?NONMSL_Obj['KPIFieldEnable']:false; + + let catId=Category.CategoryId; + if(isHdrImgEnable==true && (catData.ImagePath== null || catData.ImagePath=='')){ + notify('Please click image for '+Category.CategoryName,'SHORT'); + isValid=false; + } + else{ + await Promise.all( + globalSubCatData.map(async (item,index) => { + let skulist=item.skulist || []; + if(isValid==true){ + if(skulist.length>0){ + await Promise.all( + skulist.map(async (skuItem,skuIndex) => { + if(isValid==true){ + let skuData=SKUStockData.find(ci=>ci.ProductId==skuItem.ProductId ) || {}; + let stock=skuData.Stock!=null?skuData.Stock:''; + let ex_stock=skuData.ExpiryStock!=null?skuData.ExpiryStock:''; + let damage_stock=skuData.DamagedStock!=null?skuData.DamagedStock:''; + let lost_stock=skuData.LostStock!=null?skuData.LostStock:''; + let isSKUPresent=skuData.isSKUPresent!=null?skuData.isSKUPresent:0; + let br_stock=skuData.BackRoomStock!=null?skuData.BackRoomStock:''; + let NearExpiry_stock1=skuData.NearExpiry1!=null?skuData.NearExpiry1:''; + let NearExpiry_stock2=skuData.NearExpiry2!=null?skuData.NearExpiry2:''; + let NearExpiry_stock3=skuData.NearExpiry3!=null?skuData.NearExpiry3:''; + + let isMandatory=((isMSLAllow==1 || isMSLAllow=='true') && (skuItem.MSL==1 || skuItem.MSL=='true') ) || ((isNONMSL_Allow==1 || isNONMSL_Allow=='true') && (skuItem.MSL!=1 && skuItem.MSL!='true') ) + + if((isListedSKUEnable==true && isSKUPresent==1) || (!isListedSKUEnable && (isMandatory)) ){ + // let sumOfDamagedStocks=parseInt(ex_stock)+parseInt(damage_stock)+parseInt(lost_stock); + if(isStockEnable==true && stock!==0 && ( stock==null || stock=='')){ + notify('Please enter '+isStockDis_Name+' for '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(isBRStockEnable==true && br_stock!==0 && ( br_stock==null || br_stock=='')){ + notify('Please enter '+isBRStockDis_Name+' for '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(isDStockEnable==true && damage_stock!==0 && ( damage_stock==null || damage_stock=='')){ + notify('Please enter '+isDStockDis_Name+' for '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(isLStockEnable==true && lost_stock!==0 && ( lost_stock==null || lost_stock=='')){ + notify('Please enter '+isDStockDis_Name+' for '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(isExStockEnable==true && ex_stock!==0 && ( ex_stock==null || ex_stock=='')){ + notify('Please enter '+isExStockDis_Name+' for '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(NrExpiry1Enable==true && NearExpiry_stock1!==0 && ( NearExpiry_stock1==null || NearExpiry_stock1=='')){ + notify('Please enter '+NrExpiry1_Dis_Name+' for '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(NrExpiry2Enable==true && NearExpiry_stock2!==0 && ( NearExpiry_stock2==null || NearExpiry_stock2=='')){ + notify('Please enter '+NrExpiry2_Dis_Name+' for '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(NrExpiry3Enable==true && NearExpiry_stock3!==0 && ( NearExpiry_stock3==null ||NearExpiry_stock3=='')){ + notify('Please enter '+NrExpiry3_Dis_Name+' for '+skuItem.ProductName,'LONG'); + isValid=false; + } + // else if((isDStockEnable && isLStockEnable && isExStockEnable) && sumOfDamagedStocks>parseInt(stock)){ + // notify('Sum of '+isDStockDis_Name+','+isLStockDis_Name+' and '+isExStockDis_Name+' should be less than or equal to Stock for '+skuItem.ProductName,'LONG'); + // isValid=false; + // } + // else if((isDStockEnable && isLStockEnable) && sumOfDamagedStocks>parseInt(stock)){ + // notify('Sum of '+isDStockDis_Name+' and '+isLStockDis_Name+' should be less than or equal to '+isStockDis_Name+' for '+skuItem.ProductName,'LONG'); + // isValid=false; + // } + // else if((isLStockEnable && isExStockEnable) && sumOfDamagedStocks>parseInt(stock)){ + // notify('Sum of '+isLStockDis_Name+' and '+isExStockDis_Name+' should be less than or equal to '+isStockDis_Name+' for '+skuItem.ProductName,'LONG'); + // isValid=false; + // } + // else if((isDStockEnable && isExStockEnable) && sumOfDamagedStocks>parseInt(stock)){ + // notify('Sum of '+isDStockDis_Name+' and '+isExStockDis_Name+' should be less than or equal to '+isStockDis_Name+' for '+skuItem.ProductName,'LONG'); + // isValid=false; + // } + else{ + + } + + } + } + }) + ); + } + } + }) + ); + } + + console.log('isValid:',isValid); + return isValid; + } + + function onStockValChange(skuItem,val,key,type=''){ + if(type=='numeric' && val!=''){ + const regex = new RegExp(/^\d+$/); + let isNUmeric=regex.test(val); + if(!isNUmeric){ + notify('Please enter whole numbers only','SHORT'); + return; + } + } + + let allSKUData=SKUStockData; + let defData={'ProductId':skuItem.ProductId}; + const skud_index=allSKUData.findIndex(i=>i.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + skud[key]=val; + + if(key=='isSKUPresent'){ + skud['showAllSKU_Fields']=val==1?true:false; + } + + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + // function checkStockVal(item,skuItem,key,old_key,old_val){ + // console.log('checkStockVal',old_val,val); + // let allSKUData=SKUStockData; + // let defData={'ProductId':skuItem.ProductId}; + // const skud_index=allSKUData.findIndex(i=>i.CategoryId==item.CategoryId && i.ProductId==skuItem.ProductId); + // const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + // console.log('checkStockVal'); + // let val=skud[key] || ''; + // let val1=skud[key] || 0; + // let product_total_stock=skud['Stock']; + // if(product_total_stock!=''){ + // product_total_stock=parseInt(product_total_stock); + // let product_damage_stock=parseInt(skud['DamagedStock'] || 0); + // let product_lost_stock=parseInt(skud['LostStock'] || 0); + // let product_ex_stock=parseInt(skud['ExpiryStock'] || 0); + + // let product_stock=product_ex_stock;//product_total_stock-(product_damage_stock+product_lost_stock+product_ex_stock); + // val1=parseInt(val1); + // if(skud_index>=0){ + // let mfdStocks=skud['mfdStocks'] || []; + // let sumOfAllStocks=0 + // for(let i in mfdStocks){ + // let ds=mfdStocks[i]; + // sumOfAllStocks+=parseInt(ds.stock); + // } + + // if(sumOfAllStocks>product_stock){ + // notify('Sum of all MFD stock cannot be greater than product stock count!'); + // skud[key]=old_val; + // skud[old_key]=old_val; + // } + // else{ + // skud[old_key]=val; + // } + // } + // else{ + // skud[old_key]=val; + // } + + + // skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + // setSKUStockData(allSKUData); + // setHasUnsavedChanges(true); + // setrerenderdata(!rerenderdata); + // } + // } + + function openAddStkModal(skuItem){ + setCurrentProduct(skuItem); + // let allSKUData=SKUStockData; + // let defData={'ProductId':skuItem.ProductId}; + // const skud_index=allSKUData.findIndex(i=>i.ProductId==skuItem.ProductId); + // const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + + setShowStockModal(true); + // let mfdStocks=skud['mfdStocks'] || []; + // let product_stock=skud['Stock']; + // let product_ex_stock=skud['ExpiryStock']; + + // if(product_stock==null || product_stock==''){ + // notify('Please enter sku stock first!'); + // } + // else if(product_ex_stock==null || product_ex_stock==''){ + // notify('Please enter expiry stock first!'); + // } + // else{ + + // } + + } + + function onSaveCancel(){ + setShowAlert(false) + } + + function setStockDate(date){ + let d1=moment(date).format('DD/MM/YYYY'); + let cstock=currentStock; + cstock['date']=date; + cstock['mfd']=d1; + setCurrentStock(cstock); + setShowDatePicker(false); + } + + function setCS_Stock(key,val,type=''){ + if(type=='numeric' && val!=''){ + const regex = new RegExp(/^\d+$/); + let isNUmeric=regex.test(val); + if(!isNUmeric){ + notify('Please enter whole numbers only','SHORT'); + return; + } + } + + let cstock=currentStock; + cstock[key]=val; + setCurrentStock(cstock); + setrerendermodal(!rerendermodal); + } + + + + function getAllSum(mfdStocks=[],cstock={}){ + let {mfd,date,stock}=cstock + let sumOfAllStocks=parseInt(stock); + return new Promise((resolve,reject)=>{ + if(mfdStocks.length>0){ + for(let i in mfdStocks){ + let ds=mfdStocks[i]; + sumOfAllStocks+=parseInt(ds.stock); + if(i==mfdStocks.length-1){ + resolve(sumOfAllStocks) + } + } + } + else{ + resolve(sumOfAllStocks) + } + }).catch((err)=>{ + console.log(err); + return 0; + }) + } + + async function addMFDStock(){ + Keyboard.dismiss(); + let skuItem=currentProduct + let cstock=currentStock; + var allSKUData=SKUStockData; + let defData={'ProductId':skuItem.ProductId}; + const skud_index=allSKUData.findIndex(i=> i.ProductId==skuItem.ProductId); + var skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + let mfdStocks=skud['mfdStocks'] || []; + let {mfd,date,stock,lotno}=cstock + + if(mfd==null || mfd==''){ + notify('Please select date!'); + return ; + } + else if(stock==null || stock==''){ + notify('Please enter stock!'); + return ; + } + else if(lotno==null || lotno==''){ + notify('Please enter lot no.!'); + return ; + } + else if(mfdStocks.findIndex(i=>i.mfd==mfd)>=0){ + notify('This date is already added! Please select different date'); + return ; + } + else { + console.log('added') + mfdStocks.push(cstock); + skud['mfdStocks']=mfdStocks; + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + setCurrentStock({}); + setShowStockModal(false); + } + } + + + function removeMFDStock(){ + let skuItem=toRemoveSKU; + let cstockIndex=toRemoveId; + let allSKUData=SKUStockData; + let defData={'ProductId':skuItem.ProductId}; + const skud_index=allSKUData.findIndex(i=>i.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + let mfdStocks=skud['mfdStocks'] || []; + mfdStocks.splice(cstockIndex,1); + skud['mfdStocks']=mfdStocks; + + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + setShowRemoveConfirm_M(false); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function showRemoveConfirm(skuItem,cstock,cstockIndex){ + setToRemoveId(cstockIndex); + setToRemoveSKU(skuItem); + setShowRemoveConfirm_M(true); + } + + function FilterStores(searchedQry){ + searchedQry=searchedQry.toLowerCase(); + console.log('searchedQry',searchedQry); + let arr=[]; + var arr2={}; + if(searchedQry!=null && searchedQry!=''){ + for(let i=0;i0){ + arr.push(arr2); + } + } + } + + + } + } + else{ + arr=globalSubCatData; + } + + setSubCatData(arr); + setrerenderdata(!rerenderdata) + setrerenderdata2(!rerenderdata2) + } + + function renderDatePicker(){ + let today=new Date(); + console.log('today:',today); + let d1=Object.keys(currentStock).length>0 && currentStock.date!=null && currentStock.date!='' ?new Date(currentStock.date):new Date(); + return ( + {setStockDate(selectedDate)}} + /> + ); + } + + function _render_StockModal(){ + let mfd=Object.keys(currentStock).length>0 && currentStock.mfd!=null && currentStock.mfd!='' ?currentStock.mfd:''; + let stock=Object.keys(currentStock).length>0 && currentStock.stock!=null?currentStock.stock:''; + let lotno=Object.keys(currentStock).length>0 && currentStock.lotno!=null?currentStock.lotno:''; + + return ( + + + + Expiry Date + + {mfd} + + {setShowDatePicker(true);}}> + + + + {showDatePicker==true && + renderDatePicker() + } + + + Stock + + {setCS_Stock('stock',val,'numeric')}} + autoComplete='off' + /> + + + + Lot No. + + {setCS_Stock('lotno',val)}} + autoComplete='off' + /> + + + + + {setCurrentStock({});setShowStockModal(false);}}> + Cancel + + {addMFDStock()}}> + Add + + + + + ) + } + + + function toggleCollapse(subcat={},subcatIndex){ + let allData=subCatData; + let isSubCatCollapsed=subcat.isSubCatCollapsed; + subcat['isSubCatCollapsed']=!isSubCatCollapsed; + allData[subcatIndex]=subcat; + setSubCatData(allData); + setGlobalSubCatData(allData); + setrerenderdata(!rerenderdata); + } + + function _renderStocks(){ + + let isHdrImgIndex=KPIFields.findIndex(i=>i.KPIFieldName=='HeaderImageAllow') + let isHdrImgKPIObj=isHdrImgIndex>=0?KPIFields[isHdrImgIndex]:{}; + let isHdrImgEnable=isHdrImgIndex>=0?isHdrImgKPIObj['KPIFieldEnable']:false; + + let isListedSKUIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ListedSKU') + let isListedSKUKPIObj=isListedSKUIndex>=0?KPIFields[isListedSKUIndex]:{}; + let isListedSKUEnable=isListedSKUIndex>=0?isListedSKUKPIObj['KPIFieldEnable']:false; + + let isStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='Stock') + let isStockKPIObj=isStockIndex>=0?KPIFields[isStockIndex]:{}; + let isStockEnable=isStockIndex>=0?isStockKPIObj['KPIFieldEnable']:true; + let isStockDis_Name=isStockIndex>=0?isStockKPIObj['KPIFieldDisplayName']:'Stock'; + + let isBRStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='BackRoomStock') + let isBRStockKPIObj=isBRStockIndex>=0?KPIFields[isBRStockIndex]:{}; + let isBRStockEnable=isBRStockIndex>=0?isBRStockKPIObj['KPIFieldEnable']:false; + let isBRStockDis_Name=isBRStockIndex>=0?isBRStockKPIObj['KPIFieldDisplayName']:'Back Room Stock'; + + let isDStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='DamageStock') + let isDStockKPIObj=isDStockIndex>=0?KPIFields[isDStockIndex]:{}; + let isDStockEnable=isDStockIndex>=0?isDStockKPIObj['KPIFieldEnable']:false; + let isDStockDis_Name=isDStockIndex>=0?isDStockKPIObj['KPIFieldDisplayName']:''; + + let isLStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='LostStock') + let isLStockKPIObj=isLStockIndex>=0?KPIFields[isLStockIndex]:{}; + let isLStockEnable=isLStockIndex>=0?isLStockKPIObj['KPIFieldEnable']:false; + let isLStockDis_Name=isLStockIndex>=0?isLStockKPIObj['KPIFieldDisplayName']:''; + + let isExStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ExpiredStock') + let isExStockKPIObj=isExStockIndex>=0?KPIFields[isExStockIndex]:{}; + let isExStockEnable=isExStockIndex>=0?isExStockKPIObj['KPIFieldEnable']:false; + let isExStockDis_Name=isExStockIndex>=0?isExStockKPIObj['KPIFieldDisplayName']:''; + + let isMFDIndex=KPIFields.findIndex(i=>i.KPIFieldName=='MFD') + let isMFD_KPIObj=isMFDIndex>=0?KPIFields[isMFDIndex]:{}; + let isMFDEnable=isMFDIndex>=0?isMFD_KPIObj['KPIFieldEnable']:true; + let isMFDDis_Name=isMFDIndex>=0?isMFD_KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry1Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry1') + let NrExpiry1KPIObj=NrExpiry1Index>=0?KPIFields[NrExpiry1Index]:{}; + let NrExpiry1Enable=NrExpiry1Index>=0?NrExpiry1KPIObj['KPIFieldEnable']:false; + let NrExpiry1_Dis_Name=NrExpiry1Index>=0?NrExpiry1KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry2Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry2') + let NrExpiry2KPIObj=NrExpiry2Index>=0?KPIFields[NrExpiry2Index]:{}; + let NrExpiry2Enable=NrExpiry2Index>=0?NrExpiry2KPIObj['KPIFieldEnable']:false; + let NrExpiry2_Dis_Name=NrExpiry2Index>=0?NrExpiry2KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry3Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry3') + let NrExpiry3KPIObj=NrExpiry1Index>=0?KPIFields[NrExpiry3Index]:{}; + let NrExpiry3Enable=NrExpiry1Index>=0?NrExpiry3KPIObj['KPIFieldEnable']:false; + let NrExpiry3_Dis_Name=NrExpiry1Index>=0?NrExpiry3KPIObj['KPIFieldDisplayName']:''; + + let MSLIndex=KPIFields.findIndex(i=>i.KPIFieldName=='MSL'); + let MSLObj=MSLIndex>=0?KPIFields[MSLIndex]:{}; + let isMSLAllow=MSLIndex>=0?MSLObj['KPIFieldEnable']:true; + + let NONMSL_Index=KPIFields.findIndex(i=>i.KPIFieldName=='ChildImageAllow'); + let NONMSL_Obj=NONMSL_Index>=0?KPIFields[NONMSL_Index]:{}; + let isNONMSL_Allow=NONMSL_Index>=0?NONMSL_Obj['KPIFieldEnable']:true; + + const cimgName=catData.ImageName!=null?catData.ImageName:''; + const cimgPath=catData.ImagePath!=null?catData.ImagePath:''; + const showIMg=cimgPath!='' && cimgPath!=null; + + + + return ( + + + + { + ( isHdrImgEnable==true) && + + + { !showIMg && + {openCamera(item)}}> + + + } + { showIMg && + + + {openCamera(Category)}}> + + + + } + + + } + { (rerenderdata==rerenderdata) && + subCatData.map((item,index)=>{ + const subcat=item; + const subcat_index=index; + let isSubCatCollapsed=subcat.isSubCatCollapsed!=null?subcat.isSubCatCollapsed:false; + + return( + + + {toggleCollapse(subcat,index)}}> + + {item.SubCategoryName} + + {isSubCatCollapsed==true && } + {isSubCatCollapsed==false && } + + + { !isSubCatCollapsed && + + {(rerenderdata2==rerenderdata2) && + subcat.skulist.map((item,index)=>{ + + const skus=item; + const sku_index=index; + let thisCatSkuData_i=SKUStockData.findIndex(i=>i.ProductId==skus.ProductId); + let thisCatSkuData=thisCatSkuData_i>=0?(SKUStockData[thisCatSkuData_i] || {}):{}; + let stock=thisCatSkuData.Stock!=null?thisCatSkuData.Stock:''; + let br_stock=thisCatSkuData.BackRoomStock!=null?thisCatSkuData.BackRoomStock:''; + + // let Old_Stock=thisCatSkuData.Old_Stock!=null?thisCatSkuData.Old_Stock:''; + // let OldDamagedStock=thisCatSkuData.OldDamagedStock!=null?thisCatSkuData.OldDamagedStock:''; + // let OldLostStock=thisCatSkuData.OldLostStock!=null?thisCatSkuData.OldLostStock:''; + // let OldExStock=thisCatSkuData.OldExStock!=null?thisCatSkuData.OldExStock:''; + + let isSKUPresent=thisCatSkuData.isSKUPresent!=null?thisCatSkuData.isSKUPresent:0; + let showAllSKU_Fields=thisCatSkuData.showAllSKU_Fields!=null?thisCatSkuData.showAllSKU_Fields:false; + let ex_stock=thisCatSkuData.ExpiryStock!=null?thisCatSkuData.ExpiryStock:''; + let damage_stock=thisCatSkuData.DamagedStock!=null?thisCatSkuData.DamagedStock:''; + let lost_stock=thisCatSkuData.LostStock!=null?thisCatSkuData.LostStock:''; + let mfdStocks=thisCatSkuData.mfdStocks || []; + let NearExpiry_stock1=thisCatSkuData.NearExpiry1!=null?thisCatSkuData.NearExpiry1:''; + let NearExpiry_stock2=thisCatSkuData.NearExpiry2!=null?thisCatSkuData.NearExpiry2:''; + let NearExpiry_stock3=thisCatSkuData.NearExpiry3!=null?thisCatSkuData.NearExpiry3:''; + + let isMandatory=((isMSLAllow==1 || isMSLAllow=='true') && (skus.MSL==1 || skus.MSL=='true') ) || ((isNONMSL_Allow==1 || isNONMSL_Allow=='true') && (skus.MSL!=1 && skus.MSL!='true') ) + + + return( + + {isListedSKUEnable==true && + + + {console.log('valchange:',val); let val1=(val==true)?1:0; onStockValChange(skus,val1,'isSKUPresent') }} + style={[customStyle.openStkP_checkbox,(Platform.OS=='ios'?{height:20,width:20,marginTop:8,marginLeft:8,}:{})]} + + tintColors={{ true:PageTheme.$primary_color, false:PageTheme.$text_color_light }} + /> + + {skus.ProductName} + + } + + {isListedSKUEnable!=true && {skus.ProductName}} + {((isListedSKUEnable==true && showAllSKU_Fields==true) || isListedSKUEnable==false) && + + {(isStockEnable==true) && + + + {isStockDis_Name} + { onStockValChange(skus,val,'Stock','numeric')}} + autoComplete='off' + /> + + + } + {(isBRStockEnable==true) && + + + {isBRStockDis_Name} + { onStockValChange(skus,val,'BackRoomStock','numeric')}} + autoComplete='off' + /> + + + } + {(isDStockEnable==true) && + + + {isDStockDis_Name} + { onStockValChange(skus,val,'DamagedStock','numeric')}} + autoComplete='off' + /> + + + } + {(isLStockEnable==true) && + + + {isLStockDis_Name} + { onStockValChange(skus,val,'LostStock','numeric')}} + autoComplete='off' + /> + + + } + {(isExStockEnable==true ) && + + + + {isExStockDis_Name} + { onStockValChange(skus,val,'ExpiryStock','numeric')}} + autoComplete='off' + /> + + + } + + {(NrExpiry1Enable==true ) && + + + {NrExpiry1_Dis_Name} + { onStockValChange(skus,val,'NearExpiry1','numeric')}} + autoComplete='off' + /> + + + } + {(NrExpiry2Enable==true ) && + + + {NrExpiry2_Dis_Name} + { onStockValChange(skus,val,'NearExpiry2','numeric')}} + autoComplete='off' + /> + + + } + {(NrExpiry3Enable==true ) && + + + {NrExpiry3_Dis_Name} + { onStockValChange(skus,val,'NearExpiry3','numeric')}} + autoComplete='off' + /> + + + } + {(isMFDEnable==true) && + + {isMFDDis_Name} + {openAddStkModal(skus)}}> + Add + + + + Date + + + Stock + + + Lot No. + + + Actions + + + + + { + mfdStocks.map((mfd_Item,mfd_index)=>{ + let mfd=mfd_Item.mfd || ''; + let stock=mfd_Item.stock || ''; + let lotno=mfd_Item.lotno || ''; + + return( + + + {mfd} + + + {stock} + + + {lotno} + + + {showRemoveConfirm(skus,mfd_Item,mfd_index)}}> + + + + + ) + }) + } + + + } + + } + + ) + }) + } + + } + + ); + }) + } + + + ) + } + + + + + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showRemoveConfirm_M,()=>{setShowRemoveConfirm_M(false)},removeMFDStock,'Do you really want to remove this stock?')} + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {rerendermodal==rerendermodal && _render_StockModal()} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + {`Category: ${(Category.CategoryName!=null?(Category.CategoryName.length>40?Category.CategoryName.substring(0,40)+'...':Category.CategoryName):'')}`} + + + + + + {setSearchedItem(val); FilterStores(val)}} + autoComplete='off' + /> + {FilterStores(searchedItem)}}> + + + + + + + MSL (Mandatory) + + + + Non-MSL (Non-Mandatory) + + + { Object.keys(storeData).length>0 && + _renderStocks() + } + + + {submitOpeningStock()}}/> + + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(StockWithCat); \ No newline at end of file diff --git a/src/screens/Stock_BckUp.js b/src/screens/Stock_BckUp.js new file mode 100644 index 0000000..851b112 --- /dev/null +++ b/src/screens/Stock_BckUp.js @@ -0,0 +1,1697 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, KeyboardAvoidingView, BackHandler, Keyboard} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, Fontisto, Ionicons, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import CheckBox from '@react-native-community/checkbox'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { ConfirmSaveAlert, ExitScreenAlert } from '../components/alert'; +import CustomCamera from '../components/Camera'; +import Accordion from 'react-native-collapsible/Accordion'; +import DateTimePicker from '@react-native-community/datetimepicker'; +import { createFalse } from 'typescript'; +import CustomModal2 from '../components/CustomModal2'; + +function Stock(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [brandData, setBrandData] = useState([]); + const [globalBrandData, setGlobalBrandData] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + + const [catImages, setCatImages] = useState([]); + const [SKUStockData, setSKUStockData] = useState([]); + const [currentStock, setCurrentStock] = useState({}); + const [currentBrand, setCurrentBrand] = useState({}); + const [currentProduct, setCurrentProduct] = useState({}); + const [KPIFields, setKPIFields] = useState([]); + const [showAlert, setShowAlert] = useState(false); + const [showStockModal, setShowStockModal] = useState(false); + const [showDatePicker, setShowDatePicker] = useState(false); + const [rerendermodal, setrerendermodal] = useState(0); + const [toRemoveId, setToRemoveId] = useState(''); + const [toRemoveCat, setToRemoveCat] = useState({}); + const [toRemoveSKU, setToRemoveSKU] = useState({}); + const [showRemoveConfirm_M, setShowRemoveConfirm_M] = useState(false); + const [searchedItem, setSearchedItem]= useState(''); + + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const [activeSections,setActiveSections]= useState([]); + + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + + function onRemoveScreen(e){ + Alert.alert( + "", + ST.Doyoureallywanttoexitthescreen, + [ + { + text: ST.Cancel, + onPress: () => {}, + style: "cancel" + }, + { text: ST.OK, onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + async function getKPIFields(menu1){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q=`select * from Mapping_MenuConfiguration where ScreenName='${menu1.ScreenName}'`; + await txn.executeSql(q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + } + + async function getData(storeData1,menu1){ + + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + let allCats=[]; + let allSKUData=[]; + await getKPIFields(menu1); + await db.transaction(async function (txn) { + + // let dq=`DELETE FROM ${AppTables.STOCK2_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + // let dq2=`DELETE FROM ${AppTables.STOCK2HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + // let dq3=`DELETE FROM ${AppTables.STOCK2_MFD_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // // remove old data + // await txn.executeSql(dq,[],async function (txn2, txnres) { + // console.log('stock data deleted'); + // },function (txn2, txnerr) { console.log(txnerr); },); + + // await txn.executeSql(dq2,[],async function (txn2, txnres) { + // console.log('stock header data deleted'); + // },function (txn2, txnerr) { console.log(txnerr); },); + + // await txn.executeSql(dq3,[],async function (txn2, txnres) { + // console.log('stock mfd data deleted'); + // },function (txn2, txnerr) { console.log(txnerr); },); + + + + let join=' INNER join Product_Master p on c.CategoryId=p.CategoryId '; + let join2=' INNER join Mapping_ProductAssortment mp on p.ProductId=mp.ProductId '; + let q=`SELECT DISTINCT c.CategoryId,c.CategoryName from Master_Category c ${join} ${join2} where mp.StateId='${StateId}' and mp.ChainId='${ChainId}' and mp.StoreTypeId='${StoreTypeId}' order by p.CategorySequence`; + + let q2=` SELECT CATEGORY_ID as CategoryId,CATEGORY as CategoryName,IMAGE,IMAGEPATH FROM ${AppTables.STOCK2HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('added products cats:',txnres.rows.length) + if(txnres.rows.length>0){ + + let arr=[]; + for(var i=0;i{setrerenderdata2(!rerenderdata2);},3000); + setProcessing(false); + } + } + } + else{ + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('cats len:',txnres2.rows.length) + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{setrerenderdata2(!rerenderdata2);},3000); + setProcessing(false); + + } + } + + } + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false); },); + } + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false); },); + // setProcessing(false); + + }); + } catch (err) { + console.log(err); + } + } + + async function getBrands(storeData1,menu1,item,allSKUData=[]){ + let data_to_ret={'brands':[],'products_data':allSKUData} + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + + return await new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let join=` inner join Mapping_ProductAssortment m on p.ProductId=m.ProductId `; + let join2=` inner join Master_Category mc on mc.CategoryId=p.CategoryId `; + let brands_q=`select distinct p.BrandName,p.BrandId from Product_Master p ${join} ${join2} where m.ChainId='${ChainId}' and m.StateId='${StateId}' and m.StoreTypeId='${StoreTypeId}' and p.CategoryId='${item.CategoryId}' and CompanyId='1' order by p.ProductSequence`; + + + await txn.executeSql(brands_q,[],async function (txn2, txnres) { + console.log('brands len:',txnres.rows.length) + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log(err); + return data_to_ret; + }) + } + + async function getSKU(storeData1,cat,brand,allSKUData=[]){ + let sku_ret={'products':[],'products_data':allSKUData}; + let {StoreId,ChainId,StateId,StoreTypeId,ExpiryStock}=storeData1; + return await new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + // get from stored data if exists + let seletlist=`STOCK_UID,PRODUCT as ProductName,PRODUCT_ID as ProductId,BRAND as BrandName,BRAND_ID as BrandId,MSL,STOCK,BACKROOM_STOCK,DAMAGED_STOCK,LOST_STOCK,EXPIRY_STOCK,IS_SKU_STOCK_PRESENT,NREXPIRY1_STOCK,NREXPIRY2_STOCK,NREXPIRY3_STOCK`; + let sku_q=`SELECT ${seletlist} FROM ${AppTables.STOCK2_DATA} WHERE STORE_ID='${StoreId}' and CATEGORY_ID='${cat.CategoryId}' and BRAND_ID='${brand.BrandId}' `; + + // else get products from masters + let join=` inner join Mapping_ProductAssortment m on p.ProductId=m.ProductId `; + let join2=` inner join Master_Category mc on mc.CategoryId=p.CategoryId `; + let sku_q2=`select distinct p.ProductName,p.ProductId,p.BrandName,p.BrandId,m.MSL from Product_Master p ${join} ${join2} where m.ChainId='${ChainId}' and m.StateId='${StateId}' and m.StoreTypeId='${StoreTypeId}' and p.CategoryId='${cat.CategoryId}' and p.BrandId='${brand.BrandId}' and CompanyId='1' order by p.ProductSequence`; + + + + await txn.executeSql(sku_q,[],async function (txn2, txnres) { + + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i0){ + let arr=[]; + for(var i=0;i{ + return val; + }).catch((err)=>{ + console.log('getSKU err:',err); + return sku_ret; + }) + + + } + + async function getMFDStockData(skud){ + + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q=`select * from ${AppTables.STOCK2_MFD_DATA} where STOCK_UID='${skud.STOCK_UID}'`; + await txn.executeSql(q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i{ + console.log(err); + return []; + }) + } + + async function getImage(imgdata){ + let cat=getImageProps.option || ''; + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl='file://'+img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: Stock'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+(props.UserId || '')+'_Stock-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let allIMgs=catImages; + let defData={'CategoryId':cat.CategoryId}; + const cindex=allIMgs.findIndex(i=>i.CategoryId==cat.CategoryId); + const imgData=cindex>=0?(allIMgs[cindex] || defData):defData; + imgData.ImageName=filename; + + // renamefile + let imagePath='file://'+`${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri=imagePath; + console.log('image marker',uri); + imgData.ImagePath=uri; + cindex>=0?allIMgs[cindex]=imgData:allIMgs.push(imgData); + setCatImages(allIMgs); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + }) + .catch(err => { + console.log(ST.Errorimagefilewritefailed+'!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(option){ + setGetImageProps({'option':option}); + console.log('openCamera'); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function submitOpeningStock(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData+'...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + let q=`DELETE FROM ${AppTables.STOCK2_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + let q2=`DELETE FROM ${AppTables.STOCK2HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + let q3=`DELETE FROM ${AppTables.STOCK2_MFD_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `; + + // remove old data + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('stock data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('stock header data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + await txn.executeSql(q3,[],async function (txn2, txnres) { + console.log('stock mfd data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + + let seq_q=` select seq from sqlite_sequence where name="${AppTables.STOCK2HDR_DATA}" `; + await txn.executeSql(seq_q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let data=txnres.rows.item(0); + let seq=data.seq; + insertData(seq); + } + else{ + insertData(0); + } + },function (txn2, txnerr) { console.log(txnerr); insertData(0); },); + + + }); + } catch (err) { + console.log(err); + } + } + + async function insertData(seq=0){ + try { + console.log(seq); + let {StoreId,ChainId,StateId,StoreTypeId,ExpiryStock}=storeData; + console.log('insertData'); + await db.transaction(async function (txn) { + var values='',stock_values='',mfdStockV=''; + for(var i=0;ici.CategoryId==item.CategoryId) || {}; + values+=values!=''?' , ':''; + + + values+=` ('${StoreId}','${d2}','${item.CategoryName}','${item.CategoryId}','','${(cimage.ImageName || '')}','${(cimage.ImagePath || '')}','${d2}') `; + console.log('stock hdr values added'); + + let brandList=item.brandList || []; + for(var j=0;jci.CategoryId==item.CategoryId && ci.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || {}) : {}; + let mfdStocks=skud['mfdStocks'] || []; + + let stock=skud.Stock!=null?skud.Stock:''; + let br_stock=skud.BackRoomStock!=null?skud.BackRoomStock:''; + let ex_stock=skud.ExpiryStock!=null?skud.ExpiryStock:''; + let damage_stock=skud.DamagedStock!=null?skud.DamagedStock:''; + let lost_stock=skud.LostStock!=null?skud.LostStock:''; + let isSKUPresent=skud.isSKUPresent!=null?skud.isSKUPresent:0; + + let NearExpiry_stock1=skud.NearExpiry1!=null?skud.NearExpiry1:''; + let NearExpiry_stock2=skud.NearExpiry2!=null?skud.NearExpiry2:''; + let NearExpiry_stock3=skud.NearExpiry3!=null?skud.NearExpiry3:''; + + stock_values+=` ('${seq}','${SKU_UID}','${StoreId}','${d2}','${item.CategoryId}','${item.CategoryName}','${BrandId}','${BrandName}','${ProductId}','${ProductName}','${MSL}','${stock}','${br_stock}','${damage_stock}','${lost_stock}','${ex_stock}','${isSKUPresent}','${NearExpiry_stock1}','${NearExpiry_stock2}','${NearExpiry_stock3}','${d2}') `; + + for(let m=0;mi.KPIFieldName=='HeaderImageAllow') + let isHdrImgKPIObj=isHdrImgIndex>=0?KPIFields[isHdrImgIndex]:{}; + let isHdrImgEnable=isHdrImgIndex>=0?isHdrImgKPIObj['KPIFieldEnable']:false; + + let isListedSKUIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ListedSKU'); + let isListedSKUKPIObj=isListedSKUIndex>=0?KPIFields[isListedSKUIndex]:{}; + let isListedSKUEnable=isListedSKUIndex>=0?isListedSKUKPIObj['KPIFieldEnable']:true; + + let isStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='Stock') + let isStockKPIObj=isStockIndex>=0?KPIFields[isStockIndex]:{}; + let isStockEnable=isStockIndex>=0?isStockKPIObj['KPIFieldEnable']:true; + let isStockDis_Name=isStockIndex>=0?isStockKPIObj['KPIFieldDisplayName']:'Stock'; + + let isBRStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='BackRoomStock') + let isBRStockKPIObj=isBRStockIndex>=0?KPIFields[isBRStockIndex]:{}; + let isBRStockEnable=isBRStockIndex>=0?isBRStockKPIObj['KPIFieldEnable']:true; + let isBRStockDis_Name=isBRStockIndex>=0?isBRStockKPIObj['KPIFieldDisplayName']:''; + + let isDStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='DamageStock') + let isDStockKPIObj=isDStockIndex>=0?KPIFields[isDStockIndex]:{}; + let isDStockEnable=isDStockIndex>=0?isDStockKPIObj['KPIFieldEnable']:false; + let isDStockDis_Name=isDStockIndex>=0?isDStockKPIObj['KPIFieldDisplayName']:''; + + let isLStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='LostStock') + let isLStockKPIObj=isLStockIndex>=0?KPIFields[isLStockIndex]:{}; + let isLStockEnable=isLStockIndex>=0?isLStockKPIObj['KPIFieldEnable']:false; + let isLStockDis_Name=isLStockIndex>=0?isLStockKPIObj['KPIFieldDisplayName']:''; + + let isExStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ExpiredStock') + let isExStockKPIObj=isExStockIndex>=0?KPIFields[isExStockIndex]:{}; + let isExStockEnable=isExStockIndex>=0?isExStockKPIObj['KPIFieldEnable']:false; + let isExStockDis_Name=isExStockIndex>=0?isExStockKPIObj['KPIFieldDisplayName']:''; + + let isMFDIndex=KPIFields.findIndex(i=>i.KPIFieldName=='MFD') + let isMFD_KPIObj=isMFDIndex>=0?KPIFields[isMFDIndex]:{}; + let isMFDEnable=isMFDIndex>=0?isMFD_KPIObj['KPIFieldEnable']:false; + let isMFDDis_Name=isMFDIndex>=0?isMFD_KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry1Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry1') + let NrExpiry1KPIObj=NrExpiry1Index>=0?KPIFields[NrExpiry1Index]:{}; + let NrExpiry1Enable=NrExpiry1Index>=0?NrExpiry1KPIObj['KPIFieldEnable']:false; + let NrExpiry1_Dis_Name=NrExpiry1Index>=0?NrExpiry1KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry2Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry2') + let NrExpiry2KPIObj=NrExpiry2Index>=0?KPIFields[NrExpiry2Index]:{}; + let NrExpiry2Enable=NrExpiry2Index>=0?NrExpiry2KPIObj['KPIFieldEnable']:false; + let NrExpiry2_Dis_Name=NrExpiry2Index>=0?NrExpiry2KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry3Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry3') + let NrExpiry3KPIObj=NrExpiry1Index>=0?KPIFields[NrExpiry3Index]:{}; + let NrExpiry3Enable=NrExpiry1Index>=0?NrExpiry3KPIObj['KPIFieldEnable']:false; + let NrExpiry3_Dis_Name=NrExpiry1Index>=0?NrExpiry3KPIObj['KPIFieldDisplayName']:''; + + let MSLIndex=KPIFields.findIndex(i=>i.KPIFieldName=='MSL'); + let MSLObj=MSLIndex>=0?KPIFields[MSLIndex]:{}; + let isMSLAllow=MSLIndex>=0?MSLObj['KPIFieldEnable']:true; + + let NONMSL_Index=KPIFields.findIndex(i=>i.KPIFieldName=='ChildImageAllow'); + let NONMSL_Obj=NONMSL_Index>=0?KPIFields[NONMSL_Index]:{}; + let isNONMSL_Allow=NONMSL_Index>=0?NONMSL_Obj['KPIFieldEnable']:false; + + + + await Promise.all( + globalBrandData.map(async (item,index) => { + if(isValid){ + let catId=item.CategoryId; + + let cimgData=catImages.find(ci=>ci.CategoryId==catId) || {}; + + + // let isCollapsed=item.isCollapsed!=null?item.isCollapsed:true; + + if(isHdrImgEnable==true && (cimgData.ImagePath== null || cimgData.ImagePath=='')){ + notify(ST.Pleaseclickimagefor+' '+item.CategoryName,'SHORT'); + isValid=false; + } + else{ + let brandList=item.brandList || []; + + if(brandList.length>0){ + brandList.map(async (brand,brand_index) => { + let skulist=brand.skulist || []; + if(isValid==true){ + if(skulist.length>0){ + await Promise.all( + skulist.map(async (skuItem,skuIndex) => { + if(isValid==true){ + let skuData=SKUStockData.find(ci=>ci.CategoryId==item.CategoryId && ci.ProductId==skuItem.ProductId ) || {}; + let stock=skuData.Stock!=null?skuData.Stock:''; + let ex_stock=skuData.ExpiryStock!=null?skuData.ExpiryStock:''; + let damage_stock=skuData.DamagedStock!=null?skuData.DamagedStock:''; + let lost_stock=skuData.LostStock!=null?skuData.LostStock:''; + let isSKUPresent=skuData.isSKUPresent!=null?skuData.isSKUPresent:0; + let br_stock=skuData.BackRoomStock!=null?skuData.BackRoomStock:''; + let NearExpiry_stock1=skuData.NearExpiry1!=null?skuData.NearExpiry1:''; + let NearExpiry_stock2=skuData.NearExpiry2!=null?skuData.NearExpiry2:''; + let NearExpiry_stock3=skuData.NearExpiry3!=null?skuData.NearExpiry3:''; + + let isMandatory=((isMSLAllow==1 || isMSLAllow=='true') && (skuItem.MSL==1 || skuItem.MSL=='true') ) || ((isNONMSL_Allow==1 || isNONMSL_Allow=='true') && (skuItem.MSL!=1 && skuItem.MSL!='true') ) + + + + if((isListedSKUEnable==true && isSKUPresent==1) || (!isListedSKUEnable && (isMandatory)) ){ + + // let sumOfDamagedStocks=parseInt(ex_stock)+parseInt(damage_stock)+parseInt(lost_stock); + + + if(isStockEnable==true && stock!==0 && ( stock==null || stock=='')){ + notify(ST.Pleaseenter+' '+isStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(isBRStockEnable==true && br_stock!==0 && ( br_stock==null || br_stock=='')){ + notify(ST.Pleaseenter+' '+isBRStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(isDStockEnable==true && damage_stock!==0 && ( damage_stock==null || damage_stock=='')){ + notify(ST.Pleaseenter+' '+isDStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(isLStockEnable==true && lost_stock!==0 && ( lost_stock==null || lost_stock=='')){ + notify(ST.Pleaseenter+' '+isDStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(isExStockEnable==true && ex_stock!==0 && ( ex_stock==null || ex_stock=='')){ + notify(ST.Pleaseenter+' '+isExStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(NrExpiry1Enable==true && NearExpiry_stock1!==0 && ( NearExpiry_stock1==null || NearExpiry_stock1=='')){ + notify(ST.Pleaseenter+' '+NrExpiry1_Dis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(NrExpiry2Enable==true && NearExpiry_stock2!==0 && ( NearExpiry_stock2==null || NearExpiry_stock2=='')){ + notify(ST.Pleaseenter+' '+NrExpiry2_Dis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + else if(NrExpiry3Enable==true && NearExpiry_stock3!==0 && ( NearExpiry_stock3==null ||NearExpiry_stock3=='')){ + notify(ST.Pleaseenter+' '+NrExpiry3_Dis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + isValid=false; + } + // else if((isDStockEnable && isLStockEnable && isExStockEnable) && sumOfDamagedStocks>parseInt(stock)){ + // notify('Sum of '+isDStockDis_Name+','+isLStockDis_Name+' and '+isExStockDis_Name+' should be less than or equal to Stock for '+skuItem.ProductName,'LONG'); + // isValid=false; + // } + // else if((isDStockEnable && isLStockEnable) && sumOfDamagedStocks>parseInt(stock)){ + // notify('Sum of '+isDStockDis_Name+' and '+isLStockDis_Name+' should be less than or equal to '+isStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + // isValid=false; + // } + // else if((isLStockEnable && isExStockEnable) && sumOfDamagedStocks>parseInt(stock)){ + // notify('Sum of '+isLStockDis_Name+' and '+isExStockDis_Name+' should be less than or equal to '+isStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + // isValid=false; + // } + // else if((isDStockEnable && isExStockEnable) && sumOfDamagedStocks>parseInt(stock)){ + // notify('Sum of '+isDStockDis_Name+' and '+isExStockDis_Name+' should be less than or equal to '+isStockDis_Name+' '+ST.for+' '+skuItem.ProductName,'LONG'); + // isValid=false; + // } + else{ + + } + + } + } + }) + ); + } + } + + }); + } + + } + } + }) + ); + + console.log('isValid:',isValid); + return isValid; + } + + function onStockValChange(item,skuItem,val,key,type=''){ + if(type=='numeric' && val!=''){ + const regex = new RegExp(/^\d+$/); + let isNUmeric=regex.test(val); + if(!isNUmeric){ + notify(ST.Pleaseenterwholenumbersonly,'SHORT'); + return; + } + } + + let allSKUData=SKUStockData; + let defData={'CategoryId':item.CategoryId,'ProductId':skuItem.ProductId}; + const skud_index=allSKUData.findIndex(i=>i.CategoryId==item.CategoryId && i.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + skud[key]=val; + + if(key=='isSKUPresent'){ + skud['showAllSKU_Fields']=val==1?true:false; + } + + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + // function checkStockVal(item,skuItem,key,old_key,old_val){ + // console.log('checkStockVal',old_val,val); + // let allSKUData=SKUStockData; + // let defData={'CategoryId':item.CategoryId,'ProductId':skuItem.ProductId}; + // const skud_index=allSKUData.findIndex(i=>i.CategoryId==item.CategoryId && i.ProductId==skuItem.ProductId); + // const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + // console.log('checkStockVal'); + // let val=skud[key] || ''; + // let val1=skud[key] || 0; + // let product_total_stock=skud['Stock']; + // if(product_total_stock!=''){ + // product_total_stock=parseInt(product_total_stock); + // let product_damage_stock=parseInt(skud['DamagedStock'] || 0); + // let product_lost_stock=parseInt(skud['LostStock'] || 0); + // let product_ex_stock=parseInt(skud['ExpiryStock'] || 0); + + // let product_stock=product_ex_stock;//product_total_stock-(product_damage_stock+product_lost_stock+product_ex_stock); + // val1=parseInt(val1); + // if(skud_index>=0){ + // let mfdStocks=skud['mfdStocks'] || []; + // let sumOfAllStocks=0 + // for(let i in mfdStocks){ + // let ds=mfdStocks[i]; + // sumOfAllStocks+=parseInt(ds.stock); + // } + + // if(sumOfAllStocks>product_stock){ + // notify('Sum of all MFD stock cannot be greater than product stock count!'); + // skud[key]=old_val; + // skud[old_key]=old_val; + // } + // else{ + // skud[old_key]=val; + // } + // } + // else{ + // skud[old_key]=val; + // } + + + // skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + // setSKUStockData(allSKUData); + // setHasUnsavedChanges(true); + // setrerenderdata(!rerenderdata); + // } + // } + + function openAddStkModal(cat,skuItem){ + setCurrentBrand(cat); + setCurrentProduct(skuItem); + let allSKUData=SKUStockData; + let defData={'CategoryId':cat.CategoryId,'ProductId':skuItem.ProductId}; + const skud_index=allSKUData.findIndex(i=>i.CategoryId==cat.CategoryId && i.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + + setShowStockModal(true); + // let mfdStocks=skud['mfdStocks'] || []; + // let product_stock=skud['Stock']; + // let product_ex_stock=skud['ExpiryStock']; + + // if(product_stock==null || product_stock==''){ + // notify('Please enter sku stock first!'); + // } + // else if(product_ex_stock==null || product_ex_stock==''){ + // notify('Please enter expiry stock first!'); + // } + // else{ + + // } + + } + + function onSaveCancel(){ + setShowAlert(false) + } + + function setStockDate(date){ + let d1=moment(date).format('DD/MM/YYYY'); + let cstock=currentStock; + cstock['date']=date; + cstock['mfd']=d1; + setCurrentStock(cstock); + setShowDatePicker(false); + } + + function setCS_Stock(key,val,type=''){ + if(type=='numeric' && val!=''){ + const regex = new RegExp(/^\d+$/); + let isNUmeric=regex.test(val); + if(!isNUmeric){ + notify(ST.Pleaseenterwholenumbersonly,'SHORT'); + return; + } + } + + let cstock=currentStock; + cstock[key]=val; + console.log(key,val) + setCurrentStock(cstock); + setrerendermodal(!rerendermodal); + } + + + + function getAllSum(mfdStocks=[],cstock={}){ + let {mfd,date,stock}=cstock + let sumOfAllStocks=parseInt(stock); + return new Promise((resolve,reject)=>{ + if(mfdStocks.length>0){ + for(let i in mfdStocks){ + let ds=mfdStocks[i]; + sumOfAllStocks+=parseInt(ds.stock); + if(i==mfdStocks.length-1){ + resolve(sumOfAllStocks) + } + } + } + else{ + resolve(sumOfAllStocks) + } + }).catch((err)=>{ + console.log(err); + return 0; + }) + } + + async function addMFDStock(){ + Keyboard.dismiss(); + let cat=currentBrand + let skuItem=currentProduct + let cstock=currentStock; + var allSKUData=SKUStockData; + let defData={'CategoryId':cat.CategoryId,'ProductId':skuItem.ProductId}; + const skud_index=allSKUData.findIndex(i=>i.CategoryId==cat.CategoryId && i.ProductId==skuItem.ProductId); + var skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + let mfdStocks=skud['mfdStocks'] || []; + let product_total_stock=skud['Stock']; + let product_damage_stock=parseInt(skud['DamagedStock'] || 0); + let product_lost_stock=parseInt(skud['LostStock'] || 0); + let product_ex_stock=parseInt(skud['ExpiryStock'] || 0); + + let product_stock=product_ex_stock;//product_total_stock-(product_damage_stock+product_lost_stock+product_ex_stock); + let {mfd,date,stock,lotno}=cstock + + + + + if(mfd==null || mfd==''){ + notify(ST.Pleaseselectdate); + return ; + } + else if(stock==null || stock==''){ + notify(ST.Pleaseenterstock); + return ; + } + else if(lotno==null || lotno==''){ + notify(ST.Pleaseenterlotno); + return ; + } + else if(mfdStocks.findIndex(i=>i.mfd==mfd)>=0){ + notify(ST.ThisdateisalreadyaddedPleaseselectdifferentdate); + return ; + } + else { + // let sumOfAllStocks=await getAllSum(mfdStocks,cstock); + // console.log('product_stock',product_stock,',sum:',sumOfAllStocks,JSON.stringify(SKUStockData)) + // if(product_stock!==0 && (product_stock==null || product_stock=='')){ + // notify('Please enter sku stock'); + // return ; + // } + // else if(sumOfAllStocks>product_stock){ + // notify('Sum of all MFD stock cannot be greater than product stock count!'); + // return ; + // }else{ + console.log('added') + mfdStocks.push(cstock); + skud['mfdStocks']=mfdStocks; + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + setCurrentStock({}); + setShowStockModal(false); + // } + + } + } + + + function removeMFDStock(){ + let cat=toRemoveCat; + let skuItem=toRemoveSKU; + let cstockIndex=toRemoveId; + let allSKUData=SKUStockData; + let defData={'CategoryId':cat.CategoryId,'ProductId':skuItem.ProductId}; + const skud_index=allSKUData.findIndex(i=>i.CategoryId==cat.CategoryId && i.ProductId==skuItem.ProductId); + const skud=skud_index>=0?(allSKUData[skud_index] || defData) : defData; + let mfdStocks=skud['mfdStocks'] || []; + mfdStocks.splice(cstockIndex,1); + skud['mfdStocks']=mfdStocks; + + skud_index>=0?allSKUData[skud_index]=skud:allSKUData.push(skud); + setShowRemoveConfirm_M(false); + setSKUStockData(allSKUData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function showRemoveConfirm(cat,skuItem,cstock,cstockIndex){ + setToRemoveId(cstockIndex); + setToRemoveCat(cat); + setToRemoveSKU(skuItem); + setShowRemoveConfirm_M(true); + } + + function FilterStores(searchedQry){ + searchedQry=searchedQry.toLowerCase(); + console.log('searchedQry',searchedQry); + let arr=[]; + var arr2={}; + var newBrand={}; + if(searchedQry!=null && searchedQry!=''){ + // globalBrandData.map((item,index)=>{ + for(let i=0;i0){ + newBrandList.push(newBrand); + if(j==brandList.length-1){ + arr2.brandList=newBrandList; + arr.push(arr2); + } + } + + } + } + } + + + } + } + else{ + arr=globalBrandData; + } + + console.log('globalBrandData:',globalBrandData) + setBrandData(arr); + setrerenderdata(!rerenderdata) + setrerenderdata2(!rerenderdata2) + } + + function renderDatePicker(){ + let today=new Date(); + console.log('today:',today); + let d1=Object.keys(currentStock).length>0 && currentStock.date!=null && currentStock.date!='' ?new Date(currentStock.date):new Date(); + return ( + {setStockDate(selectedDate)}} + /> + ); + } + + function _render_StockModal(){ + let mfd=Object.keys(currentStock).length>0 && currentStock.mfd!=null && currentStock.mfd!='' ?currentStock.mfd:''; + let stock=Object.keys(currentStock).length>0 && currentStock.stock!=null?currentStock.stock:''; + let lotno=Object.keys(currentStock).length>0 && currentStock.lotno!=null?currentStock.lotno:''; + + return ( + + + + {ST.ExpiryDate} + + {mfd} + + {setShowDatePicker(true);}}> + + + + {showDatePicker==true && + renderDatePicker() + } + + + {ST.Stock} + + {setCS_Stock('stock',val,'numeric')}} + autoComplete='off' + /> + + + + {ST.LotNo} + + {setCS_Stock('lotno',val,'')}} + autoComplete='off' + /> + + + + + {setCurrentStock({});setShowStockModal(false);}}> + {ST.Cancel} + + {addMFDStock()}}> + {ST.Add} + + + + + ) + } + + + function toggleCollapse(cat={},catIndex){ + let allData=brandData; + let isCollapsed=cat.isCollapsed; + cat['isCollapsed']=!isCollapsed; + allData[catIndex]=cat; + setBrandData(allData); + setGlobalBrandData(allData); + setrerenderdata(!rerenderdata); + } + + + function toggleCollapse2(cat={},catIndex,brand={},brand_index){ + let allData=brandData; + let isBrandCollapsed=brand.isBrandCollapsed; + let brandList=cat.brandList || []; + console.log('already brandList len:',brandList.length); + brand['isBrandCollapsed']=!isBrandCollapsed; + brandList[brand_index]=brand; + cat['brandList']=brandList; + allData[catIndex]=cat; + setBrandData(allData); + setGlobalBrandData(allData); + setrerenderdata(!rerenderdata); + } + + function _renderStocks(){ + + let isHdrImgIndex=KPIFields.findIndex(i=>i.KPIFieldName=='HeaderImageAllow') + let isHdrImgKPIObj=isHdrImgIndex>=0?KPIFields[isHdrImgIndex]:{}; + let isHdrImgEnable=isHdrImgIndex>=0?isHdrImgKPIObj['KPIFieldEnable']:false; + + + + let isListedSKUIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ListedSKU') + let isListedSKUKPIObj=isListedSKUIndex>=0?KPIFields[isListedSKUIndex]:{}; + let isListedSKUEnable=isListedSKUIndex>=0?isListedSKUKPIObj['KPIFieldEnable']:true; + + let isStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='Stock') + let isStockKPIObj=isStockIndex>=0?KPIFields[isStockIndex]:{}; + let isStockEnable=isStockIndex>=0?isStockKPIObj['KPIFieldEnable']:true; + let isStockDis_Name=isStockIndex>=0?isStockKPIObj['KPIFieldDisplayName']:''; + + let isBRStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='BackRoomStock') + let isBRStockKPIObj=isBRStockIndex>=0?KPIFields[isBRStockIndex]:{}; + let isBRStockEnable=isBRStockIndex>=0?isBRStockKPIObj['KPIFieldEnable']:true; + let isBRStockDis_Name=isBRStockIndex>=0?isBRStockKPIObj['KPIFieldDisplayName']:''; + + let isDStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='DamageStock') + let isDStockKPIObj=isDStockIndex>=0?KPIFields[isDStockIndex]:{}; + let isDStockEnable=isDStockIndex>=0?isDStockKPIObj['KPIFieldEnable']:false; + let isDStockDis_Name=isDStockIndex>=0?isDStockKPIObj['KPIFieldDisplayName']:''; + + let isLStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='LostStock') + let isLStockKPIObj=isLStockIndex>=0?KPIFields[isLStockIndex]:{}; + let isLStockEnable=isLStockIndex>=0?isLStockKPIObj['KPIFieldEnable']:false; + let isLStockDis_Name=isLStockIndex>=0?isLStockKPIObj['KPIFieldDisplayName']:''; + + let isExStockIndex=KPIFields.findIndex(i=>i.KPIFieldName=='ExpiredStock') + let isExStockKPIObj=isExStockIndex>=0?KPIFields[isExStockIndex]:{}; + let isExStockEnable=isExStockIndex>=0?isExStockKPIObj['KPIFieldEnable']:false; + let isExStockDis_Name=isExStockIndex>=0?isExStockKPIObj['KPIFieldDisplayName']:''; + + let isMFDIndex=KPIFields.findIndex(i=>i.KPIFieldName=='MFD') + let isMFD_KPIObj=isMFDIndex>=0?KPIFields[isMFDIndex]:{}; + let isMFDEnable=isMFDIndex>=0?isMFD_KPIObj['KPIFieldEnable']:false; + let isMFDDis_Name=isMFDIndex>=0?isMFD_KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry1Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry1') + let NrExpiry1KPIObj=NrExpiry1Index>=0?KPIFields[NrExpiry1Index]:{}; + let NrExpiry1Enable=NrExpiry1Index>=0?NrExpiry1KPIObj['KPIFieldEnable']:false; + let NrExpiry1_Dis_Name=NrExpiry1Index>=0?NrExpiry1KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry2Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry2') + let NrExpiry2KPIObj=NrExpiry2Index>=0?KPIFields[NrExpiry2Index]:{}; + let NrExpiry2Enable=NrExpiry2Index>=0?NrExpiry2KPIObj['KPIFieldEnable']:false; + let NrExpiry2_Dis_Name=NrExpiry2Index>=0?NrExpiry2KPIObj['KPIFieldDisplayName']:''; + + let NrExpiry3Index=KPIFields.findIndex(i=>i.KPIFieldName=='NrExpiry3') + let NrExpiry3KPIObj=NrExpiry1Index>=0?KPIFields[NrExpiry3Index]:{}; + let NrExpiry3Enable=NrExpiry1Index>=0?NrExpiry3KPIObj['KPIFieldEnable']:false; + let NrExpiry3_Dis_Name=NrExpiry1Index>=0?NrExpiry3KPIObj['KPIFieldDisplayName']:''; + + let MSLIndex=KPIFields.findIndex(i=>i.KPIFieldName=='MSL'); + let MSLObj=MSLIndex>=0?KPIFields[MSLIndex]:{}; + let isMSLAllow=MSLIndex>=0?MSLObj['KPIFieldEnable']:true; + + let NONMSL_Index=KPIFields.findIndex(i=>i.KPIFieldName=='ChildImageAllow'); + let NONMSL_Obj=NONMSL_Index>=0?KPIFields[NONMSL_Index]:{}; + let isNONMSL_Allow=NONMSL_Index>=0?NONMSL_Obj['KPIFieldEnable']:true; + + + + // isMandatory=true; + + + return ( + + { + const cat=item; + const cindex=catImages.findIndex(i=>i.CategoryId==item.CategoryId); + const cimgName=cindex>=0?(catImages[cindex]?catImages[cindex].ImageName:''):''; + const cimgPath=cindex>=0?(catImages[cindex]?catImages[cindex].ImagePath:''):''; + const showIMg=cimgPath!='' && cimgPath!=null; + + console.log('brand render:',item.brandList.length); + + let isCollapsed=cat.isCollapsed!=null?item.isCollapsed:false; + + // let isHdrImgDis_Name=isHdrImgIndex>=0?isHdrImgKPIObj['KPIFieldDisplayName']:''; + return( + + + {toggleCollapse(cat,index)}}> + + {item.CategoryName} + + {isCollapsed==true && } + {isCollapsed==false && } + + {( !isCollapsed && isHdrImgEnable==true) && + + + { !showIMg && + {openCamera(item)}}> + + + } + { showIMg && + + + {openCamera(item)}}> + + + + } + } + + { !isCollapsed && + item.brandList!=null && item.brandList.length>0 && + item.brandList.map((brand,brand_index)=>{ + let isBrandCollapsed=brand.isBrandCollapsed!=null?brand.isBrandCollapsed:false; + console.log('brand render:',brand.BrandName,', cat:',item.CategoryName); + + return ( + + {toggleCollapse2(cat,index,brand,brand_index)}}> + + {brand.BrandName} + + {isBrandCollapsed==true && } + {isBrandCollapsed==false && } + + + + { !isBrandCollapsed && + + { return skuIndex;}} + renderItem={({item,index})=>{ + + const skus=item; + const sku_index=index; + let thisCatSkuData_i=SKUStockData.findIndex(i=>i.CategoryId==cat.CategoryId && i.ProductId==skus.ProductId); + let thisCatSkuData=thisCatSkuData_i>=0?(SKUStockData[thisCatSkuData_i] || {}):{}; + let stock=thisCatSkuData.Stock!=null?thisCatSkuData.Stock:''; + let br_stock=thisCatSkuData.BackRoomStock!=null?thisCatSkuData.BackRoomStock:''; + let Old_Stock=thisCatSkuData.Old_Stock!=null?thisCatSkuData.Old_Stock:''; + let OldDamagedStock=thisCatSkuData.OldDamagedStock!=null?thisCatSkuData.OldDamagedStock:''; + let OldLostStock=thisCatSkuData.OldLostStock!=null?thisCatSkuData.OldLostStock:''; + let OldExStock=thisCatSkuData.OldExStock!=null?thisCatSkuData.OldExStock:''; + let isSKUPresent=thisCatSkuData.isSKUPresent!=null?thisCatSkuData.isSKUPresent:0; + let showAllSKU_Fields=thisCatSkuData.showAllSKU_Fields!=null?thisCatSkuData.showAllSKU_Fields:false; + + let ex_stock=thisCatSkuData.ExpiryStock!=null?thisCatSkuData.ExpiryStock:''; + let damage_stock=thisCatSkuData.DamagedStock!=null?thisCatSkuData.DamagedStock:''; + let lost_stock=thisCatSkuData.LostStock!=null?thisCatSkuData.LostStock:''; + let mfdStocks=thisCatSkuData.mfdStocks || []; + + let NearExpiry_stock1=thisCatSkuData.NearExpiry1!=null?thisCatSkuData.NearExpiry1:''; + let NearExpiry_stock2=thisCatSkuData.NearExpiry2!=null?thisCatSkuData.NearExpiry2:''; + let NearExpiry_stock3=thisCatSkuData.NearExpiry3!=null?thisCatSkuData.NearExpiry3:''; + + let isMandatory=((isMSLAllow==1 || isMSLAllow=='true') && (skus.MSL==1 || skus.MSL=='true') ) || ((isNONMSL_Allow==1 || isNONMSL_Allow=='true') && (skus.MSL!=1 && skus.MSL!='true') ) + + // console.log('skus.MSL:',skus.MSL); + + return( + + {isListedSKUEnable==true && + + + {console.log('valchange:',val); let val1=(val==true)?1:0; onStockValChange(cat,skus,val1,'isSKUPresent','') }} + style={[customStyle.openStkP_checkbox,(Platform.OS=='ios'?{height:20,width:20,marginTop:8,marginLeft:8,}:{})]} + + tintColors={{ true:PageTheme.$primary_color, false:PageTheme.$text_color_light }} + /> + + {skus.ProductName} + + } + + {isListedSKUEnable!=true && {skus.ProductName}} + {((isListedSKUEnable==true && showAllSKU_Fields==true) || isListedSKUEnable==false) && + + {(isStockEnable==true) && + + + {isStockDis_Name} + { onStockValChange(cat,skus,val,'Stock','numeric')}} + autoComplete='off' + // onEndEditing={(e)=>{ checkStockVal(cat,skus,'Stock','Old_Stock',Old_Stock)}} + /> + + + } + {(isBRStockEnable==true) && + + + {isBRStockDis_Name} + { onStockValChange(cat,skus,val,'BackRoomStock','numeric')}} + autoComplete='off' + // onEndEditing={(e)=>{ checkStockVal(cat,skus,'Stock','Old_Stock',Old_Stock)}} + /> + + + } + {(isDStockEnable==true) && + + + {isDStockDis_Name} + { onStockValChange(cat,skus,val,'DamagedStock','numeric')}} + autoComplete='off' + // onEndEditing={(e)=>{ checkStockVal(cat,skus,'DamagedStock','OldDamagedStock',OldDamagedStock)}} + /> + + + } + {(isLStockEnable==true) && + + + {isLStockDis_Name} + { onStockValChange(cat,skus,val,'LostStock','numeric')}} + autoComplete='off' + // onEndEditing={(e)=>{ checkStockVal(cat,skus,'LostStock','OldLostStock',OldLostStock)}} + /> + + + } + {(isExStockEnable==true ) && + // && !isMFDEnable + + + {isExStockDis_Name} + { onStockValChange(cat,skus,val,'ExpiryStock','numeric')}} + autoComplete='off' + // onEndEditing={(e)=>{ checkStockVal(cat,skus,'ExpiryStock','OldExStock',OldExStock)}} + /> + + + } + + {(NrExpiry1Enable==true ) && + + + {NrExpiry1_Dis_Name} + { onStockValChange(cat,skus,val,'NearExpiry1','numeric')}} + autoComplete='off' + /> + + + } + {(NrExpiry2Enable==true ) && + + + {NrExpiry2_Dis_Name} + { onStockValChange(cat,skus,val,'NearExpiry2','numeric')}} + autoComplete='off' + /> + + + } + {(NrExpiry3Enable==true ) && + + + {NrExpiry3_Dis_Name} + { onStockValChange(cat,skus,val,'NearExpiry3','numeric')}} + autoComplete='off' + /> + + + } + {(isMFDEnable==true) && + + {isMFDDis_Name} + {openAddStkModal(cat,skus)}}> + {ST.Add} + + + + {ST.Date} + + + {ST.Stock} + + + {ST.LotNo} + + + {ST.Actions} + + + + + { + mfdStocks.map((mfd_Item,mfd_index)=>{ + let mfd=mfd_Item.mfd || ''; + let stock=mfd_Item.stock || ''; + let lotno=mfd_Item.lotno || ''; + + return( + + + {mfd} + + + {stock} + + + {lotno} + + + {showRemoveConfirm(cat,skus,mfd_Item,mfd_index)}}> + + + + + ) + }) + } + + + } + + } + + ) + }}/> + } + + + ) + }) + } + + + ); + }} + /> + + ) + } + + + + + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showRemoveConfirm_M,()=>{setShowRemoveConfirm_M(false)},removeMFDStock,ST.Doyoureallywanttoremovethisstock)} + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {rerendermodal==rerendermodal && _render_StockModal()} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + + {setSearchedItem(val); FilterStores(val)}} + autoComplete='off' + /> + {FilterStores(searchedItem)}}> + + + + { Object.keys(storeData).length>0 && + _renderStocks() + } + + + {submitOpeningStock()}}/> + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(Stock); \ No newline at end of file diff --git a/src/screens/StoreDailyMenu.js b/src/screens/StoreDailyMenu.js new file mode 100644 index 0000000..6052c92 --- /dev/null +++ b/src/screens/StoreDailyMenu.js @@ -0,0 +1,416 @@ +import React,{useState,useEffect, useRef} from 'react'; +import Container from '../components/container'; +import { useIsFocused, useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import {checkFilledSurveys, getAvailblQuery, getIfAvlbl, getIfKPIDone, getQuery, Q_GetAvailabityDefaultData, Q_getCategoryforAdditional, Q_getdefaltShareofSelf, Q_getpaidvisibility, Q_getpromotionmappingList, Q_getSamplingData, Q_getSurveys, Q_MenuList} from '../constants/ConstantQueries'; + +import grey_bg_image from '../assets/performics/circle_grey.svg'; +import { SvgXml } from 'react-native-svg'; + +function StoreDailyMenu(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [StoreIntro, setStoreIntro] = useState(false); + const [StorePhotosDone, setStorePhotosDone] = useState(false); + const [StoreSKUPhotosDone, setStoreSKUPhotosDone] = useState(false); + const [StoreSKUActPhotosDone, setStoreSKUActPhotosDone] = useState(false); + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [dailyMenu, setDailyMenu] = useState([]); + const [refreshMenuStatus, setRefreshMenuStatus] = useState(false); + const [checkAvailable, setcheckAvailable] = useState(false); + const [refreshMenuRender, setRefreshMenuRender] = useState(0); + const [isLoaded, setIsLoaded] = useState(false); + const [EmpData, setEmpData] = useState([]); + const [isNPNDScreen, setisNPNDScreen] = useState(false); + + const isNPNDRef=useRef(isNPNDScreen) + + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let isAdhoc=params.isAdhoc!=null?params.isAdhoc:false; + let empData1=params.empData || {}; + let isNPND=params.isNPND!=null?params.isNPND:false; + + isNPNDRef.current=isNPND + setisNPNDScreen(isNPND); + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setEmpData(empData1); + + getDailyMenu(storeData1,false,isAdhoc,isNPND); + const willFocusSubscription = props.navigation.addListener('focus', () => { + console.log('storedailymenu onfocus'); + getDailyMenu(storeData1,false,isAdhoc,isNPNDRef.current); + }); + + return willFocusSubscription; + }, []); + + // useEffect(() => { + // if(refreshMenuStatus==true){ + // updateStatus(); + // } + // }, [refreshMenuStatus]); + + // useEffect(() => { + // if(checkAvailable==true){ + // checkAvailability(); + // } + // }, [checkAvailable]); + + useEffect(() => { + console.log('AutoGoToPrev dailmenu onchange',props.AutoGoToPrev); + if(props.AutoGoToPrev==true){ + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + getDailyMenu(storeData1,true,isAdhocScreen,isNPNDRef.current); + } + }, [props.AutoGoToPrev]); + + + const isFocused = useIsFocused(); + const [prevRoute , setprevRoute] = useState('') + + useEffect(()=> { + const routes = props?.navigation?.getState()?.routes; + const prevRoute = routes?.[routes.length - 2]; + console.log("prevRoute?.name",prevRoute?.name) + setprevRoute(prevRoute?.name); + // if (prevRoute?.name === 'SearchStoreList') { + // props?.navigation.replace('StoreList'); + // } else { + // props?.navigation.goBack(); + // } + },[isFocused]) + + + async function getDailyMenu(storeData1,isAutoBack=false,isAdhoc=false,isNPND=false){ + console.log("getDailyMenu called") + setProcessing(true); + try { + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let {StoreId,ChannelId,RegionId,StoreTypeId}=storeData1; + await db.transaction(async function (txn) { + + let q=Q_MenuList(storeData1,isAdhoc,isNPND); + console.log('KEYYYYYYYYYYYYYYYYq',q) + await txn.executeSql(q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + let allDone=true; + for(var i=0;i { + + // props.navigation.goBack(); + if (prevRoute == 'SearchStoreList') { + props?.navigation.replace('StoreList'); + } else { + props?.navigation.goBack(); + } + },3000); + } + } + } + } + else{ + setProcessing(false); + } + },function (txn2, txnerr) { console.log(txnerr); setProcessing(false);},); + + }); + } catch (err) { + console.log(err); + } + } + + async function checkAvailability(storeData1,data){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q2=getAvailblQuery(data.ScreenName,storeData1,data); + + if(data.ScreenName=='POSM'){ + console.log('POSM query:',q2); + } + if(q2!='' && q2!=null){ + await txn.executeSql(q2,[],async function (txn2, txnres2) { + if(data.ScreenName=='POSM'){ + console.log('POSM count:',txnres2.rows.length); + for(var n=0;n{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + } + + async function updateStatus(storeData1,data,isAvlbl){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q2=getQuery(data.ScreenName,storeData1,data); + console.log('in store daily menu',data.ScreenName) + if(q2!='' && q2!=null && ( isAvlbl==true || isAvlbl.isAvlbl==true)){ + await txn.executeSql(q2,[],async function (txn2, txnres2) { + + console.log(q2, "Query update status of KPI done") + let isDone=await getIfKPIDone(data.ScreenName,txnres2,storeData1,isAvlbl,data); + + console.log(isDone , "---update status of KPI done") + + resolve(isDone); + },function (txn2, txnerr) { console.log(txnerr); resolve(false);},); + } + else{ + resolve(false); + } + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + + } + + async function gotoKPITaskScreen(item){ + + console.log(item, "item.ScreenName") + + switch(item.ScreenName){ + case 'STOREAUDIT':{ + gotoPage('SurveyList',item); + } + return; + case 'STOREPHOTO':{ + gotoPage('StoreImages',item); + } + return; + // case 'COMPETITIONSKU':{ + // gotoPage('CompetitionVisibility',item); + // } + // return; + // case 'COMPETITIONACT':{ + // gotoPage('CompetitionPromotion',item); + // } + // return; + case 'COMPVISI':{ + gotoPage('CompetitionVisibility',item); + } + return; + case 'COMPPROMO':{ + gotoPage('CompetitionPromotion',item); + } + return; + case 'VISIBILITYAUDIT':{ + gotoPage('VisibilityAuditList',item); + } + return; + case 'POSSALE':{ + gotoPage('POSSale',item); + } + return; + default:return; + } + } + + function gotoPage(screenname='',item){ + props.set_autoback({'AutoGoToPrev':false}); + props.navigation.navigate(screenname,{storeData:storeData,empData:EmpData,menu:item,'isAdhoc':isAdhocScreen,'isNPND':isNPNDScreen}) + } + + + function _renderLeftMenuItem(index,RowContent){ + return( + + {RowContent[0]} + + ) + } + + + function _renderRightMenuItem(item,index,RowContent){ + return( + + {RowContent[0]} + {_renderMenuItem(item,index)} + + ) + + } + + function _renderMenuItem(item,index){ + let newi=index>2?((index%3)):index; + let firstitem=(index%2==0)?true:false; + let arr=colors_Arr[newi]?colors_Arr[newi].bg:colors_Arr["0"].bg; + let unavlbl_bg=['#bfbfbf','#bfbfbf']; + let arr_new=item.isAvlbl==false?unavlbl_bg:arr; + let iconColor=colors_Arr[newi]?colors_Arr[newi].color:colors_Arr["0"].color; + const imgPath=item.MenuPath+(item.isAvlbl==false?item.GreyIcon:item.NormalIcon); + + let m_bgimage=colors_Arr[newi]?colors_Arr[newi].bgImage:colors_Arr["0"].bgImage; + m_bgimage=item.isAvlbl==false?grey_bg_image:m_bgimage; + + return( + {if(item.isAvlbl!=false){gotoKPITaskScreen(item)}}}> + + + + + + + + {(imgPath!=null && imgPath!='') && } + + + {item.MenuName} + {item.isKPI_Done==true && + + } + + + ) + } + + + function _renderDailyMenu(){ + var RowContent=[]; + return( + + + {refreshMenuRender==refreshMenuRender && dailyMenu.length>0 && + dailyMenu.map((item,index)=>{ + let firstitem=(index%2==0)?true:false; + + if(firstitem){ + var content=_renderMenuItem(item,index); + RowContent=[content]; + if(index==dailyMenu.length-1){ + return _renderLeftMenuItem(index,RowContent); + } + } + else{ + return _renderRightMenuItem(item,index,RowContent); + } + + }) + } + + + + ); + } + + return ( + + {processing && } + + + + { Object.keys(storeData).length>0 && + + + + + + + + {storeData.StoreName} + + {storeData.StoreType} + + + + + + + {ST.StoreId+':'} + {storeData.StoreId} + + + {ST.StoreCode+':'} + {storeData.StoreCode} + + + + + + + {isLoaded==true && _renderDailyMenu()} + + } + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(StoreDailyMenu); \ No newline at end of file diff --git a/src/screens/StoreDailyMenuCat.js b/src/screens/StoreDailyMenuCat.js new file mode 100644 index 0000000..5a12298 --- /dev/null +++ b/src/screens/StoreDailyMenuCat.js @@ -0,0 +1,221 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import {checkFilledSurveys, getAvailblQuery, getIfAvlbl, getIfKPIDone, getQuery, Q_GetAvailabityDefaultData, Q_getCategoryforAdditional, Q_getdefaltShareofSelf, Q_getpaidvisibility, Q_getpromotionmappingList, Q_getSamplingData, Q_getSurveys} from '../constants/ConstantQueries'; + +import grey_bg_image from '../assets/performics/circle_grey.svg'; +import { SvgXml } from 'react-native-svg'; +import CheckBox from '@react-native-community/checkbox'; + +function StoreDailyMenuCat(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [StoreCategories, setStoreCategories] = useState([]); + + const [refreshMenuRender, setRefreshMenuRender] = useState(0); + + + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + + getStoreCategories(storeData1); + const willFocusSubscription = props.navigation.addListener('focus', () => { + getStoreCategories(storeData1); + }); + + return willFocusSubscription; + }, []); + + + + // useEffect(() => { + // console.log('AutoGoToPrev dailmenu onchange',props.AutoGoToPrev); + // if(props.AutoGoToPrev==true){ + // let params=props.route.params? props.route.params:{}; + // let storeData1=params.storeData || {}; + // getDailyMenu(storeData1,true); + // } + // }, [props.AutoGoToPrev]); + + + async function getStoreCategories(storeData1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + await db.transaction(async function (txn) { + + let join=' INNER join Product_Master p on c.CategoryId=p.CategoryId '; + let join2=' INNER join Mapping_ProductAssortment mp on p.ProductId=mp.ProductId '; + let q=`SELECT DISTINCT c.CategoryId,c.CategoryName from Master_Category c ${join} ${join2} where mp.StateId='${StateId}' and mp.ChainId='${ChainId}' and mp.StoreTypeId='${StoreTypeId}' order by p.CategorySequence`; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('cats len:',txnres2.rows.length) + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + db.transaction(async function (txn) { + let seletlist=`STOCK_UID,PRODUCT as ProductName,PRODUCT_ID as ProductId,BRAND as BrandName,BRAND_ID as BrandId,SUB_CATEGORY as SubCategoryName,SUB_CATEGORY_ID as SubCategoryId,MSL,STOCK,BACKROOM_STOCK,DAMAGED_STOCK,LOST_STOCK,EXPIRY_STOCK,IS_SKU_STOCK_PRESENT,NREXPIRY1_STOCK,NREXPIRY2_STOCK,NREXPIRY3_STOCK`; + let sku_q=`SELECT ${seletlist} FROM ${AppTables.STOCKWITHCAT_DATA} WHERE STORE_ID='${StoreId}' and CATEGORY_ID='${cat.CategoryId}' `; + await txn.executeSql(sku_q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + resolve(true); + }else{ + resolve(false); + } + },function (txn2, txnerr) { console.log(txnerr);resolve(false); },); + + }); + }).catch((err)=>{ + console.log(err); + return false; + }) + } + + + function gotoPage(item){ + props.set_autoback({'AutoGoToPrev':false}); + props.navigation.navigate('StoreDailyMenu',{'storeData':storeData,'isAdhoc':isAdhocScreen,'category':item,'CategoryWiseMenu':true}); + } + + async function setCatSelected(item,index,val){ + let allData=StoreCategories; + let data=allData[index]!=null?allData[index]:{}; + data['isCatPresent']=val; + setStoreCategories(allData); + setRefreshMenuRender(!refreshMenuRender); + } + + + + + function _renderCats(){ + + return( + + + {refreshMenuRender==refreshMenuRender && StoreCategories.length>0 && + StoreCategories.map((item,index)=>{ + let isCatPresent=item.isCatPresent!=null?item.isCatPresent:false; + return ( + {gotoPage(item);}}> + + {console.log('valchange:',val); let val1=(val==true)?1:0; setCatSelected(item,index,val1); }} + style={[customStyle.catDMenuI_CheckBox,(Platform.OS=='ios'?{height:20,width:20,marginTop:8,marginLeft:8,}:{})]} + tintColors={{ true:PageTheme.$primary_color, false:PageTheme.$text_color_light }} + /> + + {item.CategoryName} + + ) + }) + } + + + + ); + } + + return ( + + {processing && } + + + + { Object.keys(storeData).length>0 && + + + + + + + + {storeData.StoreName} + + + + + + Store Id: + {storeData.StoreId} + + + Store Code: + {storeData.StoreCode} + + + + + + + {_renderCats()} + + } + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(StoreDailyMenuCat); \ No newline at end of file diff --git a/src/screens/StoreImages.js b/src/screens/StoreImages.js new file mode 100644 index 0000000..847a486 --- /dev/null +++ b/src/screens/StoreImages.js @@ -0,0 +1,193 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert,BackHandler, Animated} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; + + +function StoreImages(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [ImageTypes, setImageTypes] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [EmpData, setEmpData] = useState([]); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + let empData1=params.empData || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setEmpData(empData1); + setCurrentMenu(menu1); + + getData(storeData1,menu1); + props.navigation.addListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('focus', () => { + getData(storeData1,menu1); + }); + + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.removeListener('focus', () => { + console.log('storedailymenu onfocus'); + getData(storeData1,menu1); + }); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + function onBeforeRemove(e){ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + function onRemoveScreen(e){ + {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} + + // Alert.alert( + // "", + // ST.Doyoureallywanttoexitthescreen, + // [ + // { + // text: ST.Cancel, + // onPress: () => {}, + // style: "cancel" + // }, + // { text: ST.OK, onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + // ] + // ); + } + + + async function getData(storeData1,menu1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + await db.transaction(async function (txn) { + let q=`Select * From Sup_ImageType`; + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + let {StoreId}=storeData1; + db.transaction(async function (txn) { + + let q=`Select count(*) as ImageCount From ${AppTables.STORE_IMAGES} where STORE_ID='${StoreId}' and EMP_ID='${storeData1.MerchandiserId}' and VISIT_DATE='${d2}' and IMAGE_TYPE_ID='${imageType.ImageTypeId}'`; + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let data =txnres2.rows.item(0); + let count=data.ImageCount; + + resolve(count); + } + else{ + resolve(0); + } + },function (txn2, txnerr) { console.log(txnerr);resolve(0); },); + + }); + }).catch((err)=>{ + console.log(err); + return 0; + }) + } + + + return ( + + {processing && } + + + + + {ST.ImageTypes} + + { Object.keys(storeData).length>0 && + { + let ImageCount=item.ImageCount!=null?item.ImageCount:0; + return( + {props.navigation.navigate('StoreImagesCap',{storeData:storeData,'empData':EmpData,menu:currentMenu,'isAdhoc':isAdhocScreen,imageType:item})}}> + {item.ImageType} + {ImageCount>0 && + + {ImageCount} + + } + + ); + }} + /> + } + + + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(StoreImages); \ No newline at end of file diff --git a/src/screens/StoreImagesCap.js b/src/screens/StoreImagesCap.js new file mode 100644 index 0000000..d2cc9a2 --- /dev/null +++ b/src/screens/StoreImagesCap.js @@ -0,0 +1,612 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert,BackHandler, Animated} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,marktext1,marktext2, validateNumber} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, FontAwesome, Ionicons, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; + +import cameraImg from '../assets/performics/add_image.svg' +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility } from '../constants/ConstantQueries'; +import { CustomPicker, CustomPicker2 } from '../components/CustomPicker'; +import { ConfirmSaveAlert, ExitScreenAlert } from '../components/alert'; +import CustomCamera from '../components/Camera'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import { getKPIFields } from '../controller/functions'; + +function StoreImagesCap(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [ImageType, setImageType] = useState({}); + const [AllImagesData, setAllImagesData] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + + + const [showAlert, setShowAlert] = useState(false); + const [showRemoveAlert, setShowRemoveAlert] = useState(false); + const [toRemoveIndex, setToRemoveIndex] = useState(0); + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [EmpData, setEmpData] = useState([]); + const [MenuConfig, setMenuConfig] = useState([]); + // const [KPIFields, setKPIFields] = useState([]); + const zoomView=useRef(null); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + let imageType=params.imageType || {}; + let empData1=params.empData || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setEmpData(empData1); + setCurrentMenu(menu1); + setImageType(imageType); + + getData(storeData1,menu1,imageType); + getKPIFieldsmenu(menu1); + + + + // let t={"Uploadxml":"4521testpromo06/27/2022U"} + + // console.log(JSON.stringify(t)); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + async function getKPIFieldsmenu(menu1){ + + let menuconfig = await getKPIFields(menu1); + setMenuConfig(menuconfig) + console.log('menuconfig',menuconfig) + } + + + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + + + + function onRemoveScreen(e){ + {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} + // Alert.alert( + // "", + // ST.Doyoureallywanttoexitthescreen, + // [ + // { + // text: ST.Cancel, + // onPress: () => {}, + // style: "cancel" + // }, + // { text: ST.OK, onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + // ] + // ); + } + + + async function getData(storeData1,menu1,imageType){ + try { + let {StoreId,ChainId,StateId,StoreTypeId,MerchandiserId}=storeData1; + + + await db.transaction(async function (txn) { + + + let q=`Select * From ${AppTables.STORE_IMAGES} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' and VISIT_DATE='${d2}' and IMAGE_TYPE_ID='${imageType.ImageTypeId}'`; + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('dataq',q) + console.log('txn2',txnres2.rows.length) + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+(props.UserId || '')+'_'+imageTypeId+'Img-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + // console.log('remarkdata',remarkdata) + + + let allData=AllImagesData; + let imgData={} + let image_key='ImageName'; + let image_path_key='ImagePath'; + imgData[image_key]=filename; + + // renamefile + let imagePath='file://'+common_ImagePath+filename; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri=imagePath; + // imgData=remarkdata; + console.log('image marker',uri); + imgData[image_path_key]=uri; + // imgData=remarkdata; + allData.push(imgData); + console.log('alldata',allData) + setAllImagesData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + }) + .catch(err => { + console.log('ERROR: image file write fail ed!!!'); + console.log(err.message, err.code); + }); + + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(){ + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function removeImage(){ + let index=toRemoveIndex; + let allData=AllImagesData; + let imgData=allData[index]; + let imgPath=imgData.ImagePath || ''; + if(imgPath!=''){ + let imgPath1='file://'+imgPath; + RNFS.unlink(imgPath1); + } + allData.splice(index,1); + setAllImagesData(allData); + setShowRemoveAlert(false); + setrerenderdata(!rerenderdata); + } + + async function onRemoveImage(imgName,index){ + setToRemoveIndex(index); + setShowRemoveAlert(true); + } + + async function submit(){ + let isvalid=await validate(); + console.log('isvalid:',isvalid); + if(isvalid){ + setShowAlert(true); + } + } + + async function validate() + { + var isValid=true; + let isBRStockMandIndex=MenuConfig.findIndex(i=>i.KPIFieldName=='ShowRemark') + let isBRStockMandKPIObj=isBRStockMandIndex>=0?MenuConfig[isBRStockMandIndex]:{}; + let isRemarkEnable=isBRStockMandIndex>=0?isBRStockMandKPIObj['KPIFieldEnable']:false; + let isRemarkEnableMand=isBRStockMandIndex>=0?isBRStockMandKPIObj['KPIMandatory']:false; + + let isRemarkDisName=isRemarkEnable>=0?isBRStockMandKPIObj['KPIFieldDisplayName']:''; + + + + if(AllImagesData.length<=0){ + notify('Please click atleast one image!'); + console.log('error found'); + isValid=false; + + } + else if(AllImagesData.length>0){ + for(var i=0;i{ + let Remark=item.remark; + console.log('remarkvalid',Remark) + console.log('Validate isRemarkEnableMand:',isRemarkEnable,isRemarkEnableMand,(Remark==null || Remark==undefined || Remark=='undefined' || Remark=='')); + if(isRemarkEnable && isRemarkEnableMand && (Remark==null || Remark==undefined || Remark=='undefined' || Remark=='') ){ + notify('Please enter ' + isRemarkDisName+ '!'); + console.log('error found'); + isValid=false; + } + } + + )} + } + + return isValid; + } + + // function onFormDataChange(val,key,type=''){ + + // let data=AllImagesData; + // data[key]=val; + // setAllImagesData(data); + // setHasUnsavedChanges(true); + // setrerenderdata(!rerenderdata); + // } + + + function onTextChange(key, val,type='',index){ + console.log("onTextChange AllImagesData:",AllImagesData,index) + if(val!=''){ + let isValid=validateNumber(val,type); + if(!isValid){ + return; + } + } + + if(index!=null && index>=0) { + let data=AllImagesData; + console.log('',AllImagesData) + let obj = data[index]; + obj[key]=val; + data[index]=obj; + console.log('onTextChangeData',data) + + + setAllImagesData(data); + setrerenderdata(!rerenderdata); + setHasUnsavedChanges(true); + } + + + } + + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData+'...'); + setProcessing(true); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + let imgType=ImageType.ImageType; + let imgTypeId=ImageType.ImageTypeId; + + await db.transaction(async function (txn) { + + let q=`DELETE FROM ${AppTables.STORE_IMAGES} where STORE_ID='${StoreId}' and EMP_ID='${storeData.MerchandiserId}' and VISIT_DATE='${d2}' and IMAGE_TYPE_ID='${ImageType.ImageTypeId}' `; + // remove old data + + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('Images data deleted'); + let values=''; + if(AllImagesData.length>0){ + for(var i=0;i{ + // console.log('response',response); + if(response.status === 404) {}else { return response.json()} + + }).then((response)=>{ + console.log(response); + + }).catch((error)=>{ + console.log('error:',error); + }) + + + } + + async function showImage(item,index){ + let ImagePath=item.ImagePath; + let imgObj={imgIndex:1,url: ImagePath, props: {}} + let arr=[imgObj]; + setZoomImageUrl(arr); + setShow_zoomImage(true); + } + + function _renderHeader(currentIndex){ + return( + + {/*,borderWidth:1,borderColor:'#fff',position:'absolute',top:0,zIndex:1 */} + {/* {`${(currentIndex+1)}/${zoomImageUrl.length}`} */} + {setShow_zoomImage(false) }}> + + + + ) + } + + + function _renderImages(){ + let isBRStockMandIndex=MenuConfig.findIndex(i=>i.KPIFieldName=='ShowRemark') + console.log('isBRStockMandIndex',isBRStockMandIndex) + let isBRStockMandKPIObj=isBRStockMandIndex>=0?MenuConfig[isBRStockMandIndex]:{}; + let isBRStockMandEnable=isBRStockMandIndex>=0?isBRStockMandKPIObj['KPIFieldEnable']:false; + console.log('isBRStockMandEnable',isBRStockMandEnable) + let ShowMBQLabelDisName=isBRStockMandEnable>=0?isBRStockMandKPIObj['KPIFieldDisplayName']:''; + + + return( + + {AllImagesData.length>0 && + AllImagesData.map((item,index)=>{ + console.log('renderitem',item) + let ImagePath=item.ImagePath; + let ImageName=item.ImageName; + let Remark=item.remark; + console.log('remarkView',Remark) + if(ImagePath!=null && ImagePath!=''){ + return ( + + {showImage(item,index)}}> + + {onRemoveImage(ImageName,index)}}> + + + + { + isBRStockMandEnable == true && + + {/* {ShowMBQLabelDisName} */} + {onTextChange('remark',val,'text',index)}} + autoComplete='off' + /> + + } + + ) + } + else + { + return null + } + + }) + } + + ) + } + + return ( + + + + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {ConfirmSaveAlert(props,showRemoveAlert,onRemoveCancel,removeImage,ST.DoyoureallywanttoremovethisImage)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + {(ImageType.ImageType!=null?`${ST.Add} ${ImageType.ImageType}`:'')} + + + {/* + {sendEmail()}}/> + */} + + + + + + {openCamera()}}> + + + + + + + {_renderImages()} + + + + {submit()}}/> + + + + + {show_zoomImage && + + null} + /> + + } + + ); +} + +export default connect(mapStateToProps, mapDispatchToProps)(StoreImagesCap); \ No newline at end of file diff --git a/src/screens/StoreList.js b/src/screens/StoreList.js new file mode 100644 index 0000000..d452df4 --- /dev/null +++ b/src/screens/StoreList.js @@ -0,0 +1,2182 @@ +import React, { useState, useEffect, useCallback, useRef } from 'react'; +import Container from '../components/container'; +import { useRoute, useFocusEffect } from '@react-navigation/native'; +import { customStyles, GetPageTheme } from "../styles/Global"; +import { Image, TextInput, View, Text, ScrollView, TouchableOpacity, Platform, FlatList } from 'react-native'; +import { connect } from 'react-redux'; +import { mapStateToProps, mapDispatchToProps } from '../reducers/contextProvider'; +import { notify } from '../components/notify'; +import moment from 'moment'; +import { checkRange, UploadData2, UpdateStoreStatus, getKPIS, marktext1, marktext2, UploadFormData, getDownloadJson1, fetchProjectConfig } from '../controller/functions'; +import { get_item } from '../components/localStorage'; +import { db, AppVersion } from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import { AntDesign, Feather, MaterialCommunityIcons } from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import NoDataComponent from '../components/NoDataComponent'; +import { SvgXml } from 'react-native-svg'; +import CustomModal from '../components/CustomModal'; +import { AppTables } from '../constants/tableConstants'; +import { _checkLocationPermission } from '../components/geolocation'; +import Geolocation from 'react-native-geolocation-service'; +import { getAvailblQuery, getIfAvlbl, getIfKPIDone, getQuery, Q_MenuList } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; +import { uploadAllData, uploadAllImages, uploadStoreStatus } from '../constants/uploadData'; +import * as RNFS from 'react-native-fs'; + +import CameraImg2 from '../assets/performics/camera_icon.svg'; +import CustomCamera from '../components/Camera'; +import StoreItem from '../components/StoreItem'; + + +function StoreList(props) { + console.log("propss:",props) + + const route = useRoute(); + const ST = props.StaticText || {}; + + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const [loaderTitle, setLoaderTitle] = useState(); + const [processing, setProcessing] = useState((props.isDataDownloaded ? true : false)); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [isNPNDScreen, setisNPNDScreen] = useState(false); + + const isNPNDRef = useRef(isNPNDScreen); + const isAdhocRef = useRef(isAdhocScreen); + + const [nodataFound, setNodataFound] = useState(false); + const [showStoreVisitModal, setShowStoreVisitModal] = useState(false); + const [showGeoTagModal, setShowGeoTagModal] = useState(false); + const [showDistanceModal, setShowDistanceModal] = useState(false); + const [currentStore, setCurrentStore] = useState({}); + const [storeDistance, setStoreDistance] = useState('0 M'); + const [storeDistanceinM, setStoreDistanceinM] = useState(0); + const [showAlert, setShowAlert] = useState(false); + const [checkOutStore, setCheckOutStore] = useState({}); + const [rerenderdata, setrerenderdata] = useState(false); + let [state, setState] = useState({ storeList: [] }); + const [globalStorelist, setGlobalStorelist] = useState([]); + const [cancelCheckOutStore, setCancelCheckOutStore] = useState({}); + const [showCancelCIModal, setShowCancelCIModal] = useState(false); + const [searchedItem, setSearchedItem] = useState(''); + const [CheckOutImage, setCheckOutImage] = useState(''); + const [CheckOutImagePath, setCheckOutImagePath] = useState(''); + const [CheckOutImageModal, setCheckOutImageModal] = useState(false); + const [CheckOutLoc, setCheckOutLoc] = useState({}); + const [showImageSaveOp, setShowImageSaveOp] = useState(true); + const [showCamera, setShowCamera] = useState(false); + const showCameraRef = useRef(false); + const [GeoFenceEnable_Checkout, setGeoFenceEnable_Checkout] = useState(false); + const [GeoFenceRadius_Checkout, setGeoFenceRadius_Checkout] = useState(''); + const [showSearchWiseStore, setShowSearchWiseStore] = useState(false); + const [showStoreSearchLabel, setShowStoreSearchLabel] = useState(''); + + const [EmpData, setEmpData] = useState([]); + const [storeData, setStoreData] = useState([]); + const [isAsyncDone, setIsAsyncDone] = useState(false); + const [desig, setDesig] = useState(''); + const [storewisePjp, setStorewisePjp] = useState(''); + const [showsearchwise_dummy, setShowSearchWise_Dummy] = useState(false) + + + // useEffect(() => { + // // let ShowStoreSearch = props?.ShowStoreSearch ?? false; + // // setShowSearchWise_Dummy(ShowStoreSearch); + + // const params = props.route.params || {}; + // const empData1 = params.empData || {}; + + // fetchProjectConfig(props.ManagerAppConfig) + // .then(storewisePjp => { + // setStorewisePjp(storewisePjp); + // console.log('storewisePjpTop>>:', storewisePjp); + // }); + + // DownloadMappingSurvey(empData1, storewisePjp.StorewisePJP); + // }, []); + + useEffect(() => { + const params = props.route.params || {}; + const empData1 = params.empData || {}; + + fetchProjectConfig(props.ManagerAppConfig) + .then(storewisePjp => { + setStorewisePjp(storewisePjp); + + console.log('storewisePjpTop>>:', storewisePjp); + + // ✅ SAFE: yahi se call + DownloadMappingSurvey(empData1, storewisePjp?.StorewisePJP); + }) + .catch(err => { + console.error('Config error', err); + }); + +}, []); + + + + useFocusEffect( + useCallback( + () => { + fetchLoginInfo(); + }, [])); + + const fetchLoginInfo = async () => { + try { + const loginInfo = await get_item('loginInfo'); + const loginDetails = loginInfo ? JSON.parse(loginInfo) : null; + await new Promise((resolve) => setTimeout(resolve, 2000)); // Simulate delay + setDesig(loginDetails?.Designation || ''); + console.log('Async useEffect completed'); + setIsAsyncDone(true); // Mark async operation as done + return loginDetails?.Designation || "" + } catch (error) { + console.error('Error in async useEffect:', error); + setIsAsyncDone(true); // Still mark as done to proceed + } + }; + + + useFocusEffect( + useCallback(() => { + let isActive = true; // prevents state updates after unmount + + const run = async () => { + try { + setLoaderTitle(ST.Loading + '...'); + + const params = props.route.params || {}; + const empData1 = params.empData || {}; + + const showSearchWiseStore1 = + params.showSearchWiseStore != null && params.showSearchWiseStore !== '' + ? params.showSearchWiseStore + : false; + + const {StorewisePJP: storewisePjp, StoreSearch: storeSearch } = await fetchProjectConfig(props.ManagerAppConfig); + console.log('storewisePjpMid::', storewisePjp, storeSearch); + + + const ShowStoreSearch = storeSearch ?storeSearch: false; + const ShowStoreSearchLabel = props?.ShowStoreSearchLabel ?? false; + + const isAdhoc = params.isAdhoc ?? false; + const isNPND = params.isNPND ?? false; + + isAdhocRef.current = isAdhoc; + isNPNDRef.current = isNPND; + + if (!isActive) return; + + // ---- SET STATES ---- + setIsAdhocScreen(isAdhoc); + setisNPNDScreen(isNPND); + setEmpData(empData1); + setShowSearchWiseStore(ShowStoreSearch); + setShowStoreSearchLabel(ShowStoreSearchLabel); + + const CO_GeoFenceEnable = props.GFEnable_checkout ?? false; + const CO_GeoFenceRadius = props.GFRadius_checkout ?? ''; + + setGeoFenceEnable_Checkout(CO_GeoFenceEnable); + setGeoFenceRadius_Checkout(CO_GeoFenceRadius); + + // ---- NAVIGATION CHECK ---- + if (props.isDataDownloaded && !props.isAttendanceMarked) { + props.navigation.pop(); + props.navigation.push('Attendance'); + return; + } + + let dS = await fetchLoginInfo() + let ds2 = dS || desig + + console.log("desig-----", ShowStoreSearch, dS); + + // ---- CONDITIONAL ASYNC CALL ---- + if (ShowStoreSearch && ds2 !== "Supervisor") { + console.log("THIS IS MANAGER"); + await getCheckedInData(isAdhocRef.current, isNPNDRef.current, empData1); + } else { + console.log("THIS IS SUPERVISOR"); + await getData(empData1, isAdhoc, isNPND); + } + + } catch (err) { + console.log("Error in useFocusEffect async:", err); + } + }; + + run(); + + return () => { + isActive = false; // cleanup + }; + }, []) + ); + + + + function onBeforeRemove(e) { + if (showCameraRef.current == true) { + e.preventDefault(); + ChangeShowCamera(false); + } + else { + return; + } + } + + function ChangeShowCamera(val) { + showCameraRef.current = val; + setShowCamera(val); + } + + async function calLocatDistance() { + if (currentStore.Latitude != '' && currentStore.Latitude != null) { + const hasPermission = await _checkLocationPermission(); + if (hasPermission == true) { + Geolocation.getCurrentPosition( + async (position) => { + let loc = { lat: position.coords.latitude, lng: position.coords.longitude }; + var distance = checkRange(loc.lat, loc.lng, currentStore.Latitude, currentStore.Longitude); + console.log("distanceeee-->",distance) + let dinKM = (distance / 1000); + let distanceinM = (distance == '' || distance == null || isNaN(distance)) ? ' 0 m' : (dinKM > 1 ? dinKM.toFixed(1) + ' Km' : distance + ' m'); + setStoreDistance(distanceinM); + setStoreDistanceinM(distance); + + if (props.GeoFenceEnable == true && distance > props.GeoFenceRadius) { + setShowDistanceModal(true); + } + else { + props.navigation.navigate('StoreCheckin', { storeData: currentStore, empData: EmpData, 'isAdhoc': isAdhocScreen, 'IsSearchedStore': showSearchWiseStore, 'isNPND': isNPNDScreen }); + } + }, + (error) => { + notify(ST.Cannotgetuserposition); + }, + { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + ); + } + else { + notify(ST.Pleaseallowlocationpermission); + } + } + else { + notify(ST.Storelocationnotavailable); + } + + } + + async function getData(empData1, isAdhoc, isNPND) { + setLoaderTitle("Loading..."); + setProcessing(true); + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + let projectInfo = await get_item('projectInfo'); + // const storewisePjp = await fetchProjectConfig(props.ManagerAppConfig); + const {StorewisePJP: storewisePjp, StoreSearch: storeSearch } = await fetchProjectConfig(props.ManagerAppConfig); + console.log('storewisePjpMid::', storewisePjp, storeSearch); + + let projectDetails = projectInfo != null ? JSON.parse(projectInfo) : {}; + let SUP_StorewisePJP = projectDetails?.SUP_StorewisePJP != null ? projectDetails?.SUP_StorewisePJP : '' + let columKey = loginDetails?.Designation == "Supervisor" ? "MerchandiserId" : "EmpId"; + + console.log("storewisePjpGetData>>:", storewisePjp); + + try { + let q = ''; + // when SUP_StorewisePJPis is true then check if data exists or not + if (loginDetails?.Designation == "Supervisor" && storewisePjp == true) { + if (isAdhoc == true) { + q = `Select * from Sup_JourneyPlanStorewiseSup_Adhoc where VisitDate='${d2}' `; + } else if (isNPND) { + q = `Select * from Sup_NPNDStore where VisitDate='${d2}' `; + } + else { + q = `Select * from Sup_JourneyPlanStorewiseSup where VisitDate='${d2}' `; + } + } + + // when SUP_StorewisePJPis is false + else { + if (isAdhoc == true) { + q = `Select * from Sup_AdhocJourneyPlan where VisitDate='${d2}' and ${columKey}='${empData1?.EmpId}' `; + } else if (isNPND) { + q = `Select * from Sup_NPNDStore where VisitDate='${d2}' `; + } + else { + q = `Select * from Sup_JourneyPlan where VisitDate='${d2}' and ${columKey}='${empData1?.EmpId}' `; + } + console.log('YE WALA DATA'); + + // For non-supervisor case ======== + if (showSearchWiseStore === true) { + // Case 1 & 2 merged ( teamwise case (any of them like sup or am/pm) + if (isAdhoc == true) { + q = `Select * from Sup_AdhocJourneyPlan where VisitDate='${d2}' and ${columKey}='${empData1?.EmpId}' `; + } else if (isNPND) { + q = `Select * from Sup_NPNDStore where VisitDate='${d2}' `; + } else { + q = `Select * from Sup_JourneyPlan where VisitDate='${d2}' and ${columKey}='${empData1?.EmpId}' `; + } + } + + + // CONDITIONS FOR STOREWISE PJP + else if (storewisePjp === true && showSearchWiseStore === false) { + // console.log('Case 3 storewisepjp true + no search'); + // Case 3 storewisepjp true + no search + if (isAdhoc == true) { + // q = `Select * from Sup_JourneyPlanStorewiseSup_Adhoc where VisitDate='${d2}' and ${columKey}='${empData1?.EmpId}' `; //changes by Ajeet + q = `Select * from Sup_JourneyPlanStorewiseSup_Adhoc where VisitDate='${d2}' `; + } else if (isNPND) { + q = `Select * from NPNDStore where VisitDate='${d2}' `; + } else { + // q = `Select * from Sup_JourneyPlanStorewiseSup where VisitDate='${d2}' and ${columKey}='${empData1?.EmpId}' `; //changes by Ajeet + q = `Select * from Sup_JourneyPlanStorewiseSup where VisitDate='${d2}' `; + } + } + } + + // console.log("Queryyyyyy in getData() ==> ", q) + + db.transaction(async function (txn) { + + txn.executeSql(q, [], async function (txn2, txnres2) { + await DownloadMappingSurvey(empData1, storewisePjp); + console.log('AllStores check:', txnres2.rows.length); + if (txnres2.rows.length > 0) { + let AllStores = await getdownloadedPJP(empData1, isAdhoc, isNPND, storewisePjp); + console.log('AllStores:', AllStores.length, JSON.stringify(AllStores)); + console.log("console 1"); + setState({ storeList: AllStores }); + setGlobalStorelist(AllStores); + setProcessing(false); setNodataFound(false); + } + else if (storewisePjp == false) { // download PJP emp only when Store list is shown Employee Wise i.e. SUP_StorewisePJP is false + let AllStores = await DownloadPJP(empData1, isAdhoc, isNPND, storewisePjp); + let isdataNotFound = AllStores.length > 0 ? false : true; + console.log("console 2"); + setState({ storeList: AllStores }); + setGlobalStorelist(AllStores); + setrerenderdata(!rerenderdata); + setProcessing(false); setNodataFound(isdataNotFound); + } + else { + setProcessing(false); setNodataFound(true); + } + }, function (txn2, txnerr) { console.log(txnerr); setProcessing(false); notify(ST.Nodatafound); setNodataFound(true); }); + }); + } + catch (err) { + console.log(err); + } + } + + async function getCheckedInData(isAdhoc, isNPND, empData1) { + setLoaderTitle("Loading..."); + setProcessing(true); + try { + let AllStores = await getAlreadyCheckedInStores(isAdhoc, isNPND); + console.log('AllStores:', AllStores.length); + setState({ storeList: AllStores }); + setGlobalStorelist(AllStores); + + if (AllStores.length > 0) { + setNodataFound(false); + } + else { + // getData(empData1, isAdhoc, isNPND); + setNodataFound(true); + } + setProcessing(false); + } catch (err) { + console.log("err in getCheckedInData:"); + } + } + + async function getAlreadyCheckedInStores(isAdhoc, isNPND) { // need check + console.log("get already checkedin store ------") + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + + return new Promise((resolve, reject) => { + + var q = '', join_tbl = 'Sup_JourneyPlan', tb2 = AppTables.CHECKIN_DATA; + + var join = ` left outer join ${tb2} on ${tb2}.STORE_ID=${join_tbl}.StoreId and ${tb2}.JCP_TYPE='${join_tbl}' and ${tb2}.VISIT_DATE='${d2}' and ${tb2}.EMP_ID=${join_tbl}.MerchandiserId and ${join_tbl}.UploadStatus in ('I','C','D','U','L') `; + var orderby = ` group by ${join_tbl}.StoreId,${join_tbl}.VisitDate order by ${join_tbl}.StoreName,${tb2}.KEY_ID desc`; + + // get data from PJP /adhoc table + q = `Select ${join_tbl}.*,${tb2}.CHECKIN_TIME as CheckInTime ,${tb2}.CHECKOUT_TIME as CheckOutTime from ${join_tbl} ${join} where ${join_tbl}.VisitDate='${d2}' and UploadStatus!='N' `; + q += ` ${orderby}`; + + // q=`select * from ${join_tbl}`; + console.log("storelist q getAlreadyCheckedInStores:", q); + db.transaction(async function (txn) { + + + txn.executeSql(q, [], async function (txn2, txnres2) { + console.log('storelist len', txnres2.rows.length); + if (txnres2.rows.length > 0) { + // show from local + var storeArr = []; + console.log(txn2, 'storelist len2', txnres2.rows.length); + for (var i = 0; i < txnres2.rows.length; i++) { + console.log("txnres2.rows==========", txnres2.rows); + console.log("txnres2.rows.length", txnres2.rows.length, txnres2.rows.item(i)); + let sdata = txnres2.rows.item(i); + + console.log("sdata---->>>>", sdata); + let { InTime, OutTime, UploadStatus, StoreId, MID } = sdata; + + + let time = sdata?.CheckInTime + ? moment(sdata?.CheckInTime, sdata?.CheckInTime.includes('/') + ? "MM/DD/YYYY HH:mm:ss" + : "HH:mm:ss" + ).format("HH:mm:ss") + : ''; + + let time2 = sdata?.CheckOutTime + ? moment(sdata?.CheckOutTime, sdata?.CheckOutTime.includes('/') + ? "MM/DD/YYYY HH:mm:ss" + : "HH:mm:ss" + ).format("HH:mm:ss") + : ''; + + let In_Time = (time == '' && UploadStatus != '' && UploadStatus != 'N') ? InTime : time; + let Out_Time = (time2 == '' && UploadStatus != '' && UploadStatus != 'N' && UploadStatus != 'I') ? OutTime : time2; + sdata.CheckInTime = In_Time; + sdata.CheckOutTime = Out_Time; + + + console.log("MenuList=======12"); + let MenuList = await getMenuList(sdata, isAdhoc, isNPND, checkPosale = false); + console.log("MenuList=======", MenuList); + let allDone = MenuList.length > 0 ? await getDailyMenu(sdata, isAdhoc, isNPND) : true; + + sdata.allDone = allDone; + sdata.MenuList = MenuList || []; + storeArr.push(sdata); + setStoreData(sdata); + + if (i == (txnres2.rows.length - 1)) { + console.log("storeArr:", storeArr.length); + resolve(storeArr); + } + } + } + else { + resolve([]); + } + }, function (txn2, txnerr) { console.log(txnerr); resolve([]); }); + }); + }).catch((err) => { + console.log(err); + return []; + }) + + } + + async function DownloadPJP(empData1, isAdhoc, isNPND, storewisePjp) { + console.log("download PJPPP12") + setLoaderTitle("Downloading " + (isAdhoc ? "Adhoc" : "") + " Storelist Data..."); + setProcessing(true); + let downloadKey = isAdhoc == true ? "Sup_AdhocJourneyPlan" : isNPND ? "Sup_NPNDStore" : "Sup_JourneyPlan"; + + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url = props.baseurl + getMethodName(METHODS.DOWNLOADJSON_METHOD); + let data = ''; + + console.log('props.SUP_StorewisePJP-->', storewisePjp); + + if (storewisePjp == true || storewisePjp == 1) { + console.log('STORE WISE CALLED'); + + data = { + Downloadtype: downloadKey, + Username: loginDetails.UserId, + Param1: 0, + Param2: storewisePjp != '' ? storewisePjp == true ? 1 : 0 : '', + }; + } + // Team wise condition------ + else { + console.log('TEAM WISE CALLED'); + + data = { + Downloadtype: downloadKey, + Username: loginDetails.UserId, + Param1: empData1?.EmpId || EmpData?.EmpId, + Param2: 0, + }; + } + + console.log('TEAMWISE DATA+++++++++++>:', data); + + + return await getDownloadJson1(url, data) + .then(async (res) => { + // console.log("DownloadPJP res:",res); + if (res.Sup_AdhocJourneyPlan != null || res.Sup_JourneyPlan != null) { + let storeArr = isAdhoc == true ? (res.Sup_AdhocJourneyPlan || []) : isNPND ? (res.Sup_NPNDStore || []) : (res.Sup_JourneyPlan || []); + let isInserted = await InsertDownloadedPJP(isAdhoc, empData1?.EmpId, storeArr); + console.log('isInserted:', isInserted) + if (isInserted) { + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const configData = (() => { + try { + return typeof props.ManagerAppConfig === "string" + ? JSON.parse(props.ManagerAppConfig) + : props.ManagerAppConfig; + } catch (e) { + return null; + } + })(); + + const configArray = configData?.ManagerAppConfig ?? []; + const currentConfig = configArray.find( + item => item.Designation?.toLowerCase() === loginDetails?.Designation?.toLowerCase() + ); + + const storewisePjp = currentConfig?.StorewisePJP; + + let AllStores = await getdownloadedPJP(empData1, isAdhoc, isNPND, storewisePjp); + console.log("getdownloadedPJP res after download:", AllStores.length); + setProcessing(false); + notify("Storelist downloaded successfully."); + return AllStores; + } + else { + setProcessing(false); + notify("Cannot download storelist data! Error in saving data."); + return []; + } + } + else { + notify('No data found!'); + setProcessing(false); + return []; + } + + }) + .catch((err) => { + console.log('onPage Team error', err); + setProcessing(false); + notify("Cannot download storelist data!") + return []; + }); + } + + async function DownloadMappingSurvey(empData1, storewisePjp) { + // console.log("download PJPPP"); + setLoaderTitle("Downloading...."); + setProcessing(true); + const loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url = props.baseurl + getMethodName(METHODS.DOWNLOADJSON_METHOD); + // Define multiple keys + let downloadKeys = []; + downloadKeys.push("Mapping_SurveySup") + + let combinedStoreArr = []; + // console.log('empData1?.EmpId------>', empData1?.EmpId, EmpData?.EmpId); + + console.log("storewisePjpDownloadMappingSurvey>>", storewisePjp) + + for (let key of downloadKeys) { + let data = { + Downloadtype: key, + Username: loginDetails.UserId, + Param1: storewisePjp ? '' : empData1?.EmpId || EmpData?.EmpId, + Param2: storewisePjp !== '' ? (storewisePjp === true ? 1 : 0) : '', + }; + + // console.log(`Downloading for key: ${key}`, data); + + try { + const res = await getDownloadJson1(url, data); + + const storeArr = + key === "Mapping_SurveySup" ? (res?.Mapping_SurveySup || []) : []; + + combinedStoreArr = combinedStoreArr.concat(storeArr); + } catch (err) { + console.log(`Error downloading ${key}:`, err); + } + } + + if (combinedStoreArr.length > 0) { + + let res = combinedStoreArr; + if (res != null && !res.includes("No Data") && res?.length > 0) { + let data_arr = res || []; + // console.log('surveys:', data_arr.length) + let values = []; + + // const sanitize = (str) => (str || '').replace(/'/g, "''"); + + data_arr.map((data_obj) => { + let { SurveyId, StoreId } = data_obj; + values.push(` ('${StoreId}','${SurveyId}')`); + }); + + let all_vals = values.join(','); + let sql_stmnt = `INSERT INTO Mapping_SurveySup(StoreId,SurveyId) values ${all_vals}`; + // console.log('SQL:', sql_stmnt); + + await new Promise((resolve, reject) => { + db.transaction(function (txn) { + txn.executeSql(`DELETE FROM Mapping_SurveySup WHERE 1=1`, [], function (txn1, txnres) { + txn.executeSql(sql_stmnt, [], function (txn1, txnres) { + // console.log('Mapping_SurveySup added-----'); + resolve(true); + }, function (txn1, txnerr) { + console.log('insert err:', txnerr); + reject(txnerr); + }); + }, function (txn1, txnerr) { + console.log('delete err:', txnerr); + reject(txnerr); + }); + }); + }); + } else { + setProcessing(false); + notify("No data found!"); + return []; + } + + + } else { + setProcessing(false); + notify("No data found!"); + return []; + } + } + + async function InsertDownloadedPJP(isAdhoc, empData1, storeArr) { + console.log("InsertDownloadedPJP======", InsertDownloadedPJP); + return new Promise((resolve, reject) => { + + var values = [], sql_stmnt = '', all_vals = ''; + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + let tbname = isAdhoc == true ? 'Sup_AdhocJourneyPlan' : 'Sup_JourneyPlan'; + let q = `Delete from ${tbname} where VisitDate='${d2}' `; + + storeArr.map((data_obj) => { + let { MID, ChannelId, StoreId, StoreCode, EmpId, MerchandiserId, VisitDate, ChainId, ChainName, StoreName, Address, Location, Landmark, CityId, CityName, StateId, StateName, RegionId, StoreTypeId, StoreType, Pincode, Latitude, Longitude, Phone, Mobile, ContactPerson, Email, UploadStatus, GeoTag, GeoFenceRadius, InTime, OutTime, CameraAllow } = data_obj; + values.push(` ('${MID}', '${ChannelId}', '${StoreId}', '${StoreCode}', '${EmpId}', '${MerchandiserId}', '${VisitDate}', '${ChainId}', '${ChainName}', '${StoreName}', '${Address}', '${Location}', '${Landmark}', '${CityId}', '${CityName}', '${StateId}', '${StateName}', '${RegionId}', '${StoreTypeId}', '${StoreType}', '${Pincode}', '${Latitude}', '${Longitude}', '${Phone}', '${Mobile}', '${ContactPerson}', '${Email}', '${UploadStatus}', '${GeoTag}', '${GeoFenceRadius}', '${InTime}', '${OutTime}','${CameraAllow}')`); + }); + all_vals = values.join(','); + sql_stmnt = `INSERT INTO ${tbname}(MID,ChannelId,StoreId,StoreCode,EmpId,MerchandiserId,VisitDate,ChainId,ChainName,StoreName,Address,Location,Landmark,CityId,CityName,StateId,StateName,RegionId,StoreTypeId,StoreType,Pincode,Latitude,Longitude,Phone,Mobile,ContactPerson,Email,UploadStatus,GeoTag,GeoFenceRadius,InTime,OutTime,CameraAllow) + values ${all_vals}`; + + console.log("sql_stmnt---qweq", sql_stmnt) + + db.transaction(async function (txn) { + await txn.executeSql(q, [], async function (txn2, txnres4) { + console.log('removeddata'); + await txn.executeSql(sql_stmnt, [], async function (txn2, txnres2) { + resolve(true); + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); }); + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); }); + }) + }).catch((err) => { + console.log(err); + return false; + }) + + } + + const isValidTime = (time) => { + if (!time) return false; + + return moment( + time, + ["MM/DD/YYYY HH:mm:ss", "HH:mm:ss"], + true + ).isValid(); +}; + + async function getdownloadedPJP(empData1, isAdhoc, isNPND, storewisePjp) { + + console.log("callledddd get download PJP--") + console.log("isNPND---", isNPND); + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + // console.log("loginDetails--------",loginDetails ) + let columKey = loginDetails?.Designation == "Supervisor" ? "MerchandiserId" : "EmpId"; + console.log("isAdhoc=========", isAdhoc); + return new Promise((resolve, reject) => { + var join_tbl = ''; + var q = '', + tb1 = 'Sup_JourneyPlan', + tb2 = AppTables.CHECKIN_DATA, + tb3 = 'Sup_AdhocJourneyPlan', + tb4 = 'Sup_JourneyPlanStorewiseSup', + tb5 = 'Sup_JourneyPlanStorewiseSup_Adhoc', + tb6 = 'Sup_NPNDStore'; + + + if (loginDetails?.Designation == "Supervisor" && storewisePjp == true) { + join_tbl = isAdhoc == true ? tb5 : isNPND ? tb6 : tb4; + } + else { + + join_tbl = isAdhoc == true ? tb3 : isNPND ? tb6 : tb1; + // Non-supervisor logic + if (showSearchWiseStore == true) { + join_tbl = isAdhoc == true ? tb3 : isNPND ? tb6 : tb1; + } else if (storewisePjp == true && showSearchWiseStore == false) { + join_tbl = isAdhoc == true ? tb5 : isNPND ? tb6 : tb4; + } + } + + console.log('join_tbl', join_tbl) + var join = ` left outer join ${tb2} on ${tb2}.STORE_ID=${join_tbl}.StoreId and ${tb2}.JCP_TYPE='${join_tbl}' and ${tb2}.VISIT_DATE='${d2}' and ${tb2}.EMP_ID=${join_tbl}.MerchandiserId and ${join_tbl}.UploadStatus in ('I','C','D','U','L') `; + var orderby = ` group by ${join_tbl}.StoreId,${join_tbl}.VisitDate order by ${join_tbl}.StoreName,${tb2}.KEY_ID desc`; + + + // get data from PJP /adhoc table + q = `Select ${join_tbl}.*,${tb2}.CHECKIN_TIME as CheckInTime ,${tb2}.CHECKOUT_TIME as CheckOutTime from ${join_tbl} ${join} where ${join_tbl}.VisitDate='${d2}' `; + + // if SUP_StorewisePJP is true , then we don't need to include below condition in query + if (storewisePjp != true) { + q += ` and ${join_tbl}.${columKey}='${empData1?.EmpId || EmpData?.EmpId}' `; + // q+=` and ${join_tbl}.MerchandiserId='${empData1.EmpId}' `; + } + + q += ` ${orderby}`; + +console.log("storelist q getdownloadedPJP:", q); + db.transaction(async function (txn) { + txn.executeSql(q, [], async function (txn2, txnres2) { + console.log('storelist len', txnres2.rows.length); + if (txnres2.rows.length > 0) { + // show from local + var storeArr = []; ``; + for (var i = 0; i < txnres2.rows.length; i++) { + let sdata = txnres2.rows.item(i); + console.log("sdata--------", sdata); + let { InTime, OutTime, UploadStatus, StoreId, MID } = sdata; + console.log("InTime, OutTime, UploadStatus, StoreId, MID----->>", InTime, OutTime, UploadStatus, StoreId, MID,sdata.CheckInTime,sdata.CheckOutTime ); + + let time = sdata?.CheckInTime + ? moment(sdata?.CheckInTime, sdata?.CheckInTime.includes('/') + ? "MM/DD/YYYY HH:mm:ss" + : "HH:mm:ss" + ).format("HH:mm:ss") + : ''; + + let time2 = sdata?.CheckOutTime + ? moment(sdata?.CheckOutTime, sdata?.CheckOutTime.includes('/') + ? "MM/DD/YYYY HH:mm:ss" + : "HH:mm:ss" + ).format("HH:mm:ss") + : ''; + console.log("time time2----->>", time, time2); + let In_Time = (time == '' && UploadStatus != '' && UploadStatus != 'N') ? InTime : time; + let Out_Time = (time2 == '' && UploadStatus != '' && UploadStatus != 'N' && UploadStatus != 'I') ? OutTime : time2; + sdata.CheckInTime = In_Time; + sdata.CheckOutTime = Out_Time; + + + console.log("checkintime---->>",sdata.CheckInTime,sdata.CheckOutTime ); + let MenuList = await getMenuList(sdata, isAdhoc, isNPND, true); + let allDone = MenuList.length > 0 ? await getDailyMenu(sdata, isAdhoc, isNPND) : true; + sdata.allDone = allDone; + sdata.MenuList = MenuList || []; + storeArr.push(sdata); + setStoreData(sdata); + + if (i == (txnres2.rows.length - 1)) { + console.log("storeArr:", storeArr.length); + resolve(storeArr); + } + } + } + else { + resolve([]); + } + }, function (txn2, txnerr) { console.log(txnerr); resolve([]); }); + }); + }).catch((err) => { + console.log(err); + return []; + }) + + + } + + async function getDailyMenu(storeData1, isAdhoc, isNPND, checkPosale = false) { + + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + let { StoreId, ChannelId, RegionId, StoreTypeId } = storeData1; + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + let q = Q_MenuList(storeData1, isAdhoc, isNPND); + + txn.executeSql(q, [], async function (txn2, txnres) { + + if (txnres.rows.length > 0) { + let allDone = true; + for (var i = 0; i < txnres.rows.length; i++) { + let data = txnres.rows.item(i); + let isAvlbl = await checkAvailability(storeData1, data, checkPosale); + + + let isDone = await updateStatus(storeData1, data, isAvlbl); + + if (((isAvlbl == true) || (isAvlbl.isAvlbl == true)) && !isDone) { + allDone = false; + resolve(allDone); + break; + } + if (i == (txnres.rows.length - 1)) { + resolve(allDone); + } + } + } + else { + resolve(true); + } + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); }); + + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log(err); + return false; + }); + + } + + async function getMenuList(storeData1, isAdhoc, isNPND, checkPosale = false) { + let { StoreId, ChannelId, RegionId, StoreTypeId } = storeData1; + + return new Promise((resolve, reject) => { + + db.transaction(async function (txn) { + let q = Q_MenuList(storeData1, isAdhoc, isNPND); + + + txn.executeSql(q, [], async function (txn2, txnres) { + + if (txnres.rows.length > 0) { + let arr = []; + for (var i = 0; i < txnres.rows.length; i++) { + let data = txnres.rows.item(i); + let isAvlbl = await checkAvailability(storeData1, data, checkPosale); + // if (isAvlbl) { + arr.push(data); + // } + if (i == (txnres.rows.length - 1)) { + resolve(arr); + } + } + } + else { + resolve([]); + } + }, function (txn2, txnerr) { console.log(txnerr); resolve([]); }); + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log('') + return [] + }) + } + + + async function checkAvailability(storeData1, data, checkPosale = false) { + + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + let q2 = getAvailblQuery(data.ScreenName, storeData1, data, checkPosale); + if (q2 != '' && q2 != null) { + // console.log("checkAvailability", q2) + txn.executeSql(q2, [], async function (txn2, txnres2) { + let isAvlbl = getIfAvlbl(data.ScreenName, txnres2, storeData1); + resolve(isAvlbl); + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); }); + } + else { + let isAvlbl = getIfAvlbl(data.ScreenName, {}, storeData1); + resolve(isAvlbl); + } + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log(err); + return false; + }); + } + + + async function updateStatus(storeData1, data, isAvlbl) { + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + let q2 = getQuery(data.ScreenName, storeData1, data); + + + if (q2 != '' && q2 != null && ((isAvlbl == true) || (isAvlbl && (isAvlbl.isAvlbl == true)))) { + txn.executeSql(q2, [], async function (txn2, txnres2) { + let isDone = await getIfKPIDone(data.ScreenName, txnres2, storeData1, isAvlbl, data); + resolve(isDone); + + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); }); + } + else { + resolve(false); + } + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log(err); + return false; + }); + + } + + async function onCheckOut(storeData1) { + console.log('storeData1--onCheckOut-->', storeData1); + + let isAlldone = await getDailyMenu(storeData1, isAdhocScreen, isNPNDScreen); + // let isAlldone=await getDailyMenu(storeData1,EmpData,isAdhocScreen,isNPNDScreen); + if (isAlldone == true) { + setCheckOutStore(storeData1); + setShowAlert(true); + } + else { + notify(ST.PleasefillallKPI, false); + } + } + + function onSaveCancel() { + setShowAlert(false); + } + + + async function getLocOnCheckout() { + setShowAlert(false); + setLoaderTitle(ST.Gettinglocation + '...'); + setProcessing(true); + + Geolocation.getCurrentPosition( + async (position) => { + let { latitude, longitude } = position.coords; + let loc = { lat: latitude, lng: longitude }; + var distance = checkRange(loc.lat, loc.lng, checkOutStore.Latitude, checkOutStore.Longitude); + // console.log('COut distance:',distance); + setProcessing(false); + // let dinKM=(distance / 1000); + // let distanceinM=(distance=='' || distance==null || isNaN(distance))?' 0 m':( dinKM > 1 ? dinKM.toFixed(1) + ' Km' : distance + ' m'); + if (GeoFenceEnable_Checkout == true) { + if (GeoFenceRadius_Checkout != '' && distance > GeoFenceRadius_Checkout) { + notify(ST.Youcannotcheckout + ' ' + ST.Youarenotwithinthealloweddistancefromthestore + ' ' + GeoFenceRadius_Checkout + ' m', 'LONG') + } + else { + checkOutAfterLoc(loc); + } + } + else { + checkOutAfterLoc(loc); + } + + }, + (error) => { + notify(ST.Cannotgetuserposition); + setProcessing(false); + }, + { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + ); + } + + async function checkOutAfterLoc(loc) { + let CheckOut_PhotoReq = props.CheckOut_PhotoReq != null ? props.CheckOut_PhotoReq : false; + if (CheckOut_PhotoReq) { + setCheckOutLoc(loc); + setShowAlert(false); + setCheckOutImageModal(true); + } + else { + UpdateCheckOutStatus(loc); + } + } + + async function UpdateCheckOutStatus(loc) { + + setLoaderTitle(ST.UpdatingCheckoutStatus + '...'); + setProcessing(true); + let { StoreId, MID, EmpId, MerchandiserId } = checkOutStore; + let CheckOut_PhotoReq = props.CheckOut_PhotoReq != null ? props.CheckOut_PhotoReq : false; + + console.log(CheckOut_PhotoReq, "CheckOut_PhotoReq") + + let d = new Date(); + let d2 = moment(d).format('MM/DD/YYYY'); + let d3 = moment(d).format('MM/DD/YYYY HH:mm:ss'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + let data1 = ''; + + const {StorewisePJP: storewisePjp, StoreSearch: storeSearch } = await fetchProjectConfig(props.ManagerAppConfig); + console.log("storewisePjpStatuss::",storeSearch, storewisePjp); + + // const loginDetails = JSON.parse(loginInfo); + // let data1 = ''; + // const configData = (() => { + // try { + // return typeof props.ManagerAppConfig === "string" + // ? JSON.parse(props.ManagerAppConfig) + // : props.ManagerAppConfig; + // } catch (e) { + // return null; + // } + // })(); + + // const configArray = configData?.ManagerAppConfig ?? []; + // const currentConfig = configArray.find( + // item => item.Designation?.toLowerCase() === loginDetails?.Designation.toLowerCase() + // ); + + // const storewisePjp = currentConfig?.StorewisePJP; + + data1 = { + "UserId": loginDetails.UserId, + "StoreId": StoreId, + "MerchandiserId": MerchandiserId, + "Latitude": loc.lat, + "Longitude": loc.lng, + "CheckoutDate": d2, + "CheckOutImage": CheckOut_PhotoReq == true ? CheckOutImage : '', + + } + + // let fpath=Platform.OS=='ios'?CheckOutImagePath.replace('file://',''):CheckOutImagePath; + var data2 = new FormData(); + data2.append('file', { + uri: CheckOutImagePath, + type: 'image/jpg', + name: CheckOutImage, + }); + + let foldername = getFolderName(CheckOutImage); + data2.append('Foldername', foldername); + data2.append('Path', d2); + + console.log('data1=====>', data1); + console.log('data2--------->', data2); + + + const url = props.baseurl + getMethodName(METHODS.CHECKOUTDETAIL_METHOD); + const url1 = (props.imageUploadUrl || URL_IMAGE) + getMethodName(METHODS.UPLOADIMAGES_METHOD); + console.log(url, data1); + await UploadData2(url, data1) + .then(async (res) => { + console.log('StoreCheckOutSup1:', res, 'MID:', MID); + if (!res.error) { + if (res == 1) { + //Check out completed + if (CheckOut_PhotoReq) { + // Upload Image + await UploadFormData(url1, data2) + .then(async (res1) => { + console.log('checkout image upload:', res1); + cancelImage(); + }) + .catch((err) => { + console.log(err); + }); + } + + + let data = { checkout_image: '' }; + const isCheckOutUpdated = await UpdateStoreCheckOut(data); + + if (isCheckOutUpdated == true) { + let datan = ''; + + let ShowStoreSearch = storeSearch?storeSearch : false; + + if (ShowStoreSearch && designation != "Supervisor") { + datan = { StoreId: StoreId, UploadStatus: 'C', tbname: 'Sup_JourneyPlan', EmpId: MerchandiserId }; + } + else if (ShowStoreSearch ? (designation == "Supervisor" && storewisePjp == true) : storewisePjp == true) { + datan = { StoreId: StoreId, UploadStatus: 'C', tbname: (isAdhocScreen == true ? 'Sup_JourneyPlanStorewiseSup_Adhoc' : isNPNDScreen ? "Sup_NPNDStore" : 'Sup_JourneyPlanStorewiseSup'), EmpId: MerchandiserId }; + } + else { + datan = { StoreId: StoreId, UploadStatus: 'C', tbname: (isAdhocScreen == true ? 'Sup_AdhocJourneyPlan' : isNPNDScreen ? "Sup_NPNDStore" : 'Sup_JourneyPlan'), EmpId: MerchandiserId }; + } + + console.log("datan==============1", datan); + + const isUpdated = await UpdateStoreStatus(props, datan); + if (isUpdated == true) { + let outtime = moment(d).format('HH:mm:ss');; + await updateStoreStatuslocal('C', checkOutStore, false, true, outtime); + setLoaderTitle(ST.UploadingData + '...'); + UploadOnCheckOut(loc, storewisePjp,storeSearch); + } + else { + setProcessing(false); notify(ST.Erroroccurwhilecheckout, 'LONG'); + } + } + else { + notify(ST.Erroroccurwhilecheckout, 'LONG'); + } + + } + else { + notify(ST.Somethingwentwrong, 'SHORT'); setProcessing(false); + } + } + else { + notify(ST.Somethingwentwrong, 'SHORT'); setProcessing(false); + } + }) + .catch((err) => { + console.log('onPage Team error', err); + notify(ST.Somethingwentwrong, 'SHORT'); setProcessing(false); + }); + + + } + + async function updateStoreStatuslocal(status, storeData1, updateCheckin = false, uCOut = false, cout_time = '') { + + let storeArr = state.storeList; + let sdata_index = storeArr.findIndex(i => i.StoreId == storeData1.StoreId); + if (sdata_index >= 0) { + let sdata = storeArr[sdata_index]; + sdata['UploadStatus'] = status; + if (updateCheckin == true) { + sdata['CheckInTime'] = ''; + } + if (uCOut == true) { + sdata['CheckOutTime'] = cout_time; + } + storeArr[sdata_index] = sdata; + // console.log('storeArr',storeArr) + console.log("console 4") + setState({ ...state, storeArr }); + setGlobalStorelist(storeArr); + setrerenderdata(!rerenderdata); + } + } + + async function UpdateStoreCheckOut(data) { + console.log('UpdateStoreCheckOut') + let CheckOut_PhotoReq = props.CheckOut_PhotoReq != null ? props.CheckOut_PhotoReq : false; + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + let now = moment(d1).format('MM/DD/YYYY HH:mm:ss'); + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + let q2 = `UPDATE ${AppTables.COVERAGE_DATA} SET CHECKOUT_TIME='${now}', CHECKOUT_IMAGE='${CheckOut_PhotoReq ? CheckOutImage : ''}' WHERE STORE_ID='${checkOutStore.StoreId}' and EMP_ID='${checkOutStore.MerchandiserId}' and VISIT_DATE='${d2}' `; + + txn.executeSql(q2, [], async function (txn2, txnres2) { + console.log('store coverage updated'); + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); }); + + let q = `UPDATE ${AppTables.CHECKIN_DATA} SET CHECKOUT_TIME='${now}', CHECKOUT_IMAGE='${CheckOut_PhotoReq ? CheckOutImage : ''}' WHERE STORE_ID='${checkOutStore.StoreId}' and EMP_ID='${checkOutStore.MerchandiserId}' and VISIT_DATE='${d2}' `; + txn.executeSql(q, [], async function (txn2, txnres2) { + console.log('store checkout updated'); + resolve(true); + }, function (txn2, txnerr) { console.log(txnerr); resolve(false); }); + + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log(err); + return false; + }); + + } + + async function UploadOnCheckOut(loc, storewisePjp,storeSearch) { + try { + console.log('UploadOnCheckOut'); + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + let token = await get_item('loginToken'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + + let PJPStores = '', PJPStores1 = '', AllStores = ''; + + let ShowStoreSearch = storeSearch ? storeSearch : false; + + if ((ShowStoreSearch ? (designation == "Supervisor" && storewisePjp == true) : storewisePjp == true)) { + PJPStores = await getPJPStoresData('Sup_JourneyPlanStorewiseSup', [], d2); + console.log('Allstores', PJPStores); + if (isNPNDScreen) { + PJPStores1 = await getPJPStoresData('Sup_NPNDStore', PJPStores, d2); + } else { + PJPStores1 = PJPStores; + } + + AllStores = await getPJPStoresData('Sup_JourneyPlanStorewiseSup_Adhoc', PJPStores1, d2); + } + else { + PJPStores = await getPJPStoresData('Sup_JourneyPlan', [], d2); + if (isNPNDScreen) { + PJPStores1 = await getPJPStoresData('Sup_NPNDStore', PJPStores, d2); + } else { + PJPStores1 = PJPStores; + } + AllStores = await getPJPStoresData('Sup_AdhocJourneyPlan', PJPStores1, d2); + + } + + + db.transaction(async function (txn) { + console.log('stores to upload:', AllStores.length); + if (AllStores.length > 0) { + for (var i = 0; i < AllStores.length; i++) { + let data = AllStores[i]; + console.log("data===2", data); + const index = i; + let { StoreId, StoreName, EmpId, MerchandiserId, MID, UploadStatus, Status, VisitDate, REASON_ID, IMAGE, JCP_TYPE, ChannelId, StoreTypeId, ChainId, CHECKOUT_IMAGE } = data; + let Deviation = isAdhocScreen == true ? 1 : isNPNDScreen ? 2 : 0; + + console.log(data, "dattaaaaaaa store list"); + + let MenuList = await getMenuList(data, isAdhocScreen, isNPNDScreen, true); + let allKPIs = await getKPIS(MenuList); + console.log("allKPIs---", allKPIs, UploadStatus); + // get all checkout ids data + // let allKPIs=['Stocks','BRS','SOS','PaidVis','AddVis','CompVis','Promotion','CompPromo','Contacts','Sale','Survey']; + let pdata = ''; + + if (UploadStatus == 'C') { + pdata = { + "StoreId": StoreId, + "VisitDate": d2, + // "Mid":MID, + "MerchandiserId": MerchandiserId, + "Latitude": loc.lat, + "Longitude": loc.lng, + "ReasonId": REASON_ID != '' ? REASON_ID : 0, + "Remark": "", + "CheckInImage": IMAGE, + "AppVersion": AppVersion, + "Checkout_Image": CHECKOUT_IMAGE, + "ChainId": ChainId, + "StoreTypeId": StoreTypeId, + "ChannelId": ChannelId, + "UploadStatus": 'P', + "UserId": loginDetails.UserId, + "Deviation": Deviation, + }; + + + const url2 = props.baseurl + getMethodName(METHODS.GETCOVERAGE_METHOD); + console.log(url2, pdata, "data sending by me on Storelist .........."); + await UploadData2(url2, pdata) + .then(async (res) => { + console.log('status uploadres:', res, 'MID:', MID); + + if (!res.error) { + let tbname = JCP_TYPE; + let datan = { StoreId: StoreId, UploadStatus: 'P', tbname: tbname, EmpId: MerchandiserId }; + const isUpdated = await UpdateStoreStatus(props, datan); + if (isUpdated == true) { + + await updateStoreStatuslocal('P', data); + await uploadAfter_P_status(index, AllStores, data, MenuList, allKPIs, JCP_TYPE); + + } + else { + if (index == AllStores.length - 1) { + setProcessing(false); notify(ST.Erroroccurwhileuploadingdata, 'LONG'); + } + } + } + else { + if (index == AllStores.length - 1) { + setProcessing(false); notify(ST.Erroroccurwhileuploadingdata, 'LONG'); + } + } + + }) + .catch((err) => { + console.log(err); + if (index == AllStores.length - 1) { + setProcessing(false); notify(ST.Erroroccurwhileuploadingdata, 'LONG'); + } + }); + } + else if (UploadStatus == 'D') { + // this never be called if there is no KPI + console.log("UploadStatusD"); + let allFilesToUpload = await uploadAllData(props, data, allKPIs, props.UserId, JCP_TYPE, false, MenuList,false); + + if (allFilesToUpload.length > 0) { + await UploadDataWithImages(index, AllStores, data, MenuList, allKPIs, JCP_TYPE, allFilesToUpload); + } + else { + notify(ST.Alldatauploadedfor + ' ' + StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + } + else if (UploadStatus == 'P') { + await uploadAfter_P_status(index, AllStores, data, MenuList, allKPIs, JCP_TYPE); + } + else if (UploadStatus == 'L') { + let isAllUploaded_S = await uploadStoreStatus(props, data, 'U', JCP_TYPE, EmpData); + if (isAllUploaded_S == true) { + await updateStoreStatuslocal('U', data); + notify(ST.Alldatauploadedfor + ' ' + StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + else { + if (index == AllStores.length - 1) { + setProcessing(false); notify(ST.Erroroccurwhileuploadingdata, 'LONG'); + } + } + } + } + + } + }); + + + + } catch (err) { + console.log(err); + } + } + + async function uploadAfter_P_status(index, AllStores, data, MenuList, allKPIs, JCP_TYPE) { + console.log("JCP_TYPEJCP_TYPE", JCP_TYPE) + let { StoreName } = data; + if (MenuList.length > 0) { + // Upload data with Images + let allFilesToUpload = await uploadAllData(props, data, allKPIs, props.UserId, JCP_TYPE, true, MenuList,false); + console.log('allFilesToUpload:', allFilesToUpload.length); + await updateStoreStatuslocal('D', data); + UploadDataWithImages(index, AllStores, data, MenuList, allKPIs, JCP_TYPE, allFilesToUpload); + } + else { + // Upload statua u if no data exists + let isAllUploaded_S = await uploadStoreStatus(props, data, 'U', JCP_TYPE, EmpData); + if (isAllUploaded_S == true) { + await updateStoreStatuslocal('U', data); + notify(ST.Alldatauploadedfor + ' ' + StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + else { + if (index == AllStores.length - 1) { + setProcessing(false); notify(ST.Erroroccurwhileuploadingdata, 'LONG'); + } + } + } + } + + async function UploadDataWithImages(index, AllStores, data, MenuList, allKPIs, JCP_TYPE, allFilesToUpload) { + console.log("JCP_TYPEJCP_TYPE", JCP_TYPE) + let { StoreName } = data; + console.log("data== store list", data) + if (allFilesToUpload.length > 0) { + setLoaderTitle(ST.UploadingImages + '...'); + console.log('set loader title'); + + let isAllUploaded = await uploadAllImages(props, data, allFilesToUpload, JCP_TYPE, EmpData); + + console.log('isAllUploaded-->', isAllUploaded); + + + if (isAllUploaded == true) { + + await uploadStoreStatus(props, data, 'U', JCP_TYPE, EmpData); + await updateStoreStatuslocal('U', data); + notify(ST.Alldataandimagesuploadedfor + ' ' + StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } else { + notify(ST.Cannotuploadimagesfor + ' ' + StoreName, 'SHORT'); + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + } + else { + let isupdatedU = await uploadStoreStatus(props, data, 'U', JCP_TYPE, EmpData); + console.log('on no files found to upload , isupdated::', isupdatedU); + if (isupdatedU) { + await updateStoreStatuslocal('U', data); + notify(ST.Alldatauploadedfor + ' ' + StoreName, 'SHORT'); + } + if (index == AllStores.length - 1) { + setProcessing(false); + } + } + } + + async function getPJPStoresData(tbname, Stores = [], d2) { + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + let join, qt; + join = `INNER JOIN ${AppTables.COVERAGE_DATA} t2 on t2.STORE_ID=t1.StoreId and t2.EMP_ID=t1.MerchandiserId and t2.JCP_TYPE='${tbname}' `; + qt = `Select t1.*,t2.REASON_ID,t2.IMAGE,t2.CHECKOUT_IMAGE,t2.JCP_TYPE from ${tbname} t1 ${join} where t1.VisitDate='${d2}' and t1.UploadStatus in ('C','P','D','L','I')` + console.log('qt111', qt); + + txn.executeSql(qt, [], async function (txn2, txnres2) { + console.log('length of pjp', txnres2.rows.length); + if (txnres2.rows.length > 0) { + + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + Stores.push(data); + } + resolve(Stores); + } + else { + resolve(Stores); + } + }, function (txnE, txnerr) { console.log(txnerr); resolve(Stores); }); + + }); + }).then((val) => { + return val; + }) + .catch((err) => { + console.log(err); + return Stores; + }) + } + + async function storeVisited() { + console.log('isgeotag:', currentStore.GeoTag); + setShowStoreVisitModal(false); + + if (currentStore.GeoTag == 'N') { + setShowGeoTagModal(true); + } + else if (currentStore.UploadStatus == 'N' || currentStore.UploadStatus == '') { + // calLocatDistance(); + props.navigation.navigate('StoreCheckin', { storeData: currentStore, empData: EmpData, 'isAdhoc': isAdhocScreen, 'IsSearchedStore': showSearchWiseStore, 'isNPND': isNPNDScreen }); + } + else { + + } + } + + async function storeNotVisited() { + setShowStoreVisitModal(false); + props.navigation.navigate('StoreNonWorkingReasons', { storeData: currentStore, empData: EmpData, 'isAdhoc': isAdhocScreen, 'IsSearchedStore': showSearchWiseStore, 'isNPND': isNPNDScreen }); + } + + async function onVisitCancel() { + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + setLoaderTitle(ST.DeletingCheckInData + '...') + setShowCancelCIModal(false); + setProcessing(true); + let { MID, StoreId, EmpId, MerchandiserId } = cancelCheckOutStore; + let postdata = ''; + // const storewisePjp = await fetchProjectConfig(props.ManagerAppConfig); + const {StorewisePJP: storewisePjp, StoreSearch: storeSearch } = await fetchProjectConfig(props.ManagerAppConfig); + + console.log("storewisePjpVisitCancel::", storewisePjp); + + console.log("MerchandiserId:", MerchandiserId); + let methodN = getMethodName(METHODS.DELETECOVERAGE_METHOD); + postdata = { 'StoreId': StoreId, "UserId": props.UserId, "MerchandiserId": MerchandiserId, "VisitDate": d2 } + + if (storewisePjp == true) { + methodN = getMethodName(METHODS.DELETECOVERAGE_METHOD_SUPWISE); + postdata = { "MId": MID, "UserId": props.UserId } + } + const url = props.baseurl + methodN; + console.log(url, postdata); + await UploadData2(url, postdata) + .then(async (res) => { + console.log('delete coverage res:', res); + if (res == '1') { + let isdeleted = await deleteStore(cancelCheckOutStore); + if (isdeleted == true) { + + let data = ''; + + let ShowStoreSearch = storeSearch ? storeSearch : false; + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + + let designation = loginDetails?.Designation + + console.log("designation===", designation); + + if (showSearchWiseStore && designation != "Supervisor") { + data = { "StoreId": StoreId, UploadStatus: "N", tbname: "Sup_JourneyPlan", EmpId: MerchandiserId }; + } + else if (ShowStoreSearch ? (designation == "Supervisor" && storewisePjp == true) : storewisePjp == true) { + data = { "StoreId": StoreId, UploadStatus: "N", tbname: (isAdhocScreen == true ? 'Sup_JourneyPlanStorewiseSup_Adhoc' : 'Sup_JourneyPlanStorewiseSup'), EmpId: MerchandiserId }; + } + else { + data = { "StoreId": StoreId, UploadStatus: "N", tbname: (isAdhocScreen == true ? 'Sup_AdhocJourneyPlan' : 'Sup_JourneyPlan'), EmpId: MerchandiserId }; + } + let isUpdated = await UpdateStoreStatus(props, data); + if (isUpdated == true) { + await updateStoreStatuslocal('N', cancelCheckOutStore, true); + setProcessing(false); + console.log("check in removed called ======") + notify(ST.CheckInRemoved); + // if(showSearchWiseStore){ + // getCheckedInData(); // refresh user data + // } + + if (ShowStoreSearch && desig != "Supervisor") { + getCheckedInData(isAdhocRef.current, isNPNDRef.current); + } + } + else { + setProcessing(false); + notify(ST.CheckInremovedsuccessfullybutcannotupdatestatus); + } + } + else { + setProcessing(false); + notify(ST.CheckInremovedsuccessfullybutcannotupdatestatus); + } + } + else { + setProcessing(false); + notify(ST.CannotRemoveCheckIn); + } + + }).catch(err => { + console.log('onPage Team error', err); + setProcessing(false); + notify(ST.CannotRemoveCheckIn); + }); + + } + + async function deleteStore(storeData1) { + let { StoreId, MerchandiserId } = storeData1; + let allQueries = [ + `Delete from ${AppTables.COVERAGE_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}'`, + `Delete from ${AppTables.CHECKIN_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + `Delete from ${AppTables.GEOTAG} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.HEADER_BACK_OF_STORE} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.CHILD_BACK_OF_STORE} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.SALES} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.INSERT_OPENINGHEADER_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.STOCK_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.SHARE_OF_SHELF_IMAGE} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.SHARE_OF_SHELF_FACING_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.INSERT_SAMPLED_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.CONTACT_CONVERSION} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.INSERT_ERROR_TRACKING} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.GROOMING_IMAGE_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.ADDITIONAL_VISIBILITY} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + `Delete from ${AppTables.COMPETITION_VISIBILITY} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + `Delete from ${AppTables.COMPETITION_PROMOTION} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.PROMOTION_HEADER_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.PROMOTION_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.PAID_VISIBILITY_HEADER_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.PAID_VISIBILITY_CHILD_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + // `Delete from ${AppTables.PAID_VIS_CHECKLIST} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + `Delete from ${AppTables.STORE_IMAGES} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + `Delete from ${AppTables.SURVEY} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + `Delete from ${AppTables.VISAUDIT_HDR_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + `Delete from ${AppTables.VISAUDIT_CHILD_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + `Delete from ${AppTables.VISAUDIT_STOCK_DATA} where STORE_ID='${StoreId}' and EMP_ID='${MerchandiserId}' `, + ] + + return await Promise.all( + allQueries.map(async (q, index) => { + let isDeleted = await executeQuery(q); + return isDeleted == true; + }) + ) + .then((val) => { + // if(val.indexOf(false)<0){} + return true; + }).catch((err) => { + console.log(err); + return false; + }) + } + + async function executeQuery(q, type = '1') { + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + txn.executeSql(q, [], async function (txn2, txnres2) { + if (type == '1') { + resolve(true); + } + else { + let arr = []; + if (txnres2.rows.length > 0) { + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + arr.push(data); + } + resolve(arr); + } + else { + resolve([]); + } + } + }, function (txn2, txnerr) { console.log(txnerr); type == '1' ? resolve(false) : resolve([]); }); + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log(err); + let d = type == '1' ? false : []; + return d; + }) + } + + function FilterStores(searchedQry) { + searchedQry = searchedQry.toLowerCase(); + console.log('searchedQry', searchedQry); + let { storeList } = state; + let arr = [] + + if (searchedQry != null && searchedQry != '') { + globalStorelist.map((item, index) => { + console.log('itemstorelist', item) + let { StoreName, StoreId, StoreCode } = item; + StoreId = StoreId + ''; + + console.log('itemteamlist', item) + if (StoreName.toLowerCase().includes(searchedQry) || StoreCode.toLowerCase().includes(searchedQry) || StoreId.includes(searchedQry)) { + arr.push(item); + } + }); + } + else { + arr = globalStorelist; + } + console.log("console 5") + setState({ storeList: arr }); + setrerenderdata(!rerenderdata) + } + + function _render_StoreVisitModal() { + return ( + + + { storeVisited() }}> + {ST.Yes} + + { storeNotVisited() }}> + {ST.No} + + + + ) + } + + function _render_GeoTagModal() { + return ( + + + { setShowGeoTagModal(false) }}> + {ST.Cancel} + + { setShowGeoTagModal(false); props.navigation.navigate('GeoTag', { storeData: currentStore, empData: EmpData, 'isAdhoc': isAdhocScreen, 'IsSearchedStore': showSearchWiseStore, 'isNPND': isNPNDScreen }); }}> + {ST.OK} + + + + ) + + } + + function _render_CancelCheckinModal() { + let storename = cancelCheckOutStore.StoreName || ''; + return ( + + + + {ST.Yourallcheckindatawillbelost} + + + + + { setShowCancelCIModal(false); }}> + {ST.Cancel} + + { onVisitCancel() }}> + {ST.OK} + + + + ) + } + + async function onDistanceM_OK() { + console.log('storeDistanceinMpjp', storewisePjp); + + if (storewisePjp == true) { + if (props.GeoFenceEnable) { + if (storeDistanceinM > props.GeoFenceRadius) { + setShowDistanceModal(false); + notify(ST.Youcannotcheckin + ' ' + ST.Youarenotwithinthealloweddistancefromthestore + ' ' + props.GeoFenceRadius + ' m', 'LONG') + } + else { + setShowDistanceModal(false); props.navigation.navigate('StoreCheckin', { storeData: currentStore, empData: storeData, 'isAdhoc': isAdhocScreen, 'IsSearchedStore': showSearchWiseStore, 'isNPND': isNPNDScreen }); + } + } + else { + setShowDistanceModal(false); props.navigation.navigate('StoreCheckin', { storeData: currentStore, empData: storeData, 'isAdhoc': isAdhocScreen, 'IsSearchedStore': showSearchWiseStore, 'isNPND': isNPNDScreen }); + } + } + + else { + if (props.GeoFenceEnable) { + if (storeDistanceinM > props.GeoFenceRadius) { + setShowDistanceModal(false); + notify(ST.Youcannotcheckin + ' ' + ST.Youarenotwithinthealloweddistancefromthestore + ' ' + props.GeoFenceRadius + ' m', 'LONG') + } + else { + setShowDistanceModal(false); props.navigation.navigate('StoreCheckin', { storeData: currentStore, empData: EmpData, 'isAdhoc': isAdhocScreen, 'IsSearchedStore': showSearchWiseStore, 'isNPND': isNPNDScreen }); + } + } + } + } + + + function closeImageModal() { + setCheckOutImageModal(false); + } + + function cancelImage() { + setCheckOutImage(''); + setCheckOutImagePath(''); + closeImageModal(); + } + + async function openCamera() { + setCheckOutImageModal(false); + ChangeShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'front'}); + } + + async function getImage(imgdata) { + let storeData = checkOutStore + if (typeof imgdata == 'object' && imgdata.errorCode == 'camera_unavailable') { + notify(ST.Cameraunavailable); + } + else if (typeof imgdata == 'object' && imgdata.uri != null) { + const img = imgdata; + const imgurl = img.uri, imgWidth = img.width, imgHeight = img.height; + + + let picture_clicked_time = new Date(); + picture_clicked_time = moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1 = picture_clicked_time; + const mark_text2 = 'Store Name:' + storeData.StoreName + ' | Store Id:' + storeData.StoreId + ' | User Id:' + storeData.EmpId + ' | Image Type: Check Out' + ' | Date:' + picture_clicked_time; + + await marktext1(mark_text1, imgurl) + .then((res) => { + if (res.success) { + let uri = res.uri; + marktext2(mark_text2, uri, imgWidth, imgHeight) + .then((res) => { + if (res.success) { + let picture_clickedd = new Date(); + let picture_clicked_date = moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time = moment(picture_clickedd).format('HHmmss'); + let filename = storeData.StoreId + '_CheckoutImg-' + picture_clicked_date + '_' + picture_clicked_time + '.jpg'; + + setCheckOutImage(filename); + // renamefile + let imagePath = `${RNFS.DocumentDirectoryPath}/${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri = 'file://' + imagePath; + console.log('image marker', uri); + setCheckOutImagePath(uri); + }) + .catch(err => { + console.log(ST.Errorimagefilewritefailed + '!!!'); + console.log(err.message, err.code); + }); + + } + else { + if (res.imagenotfound) { + notify(ST.Pleasecaptureaimage); + } + else { + notify(res.error); + } + } + }); + } + else { + if (res.imagenotfound) { + notify(ST.Pleasecaptureaimage); + } + else { + notify(res.error); + } + } + }); + } + } + + + function _OpenCaptureImage_Modal() { + const isImageCap = (CheckOutImagePath == '' || CheckOutImagePath == null) ? false : true; + return ( + + { + !isImageCap && + + { openCamera() }}> + + + { closeImageModal() }}> + {ST.Cancel} + + + } + { + isImageCap && + + + + + { openCamera() }}> + + + {showImageSaveOp && + + { cancelImage() }}> + {ST.Cancel} + + { closeImageModal(); UpdateCheckOutStatus(CheckOutLoc); }}> + {ST.Save} + + } + {!showImageSaveOp && + { closeImageModal() }}> + {ST.Close} + + } + + + + } + + ) + } + + function _render_DistanceModal() { + return ( + + + {ST.Youneedtobeinthestore} + {ST.toCheckInCheckOut} + {`${ST.Alloweddistancefromstore}: ${(props.GeoFenceEnable == true ? props.GeoFenceRadius : '500')} m`} + {`${ST.Yourdistancefromstore}: ${storeDistance}`} + { onDistanceM_OK() }}> + Ok + + + + ) + + } + + async function gotoStoreSearch() { + props.navigation.navigate('SearchStoreList', { teamlistEmpData: EmpData, 'isAdhoc': isAdhocScreen, 'isNPND': isNPNDScreen }); + // props.navigation.navigate("SearchStoreList",{"teamlistEmpData":EmpData}); // addby me (17 apr); + } + + + const [designation, setDesignation] = useState('') + + useEffect(() => { + (async () => { + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + + // console.log("loginDetails--------",loginDetails ) + setDesignation(loginDetails?.Designation) + let columKey = loginDetails?.Designation == "Supervisor" ? "" : ""; + + })() + }, []) + + + // console.log("designation showSearchWiseStore showsearchwise_dummy SUP_StorewisePJP --> ", designation, showSearchWiseStore, showsearchwise_dummy, props?.SUP_StorewisePJP) + + + + return ( + + {processing && } + + {_render_StoreVisitModal()} + {_render_GeoTagModal()} + {_render_DistanceModal()} + {_render_CancelCheckinModal()} + {_OpenCaptureImage_Modal()} + {ConfirmSaveAlert(props, showAlert, onSaveCancel, getLocOnCheckout, ST.Doyoureallywanttocheckout)} + {/* { ChangeShowCamera(false); getImage(imgData) }} showCamera={showCamera} onHideCamera={() => { ChangeShowCamera(false); }} /> */} + + {console.log("setCheckOutImageModal==>", CheckOutImageModal)} + {/* { ChangeShowCamera(false); getImage(imgData); setCheckOutImageModal(false) }} + showCamera={showCamera} + onHideCamera={() => { ChangeShowCamera(false); }} + /> */} + + { setCheckOutImageModal(true); ChangeShowCamera(false); getImage(imgData) }} showCamera={showCamera} onHideCamera={() => { ChangeShowCamera(false); }} /> + + + + {!props.isDataDownloaded && } + + + + + {/* {designation != 'Supervisor' && showSearchWiseStore == true && ( + <> + gotoStoreSearch()}> + + + {showStoreSearchLabel ? showStoreSearchLabel : 'Store Search'} + + + + + Added Stores + + + )} */} + + {designation == 'Supervisor' && + + + { props.navigation.pop(); props.navigation.push('StoreList', { 'showSearchWiseStore': showSearchWiseStore, 'empData': EmpData, 'isAdhoc': false, isNPND: false }) }}> + {ST.Planned} + + { props.navigation.pop(); props.navigation.push('StoreList', { 'showSearchWiseStore': showSearchWiseStore, 'empData': EmpData, 'isAdhoc': true, isNPND: false }) }}> + {ST.Adhoc} + + {props.ShowNPND == true && + { props.navigation.pop(); props.navigation.push('StoreList', { 'showSearchWiseStore': showSearchWiseStore, 'empData': EmpData, 'isAdhoc': false, isNPND: true }) }}> + {props.ShowNPNDLabel} + + } + + } + + + {designation != 'Supervisor' && storewisePjp.StorewisePJP == false && storewisePjp.StoreSearch == false && + + + { props.navigation.pop(); props.navigation.push('StoreList', { 'showSearchWiseStore': showSearchWiseStore, 'empData': EmpData, 'isAdhoc': false, isNPND: false }) }}> + {ST.Planned} + + { props.navigation.pop(); props.navigation.push('StoreList', { 'showSearchWiseStore': showSearchWiseStore, 'empData': EmpData, 'isAdhoc': true, isNPND: false }) }}> + {ST.Adhoc} + + {props.ShowNPND == true && + { props.navigation.pop(); props.navigation.push('StoreList', { 'showSearchWiseStore': showSearchWiseStore, 'empData': EmpData, 'isAdhoc': false, isNPND: true }) }}> + {props.ShowNPNDLabel} + + } + + } + + + + + + + + + + {designation !== 'Supervisor' && ( + <> + {/* Case 1 & 2: props?.SUP_StorewisePJP doesn't matter, show search when showSearchWiseStore = true */} + {showSearchWiseStore == true && ( + <> + gotoStoreSearch()}> + + + {showStoreSearchLabel ? showStoreSearchLabel : 'Store Search'} + + + + + Added Stores + + + )} + + {/* Case 3: props?.SUP_StorewisePJP = true & showSearchWiseStore = false */} + {/* {console.log("Rendering store tabs::",storewisePjp.StorewisePJP)} */} + {storewisePjp.StorewisePJP == true && storewisePjp.StoreSearch == false && ( + + + { props.navigation.pop(); props.navigation.push('StoreList', { showSearchWiseStore, empData: EmpData, isAdhoc: false, isNPND: false }) }}> + + {ST.Planned} + + + + { + props.navigation.pop(); props.navigation.push('StoreList', { + showSearchWiseStore, empData: EmpData, isAdhoc: true, isNPND: false + }) + }} > + + {ST.Adhoc} + + + + {props.ShowNPND == true && ( + { props.navigation.pop(); props.navigation.push('StoreList', { showSearchWiseStore, empData: EmpData, isAdhoc: false, isNPND: true }) }}> + + {props.ShowNPNDLabel} + + + )} + + + )} + + )} + + + + + { setSearchedItem(val); FilterStores(val) }} + autoComplete='off' + /> + { FilterStores(searchedItem) }}> + + + + + + {nodataFound && + + { + showSearchWiseStore == true ? + {`${ST.NoDataAvailable}\n Tap on Store Search on top.`} + : + {ST.NoDataAvailable} + + } + + } + {(props.isDataDownloaded == true && !nodataFound) && + + { + return ( + + ); + }} + /> + + } + + + + + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(StoreList); \ No newline at end of file diff --git a/src/screens/StoreNonWorkingReasons.js b/src/screens/StoreNonWorkingReasons.js new file mode 100644 index 0000000..cd0f682 --- /dev/null +++ b/src/screens/StoreNonWorkingReasons.js @@ -0,0 +1,906 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { customStyles,GetPageTheme } from "../styles/Global"; +import {Image,View,Text,ScrollView,TouchableOpacity,FlatList} from 'react-native'; +import { connect } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {marktext1,marktext2, UpdateStoreStatus, UploadData, UploadData2, UploadFormData,fetchProjectConfig} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {AppVersion, db, URL_IMAGE, version} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {AntDesign, Entypo, MaterialCommunityIcons,} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import NoDataComponent from '../components/NoDataComponent'; +import {SvgXml} from 'react-native-svg'; +import CustomModal from '../components/CustomModal'; +import GradientButton from '../components/gradientButton'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +// import Geolocation from '@react-native-community/geolocation'; +import Geolocation from 'react-native-geolocation-service'; + +import {_checkLocationPermission} from '../components/geolocation'; +import CustomCamera from '../components/Camera'; + +import cameraImg from '../assets/performics/camera_front_image.svg'; +import CameraImg2 from '../assets/performics/camera_icon.svg'; +import CameraImg3 from '../assets/performics/camera_tick.svg'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; +import { AppTables } from '../constants/tableConstants'; +import { uploadStoreStatus } from '../constants/uploadData'; +import { ConfirmSaveAlert } from '../components/alert'; + + +function StoreNonWorkingReasons(props) { + console.log('StoreNonWorkingReasons props:',props); + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const [processing, setProcessing] = useState((props.isDataDownloaded?true:false)); + + const [storeData, setStoreData] = useState({}); + const [nonWorkingRsns, setNonWorkingRsns] = useState([]); + const [selectedReason, setSelectedReason] = useState({}); + const [reason, setReason] = useState(''); + const [reasonId, setReasonId] = useState(''); + const [Image1, setImage1] = useState(''); + const [Image1Path, setImage1Path] = useState(''); + const [showModal, setShowModal] = useState(false); + const [showImageSaveOp, setShowImageSaveOp] = useState(true); + const [showAlert, setShowAlert] = useState(false); + const [rerenderdata, setrerenderdata]= useState(0); + const [location, setLocation] = useState({}); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [isNPNDScreen, setisNPNDScreen] = useState(false); + const [isAnyStoreUploaded, setIsAnyStoreUploaded] = useState(false); + + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const [EmpData, setEmpData] = useState([]); + const [IsSearchedStore, setIsSearchedStore] = useState(false); + const [designation, setDesignation] = useState(''); + + + useEffect(()=>{ + (async() => { + let params=props.route.params? props.route.params:{}; + + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + + // const storewisePjp = await fetchProjectConfig(props.ManagerAppConfig); + const {StorewisePJP: storewisePjp, StoreSearch: storeSearch } = await fetchProjectConfig(props.ManagerAppConfig); + console.log("storewisePjp_get>>:",storeSearch, storewisePjp); + + setDesignation(loginDetails?.Designation) + })() + },[]) + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params = props.route.params ? props.route.params : {}; + let storeData1 = params.storeData || {}; + let empData1 = params.empData || {}; + let IsSearchedStore1 = params.IsSearchedStore != null && params.IsSearchedStore == 1 ? true : false; + + let isAdhoc = params.isAdhoc || false; + let isNPND=params.isNPND!=null?params.isNPND:false; + setIsAdhocScreen(isAdhoc); + setisNPNDScreen(isNPND) + setIsSearchedStore(IsSearchedStore1); + setStoreData(storeData1); + setEmpData(empData1); + + getNonWorkingRsns(storeData1, isAdhoc); + getData(storeData1, isAdhoc); + + const willFocusSubscription = props.navigation.addListener('focus', onBeforeRemove); + + return function cleanup() { + willFocusSubscription(); // Call the unsubscribe function + }; + }, []); + + useEffect(() => { + const beforeRemoveListener = props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + beforeRemoveListener(); // Call the unsubscribe function + }; + }, [showCamera]); + + function onBeforeRemove(e) { + if (showCamera == true) { + e.preventDefault(); + setShowCamera(false); + } + // No else needed - if showCamera is false, the event will proceed normally + } + + + async function getNonWorkingRsns(storeData1,isAdhoc){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let token=await get_item('loginToken'); + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + + let q=`SELECT * FROM Sup_NonWorkingReason where ShowStore='1'`; + + await db.transaction(async function (txn) { + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + // show from local + var storeArr=[]; + for(var i=0;i>:", storewisePjp); + + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let ShowStoreSearch= storeSearch?storeSearch:false; + console.log("designation",designation) + + let tbname1='',tbname2='',checkTbl2=true; + if (ShowStoreSearch && designation != 'Supervisor'){ + tbname1="Sup_JourneyPlan"; + checkTbl2=false; + } + else if(ShowStoreSearch ? (designation == "Supervisor" && storewisePjp==true):storewisePjp==true){ + tbname1="Sup_JourneyPlanStorewiseSup"; + tbname2="Sup_JourneyPlanStorewiseSup_Adhoc"; + } + else{ + tbname1="Sup_JourneyPlan"; + tbname2="Sup_AdhocJourneyPlan"; + } + + let q=`Select t1.* from ${tbname1} t1 where t1.VisitDate='${d2}' and t1.UploadStatus!='N' and t1.UploadStatus!='' ` + + let q2=`Select t1.* from ${tbname2} t1 where t1.VisitDate='${d2}' and t1.UploadStatus!='N' and t1.UploadStatus!='' ` + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + // show from local + resolve(true); + } + else if(checkTbl2){ + await txn.executeSql(q2,[],async function (txn2, txnres3) { + if(txnres3.rows.length>0){ + // show from local + resolve(true); + } + else{ + resolve(false); + } + },function(txn2,txnerr){console.log(txnerr);resolve(false); }); + } + else{ + resolve(false); + } + },function(txn2,txnerr){console.log(txnerr);resolve(false); }); + + }); + + }).then((val)=>{ + return val; + }).catch((err)=>{ + return false; + }); + } + + async function _getCurrentLocation() { + const {StorewisePJP: storewisePjp, StoreSearch: storeSearch } = await fetchProjectConfig(props.ManagerAppConfig); + console.log("storewisePjp_get>>:",storeSearch, storewisePjp); + const hasPermission=await _checkLocationPermission(); + if(hasPermission==true) + { + setProcessing(true); + Geolocation.getCurrentPosition( + async (position) => { + let loc={lat:position.coords.latitude,lng:position.coords.longitude}; + setLocation(loc); + if(selectedReason.EntryAllow=='true' || selectedReason.EntryAllow==true || selectedReason.EntryAllow==1){ + (storewisePjp && (isAdhocScreen || isNPNDScreen)) ? await createJCP(loc,storewisePjp,storeSearch): await uploadNonWRsnWithImage(loc,'L',storewisePjp,storeSearch); + //await uploadNonWRsnWithImage(loc,'L'); + } + else{ + await uploadNonWRsn(loc,'U',storewisePjp); + } + }, + (error) => { + notify(ST.Cannotgetuserposition); + setProcessing(false); + }, + { enableHighAccuracy: true, distanceFilter: 0, interval: 1000, fastestInterval: 2000 } + ); + } + else{ + notify(ST.Pleaseallowlocationpermission); + } + } + + async function uploadNonWRsn(loc,UploadStatus='U',storewisePjp){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let data={ + "Mid":storeData.MID, + "StoreId":storeData.StoreId, + "VisitDate":d2, + "Latitude":(loc.lat || ''), + "Longitude":(loc.lng || ''), + "ReasonId":reasonId, + "Remark":"", + "Appversion":AppVersion, + "UploadStatus":UploadStatus, + "UserName":(props.UserId || ''), + } + + const url=props.baseurl+getMethodName(METHODS.COVERAGENOTALLOW_METHOD); + console.log('url',url); + console.log('data',data); + await UploadData(url,data) + .then(async(res)=>{ + console.log('COVERAGENOTALLOW_METHOD',res); + if(res=='1'){ + let isupdated=await update_Store_UploadStatus(false); + if(isupdated==true){ + notify(ST.AllDataUploaded+'!','SHORT'); + setProcessing(false); + console.log('') + goBack(); + } + else{ + notify(ST.DataUploadedButcouldnotupdatestorestatus,'SHORT'); + setProcessing(false); + } + } + else{ + setProcessing(false); + notify(ST.Cannotuploaddata,'SHORT'); + } + }) + .catch((err)=>{ + console.log(err); + }); + } + + async function uploadNonWRsnWithImage(loc,UploadStatus='L',storewisePjp,storeSearch){ + console.log('uploadNonWRsnWithImage called'); + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let Deviation=(isAdhocScreen==true)?1:isNPNDScreen?2:0; + + var data1 = new FormData(); + if(Image1Path!='' && Image1Path!=null){ + + data1.append('file', { + uri: Image1Path, + type: 'image/jpg', + name: Image1, + }); + + let foldername=getFolderName(Image1); + data1.append('Foldername',foldername); + data1.append('Path', d2); + } + + // data1.append('UserName', (props.UserId || '')); + + + let data={ + "StoreId": storeData.StoreId, + "VisitDate": d2, + "MerchandiserId": storeData.MerchandiserId, + "Latitude": (loc.lat || ''), + "Longitude" :(loc.lng || ''), + "ReasonId": reasonId, + "Remark":"", + "CheckInImage":"", + "AppVersion":AppVersion, + "Checkout_Image": Image1, + "ChainId": storeData.ChainId, + "StoreTypeId": storeData.StoreTypeId, + "ChannelId": storeData.ChannelId, + "UploadStatus":UploadStatus, + "UserId":(props.UserId || ''), + "Deviation": Deviation + } + + const url=props.baseurl+getMethodName(METHODS.GETCOVERAGE_METHOD); + const url1=(props.imageUploadUrl || URL_IMAGE)+getMethodName(METHODS.UPLOADIMAGES_METHOD); + console.log('url',url); + console.log('data',data); + console.log('url1',url1); + + let ShowStoreSearch= storeSearch?storeSearch:false; + console.log("designation",designation) + + let tbname=''; + if (ShowStoreSearch && designation != 'Supervisor'){ + tbname="Sup_JourneyPlan"; + } + else if(ShowStoreSearch ? (designation == "Supervisor" && storewisePjp==true):storewisePjp==true){ + tbname=isAdhocScreen==true?"Sup_JourneyPlanStorewiseSup_Adhoc":"Sup_JourneyPlanStorewiseSup"; + console.log('tbnamestore',tbname) + } + else{ + tbname=isAdhocScreen==true?"Sup_AdhocJourneyPlan":"Sup_JourneyPlan"; + console.log('tbnameteamlist',tbname) + } + + await UploadData2(url,data) + .then(async(res)=>{ + console.log('res:',res); + if(parseInt(res)>0){ + let isUpdated=await InsertCoverageData(UploadStatus,storewisePjp,storeSearch); + console.log('is inserted:',isUpdated); + if(isUpdated==true){ + // Upload Image + if((selectedReason.ImageAllow=='true' || selectedReason.ImageAllow=='1' || selectedReason.ImageAllow==true) && Image1Path!='' && Image1Path!=null){ + console.log('upload IMage'); + await UploadFormData(url1,data1) + .then(async(res1)=>{ + console.log('res1:',res1); + + + let isuploaded=await uploadStoreStatus(props,storeData,'U',tbname); + + if(isuploaded==true){ + notify(ST.DataUploaded+'!'); + setProcessing(false); + console.log('222222222') + props.navigation.goBack(); + } + else + { + console.log('IMage not uploaded'); + notify(ST.Cannotuploaddata); + + setProcessing(false); + } + + }) + .catch((err)=>{ + console.log(err); + }); + } + else{ + console.log('upload status:',isuploaded); + + let isuploaded=await uploadStoreStatus(props,storeData,'U',tbname); + console.log('upload status:',isuploaded); + if(isuploaded==true){ + notify(ST.DataUploaded+'!'); + setProcessing(false); + console.log('11111111111') + goBack(); + } + else{ + notify(ST.Cannotuploaddata); + setProcessing(false); + } + + } + } + else{ + setProcessing(false); + notify(ST.Cannotuploaddata); + } + } + else{ + setProcessing(false); + notify(ST.Cannotuploaddata); + } + }) + .catch((err)=>{ + console.log(err);setProcessing(false);notify(ST.Cannotuploaddata); + }); + } + + async function InsertCoverageData(UploadStatus,storewisePjp,storeSearch){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let now=moment(d1).format('MM/DD/YYYY HH:mm:ss'); + + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let ShowStoreSearch=storeSearch?storeSearch:false; + console.log("designation",designation) + + let {StoreId,MID}=storeData; + let {lat,lng}=location; + let q=`delete from ${AppTables.COVERAGE_DATA} where STORE_ID='${StoreId}' and EMP_ID='${storeData.MerchandiserId}' and VISIT_DATE='${d2}' `; + + let JcpType=""; + if (ShowStoreSearch && designation != 'Supervisor'){ + JcpType="Sup_JourneyPlan"; + } + else if(ShowStoreSearch ? (designation == "Supervisor" && storewisePjp==true):storewisePjp==true){ + JcpType=isAdhocScreen==true?"Sup_JourneyPlanStorewiseSup_Adhoc":"Sup_JourneyPlanStorewiseSup"; + } + else{ + JcpType=isAdhocScreen==true?"Sup_AdhocJourneyPlan":"Sup_JourneyPlan"; + } + + let values=` ('${storeData.MerchandiserId}','${StoreId}','${d2}','${lat}','${lng}','${Image1}','${now}','${Image1Path}','${reasonId}','${reason}','','','${MID}','${JcpType}','${d2}')`; + let insert_q=` insert into ${AppTables.COVERAGE_DATA}(EMP_ID,STORE_ID,VISIT_DATE ,LATITUDE,LONGITUDE,IMAGE,CHECKOUT_TIME,CHECKOUT_IMAGE,REASON_ID,REASON,REMARK,STORE_FLAG,MID,JCP_TYPE,ADDED_DATE) values ${values}`; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('store coverage deleted'); + await txn.executeSql(insert_q,[],async function (txn2, txnres3) { + console.log('InsertCoverageData done'); + + },function(txn2,txnerr){console.log(txnerr);}); + },function(txn2,txnerr){console.log(txnerr);}); + + + let values2=` ('${storeData.MerchandiserId}','${StoreId}','${d2}','${lat}','${lng}','${now}','${Image1Path}','${now}','${Image1Path}','','${JcpType}','${d2}')`; + let insert_q2=` INSERT INTO ${AppTables.CHECKIN_DATA}(EMP_ID,STORE_ID,VISIT_DATE,LATITUDE,LONGITUDE,CHECKIN_TIME,CHECKIN_IMAGE,CHECKOUT_TIME,CHECKOUT_IMAGE,REMARK,JCP_TYPE,ADDED_DATE) values ${values2}`; + await txn.executeSql(`delete from ${AppTables.CHECKIN_DATA} where STORE_ID='${StoreId}' and EMP_ID='${storeData.MerchandiserId}' and VISIT_DATE='${d2}'`,[],async function (txn2, txnres2) { + console.log('store checkin deleted'); + await txn.executeSql(insert_q2,[],async function (txn2, txnres3) { + + console.log('store checkin added as leave'); + let issup=await update_Store_UploadStatus(true,storewisePjp,storeSearch); + resolve(issup); + + },function(txn2,txnerr){console.log(txnerr);resolve(false);}); + },function(txn2,txnerr){console.log(txnerr);resolve(false);}); + + }); + }).then((val)=>{ + console.log('on InsertCoverageData complete:',val); + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + + + + + } + + async function createJCP(loc,storewisePjp,storeSearch){ + console.log('create JCP called'); + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let data={"UserId":(props.UserId || ''),"JcpType":1,"StoreId":storeData.StoreId,"VisitDate":d2} + const url=props.baseurl+getMethodName(METHODS.CREATEJP_METHOD); + console.log(url,data); + await UploadData(url,data) + .then(async(res)=>{ + console.log(res); + if(res!=null && res!='' && res!='0' && parseInt(res)>0){ + updateMID(res,loc,storewisePjp,storeSearch);// update mid in db + } + else{ + setProcessing(false);notify(ST.OopsSomethingwentwrongcannotcreateJCP,'SHORT'); + } + + }) + .catch((err)=>{ + setProcessing(false);console.log(err); + }); + + } + + const goBack=()=>{ + props.navigation.goBack(); + } + + async function updateMID(MID=0,loc,storewisePjp,storeSearch){ + console.log('updateMID called',MID); + try{ + await db.transaction(async function (txn) { + let q=`UPDATE Sup_AdhocJourneyPlan SET MID='${MID}' WHERE StoreId='${storeData.StoreId}' `; + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('mid updated',storeData.StoreId,MID); + let new_st=storeData; + new_st['MID']=MID; + setStoreData(new_st); + uploadNonWRsnWithImage(loc,'L',storewisePjp,storeSearch); + + },function(txn2,txnerr){console.log(txnerr);}); + }); + } + catch(e){ + setProcessing(false); + notify(ST.CouldnotcreateJCP,'SHORT'); + } + } + + async function update_Store_UploadStatus(entryAllowed=true,storewisePjp,storeSearch){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let ShowStoreSearch=storeSearch?storeSearch:false; + console.log("designation",designation) + + if(entryAllowed==false){ + let tbname1='',tbname2='',checkTbl2=true; + if (ShowStoreSearch && designation != 'Supervisor'){ + tbname1="Sup_JourneyPlan"; + checkTbl2=false; + } + else if(ShowStoreSearch ? (designation == "Supervisor" && storewisePjp==true):storewisePjp==true){ + tbname1="Sup_JourneyPlanStorewiseSup"; + tbname2="Sup_JourneyPlanStorewiseSup_Adhoc"; + } + else{ + tbname1="Sup_JourneyPlan"; + tbname2="Sup_AdhocJourneyPlan"; + } + + let q=`UPDATE ${tbname1} SET UploadStatus='U' `; + await txn.executeSql(q,[],async function (txn2, txnres1) { + console.log('store status updated') + + if(checkTbl2){ + let q2=`UPDATE ${tbname2} SET UploadStatus='U' `; + await txn.executeSql(q2,[],async function (txn2, txnres2) { + console.log('store status updated') + resolve(true); + },function(txn2,txnerr){console.log(txnerr);resolve(false);}); + } + else{ + resolve(true); + } + },function(txn2,txnerr){console.log(txnerr);resolve(false);}); + } + else{ + let tbname=''; + if (ShowStoreSearch && designation != 'Supervisor'){ + tbname="Sup_JourneyPlan"; + } + else if(ShowStoreSearch ? (designation == "Supervisor" && storewisePjp==true):storewisePjp==true){ + tbname=isAdhocScreen==true?"Sup_JourneyPlanStorewiseSup_Adhoc":"Sup_JourneyPlanStorewiseSup"; + console.log('tbnamestore',tbname) + } + else{ + tbname=isAdhocScreen==true?"Sup_AdhocJourneyPlan":"Sup_JourneyPlan"; + console.log('tbnameteamlist',tbname) + } + + + let datan={StoreId:storeData.StoreId,UploadStatus:'L',tbname:tbname} ; + const isUpdated=await UpdateStoreStatus(props,datan); + resolve(isUpdated); + + } + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }) + } + + async function submitNonWorkingRsns(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function validate(){ + if(reasonId=='' || reasonId==null || reason=='' || reason==null){ + notify(ST.Pleaseselectreasonfornotworking,'SHORT'); + return false; + } + if( (selectedReason.ImageAllow=='true' || selectedReason.ImageAllow=='1' || selectedReason.ImageAllow==true) && (Image1Path=='' || Image1Path==null)){ + notify(ST.Pleaseclickselfieinfrontofstore,'SHORT'); + return false; + } + return true; + } + + async function selectReason(item){ + if(isAnyStoreUploaded==true && (item.EntryAllow=='false' || item.EntryAllow==false)){ + notify(ST.Youcannotselectthisreasonasthereisalreadyastore); + return; + } + + setSelectedReason(item); + setReason(item.Reason); + setReasonId(item.ReasonId); + setrerenderdata(!rerenderdata); + + if(item.ImageAllow=='1' || item.ImageAllow=='true' || item.ImageAllow==true){ + if((Image1Path!='' && Image1Path!=null)){ + setShowImageSaveOp(false); + } + else{ + setShowImageSaveOp(true); + } + openImageModal(); + } + } + + function openImageModal(){ + setShowModal(true); + } + + function closeImageModal(){ + setShowModal(false); + } + + function cancelImage(){ + setImage1(''); + setImage1Path(''); + closeImageModal(); + } + + async function getImage(imgdata){ + + console.log('imgdata',imgdata); + + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: Not Working'+' | Date:'+picture_clicked_time; + console.log('mark_text1',mark_text1,imgurl); + await marktext1(mark_text1,imgurl) + .then((res)=>{ + console.log("res.success",res.success) + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_NonworkImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + setImage1(filename); + // renamefile + let imagePath=`${RNFS.DocumentDirectoryPath}/${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker',uri); + setImage1Path(uri); + }) + .catch(err => { + console.log(ST.Errorimagefilewritefailed+'!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }).catch((err)=>{ + console.log("error--",err) + }); + } + } + + async function openCamera(){ + setShowCamera(true); + setShowModal(false); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'front'}) + } + + function onSaveCancel(){ + setShowAlert(false); + } + + async function saveData(){ + setShowAlert(false); + setLoaderTitle(ST.UploadingData+'...'); + _getCurrentLocation(); + } + + function _OpenCaptureImage_Modal(){ + const isImageCap=(Image1Path=='' || Image1Path==null)?false:true; + + console.log('isImageCap',isImageCap); + return ( + + { + !isImageCap && + + {openCamera()}}> + + + {closeImageModal()}}> + {ST.Cancel} + + + } + { + isImageCap && + + + + + {openCamera()}}> + + + { showImageSaveOp && + + {cancelImage()}}> + {ST.Cancel} + + {closeImageModal()}}> + {ST.Save} + + } + {!showImageSaveOp && + {closeImageModal()}}> + {ST.Close} + + } + + + + } + + ) + } + + return ( + + {processing && } + + {_OpenCaptureImage_Modal()} + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {setShowModal(true);setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + { !props.isDataDownloaded && } + {props.isDataDownloaded && Object.keys(storeData).length>0 && + + + + + + + + {storeData.StoreName} + + + + + + {ST.StoreId+':'} + {storeData.StoreId} + + + {ST.StoreCode+':'} + {storeData.StoreCode} + + + + + {ST.Address+':'} + {storeData.Address} + + + + + + + + + + + {ST.Reasonfornotworkinginstore} + { + + const nWselStyle=reasonId==item.ReasonId?customStyle.nWselStyle:{}; + const nWselStyleText=reasonId==item.ReasonId?customStyle.nWselStyleText:{}; + const CapImageShow=(Image1Path!='' && Image1Path!=null) && reasonId==item.ReasonId?true:false; + let isDisabled=(isAnyStoreUploaded==true && (item.EntryAllow=='false' || item.EntryAllow==false)); + return ( + {selectReason(item)}}> + {item.Reason} + { (item.ImageAllow=='1' || item.ImageAllow=='true' || item.ImageAllow==true) && + {selectReason(item)}}> + {!CapImageShow && } + {CapImageShow && } + + } + + ); + }} + /> + + + + + {submitNonWorkingRsns();}}/> + + + + + } + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(StoreNonWorkingReasons); \ No newline at end of file diff --git a/src/screens/SurveyCat.js b/src/screens/SurveyCat.js new file mode 100644 index 0000000..1ab9a10 --- /dev/null +++ b/src/screens/SurveyCat.js @@ -0,0 +1,196 @@ +import React,{useState,useEffect, useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { customStyles,GetPageTheme, STATUSBAR_HEIGHT } from "../styles/Global"; +import {Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,FlatList, Alert,Animated} from 'react-native'; +import { connect } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {db,} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { AntDesign } from '../components/icons'; +import { checkIf_surveyCatDone } from '../constants/ConstantQueries'; + + +function SurveyCat(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [surveys, setSurveys] = useState([]); + const [ActiveSurvey, setActiveSurvey]= useState({}); + const [EmpData, setEmpData] = useState([]); + + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let empData1=params.empData || {}; + let surveydata=params.surveyData || {}; + let menu1=params.menu || {}; + console.log("menu1========",menu1) + let isAdhoc=params.isAdhocScreen || false; + + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setEmpData(empData1); + setActiveSurvey(surveydata) + setCurrentMenu(menu1); + getData(surveydata,storeData1); + + const willFocusSubscription = props.navigation.addListener('focus', () => { + console.log('onfocus'); + getData(surveydata,storeData1); + }); + + return willFocusSubscription; + + }, []); + + useEffect(() => { + console.log('on AutoGoToPrev change',props.AutoGoToPrev); + if(props.AutoGoToPrev==true){ + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let surveydata=params.surveyData || {}; + getData(surveydata,storeData1,true); + } + }, [props.AutoGoToPrev]); + + + + // async function getData(surveydata,storeData1){ + // try { + // let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + // let surveyQtns=require('../constants/s_qtns.json'); + // // setSurveyJson(surveyQtns); + // let arr=[] + // for(const i in surveyQtns){ + // let item=surveyQtns[i] + // let {SurveyName,SurveyId,ShowCat,CategoryId,Category,CategorySequence}=item; + // let obj={SurveyName,SurveyId,ShowCat,Category,CategoryId} + + // if(item.SurveyId==surveydata.SurveyId && arr.findIndex(a=>a.CategoryId==item.CategoryId)<0) + // { + // arr.push(obj); + // } + // } + // setSurveys(arr);setProcessing(false); + + // } catch (err) { + // console.log(err); + // } + // } + + async function getData(surveydata,storeData1,isAutoBack=false){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + await db.transaction(async function (txn) { + + // await txn.executeSql(`Delete from ${AppTables.SURVEY} where SURVEY_ID='2' and CATEGORY_ID='13'`,[],async function (txn2, txnres) { + // console.log('deleted cat data'); + // },function (txn2, txnerr) { console.log(txnerr); },); + + + let q2=`SELECT DISTINCT T.Category,T.CategoryId , T.CategorySequence FROM Sup_Master_SurveyQuestion T INNER JOIN Mapping_SurveySup M ON T.SurveyId=M.SurveyId WHERE M.StoreId='${StoreId}' and T.SurveyId='${surveydata.SurveyId}' order by T.CategorySequence`; + + console.log('q2q2q2q2q2q2q2q2q2------',q2); + + await txn.executeSql(q2,[],async function (txn2, txnres) { + console.log('survey cats:',txnres.rows.length); + if(txnres.rows.length>0){ + let arr=[],isAllSurveyDone=true; + for(var i=0;i',data); + + let isDone=await checkIf_surveyCatDone(storeData1,surveydata.SurveyId,data.CategoryId,true) + data['isDone']=isDone; + arr.push(data); + if(!isDone){ + isAllSurveyDone=false; + } + if(i==txnres.rows.length-1){ + setSurveys(arr); + setProcessing(false); + console.log('isAllSurveyDone cat :',isAllSurveyDone,props.AutoGoToPrev,isAutoBack) + if(isAllSurveyDone==true && props.AutoGoToPrev==true && isAutoBack==true){ + props.navigation.goBack(); + } + } + } + } + + },function (txn2, txnerr) { console.log(txnerr); },); + + }); + } catch (err) { + console.log(err); + } + } + + + + function openSurveyView(item){ + props.set_autoback({'AutoGoToPrev':false}); + props.navigation.navigate('SurveyView',{'surveyData':ActiveSurvey,'catData':item,'storeData':storeData,'menu':currentMenu,'isAdhocScreen':isAdhocScreen,'ShowCat':true}); + } + + + return ( + + {processing && } + + + + + + {(ActiveSurvey.SurveyName!=null?(ActiveSurvey.SurveyName.length>26?ActiveSurvey.SurveyName.substring(0,26)+'...':ActiveSurvey.SurveyName) : '')} + + + { Object.keys(storeData).length>0 && + { + return( + {openSurveyView(item)}}> + + + {item.Category.substring(0,1)} + + {item.Category} + {(item.isDone!=null && item.isDone==true) && } + + + ); + }} + /> + } + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(SurveyCat); \ No newline at end of file diff --git a/src/screens/SurveyList.js b/src/screens/SurveyList.js new file mode 100644 index 0000000..208b6ab --- /dev/null +++ b/src/screens/SurveyList.js @@ -0,0 +1,170 @@ +import React,{useState,useEffect, useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { customStyles,GetPageTheme, STATUSBAR_HEIGHT } from "../styles/Global"; +import {Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,FlatList, Alert,Animated} from 'react-native'; +import { connect } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {db,} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { checkIf_surveyDone } from '../constants/ConstantQueries'; +import { AntDesign } from '../components/icons'; + + +function SurveyList(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [surveys, setSurveys] = useState([]); + const [EmpData, setEmpData] = useState([]); + const [isNPNDScreen, setisNPNDScreen] = useState(false); + + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let empData1=params.empData || {}; + let menu1=params.menu || {}; + let isAdhoc=params.isAdhocScreen || false; + let isNPND=params.isNPND!=null?params.isNPND:false; + + + setisNPNDScreen(isNPND); + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setEmpData(empData1); + setCurrentMenu(menu1); + getData(storeData1,false,menu1); + console.log('AA TO RHA H'); + + + const willFocusSubscription = props.navigation.addListener('focus', () => { + console.log('onfocus'); + getData(storeData1,false,menu1); + }); + + return willFocusSubscription; + }, []); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let menu1=params.menu || {}; + console.log('on AutoGoToPrev change (in list view)',props.AutoGoToPrev); + if(props.AutoGoToPrev==true){ + getData(storeData,true,menu1); + } + }, [props.AutoGoToPrev]); + + + async function getData(storeData1,isAutoBack=false,menu1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + await db.transaction(async function (txn) { + let q2=`SELECT DISTINCT T.SurveyName,T.SurveyId,T.ShowCat FROM Sup_Master_SurveyQuestion T INNER JOIN Mapping_SurveySup M ON T.SurveyId=M.SurveyId WHERE T.MenuId='${menu1?.MenuId}' AND M.StoreId='${StoreId}' `; + + console.log('q2q2========0------------->',q2); + + await txn.executeSql(q2,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[],isAllSurveyDone=true; + for(var i=0;i { + // props.navigation.goBack(); + // }, 1500); + } + } + } + + } + + },function (txn2, txnerr) { console.log(txnerr); },); + + }); + } catch (err) { + console.log(err); + } + } + + + function openSurveyView(item){ + let {ShowCat}=item + console.log('ShowCat:',ShowCat); + props.set_autoback({'AutoGoToPrev':false}); + if(ShowCat==1 || ShowCat=='true' || ShowCat==true){ + console.log('go to SurveyCat'); + props.navigation.navigate('SurveyCat',{'surveyData':item,'storeData':storeData,'empData':EmpData,'menu':currentMenu,'isAdhocScreen':isAdhocScreen,'isNPND':isNPNDScreen}); + } + else{ + props.navigation.navigate('SurveyView',{'surveyData':item,'storeData':storeData,'empData':EmpData,'menu':currentMenu,'isAdhocScreen':isAdhocScreen,'isNPND':isNPNDScreen,'ShowCat':false}); + } + } + + + return ( + + {processing && } + + + + + { Object.keys(storeData).length>0 && + { + return( + {openSurveyView(item)}}> + + + {item.SurveyName.substring(0,1)} + + {item.SurveyName} + {(item.isDone!=null && item.isDone==true) && } + + + ); + }} + /> + } + + + + ); +} + + +export default connect(mapStateToProps, mapDispatchToProps)(SurveyList) \ No newline at end of file diff --git a/src/screens/SurveyNew.js b/src/screens/SurveyNew.js new file mode 100644 index 0000000..e241ea8 --- /dev/null +++ b/src/screens/SurveyNew.js @@ -0,0 +1,135 @@ +import React,{useState,useEffect, useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { customStyles,GetPageTheme, STATUSBAR_HEIGHT } from "../styles/Global"; +import {Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,FlatList, Alert,Animated} from 'react-native'; +import { connect } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {db,} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { checkIf_surveyDone } from '../constants/ConstantQueries'; +import { AntDesign } from '../components/icons'; + + +function SurveyNew(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [surveys, setSurveys] = useState([]); + + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let storeData1={"Address": "test", "ChainId": 1, "ChainName": "GT", "ChannelId": 1, "CheckInTime": "", "CheckOutTime": "", "CityId": 3, "CityName": "Thailand", "ContactPerson": "bhhvhhhhhhh be", "Email": "njj", "EmpId": 4, "ExpiryStock": "N", "GeoFenceRadius": 500, "GeoTag": "Y", "InTime": "00:00:00", "Landmark": "-j", "Latitude": "28.5376374", "Location": "Lower Parel", "Longitude": "77.297907", "MID": 852, "Mobile": "9969999999", "OutTime": "00:00:00", "Phone": "6699996669", "Pincode": "400001", "RegionId": 1, "StateId": 1, "StateName": "Chiang Mai", "StoreCode": "W-S-LS-ST00008", "StoreId": 1, "StoreName": "teststore1", "StoreType": "D150", "StoreTypeId": 1, "UploadStatus": "N", "VisitDate": "05/09/2022"}; + let menu1={"MenuName":"Survey","MenuId":"1"}; + let isAdhoc=false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + getData(storeData1); + + const willFocusSubscription = props.navigation.addListener('focus', () => { + console.log('onfocus'); + getData(storeData1); + }); + + return willFocusSubscription; + }, []); + + + async function getData(storeData1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + await db.transaction(async function (txn) { + let q2=`SELECT DISTINCT T.SurveyName as SurveyName,T.SurveyId as SurveyId,T.ShowCat FROM Sup_Master_SurveyQuestion T INNER JOIN Mapping_Survey M ON T.SurveyId=M.SurveyId WHERE M.StoreId='${StoreId}' `; + await txn.executeSql(q2,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i + {processing && } + + + + + { Object.keys(storeData).length>0 && + { + return( + {openSurveyView(item)}}> + + + {item.SurveyName.substring(0,1)} + + {item.SurveyName} + {(item.isDone!=null && item.isDone==true) && } + + + ); + }} + /> + } + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(SurveyNew) \ No newline at end of file diff --git a/src/screens/SurveyView.js b/src/screens/SurveyView.js new file mode 100644 index 0000000..baebbf9 --- /dev/null +++ b/src/screens/SurveyView.js @@ -0,0 +1,1821 @@ +import React, { useState, useEffect, useRef } from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { customStyles, GetPageTheme, STATUSBAR_HEIGHT } from "../styles/Global"; +import { Image, TextInput, View, Text, ScrollView, TouchableOpacity, Platform, FlatList, Alert, Dimensions, Animated, Easing } from 'react-native'; +import { connect } from 'react-redux'; +import { mapStateToProps, mapDispatchToProps } from '../reducers/contextProvider'; +import { notify } from '../components/notify'; +import moment from 'moment'; +import { getKPIFields, marktext1, marktext2 } from '../controller/functions'; +import { db, common_ImagePath } from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import { AntDesign, Entypo, FontAwesome, FontAwesome5, Fontisto, MaterialCommunityIcons } from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector'; +import MultiSelect from 'react-native-multiple-select'; +import { PrimaryTheme } from '../styles/Themes'; +import DateTimePicker from '@react-native-community/datetimepicker'; +import DraggableFlatList, { ScaleDecorator } from 'react-native-draggable-flatlist' +// import AudioRecorderPlayer, { AudioEncoderAndroidType, AudioSourceAndroidType, AVEncoderAudioQualityIOSType, AVEncodingOption, AVModeIOSOption } from 'react-native-audio-recorder-player'; +import CustomCamera from '../components/Camera'; +import { SvgXml } from 'react-native-svg'; +import CameraImg5 from '../assets/image/astrickcamera.svg'; + +const { height, width } = Dimensions.get('window'); +const topbarht = STATUSBAR_HEIGHT + 50; +const actualWindowHt = parseInt((height - topbarht) + 10); + + + +function SurveyView(props) { + const route = useRoute(); + const ST = props.StaticText || {}; + const audioRecorderPlayer = ""; //new AudioRecorderPlayer(); + const AudioSet = {} + // { + // AudioEncoderAndroid: AudioEncoderAndroidType.AAC, + // AudioSourceAndroid: AudioSourceAndroidType.MIC, + // AVModeIOS: AVModeIOSOption.measurement, + // AVEncoderAudioQualityKeyIOS: AVEncoderAudioQualityIOSType.high, + // AVNumberOfChannelsKeyIOS: 2, + // AVFormatIDKeyIOS: AVEncodingOption.aac, + // }; + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [showRating, setShowRating] = useState(false); + const [RatingQtn, setRatingQtn] = useState({}); + const [RatingOrder, setRatingOrder] = useState([]); + const [showRecorder, setShowRecorder] = useState(false); + const [VRS, setVRS] = useState({}); + const [RecorderTimer, setRecorderTimer] = useState({}); + const [playerTimer, setPlayerTimer] = useState({}); + const [rerenderView, setRerenderView] = useState(0); + const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false); + const [VoiceRecorderStatus, setVoiceRecorderStatus] = useState(ST.Pressmictostartrecordingvoice); + const [RecFilePath, setRecFilePath] = useState({}); + const [dateValue, setDateValue] = useState(''); + const [openDatePicker, setOpenDatePicker] = useState(0); + const [storeData, setStoreData] = useState({}); + const [ShowCat, setShowCat] = useState(false); + const [ActiveSurvey, setActiveSurvey] = useState({}); + const [ActiveCategory, setActiveCategory] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [rerenderdata, setrerenderdata] = useState(0); + const [SurveySubCats, setSurveySubCats] = useState([]); + const [SurveyQuestions, setSurveyQuestions] = useState([]); + const [QuestionsData, setQuestionsData] = useState({}); + const [showAlert, setShowAlert] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps, setGetImageProps] = useState({}); + const [KPIFields, setKPIFields] = useState([]); + const [EmpData, setEmpData] = useState([]); + const [StoreCameraAllow, setStoreCameraAllow] = useState(true); + + // error field states + const [errorfield, setErrorField] = useState({}); + const [error, setError] = useState(false); + + const animatedRipple = useRef(new Animated.Value(0)).current; + const animatedRipple2 = useRef(new Animated.Value(0.5)).current; + + const d1 = new Date(); + const d2 = moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + console.log('print ho rha h'); + + setLoaderTitle(ST.Loading + '...') + let params = props.route.params ? props.route.params : {}; + let storeData1 = params.storeData || {}; + let surveydata = params.surveyData || {}; + let catData = params.catData || {}; + let menu1 = params.menu || {}; + let ShowCat1 = params.ShowCat || false; + let isAdhoc = params.isAdhocScreen || false; + let empData1 = params.empData || {}; + + // STORE WISE CAMERA + let cameraAllow=storeData1.CameraAllow=='true' || storeData1.CameraAllow==1?true:false; + setStoreCameraAllow(cameraAllow); + + // + + setShowCat(ShowCat1); + setIsAdhocScreen(isAdhoc); + setEmpData(empData1); + setStoreData(storeData1); + setActiveSurvey(surveydata) + setCurrentMenu(menu1); + setActiveCategory(catData) + console.log('catData =>',catData); + + + getSurveyData(surveydata, catData, storeData1, ShowCat1, menu1); + props.navigation.addListener('beforeRemove', onBeforeRemove); + return (() => { + // audioRecorderPlayer.removePlayBackListener(); + // audioRecorderPlayer.removeRecordBackListener(); + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }); + }, []); + + // useEffect(() => { + // props.navigation.removeListener('beforeRemove', onBeforeRemove); + // props.navigation.addListener('beforeRemove', onBeforeRemove); + // }, [hasUnsavedChanges]); + + // useEffect(() => { + // props.navigation.removeListener('beforeRemove', onBeforeRemove); + // props.navigation.addListener('beforeRemove', onBeforeRemove); + // }, [showCamera]); + + function onBeforeRemove(e) { + if (showCamera == true) { + e.preventDefault(); + setShowCamera(false); + } + else { + if (hasUnsavedChanges == true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else { + return; + } + } + } + + function onRemoveScreen(e) { + { setHasUnsavedChanges(false); props.navigation.dispatch(e.data.action); } + } + + + async function getSurveyData(item, catData = {}, storeData1, ShowCat1, menu1) { + try { + let { StoreId, MerchandiserId } = storeData1; + let { CategoryId } = catData; + let { SurveyId } = item; + + await db.transaction(async function (txn) { + + + let q2 = `SELECT DISTINCT SubCategory,SubCategoryId,SubCategorySequence FROM Sup_Master_SurveyQuestion T INNER JOIN Mapping_SurveySup M ON T.SurveyId=M.SurveyId WHERE M.StoreId='${StoreId}' and T.SurveyId='${SurveyId}' `; + if (ShowCat1 == true) { + q2 += ` and CategoryId='${CategoryId}' `; + } + q2 += ` order by SubCategorySequence`; + + console.log('q2q2q2q2q2===========>', q2); + + + await txn.executeSql(q2, [], async function (txn2, txnres) { + console.log('survey subcats:', txnres.rows.length); + if (txnres.rows.length > 0) { + let arr = [], allQtns = []; + for (var i = 0; i < txnres.rows.length; i++) { + let data = txnres.rows.item(i); + + let all_scat_qtns = await getSurveyQtns(item, catData, storeData1, ShowCat1, data, menu1) + console.log('all_scat_qtns:', all_scat_qtns.length) + data['Questions'] = all_scat_qtns; + allQtns = allQtns.concat(all_scat_qtns); + arr.push(data); + if (i == txnres.rows.length - 1) { + setSurveySubCats(arr); + setSurveyQuestions(allQtns); + setProcessing(false); + } + } + } else { + setProcessing(false); + // console.log('ASDFASDFAsdf asdfasdf'); + + // return( + // + // No Data + // + // ) + } + + }, function (txn2, txnerr) { console.log(txnerr); },); + + }); + } catch (err) { + console.log(err); + } + } + + + async function getSurveyQtns(item, catData, storeData1, ShowCat1, subCat, menu1) { + + return new Promise((resolve, reject) => { + try { + let { StoreId, MerchandiserId } = storeData1; + let { CategoryId } = catData; + let { SurveyId } = item; + let { SubCategoryId } = subCat; + + db.transaction(async function (txn) { + + // get inserted audit + let selectlist = ` DISTINCT T.MaxLength as MaxLength,T.CalFormula,T.RefImage,T.MinLength as MinLength,T.CategoryId,T.Category,T.SubCategoryId,T.SubCategory, T.Image1Mandatory, T.Image2Mandatory,T.QuestionImageMandatory,T.LengthValidation as LengthValidation,T.QuestionImageAllow as QuestionImageAllow,T.DateRange as DateRange,T.QEnable,T.Question as Question,T.QuestionId as QuestionId,T.QuestionType as QuestionType,T.QuestionTypeNew as QuestionTypeNew,T.OTP as OTP,T1.ANSWER As Answer, T1.ANSWER_ID as AnswerId,T1.IMAGE_ALLOW1 as ImageAllow1,T1.IMAGE1 as Image1,T1.IMAGE_ALLOW2 as ImageAllow2,T1.IMAGE2 as Image2,T1.MULTI_OPTIONS_IDS as multi_op_ids,T1.IS_DISABLED as isDisabled `; + let join = ` INNER JOIN Mapping_SurveySup M on T.SurveyId=M.SurveyId`; + let join2 = ` INNER JOIN ${AppTables.SURVEY} T1 on T.SurveyId=T1.SURVEY_ID and T.CategoryId=T1.CATEGORY_ID and T.SubCategoryId=T1.SUB_CATEGORY_ID And T.QuestionId=T1.QUESTION_ID AND T1.MENUID='${menu1?.MenuId}'`; + let q2 = `Select ${selectlist} FROM Sup_Master_SurveyQuestion T ${join} ${join2} WHERE T1.STORE_ID='${StoreId}' AND T1.EMP_ID='${MerchandiserId}' AND T1.VISIT_DATE= '${d2}' AND T1.SURVEY_ID=${SurveyId} AND T1.SUB_CATEGORY_ID='${SubCategoryId}' `; + if (ShowCat1 == true) { + q2 += ` AND T1.CATEGORY_ID=${CategoryId} `; + } + q2 += `group by T.QuestionId ORDER BY T.QuestionSequence `; + + console.log('getSurveyQtn query==>',q2); + + + await txn.executeSql(q2, [], async function (txn2, txnres) { + console.log('getSurveyData len', txnres.rows.length); + if (txnres.rows.length > 0) { + + let arr = []; + var QD = QuestionsData; + for (var i = 0; i < txnres.rows.length; i++) { + let data = txnres.rows.item(i); + let qtn = data; + // data.QEnable = data.QEnable === 1 || data.QEnable == 'true' || data.QEnable === true ? true : false; + data.QEnable = qtn.isDisabled == 1 || qtn.isDisabled == '1' || data.QEnable === true ? true : false + console.log('data.QEnable===>',data.QEnable); + + let answers = []; + + qtn.isDisabled = qtn.isDisabled == 1 || qtn.isDisabled == '1' || data.QEnable === true ? true : false + + if (data.QuestionTypeNew == 'Multi choice list' || data.QuestionTypeNew == 'Single choice list' || data.QuestionTypeNew == 'Rating') { + let allanswers = await getAnswers(data, item.SurveyId, storeData1, true); + + answers = allanswers.Answers || []; + if (data.QuestionTypeNew == 'Rating') { + data.showRating = false; + } + } + else if (data.QuestionTypeNew == 'Date') { + data.showDatePicker = false; + } + data.Answers = answers; + + let id_key = qtn.QuestionId + '_AnswerId'; + let ans_key = qtn.QuestionId + '_Answer'; + let multi_key = qtn.QuestionId + '_MultiOption'; + let date_key = qtn.QuestionId + '_Date'; + let img_key = qtn.QuestionId + '_ImagePath1'; + let imgname_key = qtn.QuestionId + '_ImageName1'; + let img_key2 = qtn.QuestionId + '_ImagePath2'; + let imgname_key2 = qtn.QuestionId + '_ImageName2'; + let rating_key = qtn.QuestionId + '_Rating'; + let voiceClip_key = qtn.QuestionId + '_VoiceClip'; + + let showImageTag = (data.QuestionImageAllow == true || data.QuestionImageAllow == 'true' || data.QuestionImageAllow == 1); + let showImageTag2 = false; + + QD[id_key] = data.AnswerId; + QD[ans_key] = data.Answer; + + + let selansid = data.AnswerId; + if (qtn.QuestionTypeNew == 'Multi choice list') { + selansid = data.multi_op_ids ? data.multi_op_ids.split(',') : []; + QD[multi_key] = data.multi_op_ids; + } + + if ((qtn.QuestionTypeNew == 'Single choice list' || qtn.QuestionTypeNew == 'Multi choice list')) { + if (qtn.Answers && qtn.Answers.length > 0) { + for (var k = 0; k < qtn.Answers.length; k++) { + let ansss = qtn.Answers[k]; + let isandImgAl = (ansss.ImageAllow1 == true || ansss.ImageAllow1 == 'true' || ansss.ImageAllow1 == 1); + let isandImgAl2 = (ansss.ImageAllow2 == true || ansss.ImageAllow2 == 'true' || ansss.ImageAllow2 == 1); + if (qtn.QuestionTypeNew == 'Single choice list' && (isandImgAl && ansss.AnswerId == selansid)) { + showImageTag = true; + } + else if (qtn.QuestionTypeNew == 'Multi choice list' && (isandImgAl && selansid.indexOf(ansss.AnswerId) >= 0)) { + showImageTag = true; + } + + if (qtn.QuestionTypeNew == 'Single choice list' && (isandImgAl2 && ansss.AnswerId == selansid)) { + showImageTag2 = true; + } + else if (qtn.QuestionTypeNew == 'Multi choice list' && (isandImgAl2 && selansid.indexOf(ansss.AnswerId) >= 0)) { + showImageTag2 = true; + } + + } + } + } + + if (showImageTag) { + let imgPath = data.Image1 != '' ? ((Platform.OS == 'ios' ? 'file://' : '') + common_ImagePath + data.Image1) : ''; + QD[imgname_key] = data.Image1; + QD[img_key] = imgPath; + } + + if (showImageTag2) { + let imgPath = data.Image2 != '' ? ((Platform.OS == 'ios' ? 'file://' : '') + common_ImagePath + data.Image2) : ''; + QD[imgname_key2] = data.Image2; + QD[img_key2] = imgPath; + } + + if (qtn.QuestionTypeNew == 'Audio') { + let voicefile_path = (Platform.OS == 'ios' ? 'file://' : '') + common_ImagePath + 'Recordings/' + data.Answer; + QD[voiceClip_key] = { 'path': voicefile_path, 'filename': data.Answer }; + } + + if (qtn.QuestionTypeNew == 'Date') { + let dayonly = moment().format('DD'); + let actual_date = data.Answer ? data.Answer.split('/') : []; + let month = actual_date[0], year = actual_date[1]; + let fulldate = month + '/' + dayonly + '/' + year; + QD[date_key] = fulldate; + + } + arr.push(data); + if (i == txnres.rows.length - 1) { + setQuestionsData(QD); + resolve(arr); + // setSurveyQuestions(arr); + // setProcessing(false); + } + } + } + else { + let sl = ` DISTINCT T.CategoryId,T.Category,T.CalFormula,T.RefImage,T.QuestionRefImage,T.Image1Mandatory, T.Image2Mandatory,T.QuestionImageMandatory,T.SubCategoryId,T.SubCategory,T.MaxLength,T.MinLength,T.LengthValidation,T.Question,T.QuestionId,T.QuestionTypeNew,T.OTP,T.QuestionImageAllow,T.DateRange,T.QEnable`; + let q = ` SELECT ${sl} FROM Sup_Master_SurveyQuestion T INNER JOIN Mapping_SurveySup M on T.SurveyId=M.SurveyId WHERE T.SurveyId='${SurveyId}' and T.SubCategoryId='${SubCategoryId}' and T.MenuId='${menu1?.MenuId}' `; + if (ShowCat1 == true) { + q += ` and T.CategoryId='${CategoryId}' `; + } + q += `group by T.QuestionId ORDER BY T.QuestionSequence `; + console.log(q, "else queryyyy"); + await txn.executeSql(q, [], async function (txn2, txnres2) { + // console.log('Surveys:', txnres2.rows.length) + let arr = []; + if (txnres2.rows.length > 0) { + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + data.QEnable = data.QEnable === 1 || data.QEnable == 'true' || data.QEnable == '1' || data.QEnable === true ? true : false; + + data['isDisabled'] = !data.QEnable + + let answers = []; + if (data.QuestionTypeNew == 'Multi choice list' || data.QuestionTypeNew == 'Single choice list' || data.QuestionTypeNew == 'Rating') { + let allanswers = await getAnswers(data, item.SurveyId, storeData1, false); + answers = allanswers.Answers || []; + if (data.QuestionTypeNew == 'Rating') { + data.showRating = false; + } + } + else if (data.QuestionTypeNew == 'Date') { + data.showDatePicker = false; + } + + data.Answers = answers; + arr.push(data); + + if (i == txnres2.rows.length - 1) { + resolve(arr); + } + } + } + else { + resolve([]); + } + + }, function (txn2, txnerr) { console.log(txnerr); resolve([]); },); + } + + }, function (txn2, txnerr) { console.log(txnerr); resolve([]); },); + + }); + } catch (err) { + console.log(err); + } + }) + } + + async function getAnswers(qtn, SurveyId, storeData1, isInserted) { + let { StoreId, ChainId, StateId, StoreTypeId } = storeData1; + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + // get inserted audit + let selectlist = ` DISTINCT T.Answer,T.AnswerId,T.ImageAllow1,T.ImageAllow2,T.EnableQuestion,T.DisableQuestion`; + let join = ` INNER JOIN Mapping_SurveySup M on T.SurveyId=M.SurveyId`; + let q2 = `Select ${selectlist} FROM Sup_Master_SurveyQuestion T ${join} WHERE T.QuestionId='${qtn.QuestionId}' AND T.SurveyId==${SurveyId} AND T.SubCategoryId='${qtn.SubCategoryId}' ORDER BY T.AnswerSequence `; + + + txn.executeSql(q2, [], async function (txn2, txnres) { + // console.log('answers len',txnres.rows.length); + if (txnres.rows.length > 0) { + let arr = []; + for (var i = 0; i < txnres.rows.length; i++) { + let data = txnres.rows.item(i); + arr.push(data); + if (i == txnres.rows.length - 1) { + setSurveyQuestions(arr); + resolve(arr); + } + } + } + else { + resolve([]); + } + }, function (txn2, txnerr) { console.log(txnerr); resolve([]); }); + + }); + }).then((val) => { + return { 'Answers': val, 'Success': true }; + }).catch((err) => { + console.log(err); + return { 'Success': false, 'Error': err } + }); + } + + async function getImage(imgdata) { + let qtn = getImageProps.qtn || ''; + let type = getImageProps.type || '1'; + if (typeof imgdata == 'object' && imgdata.errorCode == 'camera_unavailable') { + notify(ST.Cameraunavailable); + } + else if (typeof imgdata == 'object' && imgdata.uri != null) { + const img = imgdata; + const imgurl = img.uri, imgWidth = img.width, imgHeight = img.height; + + + let picture_clicked_time = new Date(); + picture_clicked_time = moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1 = picture_clicked_time; + const mark_text2 = 'Store Name:' + storeData.StoreName + ' | Store Id:' + storeData.StoreId + ' | Survey Id:' + ActiveSurvey.SurveyId + ' | Question Id :' + qtn.QuestionId + ' | Image Type: Survey' + ' | Date:' + picture_clicked_time; + + await marktext1(mark_text1, imgurl) + .then((res) => { + if (res.success) { + let uri = res.uri; + marktext2(mark_text2, uri, imgWidth, imgHeight) + .then((res) => { + if (res.success) { + let picture_clickedd = new Date(); + let picture_clicked_date = moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time = moment(picture_clickedd).format('HHmmss'); + let filename = storeData.StoreId + '_' + ActiveSurvey.SurveyId + '_' + qtn.QuestionId + '_SurveyImg_' + picture_clicked_date + '_' + picture_clicked_time + '.jpg'; + + let qd = QuestionsData; + let img_key = type == '1' ? qtn.QuestionId + '_ImagePath1' : qtn.QuestionId + '_ImagePath2'; + let imgname_key = type == '1' ? qtn.QuestionId + '_ImageName1' : qtn.QuestionId + '_ImageName2'; + qd[imgname_key] = filename; + + // renamefile + let imagePath = `${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri = 'file://' + imagePath; + // console.log('image marker', uri); + qd[img_key] = uri; + + setQuestionsData(qd); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else { + if (res.imagenotfound) { + notify(ST.Pleasecaptureaimage); + } + else { + notify(res.error); + } + } + }); + } + else { + if (res.imagenotfound) { + notify(ST.Pleasecaptureaimage); + } + else { + notify(res.error); + } + } + }); + } + } + + async function openCamera(qtn, type) { + setGetImageProps({ 'qtn': qtn, 'type': type }); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function disableQtns(sqtns, DQtns, data, isreturn = false) { + + console.log('data=======>', data); + + + if (DQtns.length > 0) { + new Promise.all( + DQtns.map((qid, q_index) => { + let s_qtnindex = sqtns.findIndex(i => i.QuestionId == qid) || {}; + console.log('sqtns qid', qid, s_qtnindex) + let s_qtn = s_qtnindex >= 0 ? sqtns[s_qtnindex] : {}; + + console.log('s_qtnindex=====>', s_qtnindex); + + + if (s_qtnindex >= 0) { + console.log('sqtns not found', s_qtnindex) + s_qtn['isDisabled'] = true + sqtns[s_qtnindex] = s_qtn; + let id_key = s_qtn.QuestionId + '_AnswerId'; + let ans_key = s_qtn.QuestionId + '_Answer'; + data[id_key] = 0; + data[ans_key] = ''; + + let imgname_key = s_qtn.QuestionId + '_ImageName1'; + let imgname_key2 = s_qtn.QuestionId + '_ImageName2'; + let img_key = s_qtn.QuestionId + '_ImagePath1'; + let img_key2 = s_qtn.QuestionId + '_ImagePath2'; + + data[img_key] = ''; + data[img_key2] = ''; + data[imgname_key] = ''; + data[imgname_key2] = ''; + + + } + return false + }) + ).then(async (val) => { + setSurveyQuestions(sqtns); + setQuestionsData(data); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + }) + } + } + + async function enableQtns(sqtns, EQtns, DQtns, data) { + new Promise.all( + EQtns.map((qid, q_index) => { + let s_qtnindex = sqtns.findIndex(i => i.QuestionId == qid) || {}; + let s_qtn = s_qtnindex >= 0 ? sqtns[s_qtnindex] : {}; + if (s_qtnindex >= 0) { + s_qtn['isDisabled'] = false + sqtns[s_qtnindex] = s_qtn; + } + return false + }) + ).then(async (val) => { + if (DQtns.length > 0) { + disableQtns(sqtns, DQtns, data) + } + else { + setSurveyQuestions(sqtns); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + }) + } + + function onselectionChange(option, qtn) { + + console.log('onselecting called'); + + let data = QuestionsData; + let id_key = qtn.QuestionId + '_AnswerId'; + let ans_key = qtn.QuestionId + '_Answer'; + data[id_key] = option.value; + data[ans_key] = option.label; + + let qid = qtn.QuestionId + + console.log('qid==>', qid); + + + setQuestionsData(data); + + console.log('datadatadatadatadatadatadatadatadatadata', data); + // console.log('option=============',qtn); + console.log('option=============', option?.value); + + + + + let aq_ans = qtn.Answers != null ? qtn.Answers : []; + let ans_obj = aq_ans.find(i => i.AnswerId == option.value) || {}; + let EQtns = ans_obj.EnableQuestion != null && ans_obj.EnableQuestion != '' ? ans_obj.EnableQuestion.replace(' ', '').split(',') : []; + let DQtns = ans_obj.DisableQuestion != null && ans_obj.DisableQuestion != '' ? ans_obj.DisableQuestion.replace(' ', '').split(',') : []; + + console.log('EQtns:', EQtns, DQtns); + let sqtns = SurveyQuestions + + // console.log('sqtns======>', JSON.stringify(sqtns)); + const answer = qtn?.Answers?.find(a => a?.AnswerId === option?.value); + console.log('answer===>', answer); + + // {"Answer": "Yes", "AnswerId": 155, "DisableQuestion": "", "EnableQuestion": "", "ImageAllow1": "true", "ImageAllow2": "false"} + + if (answer != null && (answer?.ImageAllow1 || answer?.ImageAllow2)) { + + let imgname_key = qid + '_ImageName1'; + let imgname_key2 = qid + '_ImageName2'; + let img_key = qid + '_ImagePath1'; + let img_key2 = qid + '_ImagePath2'; + + data[img_key] = ''; + data[img_key2] = ''; + data[imgname_key] = ''; + data[imgname_key2] = ''; + + } + + if (EQtns.length > 0) { + enableQtns(sqtns, EQtns, DQtns, data) + console.log('----------- called if--------'); + + } + else if (DQtns.length > 0) { + + console.log('----------- called else if--------'); + + disableQtns(sqtns, DQtns, data) + + + } + else { + console.log('----------- else only--------'); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + + } + + function setTextValue(value, qtn) { + let id_key = qtn.QuestionId + '_AnswerId'; + let ans_key = qtn.QuestionId + '_Answer'; + + let obj = QuestionsData; + if (qtn.QuestionTypeNew == 'Date') { + let date_key = qtn.QuestionId + '_Date'; + let d = value != null ? new Date(value) : new Date(); + let mfdate = moment(d).format('MM/YYYY'); + showQtnDatePicker(qtn, false); + obj[id_key] = 0; + obj[ans_key] = mfdate; + obj[date_key] = moment(d).format('MM/DD/YYYY'); + } + else { + obj[id_key] = 0; + obj[ans_key] = value; + } + console.log(value, obj); + setQuestionsData(obj); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function setRatingValue(data) { + // let ids=[]; + // data.map((item,index)=>{ + // ids.push(item.AnswerId); + // }) + setRatingOrder(data); + } + + async function setMultiSelectValue(selectedItems = [], qtn) { + console.log('setMultiSelectValue', selectedItems); + let id_key = qtn.QuestionId + '_AnswerId'; + let ans_key = qtn.QuestionId + '_Answer'; + let multi_key = qtn.QuestionId + '_MultiOption'; + let obj = QuestionsData; + obj[id_key] = 0; + obj[multi_key] = selectedItems.join(','); + let anss = []; + selectedItems.map((itemValue) => { + let ans = qtn.Answers.find(c1 => c1.AnswerId == itemValue); + if (ans.Answer) { anss.push(ans.Answer) } + }); + obj[ans_key] = anss.join(','); + console.log('obj:', obj); + + + + setQuestionsData(obj); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function showQtnDatePicker(qtn, show = false) { + let newqtnIndex = SurveyQuestions.findIndex(q => q.QuestionId == qtn.QuestionId); + console.log('showQtnDatePicker:', newqtnIndex); + if (newqtnIndex >= 0) { + let sq = SurveyQuestions; + let newqtn = sq[newqtnIndex]; + newqtn.showDatePicker = show; + sq[newqtnIndex] = newqtn; + setSurveyQuestions(sq); + if (show == true) setrerenderdata(!rerenderdata); + } + } + + + function setShowQtnKey(qtn, key, show = false) { + if (key != null && key != '') { + let newqtnIndex = SurveyQuestions.findIndex(q => q.QuestionId == qtn.QuestionId); + console.log('setShowQtnKey:', newqtnIndex); + if (newqtnIndex >= 0) { + let sq = SurveyQuestions; + let newqtn = sq[newqtnIndex]; + newqtn[key] = show; + sq[newqtnIndex] = newqtn; + setSurveyQuestions(sq); + if (show == true) setrerenderdata(!rerenderdata); + } + } + } + + function onRatingCancel() { + setShowRating(false); + + } + + function onRatingSave() { + setShowRating(false); + + let qtn = RatingQtn; + let id_key = qtn.QuestionId + '_AnswerId'; + let ans_key = qtn.QuestionId + '_Answer'; + let rating_key = qtn.QuestionId + '_Rating'; + let ids = [], anss = []; + RatingOrder.map((item, index) => { + ids.push(item.AnswerId); + anss.push(item.Answer); + }) + let obj = QuestionsData; + obj[rating_key] = ids.join(','); + obj[id_key] = 0; + obj[ans_key] = anss.join(','); + + console.log(obj); + setQuestionsData(obj); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onRecordCancel() { + setShowRecorder(false); + } + + function onRecordSave() { + + let isRecorderPlaying = VRS.RecorderPlayStatus != null && VRS.RecorderPlayStatus == true; + let isPlayerPlaying = VRS.PlayerPlayStatus != null && VRS.PlayerPlayStatus == true; + + if (isRecorderPlaying) { + notify(ST.Pleasestoprecordingfirst); + return; + } + else if (isPlayerPlaying) { + stopPlayer(VRS); + // notify('Please stop playing audio first'); + // return; + } + + setShowRecorder(false); + let qtn = RatingQtn; + let id_key = qtn.QuestionId + '_AnswerId'; + let ans_key = qtn.QuestionId + '_Answer'; + let voiceClip_key = qtn.QuestionId + '_VoiceClip'; + + let obj = QuestionsData; + obj[ans_key] = RecFilePath.filename || ''; + obj[id_key] = 0; + obj[voiceClip_key] = RecFilePath; + + setQuestionsData(obj); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + const RippleAnimation = (value, minValue, maxValue, delay) => + Animated.loop( + Animated.sequence([ + Animated.timing(value, { + toValue: maxValue, + duration: 1000, + delay: delay, + useNativeDriver: (Platform.OS == 'ios' ? false : true), + }), + Animated.timing(value, { + toValue: minValue, + duration: 1000, + delay: delay, + useNativeDriver: (Platform.OS == 'ios' ? false : true), + }), + ]), + + ).start(); + + const startRecorder = React.useCallback(async (storeData1, qtn, ActiveSurvey1, vrStatus) => { + try { + console.log('startRecorder') + if (audioRecorderPlayer != null) { + + if (vrStatus['RecorderPlayStatus'] == true) { + notify(ST.AlreadyRecording + '...') + return; + } + else if (vrStatus['PlayerPlayStatus'] == true) { + notify(ST.Pleasestopplayerfirst) + return; + } + + stopPlayer(vrStatus); + + let picture_clickedd = new Date(); + let picture_clicked_date = moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time = moment(picture_clickedd).format('HHmmss'); + let commname = storeData1.StoreId + '_' + ActiveSurvey1.SurveyId + '_' + qtn.QuestionId + '_SurveyRecording_' + picture_clicked_date + '_' + picture_clicked_time; + let filename = Platform.OS == 'ios' ? commname + '.m4a' : commname + '.mp3'; + + const url = Platform.OS == 'ios' ? 'file://' + common_ImagePath + 'Recordings/' + filename : common_ImagePath + 'Recordings/' + filename; + const url_dir = common_ImagePath + 'Recordings/'; + console.log('write file url:', url); + RNFS.mkdir(url_dir).then((res) => { + + RNFS.writeFile(url, '') + .then(async (success) => { + // if(success!=null){ + const path = Platform.select({ + ios: url, + android: url, + }); + + const result = await audioRecorderPlayer.startRecorder(path, AudioSet); + + if (result != null && result != '') { + console.log('start recording now'); + vrStatus['RecorderPlayStatus'] = true; + setVRS(vrStatus); + setRecFilePath({ 'path': url, 'filename': filename }); + // animate + RippleAnimation(animatedRipple, 0, 1, 0); + RippleAnimation(animatedRipple2, 0, 1, 100); + + audioRecorderPlayer.addRecordBackListener((e) => { + let recordsec = e.currentPosition; + let data = { 'recordSecs': recordsec, 'recordTime': audioRecorderPlayer.mmssss(Math.floor(recordsec)) }; + if (vrStatus['RecorderPlayStatus'] == true) { + setRecorderTimer(data); + setHasUnsavedChanges(true); + setVoiceRecorderStatus(ST.RecordingPressmictostoprecording); + } + + console.log('recordsec:', recordsec); + if (recordsec >= 60 * 1000) { + stopRecorder(vrStatus); + notify(ST.Maximumrecordtimelimitreached, 'LONG'); + } + return; + }); + } + console.log('start recorder:', result); + // } + // else{ + // notify('Something Went Wrong! Cannot open file for recording!'); + // } + + }) + .catch((err) => { + console.log('eerriur1', err.message); + notify(ST.Somethingwentwrong + ' ' + ST.Cannotopenfileforrecording); + }); + }) + .catch((err) => { + console.log('eerriur2', err.message); + notify(ST.Somethingwentwrong + ' ' + ST.Cannotopenfileforrecording); + }); + + } + } + catch (e) { + console.log('error:', e); + } + + }, []); + + + + + + + const stopRecorder = React.useCallback(async (vrStatus) => { + try { + console.log('stopRecorder'); + if (audioRecorderPlayer != null) { + + animatedRipple.setValue(0); + animatedRipple2.setValue(0.5); + const uri = await audioRecorderPlayer.stopRecorder(); + // audioRecorderPlayer.removeRecordBackListener(); + + vrStatus['RecorderPlayStatus'] = false; + vrStatus['PlayerPlayStatus'] = false; + setPlayerTimer({}); + setVRS({ ...VRS, vrStatus }); + setVoiceRecorderStatus(ST.Pressmictostartrecordingvoice); + } + } + catch (e) { + console.log('error:', e); + } + + }, []); + + const startPlayer = React.useCallback(async (url, vrStatus1, type = '0') => { + try { + let vrStatus = VRS; + let qtn = RatingQtn; + if (audioRecorderPlayer != null) { + console.log('startPlayer1', url); + if (vrStatus['PlayerPlayStatus'] == true) { + notify(ST.AlreadyPlaying + '...') + return; + } + else if (vrStatus['RecorderPlayStatus'] == true) { + notify(ST.Pleasestoprecordingfirst) + return; + } + else if (url == '' || url == null) { + notify(ST.Filenotfound) + return; + } + + const result = await audioRecorderPlayer.startPlayer(url); + if (result != null) { + vrStatus['PlayerPlayStatus'] = true; + setVRS(vrStatus); + + audioRecorderPlayer.addPlayBackListener((e) => { + let playDuration = audioRecorderPlayer.mmssss(Math.floor(e.duration)); + let vrs = VRS; + let data = { 'playerSecs': e.currentPosition, 'totalDuration': e.duration, 'playDuration': playDuration, 'playTime': audioRecorderPlayer.mmssss(Math.floor(e.currentPosition),) }; + let data2 = { 'playerSecs': '0000', 'totalDuration': e.duration, 'playDuration': playDuration, 'playTime': "00:00:00" }; + if (vrs['PlayerPlayStatus'] == true) { + setPlayerTimer(e.currentPosition < 0 ? data2 : data); + } + if (e.currentPosition < 0) { + return; + } + let wp = e.duration != null ? Math.floor((e.currentPosition / e.duration) * 100) : 0; + console.log('wp:', wp); + if (wp >= 100 || isNaN(wp)) { + stopPlayer(vrs); + } + else if (type == '1' && wp < 1) { + pausePlayer(); + } + setProcessing(false); + return; + }); + } + else { + setProcessing(false); + } + } + } + catch (e) { + console.log('error:', e); + setProcessing(false); + } + + }, []); + + const resumePlayer = React.useCallback(async (url) => { + console.log('resume player') + let vrStatus = VRS; + const res = await audioRecorderPlayer.resumePlayer(); + console.log('res:', res); + if (res == 'No audio playing') { + startPlayer(url, vrStatus); + } + vrStatus['PlayerPlayStatus'] = true; + setVRS({ ...VRS, vrStatus }); + }, []); + + + const pausePlayer = React.useCallback(() => { + console.log('pause player') + let vrStatus = VRS; + audioRecorderPlayer.pausePlayer(); + vrStatus['PlayerPlayStatus'] = false; + setVRS({ ...VRS, vrStatus }); + }, []); + + const stopPlayer = React.useCallback(async (vrStatus) => { + try { + console.log('stop player now'); + + if (audioRecorderPlayer != null) { + const uri = await audioRecorderPlayer.stopPlayer(); + audioRecorderPlayer.removePlayBackListener(); + vrStatus['PlayerPlayStatus'] = false; + setVRS({ ...VRS, vrStatus }); + } + } + catch (e) { + console.log('error:', e); + } + + }, []); + + async function show_recorder(qtn) { + let voiceClip_key = qtn.QuestionId + '_VoiceClip'; + let url = QuestionsData[voiceClip_key] ? QuestionsData[voiceClip_key].path : ''; + setRatingQtn(qtn); + if ((RecorderTimer == null || Object.keys(RecorderTimer).length <= 0) && (playerTimer == null || Object.keys(playerTimer).length <= 0) && url != null && url != '') { + setLoaderTitle(ST.Loading + '...'); + setProcessing(true); + await startPlayer(url, VRS, '1'); + } + setRecFilePath((QuestionsData[voiceClip_key] || {})); + setShowRecorder(true); + } + + async function onSubmitData() { + let isvalid = await validate(); + if (isvalid) { + setShowAlert(true); + } + } + + function onSaveCancel() { + setShowAlert(false); + } + + async function saveData() { + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData + '...'); + setProcessing(true); + try { + let { StoreId, ChainId, StateId, StoreTypeId } = storeData; + await db.transaction(async function (txn) { + + + let q = `DELETE FROM ${AppTables.SURVEY} WHERE STORE_ID='${StoreId}' and EMP_ID='${storeData.MerchandiserId}' and VISIT_DATE='${d2}' and SURVEY_ID='${ActiveSurvey.SurveyId}' `; + if (ShowCat == true) { + q += ` and CATEGORY_ID='${ActiveCategory.CategoryId}' `; + } + + // remove old data + await txn.executeSql(q, [], async function (txn2, txnres) { + console.log('survey data deleted'); + }, function (txn2, txnerr) { console.log(txnerr); },); + + + var values = ''; + let { SurveyId, SurveyName } = ActiveSurvey; + for (var i = 0; i < SurveyQuestions.length; i++) { + values += values != '' ? ' , ' : ''; + + let qtn = SurveyQuestions[i]; + + let id_key = qtn.QuestionId + '_AnswerId'; + let ans_key = qtn.QuestionId + '_Answer'; + let multi_key = qtn.QuestionId + '_MultiOption'; + let date_key = qtn.QuestionId + '_Date'; + let img_key1 = qtn.QuestionId + '_ImagePath1'; + let imgname_key1 = qtn.QuestionId + '_ImageName1'; + let img_key2 = qtn.QuestionId + '_ImagePath2'; + let imgname_key2 = qtn.QuestionId + '_ImageName2'; + let rating_key = qtn.QuestionId + '_Rating'; + let voiceClip_key = qtn.QuestionId + '_VoiceClip'; + + let { CategoryId, Category, SubCategory, SubCategoryId, DateRange, LengthValidation, MaxLength, MinLength, OTP, Question, QuestionId, QuestionImageAllow, QuestionTypeNew } = qtn; + + let selansid = QuestionsData[id_key] || 0; + let selans = QuestionsData[ans_key] || ''; + let imgName1 = QuestionsData[imgname_key1] || ''; + let imgName2 = QuestionsData[imgname_key2] || ''; + let multiops = QuestionsData[multi_key] || ''; + let isQtnDisabled = qtn.isDisabled != null && qtn.isDisabled != '' ? qtn.isDisabled ? 1 : 0 : 0; + let allanss = qtn.Answers || {}; + let ans_obj = allanss.find(i => i.AnswerId == selansid) + let imgallow1 = ans_obj != null && ans_obj['ImageAllow1'] != null ? ans_obj.ImageAllow1 : false; + let imgallow2 = ans_obj != null && ans_obj['ImageAllow2'] != null ? ans_obj.ImageAllow2 : false; + let f_imgalloq1 = (QuestionImageAllow == 'true' || QuestionImageAllow == 1) || (imgallow1 == 'true' || imgallow1 == 1) + + values += ` ('${storeData.MerchandiserId}','${StoreId}','${d2}','${SurveyId}','${CategoryId}','${SubCategoryId}','${Question}','${QuestionId}','${QuestionTypeNew}','${selans}','${selansid}','${f_imgalloq1}','${(imgName1 || '')}','${imgallow2}','${(imgName2 || '')}','${multiops}','${isQtnDisabled}','${d2}','${currentMenu.MenuId}') `; + } + + let add_data = `INSERT INTO ${AppTables.SURVEY} (EMP_ID,STORE_ID,VISIT_DATE,SURVEY_ID,CATEGORY_ID,SUB_CATEGORY_ID,QUESTION,QUESTION_ID,QUESTION_TYPE,ANSWER,ANSWER_ID,IMAGE_ALLOW1,IMAGE1,IMAGE_ALLOW2,IMAGE2,MULTI_OPTIONS_IDS,IS_DISABLED,ADDED_DATE,MENUID) VALUES ${values} `; + + await txn.executeSql(add_data, [], async function (txn2, txnres) { + console.log('surveys added'); + // props.set_autoback({'AutoGoToPrev':true}); + notify(ST.Surveyupdatedsuccessfully, 'SHORT'); + setProcessing(false); + props.navigation.goBack(); + // props.navigation.navigate("SurveyList") + + }, function (txn2, txnerr) { console.log(txnerr); setProcessing(false); notify(ST.Cannotupdatesurvey) },); + + + }); + } catch (err) { + console.log(err); + } + } + + async function validate() { + function showError(obj, isErr) { + setErrorField(obj); + setError(isErr); + } + + var isvalid = true; + const QD = QuestionsData; + + // console.log('SurveyQuestions====>', JSON.stringify(SurveyQuestions)); + + + console.log(SurveyQuestions.length); + for (var i = 0; i < SurveyQuestions.length; i++) { + let qtn = SurveyQuestions[i]; + let selansid = '', selanswer = '', selimg = '', showImageTag = false, showImageTag2 = false; + let id_key = qtn.QuestionId + '_AnswerId'; + let ans_key = qtn.QuestionId + '_Answer'; + let multi_key = qtn.QuestionId + '_MultiOption'; + let date_key = qtn.QuestionId + '_Date'; + let img_key = qtn.QuestionId + '_ImagePath1'; + let imgname_key = qtn.QuestionId + '_ImageName1'; + let img_key2 = qtn.QuestionId + '_ImagePath2'; + let imgname_key2 = qtn.QuestionId + '_ImageName2'; + let rating_key = qtn.QuestionId + '_Rating'; + let voiceClip_key = qtn.QuestionId + '_VoiceClip'; + let list_mcdata = []; + + let isDisabled = qtn.isDisabled != null ? qtn.isDisabled : false + + + let errorobj = { 'EF_Qtn': qtn }; + + if (isDisabled == true) { + + } + else { + let isImgAllowed = (qtn.QuestionImageAllow == true || qtn.QuestionImageAllow == 'true' || qtn.QuestionImageAllow == 1 && (qtn.QuestionTypeNew == "Image")); + let isImg1mandatory = (qtn?.Image1Mandatory == true || qtn?.Image1Mandatory == 'true' || qtn?.Image1Mandatory == '1' || qtn?.Image1Mandatory == 1); + let isImg2mandatory = (qtn?.Image2Mandatory == true || qtn?.Image2Mandatory == 'true' || qtn?.Image2Mandatory == '1' || qtn?.Image2Mandatory == 1); + let checkForAnsKey = (qtn.QuestionTypeNew == 'Decimal' || qtn.QuestionTypeNew == 'Number' || qtn.QuestionTypeNew == 'Text' || qtn.QuestionTypeNew == 'Date' || qtn.QuestionTypeNew == 'Rating'); + + + + if (qtn.QuestionTypeNew == 'Single choice list') { + selansid = QD[id_key]; + } + else if (qtn.QuestionTypeNew == 'Multi choice list') { + selansid = QD[multi_key] != null && QD[multi_key] != '' ? QD[multi_key].split(',') : []; + } + + + if (qtn.QuestionTypeNew == 'Multi choice list' && selansid.length <= 0) { + isvalid = false; + notify(ST.Pleaseselectoptionsfortherequiredfield, 'SHORT'); + break; + } + else if (checkForAnsKey && (Object.keys(QD).indexOf(ans_key) < 0 || (Object.keys(QD).indexOf(ans_key) >= 0 && QD[ans_key] === ''))) { + isvalid = false; + let msg = (qtn.QuestionTypeNew == 'Date' ? ST.Pleasepickadate : (qtn.QuestionTypeNew == 'Rating' ? ST.Pleaseselectrating : ST.Pleasefillalldetails)); + notify(msg, 'SHORT'); + break; + } + else if (qtn.QuestionTypeNew == 'Audio' && (Object.keys(QD).indexOf(voiceClip_key) < 0 || (Object.keys(QD).indexOf(voiceClip_key) >= 0 && (QD[voiceClip_key] == null || QD[voiceClip_key].filename == null || QD[voiceClip_key].filename == '')))) { + isvalid = false; + notify(ST.Pleaserecordaudioclipfortherequiredfield, 'SHORT'); + break; + } + else if (qtn.QuestionTypeNew!='Image' && Object.keys(QD).indexOf(id_key) < 0 || (Object.keys(QD).indexOf(id_key) >= 0 && (QD[id_key] === ''))) { + isvalid = false; + notify(ST.Pleasefillalldetails, 'SHORT'); + console.log(QD[id_key], QD, id_key) + break; + } + else if (isImgAllowed && (Object.keys(QD).indexOf(img_key) < 0 || (Object.keys(QD).indexOf(img_key) >= 0 && QD[img_key] === ''))) { + isvalid = false; + notify(ST.Pleaseaddimages, 'SHORT'); + break; + } else { + console.log('no condition found'); + } + + if ((qtn.QuestionTypeNew == 'Single choice list' || qtn.QuestionTypeNew == 'Multi choice list')) { + if (qtn.Answers && qtn.Answers.length > 0) { + for (var j = 0; j < qtn.Answers.length; j++) { + let ansss = qtn.Answers[j]; + let isandImgAl = (ansss.ImageAllow1 == true || ansss.ImageAllow1 == 'true' || ansss.ImageAllow1 == 1); + if (qtn.QuestionTypeNew == 'Single choice list' && (isandImgAl && ansss.AnswerId == selansid)) { + showImageTag = true; + } + else if (qtn.QuestionTypeNew == 'Multi choice list' && (isandImgAl && selansid.indexOf(ansss.AnswerId) >= 0)) { + showImageTag = true; + } + + let isandImgAl2 = (ansss.ImageAllow2 == true || ansss.ImageAllow2 == 'true' || ansss.ImageAllow2 == 1); + if (qtn.QuestionTypeNew == 'Single choice list' && (isandImgAl2 && ansss.AnswerId == selansid)) { + showImageTag2 = true; + } + else if (qtn.QuestionTypeNew == 'Multi choice list' && (isandImgAl2 && selansid.indexOf(ansss.AnswerId) >= 0)) { + showImageTag2 = true; + } + } + } + } + + // if((isImage1Mand=='1' || isImage1Mand==true) && showImageTag && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + // isvalid=false; + // notify(ST.Pleaseaddimages,'SHORT'); + // break; + // } + + // if((isImage2Mand=='1' || isImage2Mand==true) && showImageTag2 && (Object.keys(QD).indexOf(img_key2)<0 || (Object.keys(QD).indexOf(img_key2)>=0 && QD[img_key2]===''))){ + // isvalid=false; + // notify(ST.Pleaseaddimages,'SHORT'); + // break; + // } + + if ( StoreCameraAllow==true && isImg1mandatory && showImageTag && (Object.keys(QD).indexOf(img_key) < 0 || (Object.keys(QD).indexOf(img_key) >= 0 && QD[img_key] === ''))) { + errorobj["EF_Image"] = 'Image'; + showError(errorobj, true); + // let refIn1=inputRefs.current['input1_'+qtn.QuestionId] + // refIn1.focus(); + isvalid = false; + notify(ST.Pleaseaddimages, 'SHORT'); + break; + } + + if (StoreCameraAllow==true && isImg2mandatory && showImageTag2 && (Object.keys(QD).indexOf(img_key2) < 0 || (Object.keys(QD).indexOf(img_key2) >= 0 && QD[img_key2] === ''))) { + errorobj["EF_Image"] = 'Image'; + showError(errorobj, true); + // let refIn1=inputRefs.current['input1_'+qtn.QuestionId] + // refIn1.focus(); + isvalid = false; + notify(ST.Pleaseaddimages, 'SHORT'); + break; + } + + } + } + + return isvalid; + } + + function render_Picker(label_key, value_key, onChange = () => { }, selected_data = {}) { + var data = []; + let qtn = selected_data.qtn || {}; + let EStyle_Qtn_Input = selected_data.EStyle_Qtn_Input || {}; + let isQtnDisabled = qtn.isDisabled != null && qtn.isDisabled != '' ? qtn.isDisabled : false; + let allAnswers = qtn.Answers || []; + + allAnswers.map((item, index) => { + let obj = { key: index, label: item[label_key], value: item[value_key] }; + if (selected_data.value == item[label_key]) + obj['component'] = {item[label_key]}; + data.push(obj); + }); + + return ( + { onChange(option, qtn) }} + overlayStyle={customStyle.addVisPickerOverlay} + cancelContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + optionStyle={customStyle.addvis_opStyle} + optionTextStyle={customStyle.addvis_opTextStyle} + optionContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + selectedKey={'1'} + disabled={isQtnDisabled} + cancelText={ST.Cancel} + > + {(selected_data.value != null && selected_data.value != '' ? selected_data.value : '-select-')} + + ) + } + + function renderDatePicker(qtn) { + let qtnn = qtn; + let DateRange = qtn.DateRange; + let maxDate = moment().add(10, 'years').format('MM/DD/YYYY'); + let minDate = moment().subtract(10, 'years').format('MM/DD/YYYY'); + if (DateRange == 'RFD') { + maxDate = moment().format('MM/DD/YYYY'); + } + else if (DateRange == 'RPD') { + minDate = moment().format('MM/DD/YYYY'); + } + + return ( + { setTextValue(selectedDate, qtnn) }} + maximumDate={new Date(maxDate)} + minimumDate={new Date(minDate)} + /> + ); + } + + function renderItem({ item, drag, isActive }) { + return ( + + + {item.Answer} + + + ); + }; + + function renderRatingView() { + let qtn = RatingQtn; + let Answers = qtn.Answers; + let id_key = qtn.QuestionId + '_AnswerId'; + let ans_key = qtn.QuestionId + '_Answer'; + let rating_key = qtn.QuestionId + '_Rating'; + // let ratings=QuestionsData[rating_key]!=null?QuestionsData[rating_key].split(','):[]; + + let newarr = RatingOrder; + if (RatingOrder.length <= 0) { + newarr = Answers; + } + + return ( + + + {ST.DragItemsInOrder} + {ST.Pressandholdtodrag} + { setRatingValue(data) }} + keyExtractor={(item) => item.AnswerId} + renderItem={renderItem} + /> + + { onRatingCancel() }}> + {ST.Cancel} + + { onRatingSave() }}> + {ST.Save} + + + + + ) + } + + function renderRecorderView() { + + let qtn = RatingQtn; + let isRecorderPlaying = VRS.RecorderPlayStatus != null && VRS.RecorderPlayStatus == true; + let isPlayerPlaying = VRS.PlayerPlayStatus != null && VRS.PlayerPlayStatus == true; + const scale = animatedRipple.interpolate({ + inputRange: [0, 1], + outputRange: [1, 1.3], + }); + + const borderColor = animatedRipple.interpolate({ + inputRange: [0, 1], + outputRange: ['#f5acb4c2', '#fce6e9e3'], + }); + + const scale2 = animatedRipple2.interpolate({ + inputRange: [0, 1], + outputRange: [1, 1.5], + }); + + const borderColor2 = animatedRipple2.interpolate({ + inputRange: [0, 1], + outputRange: ['#f5acb4c2', '#fce6e9e3'], + }); + + let totalDuration = RecorderTimer.recordSecs != null ? RecorderTimer.recordSecs : playerTimer.totalDuration; + let wp = totalDuration != null ? Math.floor((playerTimer.playerSecs / totalDuration) * 100) : 0; + let width1 = wp <= 100 ? (wp > 0 ? wp + '%' : '0%') : '100%'; + if (isNaN(wp)) width1 = '0%'; + + return ( + + {rerenderView == rerenderView && + + {ST.RecordVoiceClip} + {ST.Youcanrecordmaxfor60secs} + {VoiceRecorderStatus} + + + + + + { startRecorder(storeData, qtn, ActiveSurvey, VRS); }}> + + + {isRecorderPlaying && + { stopRecorder(VRS); }}> + + + } + + + + {RecorderTimer.recordTime} + { + (!isRecorderPlaying && RecFilePath.filename != null && RecFilePath.filename != '') && + + + + + + + {`${(playerTimer.playTime || '00:00:00')} / ${playerTimer.playDuration || RecorderTimer.recordTime}`} + + + + { let url = (Platform.OS == 'ios' ? 'file://' : '') + common_ImagePath + 'Recordings/' + RecFilePath.filename; (wp < 100 && wp > 0) ? resumePlayer(url) : startPlayer(url, VRS); }}> + + + {isPlayerPlaying && { wp < 100 ? pausePlayer() : stopPlayer(VRS); }}> + + } + + + } + + + + { onRecordCancel() }}> + {ST.Cancel} + + { onRecordSave() }}> + {ST.Save} + + + } + + ) + } + + function _renderSurveyQtns(subcat) { + const SurveyQuestions = subcat.Questions; + + return ( + + { + SurveyQuestions.length > 0 && + SurveyQuestions.map((item, index) => { + + let qtn = item; + let selansid = '', selanswer = '', selimg = '', selimg2 = '', showImageTag = false, showImageTag2 = false; + let id_key = qtn.QuestionId + '_AnswerId'; + let ans_key = qtn.QuestionId + '_Answer'; + let multi_key = qtn.QuestionId + '_MultiOption'; + let date_key = qtn.QuestionId + '_Date'; + let img_key = qtn.QuestionId + '_ImagePath1'; + let imgname_key = qtn.QuestionId + '_ImageName1'; + let img_key2 = qtn.QuestionId + '_ImagePath2'; + let imgname_key2 = qtn.QuestionId + '_ImageName2'; + let rating_key = qtn.QuestionId + '_Rating'; + let voiceClip_key = qtn.QuestionId + '_VoiceClip'; + let list_mcdata = []; + + if (qtn.QuestionTypeNew == 'Single choice list') { + selansid = QuestionsData[id_key] != null ? QuestionsData[id_key] : ''; + selanswer = QuestionsData[ans_key] != null ? QuestionsData[ans_key] : ''; + } + else if (qtn.QuestionTypeNew == 'Multi choice list') { + + if (qtn.Answers != null) { + + for (var i = 0; i < qtn.Answers.length; i++) { + let obj = { 'AnswerId': parseInt(qtn.Answers[i].AnswerId), 'Answer': qtn.Answers[i].Answer }; + list_mcdata.push(obj); + } + } + selansid = QuestionsData[multi_key] != null && QuestionsData[multi_key] != '' ? QuestionsData[multi_key].split(',') : []; + if (selansid != null && selansid.length > 0) { + let arr = []; + for (var i = 0; i < selansid.length; i++) { + arr.push(parseInt(selansid[i])); + } + selansid = arr; + } + } + else if (qtn.QuestionTypeNew == 'Number' || qtn.QuestionTypeNew == 'Text' || qtn.QuestionTypeNew == 'Decimal' || qtn.QuestionTypeNew == 'Date'||qtn.QuestionTypeNew =='Image') { + selansid = QuestionsData[ans_key]; + selanswer = (qtn.QuestionTypeNew == 'Date') ? (QuestionsData[date_key] || moment().format('MM/DD/YYYY')) : ''; + showImageTag = (qtn.QuestionImageAllow == true || qtn.QuestionImageAllow == 'true' || qtn.QuestionImageAllow == 1); + showImageTag2 = false; + } + else if (qtn.QuestionTypeNew == 'Rating') { + selanswer = QuestionsData[ans_key] ? QuestionsData[ans_key] : ''; + } + else if (qtn.QuestionTypeNew == 'Audio') { + selansid = QuestionsData[ans_key] ? QuestionsData[ans_key] : ''; + selanswer = QuestionsData[voiceClip_key] ? (QuestionsData[voiceClip_key].filename || '') : ''; + } + + if ((qtn.QuestionTypeNew == 'Single choice list' || qtn.QuestionTypeNew == 'Multi choice list')) { + if (qtn.Answers && qtn.Answers.length > 0) { + for (var i = 0; i < qtn.Answers.length; i++) { + let ansss = qtn.Answers[i]; + + let isandImgAl = (ansss.ImageAllow1 == true || ansss.ImageAllow1 == 'true' || ansss.ImageAllow1 == 1); // ImageAlllow1 (true) + let isandImgAl2 = (ansss.ImageAllow2 == true || ansss.ImageAllow2 == 'true' || ansss.ImageAllow2 == 1); // ImageAlllow2 (true) + + if (qtn.QuestionTypeNew == 'Single choice list' && (isandImgAl && ansss.AnswerId == selansid)) { + showImageTag = true; + } + else if (qtn.QuestionTypeNew == 'Multi choice list' && (isandImgAl && selansid.indexOf(ansss.AnswerId) >= 0)) { + showImageTag = true; + } + + if (qtn.QuestionTypeNew == 'Single choice list' && (isandImgAl2 && ansss.AnswerId == selansid)) { + showImageTag2 = true; + } + else if (qtn.QuestionTypeNew == 'Multi choice list' && (isandImgAl2 && selansid.indexOf(ansss.AnswerId) >= 0)) { + showImageTag2 = true; + } + } + } + } + + if (showImageTag) { + selimg = QuestionsData[img_key] != null && QuestionsData[img_key] != '' ? 'file://' + QuestionsData[img_key] : ''; + } + + if (showImageTag2) { + selimg2 = QuestionsData[img_key2] != null && QuestionsData[img_key2] != '' ? 'file://' + QuestionsData[img_key2] : ''; + } + + let isDisabled = qtn.isDisabled != null ? qtn.isDisabled : false + // console.log('isDisabled----', qtn.QuestionId, qtn.isDisabled, isDisabled) + + // Error Field highlight styles + let EF_Qtn = errorfield.EF_Qtn != null ? errorfield.EF_Qtn : {}; + let show_errorhere = error == true && EF_Qtn.QuestionId == qtn.QuestionId; + + // this will show error field in red (if window is present and exist reason is enabled and not filled ) or (if window is not present and Not exist reason is enabled and not filled ) + let EF_Input = errorfield.EF_Input || ''; + let EF_Image = errorfield.EF_Image || ''; + let EStyle_Qtn_Input = show_errorhere && EF_Input == 'Input' ? customStyle.stk_inptSTyle_error : {}; + let EStyle_Qtn_MultiChoice = show_errorhere && EF_Input == 'Input' ? customStyle.stk_MultiSSTyle_error : {}; + let EStyle_Qtn_Image = show_errorhere && EF_Image == 'Image' ? customStyle.stk_inptSTyle_error : {}; + + let Image1Mandatory = (qtn.Image1Mandatory == "true") || (qtn.Image1Mandatory == true) || (qtn.QuestionImageMandatory == "true") || (qtn.QuestionImageMandatory == true) + let Image2Mandatory = (qtn.Image2Mandatory == "true") || (qtn.Image2Mandatory == true) + + if (isDisabled == true) { + return ( + + ) + } + else { + return ( + + {qtn.Question} + {qtn.QuestionTypeNew == 'Single choice list' && qtn.Answers && + render_Picker('Answer', 'AnswerId', onselectionChange, { value: selanswer, qtn: qtn, EStyle_Qtn_Input }) + } + {qtn.QuestionTypeNew == 'Multi choice list' && qtn.Answers && + { console.log('onSelectedItemsChange'); setMultiSelectValue(selectedItems, qtn) }} + selectedItems={selansid} + selectText="Pick Items" + searchInputPlaceholderText="Search Items..." + // onChangeInput={ (text)=> console.log(text)} + tagRemoveIconColor={PrimaryTheme.$primary_color} + tagBorderColor={PrimaryTheme.$primary_color} + tagTextColor={PrimaryTheme.$primary_color} + selectedItemTextColor={PrimaryTheme.$primary_color} + selectedItemIconColor={PrimaryTheme.$primary_color} + tagContainerStyle={{ height: 30, width: '100%', paddingVertical: 5 }} + styleTextTag={{ fontSize: 14 }} + itemTextColor={PrimaryTheme.$text_color} + displayKey="Answer" + searchInputStyle={{ color: '#CCC' }} + styleMainWrapper={EStyle_Qtn_MultiChoice} + submitButtonColor={PrimaryTheme.$primary_color} + submitButtonText="Submit" + /> + } + {(qtn.QuestionTypeNew == 'Number' || qtn.QuestionTypeNew == 'Decimal' || qtn.QuestionTypeNew == 'Text') && + { setTextValue(val, qtn) }} + autoComplete='off' + /> + } + { + (qtn.QuestionTypeNew == 'Date') && + + {selansid != '' ? selansid : 'MM/YYYY'} + { setDateValue(selanswer); showQtnDatePicker(qtn, true) }}> + + + + } + {((qtn.showDatePicker == true || qtn.showDatePicker == 'true') && (qtn.QuestionTypeNew == 'Date')) && + renderDatePicker(qtn) + } + { + (qtn.QuestionTypeNew == 'Rating') && + + {selanswer} + { setRatingQtn(qtn); setShowRating(true); }}> + + + + } + + { + (qtn.QuestionTypeNew == 'Audio') && + + {selanswer} + { show_recorder(qtn); }}> + + + + } + + { + showImageTag && + + + {Image1Mandatory ? + { openCamera(qtn, '1') }}> + + : + { openCamera(qtn, '1') }}> + + } + + } + + { + showImageTag2 && + + + {Image2Mandatory ? + { openCamera(qtn, '2') }}> + + : + { openCamera(qtn, '2') }}> + + } + + } + + ) + } + + }) + } + + + ); + } + + function _renderSurveyView() { + return ( + + { + SurveySubCats && SurveySubCats.length > 0 ? + { + let subcat = item, s_index = index; + + //changes made for category wise questions + let surveyQuestions = subcat.Questions; + let rs = surveyQuestions.filter((it) => it.isDisabled != null ? (!it.isDisabled) : false) + + if (rs.length == 0) { + return <> + } + + return ( + + + {subcat.SubCategory} + + {_renderSurveyQtns(subcat)} + + + ) + }} + > + + + : + + No data found + + } + + + ); + } + + + + return ( + + {processing && } + + {ConfirmSaveAlert(props, showAlert, onSaveCancel, saveData)} + { setShowCamera(false); getImage(imgData) }} showCamera={showCamera} onHideCamera={() => { setShowCamera(false); }} /> + + + + + + {/* {(ActiveSurvey.SurveyName!=null?(ActiveSurvey.SurveyName.length>26?ActiveSurvey.SurveyName.substring(0,26)+'...':ActiveSurvey.SurveyName) : '')} */} + {(`${(ST.SurveyId != null ? ST.SurveyId : 'Survey Id')} : ` + (ActiveSurvey.SurveyId || '') + (ShowCat == true ? ' | ' + `${(ST.CategoryId != null ? ST.CategoryId : 'Category Id')} : ` + (ActiveCategory.CategoryId || '') : ''))} + + + {Object.keys(ActiveSurvey).length > 0 && + _renderSurveyView() + } + + { onSubmitData() }} /> + + + + {showRating == true && + renderRatingView() + } + {showRecorder == true && + renderRecorderView() + } + + ); +} + + +export default connect(mapStateToProps, mapDispatchToProps)(SurveyView); \ No newline at end of file diff --git a/src/screens/Training.js b/src/screens/Training.js new file mode 100644 index 0000000..638df31 --- /dev/null +++ b/src/screens/Training.js @@ -0,0 +1,299 @@ +import React, { useState, useEffect, useRef } from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles, customStyles, GetPageTheme } from '../styles/Global'; +import { StatusBar, Image, TextInput, View, Text, ScrollView, TouchableOpacity, Platform, PermissionsAndroid, FlatList, } from 'react-native'; +import { ReactReduxContext, connect, useSelector, useDispatch, } from 'react-redux'; +import { mapStateToProps, mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import { notify } from '../components/notify'; +import moment from 'moment'; +import { getDownloadJson, DownloadData } from '../controller/functions'; +import { get_item, set_item, clear_item } from '../components/localStorage'; +import { version, sloganline, appname, testurl, db, TrainingContentFolderPath, } from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { FontAwesome, Fontisto, Ionicons, MaterialCommunityIcons } from '../components/icons'; +import NoDataComponent from '../components/NoDataComponent'; +import WebView from 'react-native-webview'; +import { AntDesign, Entypo } from "../components/icons"; +import * as RNFS from "react-native-fs"; +import FileViewer from "react-native-file-viewer"; +import ImageViewer from 'react-native-image-zoom-viewer'; +import base64 from 'base-64'; +import { updatePartiallyEmittedExpression } from 'typescript'; + + +function Training(props) { + const route = useRoute(); + const ST = props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const globalStyle = globalStyles(props.DarkMode, route.name); + + + const [processing, setProcessing] = useState(false); + const [webviewurl, setWebviewurl] = useState(''); + const [TrainingData, setTrainingData] = useState([]); + + const [showwebview, setShowWebview] = useState(false); + const [webviewurlT, setWebviewurlT] = useState(''); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [contentIdParam, setcontentIdParam] = useState(false); + const [currentReportMenu, setCurrentReportMenu] = useState({}); + + const zoomView = useRef(null); + + useEffect(() => { + let params = props.route.params ? props.route.params : {}; + let storeData1 = params.storeData || {}; + let menu1 = params.menu || {}; + let contentid = props.route.params.Contentid + let TrainingData = props.route.params.TrainingData + // console.log('vcontentid',contentid) + let isAdhoc = params.isAdhoc || false; + setCurrentReportMenu(TrainingData) + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setcontentIdParam(contentid); + setCurrentMenu(menu1); + getData(contentid); + + const unsubscribe = props.navigation.addListener('beforeRemove', onBeforeRemove); + return function cleanup() { + return unsubscribe; + }; + + }, []); + + useEffect(() => { + const unsubscribe = props.navigation.addListener('beforeRemove', onBeforeRemove); + return unsubscribe; + }, [show_zoomImage]); + + function onBeforeRemove(e) { + if (show_zoomImage == true) { + e.preventDefault(); + setShow_zoomImage(false); + } + else { + return; + } + } + + + // async function getData(){ + // try { + + // await db.transaction(async function (txn) { + + // let q=`Select * from Training_Document `; + // await txn.executeSql(q,[],async function (txn2, txnres2) { + // console.log('Training_Document:',txnres2.rows.length); + // if(txnres2.rows.length>0){ + // let data =txnres2.rows.item(0); + // console.log('Training_Document:',data); + // setWebviewurl(data.TraningLink); + // } + // },function (txnE,txnerr) { console.log(txnerr); },); + // }); + // } catch (err) { + // console.log(err); + // } + // } + + function _renderHeader(currentIndex) { + return ( + + {/* {`${(currentIndex+1)}/${zoomImageUrl.length}`} */} + { console.log('tsth'); setShow_zoomImage(false) }}> + + + + ) + } + + async function getData(content_id) { + + try { + content_id = props.route.params.Contentid + + console.log('params', content_id) + let List = []; + await db.transaction(async function (txn) { + + let q = `Select * from Sup_Master_DetailerContent where ContentTypeId = '${content_id}'`; + await txn.executeSql(q, [], async function (txn2, txnres2) { + console.log('txnres2.rows.length:', txnres2.rows.length) + if (txnres2.rows.length > 0) { + for (let i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + List.push(data) + } + setTrainingData(List) + } + + }, function (txnE, txnerr) { console.log(txnerr); },); + }); + } catch (err) { + console.log(err); + } + } + + const DownloadContent = async (item) => { + let filename = item.FName + let path = (item && item.MediaType && item.MediaType.toLowerCase() == "pdf") ? "/pdf/" : (item && item.MediaType && item.MediaType.toLowerCase() == "image") ? "/images/" : (item && item.MediaType && item.MediaType.toLowerCase() == "html") ? "html" : "/video/" + console.log('path:', path) + if (path == 'html') { + let contentURL = item.FilePath ? item.FilePath + item.FName : ''; + props.navigation.navigate('WebViewScreen', { 'url': contentURL, storeData: storeData }) + } else { + const fileDir = TrainingContentFolderPath + path; + const filePath = TrainingContentFolderPath + path + filename; + let contentURL = item.FilePath ? item.FilePath + item.FName : ''; + let contentFileExist = await RNFS.exists(filePath) + console.log('filePath:', filePath, 'contentURL:', contentURL, 'contentFileExist:', contentFileExist) + if (contentFileExist) { + setWebviewurlT(filePath) + // setShowWebview(true) + if (path == "/pdf/") { + FileViewer.open(filePath, { showOpenWithDialog: true, type: "application/pdf" }) + .then(() => console.log("Opened")) + .catch(error => console.log("Error opening file", error)); + } else if (path == "/video/") { + props.navigation.navigate('VideoScreen', { filePath: filePath }) + } else { + setShow_zoomImage(true) + } + } else { + + setProcessing(true) + let fileExist = await RNFS.exists(fileDir) + if (fileExist) { + console.log("file is exists", fileDir) + } else { + await RNFS.mkdir(fileDir).then(() => console.log("Dir is created- ", fileDir)) + } + + + RNFS.writeFile(filePath, '').then(async (create_res) => { + console.log('filecreated') + const download = await RNFS.downloadFile({ + fromUrl: contentURL, + toFile: filePath, + progress: (res) => { + }, + begin: (res) => { + console.log('on download begin'); + }, + }); + download.promise.then(async (result) => { + setProcessing(false); + setWebviewurlT(filePath) + // setShowWebview(true) + if (result.statusCode == 404) { + notify('Sorry! Cannot download file as file does not exists on server!'); + await RNFS.unlink(filePath); + } else { + notify('File is downloaded!'); + if (path == "/pdf/") { + FileViewer.open(filePath, { showOpenWithDialog: true, type: "application/pdf" }) + .then(() => console.log("Opened")) + .catch(error => console.log("Error opening file", error)); + } else if (path == "/video/") { + props.navigation.navigate('VideoScreen', { filePath: filePath }) + } else { + setShow_zoomImage(true) + } + } + }); + }).catch((err) => { + console.log('Error while creating:', err); + setProcessing(false); + setDownloading(false); + RNFS.unlink(filePath); + notify('Sorry! Cannot download file'); + + }) + } + } + } + + return ( + + {processing && } + + 0 ? `${storeData.StoreId}: ${storeData.StoreName}` : props.projectCode} /> + + + {!props.isDataDownloaded && } + {/* { props.isDataDownloaded==true && webviewurl!='' && webviewurl!=null && + + } */} + + + {contentIdParam == 2 ? Consumer Section Content : + {currentReportMenu?.ContentType || 'Training Content'} + } + + {!showwebview && + + {TrainingData && TrainingData.map((item, i) => ( + DownloadContent(item)} + key={i}> + + + {item.Topic} + {/* Description - {item.Description} */} + + + + + Description + {item.Description} + + + + + Content Type + + { + item.MediaType != null && item.MediaType.toLowerCase() == "pdf" ? : item.MediaType != null && item.MediaType.toLowerCase() == "Image" ? + console.log("click")} /> : item.MediaType != null && item.MediaType.toLowerCase() == "html" ? + : + + } + {item.MediaType} + + + + + + + ))} + + } + + + {show_zoomImage && + + null} + /> + + } + + ); +} + +export default connect(mapStateToProps, mapDispatchToProps)(Training); diff --git a/src/screens/TrainingMenu.js b/src/screens/TrainingMenu.js new file mode 100644 index 0000000..faf9800 --- /dev/null +++ b/src/screens/TrainingMenu.js @@ -0,0 +1,239 @@ +import React, { useState, useEffect } from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles, customStyles, GetPageTheme } from "../styles/Global"; +import { StatusBar, Image, TextInput, View, Text, ScrollView, TouchableOpacity, Platform, PermissionsAndroid, FlatList } from 'react-native'; +import { ReactReduxContext, connect, useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps, mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import { notify } from '../components/notify'; +import moment from 'moment'; +import { getDownloadJson, DownloadData } from '../controller/functions'; +import { get_item, set_item, clear_item } from '../components/localStorage'; +import { version, sloganline, appname, testurl, db, colors_Arr } from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import { Card } from 'react-native-paper'; +import { AntDesign } from '../components/icons'; +import { WebView } from 'react-native-webview'; +import CustomLoader from '../components/CustomLoader'; +import NoDataComponent from '../components/NoDataComponent'; +import LinearGradient from 'react-native-linear-gradient'; +import { SvgXml } from 'react-native-svg'; +import grey_bg_image from '../assets/performics/circle_grey.svg'; + +function TrainingMenu(props) { + const route = useRoute(); + const ST = props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + + const [webviewurl, setWebviewurl] = useState(false); + const [processing, setProcessing] = useState(true); + const [isDataFound, setisDataFound] = useState(false); + const [reportData, setReportData] = useState([]); + const [designation, setDesignation] = useState(''); + const [CardViewEnable, setCardViewEnable] = useState(false); + const [CardViewConfig, setCardViewConfig] = useState({}); + + const d1 = new Date(); + const d2 = moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + getData(); + }, []); + + + async function getData() { + try { + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + let desg = loginDetails.Designation || ''; + setDesignation(desg); + await db.transaction(async function (txn) { + + let q = `Select distinct ContentTypeId, ContentType, IconPath, Icon, MediaType, DownloadKey, ReportView as ReportType, InnerScreenView from Sup_Master_DetailerContent group by ContentTypeId`; + + await txn.executeSql(q, [], async function (txn2, txnres) { + console.log('txnres.rows.length:', txnres.rows.length); + if (txnres.rows.length > 0) { + let arr = []; + let carView = true + for (var i = 0; i < txnres.rows.length; i++) { + let data = txnres.rows.item(i); + console.log('txnres.rows.data:', data); + carView = data?.InnerScreenView == "Tile" + arr.push(data); + if (i == txnres.rows.length - 1) { + setCardViewConfig(data) + setCardViewEnable(carView) + setReportData(arr); + setisDataFound(true); + setProcessing(false); + } + } + + } + else { + setProcessing(false); + } + }, function (txn2, txnerr) { console.log(txnerr); setProcessing(false); },); + + }); + } catch (err) { + setProcessing(false); + console.log(err); + } + } + + function gotoTraingPage(item) { + if (item.MediaType == "DB") { + props.navigation.navigate('ReportDetail', { 'ReportData': item }) + } else { + props.navigation.navigate('Training', { 'Contentid': item.ContentTypeId, 'TrainingData': item }) + } + } + + + function _renderLeftMenuItem(index, RowContent) { + return ( + + {RowContent[0]} + + ) + } + + function _renderMenuItem(item, index) { + let newi + if (index == 1) { + newi = "2"; + } else { + newi = index > 2 ? ((index % 3)) : index; + } + + let firstitem = (index % 2 == 0) ? true : false; + + let arr = ["#bed3ea", "#bed3ea"]; + let unavlbl_bg = ['#bfbfbf', '#bfbfbf']; + let arr_new = item?.isAvlbl == false ? unavlbl_bg : arr; + const imgPath = CardViewConfig?.IconPath + CardViewConfig?.Icon; + + let m_bgimage = colors_Arr[newi] ? colors_Arr[newi]?.bgImage : colors_Arr["0"]?.bgImage; + m_bgimage = item?.isAvlbl == false ? grey_bg_image : m_bgimage; + + let hasSomeData = item?.hasSomeData + return ( + { gotoTraingPage(item) }}> + + + + + + + + {(imgPath != null && imgPath != '') && } + + + {item.ContentType} + {item.isDone == true && + + } + + + + ) + } + + + function _renderRightMenuItem(item, index, RowContent) { + return ( + + {RowContent[0]} + {_renderMenuItem(item, index)} + + ) + + } + + function _renderMenuList() { + var RowContent = []; + return (reportData.length > 0 && + reportData.map((item, index) => { + if (CardViewEnable) { + let firstitem = (index % 2 == 0) ? true : false; + + if (firstitem) { + var content = _renderMenuItem(item, index); + RowContent = [content]; + if (index == reportData.length - 1) { + return _renderLeftMenuItem(index, RowContent); + } + } + else { + return _renderRightMenuItem(item, index, RowContent); + } + + } else { + return ( + { gotoTraingPage(item) }}> + {item.ContentType} + + ) + } + })) + + } + + + + + return ( + + {processing && } + + + + {!props.isDataDownloaded && } + {props.isDataDownloaded == true && + + + {isDataFound == false && + + {ST.NoDataAvailable} + + } + + { + isDataFound == true && + + + + {ST.Username + ' :'} + {props.UserId} + + + {ST.Designation + ' :'} + {designation} + + + + {_renderMenuList()} + + + } + + + } + + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(TrainingMenu); \ No newline at end of file diff --git a/src/screens/TrainingOld.js b/src/screens/TrainingOld.js new file mode 100644 index 0000000..ae11994 --- /dev/null +++ b/src/screens/TrainingOld.js @@ -0,0 +1,279 @@ +import React, {useState, useEffect, useRef} from 'react'; +import Container from '../components/container'; +import {useRoute} from '@react-navigation/native'; +import {globalStyles, customStyles, GetPageTheme} from '../styles/Global'; +import { StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList,} from 'react-native'; +import {ReactReduxContext,connect,useSelector,useDispatch,} from 'react-redux'; +import {mapStateToProps, mapDispatchToProps} from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,DownloadData} from '../controller/functions'; +import {get_item, set_item, clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db,} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { FontAwesome, Fontisto, Ionicons, MaterialCommunityIcons } from '../components/icons'; +import NoDataComponent from '../components/NoDataComponent'; +import WebView from 'react-native-webview'; +import { AntDesign, Entypo } from "../components/icons"; +import * as RNFS from "react-native-fs"; +import FileViewer from "react-native-file-viewer"; +import ImageViewer from 'react-native-image-zoom-viewer'; + + +function Training(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const globalStyle = globalStyles(props.DarkMode, route.name); + + + const [processing, setProcessing] = useState(false); + const [webviewurl, setWebviewurl] = useState(''); + const [TrainingData, setTrainingData] = useState([]); + + const [showwebview, setShowWebview] = useState(false); + const [webviewurlT, setWebviewurlT] = useState(''); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [show_zoomImage, setShow_zoomImage] = useState(false); + + const zoomView=useRef(null); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + getData(); + }, []); + + +// async function getData(){ +// try { + +// await db.transaction(async function (txn) { + +// let q=`Select * from Training_Document `; +// await txn.executeSql(q,[],async function (txn2, txnres2) { +// console.log('Training_Document:',txnres2.rows.length); +// if(txnres2.rows.length>0){ +// let data =txnres2.rows.item(0); +// console.log('Training_Document:',data); +// setWebviewurl(data.TraningLink); +// } +// },function (txnE,txnerr) { console.log(txnerr); },); +// }); +// } catch (err) { +// console.log(err); +// } +// } + +function _renderHeader(currentIndex){ + return( + + {/* {`${(currentIndex+1)}/${zoomImageUrl.length}`} */} + {console.log('tsth');setShow_zoomImage(false) }}> + + + + ) +} + +async function getData(){ + try { + content_id= props.route.params.Contentid + + console.log('params',content_id) + let List=[]; + await db.transaction(async function (txn) { + + let q=`Select * from Sup_Master_DetailerContent where ContentTypeId = '${content_id}' `; + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + for(let i=0;i{ + + let filename = item.FName + let path = (item && item.MediaType && item.MediaType.toLowerCase() == "pdf") ? "/pdf/" :(item && item.MediaType && item.MediaType.toLowerCase() =="image") ? "/images/" :"/video/" + const fileDir = "file:///data/data/com.performicsmanager/files"+'/TrainingContent' +path; + + const filePath = "file:///data/data/com.performicsmanager/files/TrainingContent"+path+filename; + + let contentURL=item.FilePath ?item.FilePath+item.FName :''; + + let contentFileExist = await RNFS.exists(filePath) + if(contentFileExist){ + setWebviewurlT(filePath) + // setShowWebview(true) + if(path=="/pdf/"){ + FileViewer.open(filePath) + }else if(path=="/video/"){ + props.navigation.navigate('VideoScreen',{filePath:filePath}) + }else{ + setShow_zoomImage(true) + // props.navigation.navigate('ImgPreview',{filePath:filePath}) + } + }else{ + + setProcessing(true) + let fileExist = await RNFS.exists(fileDir) + + if(fileExist){ + console.log("file is exists",fileDir) + }else{ + await RNFS.mkdir(fileDir).then(()=>console.log("Dir is created- ", fileDir)) + } + + + RNFS.writeFile(filePath, '').then((create_res)=>{ + console.log('filecreated') + const download = RNFS.downloadFile({ + fromUrl: contentURL, + toFile: filePath, + progress: (res) => { + + let bytes=res.bytesWritten; + + // let per=size>0?(Math.floor((bytes/size) * 100)):0; + // setDownloadingText(per+'%'); + + let dataDownloadedinMB=(bytes/(1024*1024)).toFixed(2); + // setDownloadingText(dataDownloadedinMB+' MB'); + // setDowloadedCount(bytes); + }, + begin:(res) => { + console.log('on download begin'); + }, + + }); + + download.promise.then(async(result) => { + setProcessing(false); + setWebviewurlT(filePath) + // setShowWebview(true) + if(result.statusCode == 404){ + notify('file is not downloaded'); + RNFS.unlink(filePath); + }else{ + notify('file is downloaded'); + if(path=="/pdf/"){ + FileViewer.open(filePath) + }else if(path=="/video/"){ + props.navigation.navigate('VideoScreen',{filePath:filePath}) + }else{ + setShow_zoomImage(true) + // props.navigation.navigate('ImgPreview',{filePath:filePath}) + } + } + }); + }).catch((err)=>{ + console.log('Error while creating:',err); + setProcessing(false); + setDownloading(false); + RNFS.unlink(filePath); + notify('Sorry! Cannot download file'); + + }) + } +} + + return ( + + {processing && } + 0 ? `${storeData.StoreId}: ${storeData.StoreName}`:props.projectCode} /> + + + { !props.isDataDownloaded && } + {/* { props.isDataDownloaded==true && webviewurl!='' && webviewurl!=null && + + } */} + + + Training Content + + + { !showwebview && + TrainingData && TrainingData.map((item,i)=>( + + DownloadContent(item)} + key={i}> + + + {item.Topic} + {/* Description - {item.Description} */} + + + + + Description + {item.Description} + + + + + Content Type + + { + item.MediaType =="PDF" ? : item.MediaType =="Image" ? + console.log("click")}/>: + + } + {item.MediaType} + + + + + + + + )) + + + + + } + +{! TrainingData && + + {'No Training Content Available'} + + } + + + {show_zoomImage && + + null} + /> + + } + + ); +} + +export default connect(mapStateToProps, mapDispatchToProps)(Training); diff --git a/src/screens/UploadData.js b/src/screens/UploadData.js new file mode 100644 index 0000000..be89e87 --- /dev/null +++ b/src/screens/UploadData.js @@ -0,0 +1,393 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {UploadData,UploadData2,UploadFormData,UpdateStoreStatus,UpdateImageStatus} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,testurl_upload,db,testurl_image} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import * as RNFS from 'react-native-fs'; + + +function UploadDataScreen(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const [processing, setProcessing] = useState(false); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + + let [StoreQuestions, setStoreQuestions] = useState({}); + let [StorePhotosData, setStorePhotosData] = useState({}); + let [StoreSKUPhotosData, setStoreSKUPhotosData] = useState({}); + let [StoreActPhotosData, setStoreActPhotosData] = useState({}); + let [UploadImages, setUploadImages] = useState([]); + let [UploadImages2, setUploadImages2] = useState([]); + let [UploadImages3, setUploadImages3] = useState([]); + let [MDetails, setMDetails] = useState([]); + + const [state, setState] = useState({teamList: [], isDataDownloaded: false}); + + useEffect(() => { + // getLocalData(); + }, []); + + + async function getLocalData(){ + try { + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let token = await get_item('loginToken'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const imagePath=`${RNFS.DocumentDirectoryPath}/`; + MDetails=[];StorePhotosData={};StoreSKUPhotosData={};StoreActPhotosData={},UploadImages=[],UploadImages2=[],UploadImages3=[]; + setMDetails(MDetails);setStorePhotosData(StorePhotosData);setStoreSKUPhotosData(StoreSKUPhotosData);setStoreActPhotosData(StoreActPhotosData); + setUploadImages(UploadImages);setUploadImages2(UploadImages2);setUploadImages3(UploadImages3); + + await db.transaction(async function (txn) { + + await txn.executeSql(`Select * from Stores where VisitDate='${d2}' and (UploadStatus='C' or UploadStatus='D') `,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + console.log('checkout ids',txnres2.rows.length); + // let mstatus_data=[],storePhotos=[],storeSKUPhotos=[],storeActPhotos=[]; + for (var i=0;i0){ + for (var i=0;i0){ + for (var i=0;i0){ + for (var i=0;i0){ + for (var i=0;i0?1:0); + let objdata={ + "MID": MID, + "UserId": loginDetails.UserId, + "Present": Type==''?'0':'1', + "ActivationTypeId": TypeId, + "CompBrandId": BrandId, + "Remark": "", + "ShowContactsFlag": ShowContactsFlag, + "NoofContacts": NoOfContacts, + "Image": imgName1, + "ImageTwo": imgName2, + "ImageThree": imgName3 + }; + console.log('datae tu:',objdata); + let spd_Arr=StoreActPhotosData[MID]!=null?StoreActPhotosData[MID]:[]; + spd_Arr.push(objdata); + StoreActPhotosData[MID]=spd_Arr; + setStoreActPhotosData(StoreActPhotosData); + + + } + } + }); + } + + let q3=`Select * from imageUploadStatus where MID='${MID}' and status='0'`; + console.log(q3); + await txn.executeSql(q3,[],async function (txn2, txnres3) { + console.log('images to upload:',txnres3.rows.length) + if(txnres3.rows.length>0){ + for(var i=0;i{ + const MID=item.MID; + let sQtns=StoreQuestions[MID]; + let spdArr=StorePhotosData[MID]; + let sSKUpdArr=StoreSKUPhotosData[MID]; + let sACTpdArr=StoreActPhotosData[MID]; + console.log(MID,sACTpdArr); + // upload store photos data data + if(item.UploadStatus=='D') + { + uploadImages(loginDetails,token,MID); + } + else{ + var data = {"MID": MID,"Keys":"Sup_StoreCatPics","SecurityToken":token,"JsonData":JSON.stringify(spdArr),"UserName":loginDetails.UserId} + await UploadData2(testurl_upload, data) + .then(async(res) => { + console.log('storephotos data uploaded:',res); + + // upload store sku photos data + data = {"MID": MID,"Keys":"Sup_Competition_SKU","SecurityToken":token,"JsonData":JSON.stringify(sSKUpdArr),"UserName":loginDetails.UserId} + await UploadData2(testurl_upload, data) + .then(async(res) => { + console.log('compSKU data uploaded:',res); + + // upload store Act photos data + data = {"MID": MID,"Keys":"Sup_Competition_Activation","SecurityToken":token,"JsonData":JSON.stringify(sACTpdArr),"UserName":loginDetails.UserId} + await UploadData2(testurl_upload, data) + .then(async(res) => { + console.log('compACT data uploaded:',res); + + // upload store qtns data + data = {"MID": MID,"Keys":"Sup_StoreAudit","SecurityToken":token,"JsonData":JSON.stringify(sQtns),"UserName":loginDetails.UserId} + console.log(data); + await UploadData2(testurl_upload, data) + .then(async(res) => { + console.log('Store Qtns data uploaded:',res); + + data_uploadStatus(loginDetails,token,MID); + + }).catch(err => { + console.log('onPage Team error', err); + setProcessing(false); + notify('Cannot Upload Data!'); + }); + + }).catch(err => { + console.log('onPage Team error', err); + setProcessing(false); + notify('Cannot Upload Data!'); + }); + + }).catch(err => { + console.log('onPage Team error', err); + setProcessing(false); + notify('Cannot Upload Data!'); + }); + + }).catch(err => { + console.log('onPage Team error', err); + setProcessing(false); + notify('Cannot Upload Data!'); + }); + } + }); + + if(MDetails.length<=0){ + setProcessing(false); + notify('All Data and images already uploaded!','SHORT'); + props.navigation.goBack(); + } + } + + async function data_uploadStatus(loginDetails,token,MID){ + // update upload status + const url='https://anitemp.parinaam.in/Webservice/Abbott_MnancService.svc/'; + let data2={'Mid':MID,'Status':'D'} + await UploadData(url+'StoreCoverageStatusSup',data2) + .then(async(res)=>{ + console.log('StoreCoverageStatusSup res:',res); + if(res==1){ + let datan={Mid:MID,Status:'D'} ; + UpdateStoreStatus(props,datan); + setLoaderTitle('Uploading Images...'); + uploadImages(loginDetails,token,MID); + } + }).catch(err => { + console.log('onPage Team error', err); + setProcessing(false); + notify('Cannot Upload Data!'); + }); + } + + async function uploadImages(loginDetails,token,MID){ + let allimages=UploadImages[MID]!=null?UploadImages[MID]:[]; + if(allimages.length>0){ + allimages.map(async(file,index)=>{ + const data1 = new FormData(); + let {uniqueID,MID,StorePhotosId,imgType,imgPath,imgName,Status,AddedDate}=file; + let Foldername=imgType=='sku'?'Sup_Competition_SKUImages':(imgType=='act'?'Sup_Competition_ActivationImages':(imgType='audit'?'Sup_AuditImages':'Sup_StoreCategoryImages')); + + data1.append('file', { + uri: 'file://'+file.imgPath, + type: 'image/jpg', + name: file.imgName + }); + data1.append('Foldername', Foldername); + data1.append('Path', ''); + data1.append('UserName', loginDetails.UserId); + data1.append('SecurityToken', token); + + await UploadFormData(testurl_image, data1) + .then(async(res) => { + console.log('image uploaded:',imgType); + UpdateImageStatus(props,{uniqueID:uniqueID}) + if(index==(allimages.length-1)){ + // update upload status + console.log('lastimage update status u'); + const url='https://anitemp.parinaam.in/Webservice/Abbott_MnancService.svc/'; + let data2={'Mid':MID,'Status':'U'} + await UploadData(url+'StoreCoverageStatusSup',data2) + .then(async(res)=>{ + console.log('StoreCoverageStatusSup res:',res); + if(res==1){ + UpdateStoreStatus(props,data2); + setProcessing(false); + notify('Uploaded successfully','SHORT'); + } + }).catch(err => { + console.log('onPage Team error', err); + setProcessing(false); + notify('Cannot Upload Data!'); + }); + } + }).catch(err => { + console.log('onPage Team error', err); + setProcessing(false); + notify('Cannot Upload Image!'); + }); + }); + } + else{ + setProcessing(false); + } + + } + + + return ( + + {processing && } + + + {/* {uploadAllData()}}> + Upload Data + */} + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(UploadDataScreen); \ No newline at end of file diff --git a/src/screens/VideoScreen.js b/src/screens/VideoScreen.js new file mode 100644 index 0000000..7041d41 --- /dev/null +++ b/src/screens/VideoScreen.js @@ -0,0 +1,57 @@ +import React, {useState, useEffect} from 'react'; +import Container from '../components/container'; +import {useNavigation, useRoute} from '@react-navigation/native'; +import {globalStyles, customStyles, GetPageTheme} from '../styles/Global'; +import { StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList,} from 'react-native'; +import {ReactReduxContext,connect,useSelector,useDispatch,} from 'react-redux'; +import {mapStateToProps, mapDispatchToProps} from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,DownloadData} from '../controller/functions'; +import {get_item, set_item, clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db,} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { FontAwesome, Fontisto, Ionicons, MaterialCommunityIcons } from '../components/icons'; +import NoDataComponent from '../components/NoDataComponent'; +import WebView from 'react-native-webview'; +import { AntDesign, Entypo } from "../components/icons"; +import * as RNFS from "react-native-fs"; +import FileViewer from "react-native-file-viewer"; +import VideoPlayer from 'react-native-video-controls'; + + +function VideoScreen(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + const navigation = props.navigation +// const navigation = useNavigation() + const filePath = props.route.params.filePath; + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const globalStyle = globalStyles(props.DarkMode, route.name); + + + const [processing, setProcessing] = useState(false); + + const [webviewurlT, setWebviewurlT] = useState(''); + +useEffect(()=>{ + setWebviewurlT(filePath) +},[filePath]) + + return ( + + {processing && } + + + ); +} + +export default VideoScreen; diff --git a/src/screens/ViewListData.js b/src/screens/ViewListData.js new file mode 100644 index 0000000..b6d7cec --- /dev/null +++ b/src/screens/ViewListData.js @@ -0,0 +1,137 @@ +import { View, Text, TextInput,TouchableOpacity, NativeModules, Icon, Image } from 'react-native' +import React,{useState,useEffect} from 'react' +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {connect} from 'react-redux' +import CustomHeader from '../components/customHeader'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import LinearGradient from 'react-native-linear-gradient'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; + +import { ConfirmSaveAlert } from '../components/alert'; +import { colors_Arr, db} from '../constants/constants'; + +import { AppTables } from '../constants/tableConstants'; +import { ScrollView } from 'react-native-gesture-handler'; + + + + +function ViewListData(props) { + + + const route = useRoute(); + + const [currentItem, setcurrentItem] = useState({}); + + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const [showAlert, setShowAlert] = useState(false); + const [viewData,setViewData] = useState([]); + // const [nodataFound, setNodataFound] = useState(false); + + useEffect(() => { + viewResume(); + }, []); + + function onSaveCancel(){ + setShowAlert(false); + } + + function viewResume() { + console.log('View Resume'); + + + db.transaction((tx) => { + + // tx.executeSql('Create table if not exists Details (Name NVARCHAR, Age_Group INTEGER, Gender NVARCHAR,Product NVARCHAR,Purchase NVARCHAR)', [], function (tx, results){ + // console.log('table create') + tx.executeSql(`SELECT * FROM ${AppTables.RESUME_DATA} `, [], (tx, results) => { + console.log("Query completed",results); + if(results.rows.length>0){ + let arr=[]; + for(let i=0;i + + {ConfirmSaveAlert(props,showAlert,onSaveCancel)} + + + + + + + + {'Resume'} + + + + + + {viewData.length>0 && + + viewData.map((item,index)=> + { + console.log('onrender',item); + let newi=index>2?((index%3)):index; + let arr=colors_Arr[newi]?colors_Arr[newi].bg:colors_Arr["0"].bg; + + console.log('i:',arr); + return( + + + {/* */} + + + + + {item.ADDED_DATE} + + + {/* + + {(item.NAME!=null && item.NAME!=''?item.NAME.substring(0,1):'')} + */} + {item.NAME} + {item.MOBILE_NO} + + + + + + ) + }) + } + + + + + + ) +} + +export default connect(mapStateToProps, mapDispatchToProps)(ViewListData) \ No newline at end of file diff --git a/src/screens/VisibilityAudit.js b/src/screens/VisibilityAudit.js new file mode 100644 index 0000000..e781d20 --- /dev/null +++ b/src/screens/VisibilityAudit.js @@ -0,0 +1,2293 @@ +import React, { useState, useEffect, useRef } from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles, customStyles, GetPageTheme } from "../styles/Global"; +import { StatusBar, Image, TextInput, View, Text, ScrollView, TouchableOpacity, Platform, PermissionsAndroid, FlatList, Alert, Animated } from 'react-native'; +import { ReactReduxContext, connect, useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps, mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import { notify } from '../components/notify'; +import moment from 'moment'; +import { getDownloadJson, getKPIFields, marktext1, marktext2 } from '../controller/functions'; +import { get_item, set_item, clear_item } from '../components/localStorage'; +import { version, sloganline, appname, testurl, db, colors_Arr, common_ImagePath } from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import { Card, Menu, Switch } from 'react-native-paper'; +import { AntDesign, Entypo, FontAwesome, Fontisto, MaterialCommunityIcons } from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import { launchCamera, launchImageLibrary, CameraOptions } from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector' +import { CustomPicker, CustomPicker2 } from '../components/CustomPicker'; +import CustomCamera from '../components/Camera'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import DateTimePicker from '@react-native-community/datetimepicker'; +import CheckBox from '@react-native-community/checkbox'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import MultiSelect from 'react-native-multiple-select'; + +function VisibilityAudit(props) { + const route = useRoute(); + const ST = props.StaticText || {}; + + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const animatedChoice = useRef(new Animated.Value(0)).current; + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [StoreCameraAllow, setStoreCameraAllow] = useState(true); + const [currentMenu, setCurrentMenu] = useState({}); + const [rerenderdata, setrerenderdata] = useState(0); + const [rerenderdata2, setrerenderdata2] = useState(0); + const [rerenderdata3, setrerenderdata3] = useState(0); + const [rerenderdata4, setrerenderdata4] = useState(0); + + const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false); + + const [WindowData, setWindowData] = useState([]); + const [reasons_list, setReasons_list] = useState([]); + const [Windows, setWindows] = useState([]); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [showAlert, setShowAlert] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps, setGetImageProps] = useState({}); + const zoomView = useRef(null); + const [showRating, setShowRating] = useState(false); + const [RatingQtn, setRatingQtn] = useState({}); + const [RatingWindow, setRatingWindow] = useState({}); + const [RatingOrder, setRatingOrder] = useState([]); + + const [Products, setProducts] = useState([]); + const [DisplayList, setDisplayList] = useState([]); + const [toRemoveId, setToRemoveId] = useState(''); + const [toRemoveItem, setToRemoveItem] = useState({}); + const [showRemoveConfirm_M, setshowRemoveConfirm_M] = useState(false); + const [showRAllC_M, setShowRAllC_M] = useState(false); + const [searchedItem, setSearchedItem] = useState(''); + const [globalWindows, setGlobalWindows] = useState([]); + const [KPIFields, setKPIFields] = useState([]); + const [ActiveSurvey, setActiveSurvey] = useState({}); + const d1 = new Date(); + const d2 = moment(d1).format('MM/DD/YYYY'); + + + useEffect(() => { + setLoaderTitle(ST.Loading + '...') + let params = props.route.params ? props.route.params : {}; + let storeData1 = params.storeData || {}; + let menu1 = params.menu || {}; + let cameraAllow = storeData1.CameraAllow == 'true' || storeData1.CameraAllow == 1 ? true : false; + let surveydata = params.surveyData || {}; + setStoreCameraAllow(cameraAllow); + + let isAdhoc = params.isAdhoc || false; + setActiveSurvey(surveydata) + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1, menu1, surveydata); + + }, []); + + useEffect(() => { + const unsubscribe = props.navigation.addListener( + 'beforeRemove', + onBeforeRemove + ); + + return unsubscribe; + }, []); + + const onBeforeRemove = (e) => { + // kisi bhi condition me back ko block mat karo + setHasUnsavedChanges(false); + // agar preventDefault kahin laga ho to hata do + props.navigation.dispatch(e.data.action); + }; + + async function getData(storeData1, menu1, surveydata) { + try { + let { StoreId, ChainId, StateId, StoreTypeId } = storeData1; + + let AllKPIFields = await getKPIFields(menu1); + setKPIFields(AllKPIFields); + + await db.transaction(async function (txn) { + + + let q3 = `Select VisibilityReasonId as ReasonId,VisibilityReason as Reason From Sup_Master_VisibilityReason`; + await txn.executeSql(q3, [], async function (txn2, txnres2) { + if (txnres2.rows.length > 0) { + let arr = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + arr.push(data); + if (i == txnres2.rows.length - 1) { + + setReasons_list(arr); + } + } + } + }, function (txn2, txnerr) { console.log(txnerr); },); + + // check if data exists + let selectlist = ` w.STORE_ID as StoreId,w.PVIS_HEADER_ID as PVisHeaderId,s.VId,s.Present,s.VisibilityReasonId,s.VisibilityQuestion,s.VisibilityImages,wd.VisibilityDefinitionId,wd.VisibilityId,wd.VisibilityName,wd.VisibilityTable,wd.VisibilityField,wd.VisibilityValue,wd.ChildName,wd.VisibilityRefImage,wd.VisibilityElementCheckAssortment,wd.VisibilityElementStockRequired,w.IS_PRESENT as IsPresent,wd.VisibilityNotExistCamera,w.PVIS_NA_IMAGE as PVisNAImage,wd.VisibilityExistReasonEnable,wd.VisibilityNotExistReasonEnable,w.REASON_ID as ReasonId,w.REASON as Reason,w.REMARK as Remark,wd.NoOfSplit,wd.VisibilityImage1,wd.VisibilityImage2,wd.VisibilityImage1Lable,wd.VisibilityImage2Lable,wd.VisibilityImage1CameraGrid,wd.VisibilityImage2CameraGrid,wd.StockQtyRequired`; + let join = ` inner join Sup_Master_VisibilityDefinition wd on w.PVIS_DEFINITION_ID=wd.VisibilityDefinitionId `; + let join3 = ` inner join Sup_VisibilityAudit s on w.PVIS_DEFINITION_ID=s.VisibilityDefinitionId `; + let q = ` Select ${selectlist} from ${AppTables.VISAUDIT_HDR_DATA} w ${join} ${join3} where w.STORE_ID='${StoreId}' and w.PVIS_DEFINITION_ID='${surveydata.VisibilityDefinitionId}' and s.StoreId='${StoreId}' and s.VisibilityDefinitionId='${surveydata.VisibilityDefinitionId}' and w.VISIT_DATE='${d2}' `; + + // else pick data from masters + let selectlist2 = ` s.StoreId,s.VId,w.VisibilityDefinitionId,s.VisibilityDefinitionId,w.VisibilityId,s.Present,s.VisibilityReasonId,w.VisibilityName,s.VisibilityQuestion,s.VisibilityImages,w.VisibilityTable,w.VisibilityField,w.VisibilityValue,w.ChildName,w.VisibilityRefImage,w.VisibilityElementCheckAssortment,w.VisibilityElementStockRequired,'' as IsPresent,w.VisibilityNotExistCamera,'' as PVisNAImage,w.VisibilityExistReasonEnable,w.VisibilityNotExistReasonEnable,'' as ReasonId,'' as Reason,w.NoOfSplit,w.VisibilityImage1,w.VisibilityImage2,w.VisibilityImage1Lable,w.VisibilityImage2Lable,w.VisibilityImage1CameraGrid,w.VisibilityImage2CameraGrid,w.StockQtyRequired`; + let join2 = ` inner join Sup_VisibilityAudit s on w.VisibilityDefinitionId=s.VisibilityDefinitionId `; + let q2 = ` Select ${selectlist2} from Sup_Master_VisibilityDefinition w ${join2} where s.StoreId='${StoreId}' and s.VisibilityDefinitionId='${surveydata.VisibilityDefinitionId}' `; + + // console.log('Promotion ',q); + await txn.executeSql(q, [], async function (txn2, txnres2) { + // console.log('Promotion items',txnres2.rows.length); + if (txnres2.rows.length > 0) { + let arr = []; let images = [], allWindowsData = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + console.log('Window Data fetched from inserted data:', data); + let animatedChoice = new Animated.Value((data.IsPresent == '1' || data.IsPresent == 1 ? 1 : 0)); + data.animatedChoice = animatedChoice; + data.NoOfSplit = parseInt(data.NoOfSplit); + + let NoOfSplit = data.NoOfSplit; + let isPresent = data.IsPresent == '1' || data.IsPresent == 1 ? 1 : 0; + let isStockReq = data.VisibilityElementStockRequired == 'true' || data.VisibilityElementStockRequired == 1 ? 1 : 0; + + let imgObj = { imgIndex: (i + 1), url: data.VisibilityRefImage, props: {} } + let WindowSplits = await getWindowSplits(NoOfSplit, data, storeData1); + //console.log('Window Splits for window',data.VisibilityDefinitionId,':',WindowSplits); + + let WQr = await getWindowQuestions(data, storeData1, isPresent); + let WindowQuestions = WQr['WindowQuestions'] || []; + let WindowQA = WQr['WindowQA'] || {}; + + // let QData=[]; + // let QAData={}; + // if(data.VisibilityQuestion!="" && data.VisibilityQuestion!=null){ + // let QJSON=JSON.parse(data.VisibilityQuestion) + // let QuestionList=QJSON && QJSON.QuestionList.length>0 ? QJSON.QuestionList:[] + // for(var j=0;j0;j++){ + // let Qdetail=QuestionList[j] + // Qdetail["VisibilityDefinitionId"]=data.VisibilityDefinitionId; + // Qdetail["VId"]=data.VId; + + // let WQr = await getWindowQuestions(Qdetail,storeData1,isPresent); + // let WindowQuesTemp = WQr['WindowQuestions'] ||[] + // let WindowQATemp= WQr['WindowQA'] || {}; + // QData=QData.concat(WindowQuesTemp); + // QAData={...QAData,...WindowQATemp}; + + // } + // } + + + // let WindowQuestions = QData; + // let WindowQA= QAData; + + + let WSd = isStockReq == true ? await getWindowStockData(data, storeData1, isPresent) : { 'WStocks': [], 'WStocksData': [] }; + let WStocks = WSd['WStocks'] || []; + let WStocksData = WSd['WStocksData'] || []; + let isAllChecked = WSd['isAllChecked'] != null ? WSd['isAllChecked'] : 0; + + let isNAImageAvl = data.VisibilityNotExistCamera == 'true' || data.VisibilityNotExistCamera == 1 ? 1 : 0; + let NAImage1 = isNAImageAvl == 1 && data.PVisNAImage != null ? data.PVisNAImage : ''; + let NAImage1Path = NAImage1 != '' ? 'file://' + common_ImagePath + NAImage1 : ''; + + + let windowDataObj = { 'VisibilityId': data.VisibilityId, 'VisibilityDefinitionId': data.VisibilityDefinitionId, 'WindowSplits': WindowSplits, 'WindowQA': WindowQA, 'WStocksData': WStocksData, 'NAImage1': NAImage1, 'NAImage1Path': NAImage1Path, 'ReasonId': data.ReasonId, 'Reason': data.Reason, 'isPresent': isPresent, 'isAllSKUChecked': isAllChecked, 'remark': (data.Remark != null ? data.Remark : '') }; + data['WindowQuestions'] = WindowQuestions; + data['WindowStocks'] = WStocks; + arr.push(data); + allWindowsData.push(windowDataObj); + if (i == txnres2.rows.length - 1) { + setWindowData(allWindowsData); + setWindows(arr); + setGlobalWindows(arr); + images.push(imgObj); + setZoomImageUrl(images); + setProcessing(false); + } + } + } + else { + console.log('No inserted data found, fetching from master data'); + await txn.executeSql(q2, [], async function (txn2, txnres2) { + + if (txnres2.rows.length > 0) { + let arr = [], images = [], allWindowsData = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + let animatedChoice = new Animated.Value(0); + data.animatedChoice = animatedChoice; + data.NoOfSplit = parseInt(data.NoOfSplit); + console.log('Window Data fetched from master data:', data); + let isStockReq = data.VisibilityElementStockRequired == 'true' || data.VisibilityElementStockRequired == 1 ? 1 : 0; + console.log('Window Data fetched from master dataaaa:', isStockReq); + + let imgObj = { imgIndex: (i + 1), url: data.VisibilityRefImage, props: {} } + let WindowSplits = []; + for (var s = 0; s < data.NoOfSplit; s++) { + let obj = { 'Image1Name': '', 'Image1': '', 'Image2Name': '', 'Image2': '' }; + WindowSplits.push(obj); + } + // let QData=[]; + // let QAData={}; + // console.log('Question List for window',data); + // if(data.VisibilityQuestion!="" && data.VisibilityQuestion!=null){ + // let QJSON=JSON.parse(data.VisibilityQuestion) + // let QuestionList=QJSON && QJSON.QuestionList.length>0 ? QJSON.QuestionList:[] + + // for(var j=0;j0;j++){ + // let Qdetail=QuestionList[j] + // let WQr = await getWindowQuestions(Qdetail,storeData1,false); + // console.log('Fetching questions for window',WQr); + // let WindowQuesTemp = WQr['WindowQuestions'] ||[] + // let WindowQATemp= WQr['WindowQA'] || {}; + // QData=QData.concat(WindowQuesTemp); + // QAData={...QAData,...WindowQATemp}; + + // } + // } + let WQr = await getWindowQuestions(data, storeData1, false); + let WindowQuestions = WQr['WindowQuestions'] || []; + let WindowQA = WQr['WindowQA'] || {}; + + // let WindowQuestions = QData; + // let WindowQA= QAData; + let WSd = isStockReq == true ? await getWindowStockData(data, storeData1, false) : { 'WStocks': [], 'WStocksData': [] }; + + let WStocks = WSd['WStocks'] || []; + let WStocksData = WSd['WStocksData'] || []; + let isAllChecked = WSd['isAllChecked'] != null ? WSd['isAllChecked'] : 0; + + let windowDataObj = { 'VisibilityId': data.VisibilityId, 'VisibilityDefinitionId': data.VisibilityDefinitionId, 'WindowSplits': WindowSplits, 'WindowQA': WindowQA, 'WStocksData': WStocksData, 'isAllSKUChecked': isAllChecked }; + data['WindowQuestions'] = WindowQuestions; + data['WindowStocks'] = WStocks; + + arr.push(data); + allWindowsData.push(windowDataObj); + if (i == txnres2.rows.length - 1) { + setWindowData(allWindowsData); + setWindows(arr); + setGlobalWindows(arr); + images.push(imgObj); + setZoomImageUrl(images); + setProcessing(false); + } + } + } + else { + setProcessing(false); + } + }, function (txn2, txnerr) { console.log(txnerr); setProcessing(false); },); + } + }, function (txn2, txnerr) { console.log(txnerr); setProcessing(false); },); + + }); + } catch (err) { + console.log(err); + } + } + + + async function getWindowSplits(NoOfSplit, window, storeData1) { + let WindowSplits_def = []; + for (var s = 0; s < NoOfSplit; s++) { + let obj = { 'Image1Name': '', 'Image1': '', 'Image2Name': '', 'Image2': '' }; + WindowSplits_def.push(obj); + } + return new Promise((resolve, reject) => { + + db.transaction(async function (txn) { + + let q = `select * from ${AppTables.VISAUDIT_IMAGES} where PVIS_HEADER_ID='${window.PVisHeaderId}' and STORE_ID='${storeData1.StoreId}' and VISIT_DATE='${d2}' `; + + await txn.executeSql(q, [], async function (txn2, txnres2) { + + if (txnres2.rows.length > 0) { + let arr = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + console.log(data.PVIS_HEADER_ID) + let isImage1 = window.VisibilityImage1 == 'true' || window.VisibilityImage1 == 1 ? 1 : 0; + let isImage2 = window.VisibilityImage2 == 'true' || window.VisibilityImage2 == 1 ? 1 : 0; + + let Image1 = isImage1 == 1 && data.IMAGE1 != null && data.IMAGE1 != '' ? 'file://' + common_ImagePath + data.IMAGE1 : ''; + let Image2 = isImage2 == 1 && data.IMAGE2 != null && data.IMAGE2 != '' ? 'file://' + common_ImagePath + data.IMAGE2 : ''; + let obj = { 'Image1Name': data.IMAGE1, 'Image1': Image1, 'Image2Name': data.IMAGE2, 'Image2': Image2 }; + arr.push(obj); + + if (i == txnres2.rows.length - 1) { + resolve(arr) + } + } + } + else { + resolve(WindowSplits_def) + } + }, function (txn2, txnerr) { console.log(txnerr); resolve(WindowSplits_def) },); + }); + }).then((val) => { + return val + }).catch((err) => { + console.log(err); + return WindowSplits_def; + }); + } + + async function getWindowQuestions(window, storeData1, isInserted = false) { + console.log('Fetching questions for window:', window.VisibilityQuestionId, ' IsInserted:', isInserted); + let obj = { 'WindowQA': {}, 'WindowQuestions': [] } + return new Promise((resolve, reject) => { + + db.transaction(async function (txn) { + var q = '', selectlist = '', join = '', join2 = ''; + + + + if (isInserted == true) { + selectlist = ` DISTINCT q.QUESTION_ID as VisibilityQuestionId,q.VId,q.QUESTION_CODE as VisibilityQuestionCode,wq.VisibilityQuestionName,wq.QuestionType,wq.VQShowCamera,wq.VQCameraMandatory,wq.VQLengthValidationRequired,wq.VQMinimumChar,wq.VQMaximumChar,wq.VQDecimalPoint,wq.VQDateRangeMin,wq.VQDateRangeMax,wq.VQVoiceLengthInMinutes,wq.VQDefaultQuestionEnable,q.ANSWER as Answer,q.ANSWER_ID as AnswerId,q.MULTI_OPTIONS_IDS as multi_op_ids,q.IMAGE_ALLOW1 as VAShowCamera,q.IMAGE1 as Image1 `; + join = ` inner join Sup_Master_VisibilityQuestion wq on wq.VisibilityQuestionId=q.QUESTION_ID `; + q = `select ${selectlist} from ${AppTables.VISAUDIT_CHILD_DATA} q ${join} where q.STORE_ID='${storeData1.StoreId}' and q.PVIS_DEFINITION_ID='${window.VisibilityDefinitionId}' and q.VISIT_DATE='${d2}' order by wq.VisibilityQuestionSequence `; + } + else { + selectlist = ` DISTINCT wq.VisibilityQuestionId,wq.VisibilityQuestionCode,wq.VisibilityQuestionName,wq.QuestionType,wq.VQShowCamera,wq.VQCameraMandatory,wq.VQLengthValidationRequired,wq.VQMinimumChar,wq.VQMaximumChar,wq.VQDecimalPoint,wq.VQDateRangeMin,wq.VQDateRangeMax,wq.VQVoiceLengthInMinutes,wq.VQDefaultQuestionEnable `; + join = ` inner join Sup_Mapping_VisibilityQuestion mq on mq.VisibilityQuestionId=wq.VisibilityQuestionId `; + q = `select ${selectlist} from Sup_Master_VisibilityQuestion wq ${join} where mq.VisibilityDefinitionId=${window.VisibilityDefinitionId} order by wq.VisibilityQuestionSequence `; + console.log('Query to fetch questions', q); + + } + + await txn.executeSql(q, [], async function (txn2, txnres2) { + if (txnres2.rows.length > 0) { + let arr = []; + let wqa_obj = {}; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + console.log('Question Data', data); + let answers = []; + data.VQDefaultQuestionEnable = data.VQDefaultQuestionEnable == 1 || data.VQDefaultQuestionEnable == 'true' ? true : false; + + if (data.QuestionType == 'Multi choice list' || data.QuestionType == 'Single choice list' || data.QuestionType == 'Rating') { + answers = await getWindowAnswers(data); + if (data.QuestionType == 'Rating') { + data.showRating = false; + } + } + else if (data.QuestionType == 'Date') { + data.showDatePicker = false; + } + data['Answers'] = answers; + + let id_key = data.VisibilityQuestionId + '_AnswerId'; + let ans_key = data.VisibilityQuestionId + '_Answer'; + let multi_key = data.VisibilityQuestionId + '_MultiOption'; + let date_key = data.VisibilityQuestionId + '_Date'; + let img_key = data.VisibilityQuestionId + '_ImagePath1'; + let imgname_key = data.VisibilityQuestionId + '_ImageName1'; + let rating_key = data.VisibilityQuestionId + '_Rating'; + + + let showImageTag = (data.VQShowCamera == 'true' || data.VQShowCamera == 1); + + data.AnswerId != null ? wqa_obj[id_key] = data.AnswerId : ''; + data.Answer != null ? wqa_obj[ans_key] = data.Answer : ''; + + + let selansid = data.AnswerId != null ? data.AnswerId : ''; + if (data.QuestionType == 'Multi choice list' && selansid != '' && data.multi_op_ids != null) { + selansid = data.multi_op_ids ? data.multi_op_ids.split(',') : []; + wqa_obj[multi_key] = data.multi_op_ids; + } + + if ((data.QuestionType == 'Single choice list' || data.QuestionType == 'Multi choice list') && selansid != '' && selansid != null) { + if (data.Answers && data.Answers.length > 0) { + for (var k = 0; k < data.Answers.length; k++) { + let ansss = data.Answers[k]; + let isandImgAl = (ansss.VAShowCamera == 1 || ansss.VAShowCamera == 'true'); + if (data.QuestionType == 'Single choice list' && (isandImgAl && ansss.AnswerId == selansid)) { + showImageTag = true; + } + else if (data.QuestionType == 'Multi choice list' && (isandImgAl && selansid.indexOf(ansss.AnswerId) >= 0)) { + showImageTag = true; + } + } + } + } + + if (showImageTag && data.Answer != null) { + let imgPath = (Platform.OS == 'ios' ? 'file://' : '') + common_ImagePath + data.Image1; + wqa_obj[imgname_key] = data.Image1; + wqa_obj[img_key] = imgPath; + } + + + + if (data.QuestionType == 'Date' && data.Answer != null) { + let dayonly = moment().format('DD'); + let actual_date = data.Answer ? data.Answer.split('/') : []; + let month = actual_date[0], year = actual_date[1]; + let fulldate = month + '/' + dayonly + '/' + year; + wqa_obj[date_key] = fulldate; + + } + data["EmpData"] = window + arr.push(data); + if (i == txnres2.rows.length - 1) { + obj['WindowQuestions'] = arr; + obj['WindowQA'] = wqa_obj; + resolve(obj) + } + } + } + else { + resolve(obj) + } + }, function (txn2, txnerr) { console.log(txnerr); resolve(obj) },); + }); + }).then((val) => { + return val + }).catch((err) => { + console.log(err); + return obj; + }); + } + + + async function getWindowAnswers(qtn) { + + return new Promise((resolve, reject) => { + + db.transaction(async function (txn) { + var q = '', selectlist = ''; + selectlist = ` DISTINCT VisibilityAnswerId as AnswerId,VisibilityAnswerName as Answer,VAShowCamera,VACameraMandatory,VAQuestionEnable,VAQuestionDisable `; + q = `select ${selectlist} from Sup_Master_VisibilityQuestion where VisibilityQuestionId='${qtn.VisibilityQuestionId}' order by VASequence `; + + await txn.executeSql(q, [], async function (txn2, txnres2) { + if (txnres2.rows.length > 0) { + let arr = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + arr.push(data); + if (i == txnres2.rows.length - 1) { + resolve(arr) + } + } + } + else { + resolve([]) + } + }, function (txn2, txnerr) { console.log(txnerr); resolve([]) },); + }); + }).then((val) => { + return val + }).catch((err) => { + console.log(err); + return []; + }); + } + + // async function getWindowStockData(window,storeData1,isInserted=false){ + // let obj={'WStocks':[],'WStocksData':[],'isAllChecked':0} + // return new Promise((resolve,reject)=>{ + // db.transaction(async function (txn) { + // let checkassrt=window.VisibilityElementCheckAssortment=='true' || window.VisibilityElementCheckAssortment==1?true:false; + // let join='',join2=''; + // if(checkassrt){ + // join=` inner join Mapping_ProductAssortment a on a.ProductId=s.PVIS_STOCK_VALUE `; + // } + // let selectlist1=` s.PVIS_STOCK_DEFINITION_ID as VisibilityStockDefinitionId, s.PVIS_DEFINITION_ID as VisibilityDefinitionId,s.PVIS_STOCK_TABLE as VisibilityStockTable,s.PVIS_STOCK_FIELD as VisibilityStockField,s.PVIS_STOCK_VALUE as VisibilityStockValue,s.PVIS_STOCK_MBQ as VisibilityStockMBQ,s.PRODUCT_NAME as ProductName, s.STOCK as Stock,s.IS_PVIS_PRESENT as isPVisPresent `; + // let q=`select ${selectlist1} from ${AppTables.VISAUDIT_STOCK_DATA} s ${join} where s.PVIS_DEFINITION_ID='${window.VisibilityDefinitionId}' and s.STORE_ID='${storeData1.StoreId}' `; + // if(checkassrt){ + // q+=` and a.StateId='${storeData1.StateId}' `; + // } + // q+=` order by s.PRODUCT_NAME `; + + // if(checkassrt){ + // join2=` inner join Mapping_ProductAssortment a on a.ProductId=s.VisibilityStockValue `; + // } + // let selectlist2=` s.VisibilityStockDefinitionId, s.VisibilityDefinitionId,s.VisibilityStockTable,s.VisibilityStockField,s.VisibilityStockValue,s.VisibilityStockMBQ,s.ProductName `; + // let q2=`select ${selectlist2} from Sup_Master_VisibilityStockDefinition s ${join2} where s.VisibilityDefinitionId='${window.VisibilityDefinitionId}' `; + // if(checkassrt){ + // q2+=` and a.StateId='${storeData1.StateId}' `; + // } + // q2+=` order by s.ProductName `; + + + // console.log(q); + // await txn.executeSql(q,[],async function (txn2, txnres2) { + + // if(txnres2.rows.length>0){ + // let arr=[],WStocksData=[]; + // let isAllChecked=1; + // for(var i=0;i0){ + // let arr=[],WStocksData=[]; + // let isAllChecked=1; + // for(var i=0;i{ + // return val + // }).catch((err)=>{ + // console.log(err); + // return obj; + // }); + // } + + function processStockRows(rows, isInserted) { + let WStocks = []; + let WStocksData = []; + let isAllChecked = 1; + + for (let i = 0; i < rows.length; i++) { + + const row = rows.item(i); + WStocks.push(row); + + if (isInserted && row.Stock != null) { + WStocksData.push({ + ProductId: row.VisibilityStockValue, + Stock: row.Stock, + isPVisPresent: row.isPVisPresent ?? 0 + }); + } + + if (!row.isPVisPresent || row.isPVisPresent == 0) { + isAllChecked = 0; + } + } + + return { + WStocks, WStocksData, isAllChecked + }; + } + + + async function getWindowStockData(window, storeData1, isInserted = false) { + + const defaultObj = { + WStocks: [], WStocksData: [], isAllChecked: 0 + }; + + try { + return await new Promise((resolve) => { + + db.transaction(async (txn) => { + const q1 = ` + SELECT s.PVIS_STOCK_DEFINITION_ID AS VisibilityStockDefinitionId, s.PVIS_DEFINITION_ID AS VisibilityDefinitionId,s.PVIS_STOCK_TABLE AS VisibilityStockTable,s.PVIS_STOCK_FIELD AS VisibilityStockField,s.PVIS_STOCK_VALUE AS VisibilityStockValue,s.PVIS_STOCK_MBQ AS VisibilityStockMBQ,s.PRODUCT_NAME AS ProductName,s.STOCK AS Stock,s.IS_PVIS_PRESENT AS isPVisPresent + FROM ${AppTables.VISAUDIT_STOCK_DATA} s + WHERE s.PVIS_DEFINITION_ID = ? + AND s.STORE_ID = ? + ORDER BY s.PRODUCT_NAME + `; + + await txn.executeSql( + q1, + [window.VisibilityDefinitionId, storeData1.StoreId], + async (tx, res) => { + + if (res.rows.length > 0) { + resolve(processStockRows(res.rows, isInserted)); + return; + } + + /* ================= QUERY 2: MASTER STOCK ================= */ + + const q2 = ` + SELECT s.VisibilityStockDefinitionId,s.VisibilityDefinitionId,s.VisibilityStockTable,s.VisibilityStockField,s.VisibilityStockValue,s.VisibilityStockMBQ,s.ProductName + FROM Sup_Master_VisibilityStockDefinition s + WHERE s.VisibilityDefinitionId = ? + ORDER BY s.ProductName + `; + + await tx.executeSql( + q2, + [window.VisibilityDefinitionId], + (tx2, res2) => { + resolve(processStockRows(res2.rows, isInserted)); + }, + () => resolve(defaultObj) + ); + }, + () => resolve(defaultObj) + ); + }); + }); + + } catch (err) { + console.log('❌ getWindowStockData error', err); + return defaultObj; + } + } + + + + async function getImage(imgdata) { + let type = getImageProps.type || ''; + let window = getImageProps.window || {}; + let splitItem = getImageProps.splitItem || {}; + let splitItemIndex = getImageProps.splitItemIndex || 0; + let qtn = getImageProps.qtn || {}; + let cameraType = getImageProps.cameraType != null ? getImageProps.cameraType : '1'; + + if (typeof imgdata == 'object' && imgdata.errorCode == 'camera_unavailable') { + notify(ST.Cameraunavailable); + } + else if (typeof imgdata == 'object' && imgdata.uri != null) { + const img = imgdata; + const imgurl = img.uri, imgWidth = img.width, imgHeight = img.height; + + + let picture_clicked_time = new Date(); + picture_clicked_time = moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1 = picture_clicked_time; + const mark_text2 = 'Store Name:' + storeData.StoreName + ' | Store Id:' + storeData.StoreId + ' | User Id:' + storeData.EmpId + ' | Image Type: Shelf Talker' + ' | Date:' + picture_clicked_time; + + await marktext1(mark_text1, imgurl) + .then((res) => { + if (res.success) { + let uri = res.uri; + marktext2(mark_text2, uri, imgWidth, imgHeight) + .then((res) => { + if (res.success) { + let picture_clickedd = new Date(); + let picture_clicked_date = moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time = moment(picture_clickedd).format('HHmmss'); + let filename = storeData.StoreId + '_' + window.VisibilityDefinitionId + '_' + window.VisibilityId + '_' + (props.UserId || '') + '_STImg-' + picture_clicked_date + '_' + picture_clicked_time + '.jpg'; + + let allData = WindowData; + let defData = { 'VisibilityId': window.VisibilityId, 'VisibilityDefinitionId': window.VisibilityDefinitionId }; + const wind_index = allData.findIndex(i => i.VisibilityId == window.VisibilityId && i.VisibilityDefinitionId == window.VisibilityDefinitionId); + let wind = wind_index >= 0 ? allData[wind_index] : defData; + + if (cameraType == '2') { + var QD = wind.WindowQA || {}; + var image_key = qtn.VisibilityQuestionId + '_ImageName1'; + var image_key_path = qtn.VisibilityQuestionId + '_ImagePath1'; + QD[image_key] = filename; + } + else if (cameraType == '3') { + var image_key = 'NAImage1'; + var image_key_path = 'NAImage1Path'; + wind[image_key] = filename; + } + else { + var WindowSplits = wind.WindowSplits || []; + var image_key = type == '1' ? 'Image1Name' : 'Image2Name'; + var image_key_path = type == '1' ? 'Image1' : 'Image2'; + splitItem[image_key] = filename; + } + + + + // renamefile + let imagePath = `${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri = 'file://' + imagePath; + console.log('image marker:', uri); + + if (cameraType == '2') { + QD[image_key_path] = uri; + wind.WindowQA = QD; + wind_index >= 0 ? allData[wind_index] = wind : allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata3(!rerenderdata3); + } + else if (cameraType == '3') { + wind[image_key_path] = uri; + wind_index >= 0 ? allData[wind_index] = wind : allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + else { + console.log('split image updated'); + splitItem[image_key_path] = uri; + splitItemIndex >= 0 ? WindowSplits[splitItemIndex] = splitItem : WindowSplits.push(splitItem); + wind.WindowSplits = WindowSplits; + wind_index >= 0 ? allData[wind_index] = wind : allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata2(!rerenderdata2); + } + + + + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else { + if (res.imagenotfound) { + notify(ST.Pleasecaptureaimage); + } + else { + notify(res.error); + } + } + }); + } + else { + if (res.imagenotfound) { + notify(ST.Pleasecaptureaimage); + } + else { + notify(res.error); + } + } + }); + } + } + + async function openCamera(window, splitItem, splitItemIndex, type = '1', cameraType = '1', qtn = {}) { + setGetImageProps({ 'window': window, 'splitItem': splitItem, 'splitItemIndex': splitItemIndex, 'type': type, 'cameraType': cameraType, 'qtn': qtn }); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + async function onSubmitData() { + let isvalid = await validate(); + if (isvalid) { + setShowAlert(true); + } + } + + async function saveData() { + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle(ST.SavingData + '...'); + setProcessing(true); + let d1n = new Date(); + let d3 = moment(d1n).format('MM/DD/YYYY'); + try { + let { StoreId, ChainId, StateId, StoreTypeId } = storeData; + let { VisibilityDefinitionId, VisibilityId } = ActiveSurvey; + + await db.transaction(async function (txn) { + + // remove old data + await txn.executeSql(`DELETE FROM ${AppTables.VISAUDIT_HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' and PVIS_DEFINITION_ID='${VisibilityDefinitionId}' `, [], async function (txn2, txnres) { + console.log('window hdr data deleted'); + }, function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.VISAUDIT_CHILD_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' and PVIS_DEFINITION_ID='${VisibilityDefinitionId}' `, [], async function (txn2, txnres) { + console.log('window child data deleted'); + }, function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.VISAUDIT_IMAGES} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' and PVIS_DEFINITION_ID='${VisibilityDefinitionId}' `, [], async function (txn2, txnres) { + console.log('window images data deleted'); + }, function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.VISAUDIT_STOCK_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' and PVIS_DEFINITION_ID='${VisibilityDefinitionId}' `, [], async function (txn2, txnres) { + console.log('window stock data deleted'); + }, function (txn2, txnerr) { console.log(txnerr); },); + + + + // add data + var values = '', childV = '', imageV = '', stockV = ''; + + for (const wi in globalWindows) { + const window = globalWindows[wi]; + let isImage1 = window.VisibilityImage1 == 'true' || window.VisibilityImage1 == 1 ? 1 : 0; + let isImage2 = window.VisibilityImage2 == 'true' || window.VisibilityImage2 == 1 ? 1 : 0; + let isNAImageAvl = window.VisibilityNotExistCamera == 'true' || window.VisibilityNotExistCamera == 1 ? 1 : 0; + let isNAReasonEnable = window.VisibilityNotExistReasonEnable == 'true' || window.VisibilityNotExistReasonEnable == 1 ? 1 : 0; + let isReasonEnable = window.VisibilityExistReasonEnable == 'true' || window.VisibilityExistReasonEnable == 1 ? 1 : 0; + let isStockReq = window.VisibilityElementStockRequired == 'true' || window.VisibilityElementStockRequired == 1 ? 1 : 0; + let WindowQuestions = window.WindowQuestions || []; + let WindowStocks = window.WindowStocks || []; + + + const wind = WindowData.find(i => i.VisibilityId == window.VisibilityId && i.VisibilityDefinitionId == window.VisibilityDefinitionId); + let isPresent = wind.isPresent != null && wind.isPresent != '' ? wind.isPresent : '0'; + let ReasonId = wind.ReasonId != null ? wind.ReasonId : 0; + let Reason = wind.Reason != null ? wind.Reason : ''; + let NAImage1 = wind.NAImage1 != null ? wind.NAImage1 : ''; + let NAImage1Path = wind.NAImage1Path != null ? wind.NAImage1Path : ''; + let remark = wind.remark != null ? wind.remark : ''; + let WindowSplits = wind.WindowSplits || []; + let QD = wind.WindowQA || {}; + let WStocksData = wind.WStocksData || []; + + let PVIS_HEADER_ID = 'WIND' + wi + (Math.floor(Math.random() * 1000) + 1); + let { VisibilityDefinitionId, VId, VisibilityId, VisibilityName, VisibilityTable, VisibilityField, VisibilityValue, ChildName } = window; + + + values += values != '' ? ' , ' : ''; + values += ` ('${PVIS_HEADER_ID}','${VId}','${StoreId}','${d3}','${VisibilityDefinitionId}','${VisibilityId}','${VisibilityName}','${VisibilityTable}','${VisibilityField}','${VisibilityValue}','${ChildName}','${isPresent}','${NAImage1}','${ReasonId}','${Reason}','${(remark || '')}','${d3}') `; + + if (isPresent == 1) { + for (const qtnIndex in WindowQuestions) { + const qtn = WindowQuestions[qtnIndex]; + + let selansid = '', selanswer = '', selimg = '', showImageTag = false; + let id_key = qtn.VisibilityQuestionId + '_AnswerId'; + let ans_key = qtn.VisibilityQuestionId + '_Answer'; + let multi_key = qtn.VisibilityQuestionId + '_MultiOption'; + let date_key = qtn.VisibilityQuestionId + '_Date'; + let img_key = qtn.VisibilityQuestionId + '_ImagePath1'; + let imgname_key = qtn.VisibilityQuestionId + '_ImageName1'; + let rating_key = qtn.VisibilityQuestionId + '_Rating'; + let list_mcdata = []; + + let { VisibilityQuestionId, VisibilityQuestionCode, QuestionType, VQShowCamera } = qtn + let answer = QD[ans_key] || 0; + let answerId = QD[id_key] || ''; + let multi_options_ids = QD[multi_key] || ''; + + if (qtn.QuestionType == 'Number' || qtn.QuestionType == 'Text' || qtn.QuestionType == 'Decimal' || qtn.QuestionType == 'Date') { + showImageTag = (qtn.VQShowCamera == 1 || qtn.VQShowCamera == 'true'); + } + else if ((qtn.QuestionType == 'Single choice list' || qtn.QuestionType == 'Multi choice list')) { + if (qtn.Answers && qtn.Answers.length > 0) { + for (var i = 0; i < qtn.Answers.length; i++) { + let ansss = qtn.Answers[i]; + let isandImgAl = (ansss.VAShowCamera == 'true' || ansss.VAShowCamera == 1); + if (qtn.QuestionType == 'Single choice list' && (isandImgAl && ansss.AnswerId == answerId)) { + showImageTag = true; + } + else if (qtn.QuestionType == 'Multi choice list' && (isandImgAl && answerId.indexOf(ansss.AnswerId) >= 0)) { + showImageTag = true; + } + + } + } + } + + let Image1 = showImageTag == 1 ? QD[imgname_key] : ''; + + + childV += childV != '' ? ' , ' : ''; + childV += ` ('${PVIS_HEADER_ID}','${VId}','${StoreId}','${d3}','${VisibilityDefinitionId}','${VisibilityId}','${VisibilityQuestionId}','${VisibilityQuestionCode}','${QuestionType}','${answer}','${answerId}','${multi_options_ids}','${Image1}','${showImageTag}','${d3}') `; + } + for (const splitItemIndex in WindowSplits) { + const splitItem = WindowSplits[splitItemIndex]; + let Image1Name = splitItem['Image1Name'] != null && splitItem['Image1Name'] != '' ? splitItem['Image1Name'] : ''; + let Image2Name = splitItem['Image2Name'] != null && splitItem['Image2Name'] != '' ? splitItem['Image2Name'] : ''; + Image1Name = isImage1 == 1 ? Image1Name : ''; + Image2Name = isImage2 == 1 ? Image2Name : ''; + + imageV += imageV != '' ? ' , ' : ''; + imageV += ` ('${PVIS_HEADER_ID}','${VId}','${StoreId}','${d3}','${VisibilityDefinitionId}','${VisibilityId}','${Image1Name}','${Image2Name}','${d3}') `; + } + for (const stockProdIndex in WindowStocks) { + const stockProd = WindowStocks[stockProdIndex]; + let sd = WStocksData.find(i => i.ProductId == stockProd.VisibilityStockValue) || {}; + let stock = sd.Stock != null ? sd.Stock : (sd.Stock == 0 ? sd.Stock : ''); + let isPVisPresent = sd.isPVisPresent != null ? sd.isPVisPresent : 0; + let { VisibilityStockDefinitionId, VisibilityDefinitionId, VisibilityStockTable, VisibilityStockField, VisibilityStockValue, VisibilityStockMBQ, ProductName } = stockProd + stockV += stockV != '' ? ' , ' : ''; + stockV += ` ('${PVIS_HEADER_ID}','${VId}','${StoreId}','${d3}','${VisibilityDefinitionId}','${VisibilityId}','${VisibilityStockDefinitionId}','${VisibilityStockTable}','${VisibilityStockField}','${VisibilityStockValue}','${VisibilityStockMBQ}','${ProductName}','${stock}','${isPVisPresent}','${d3}') `; + } + + } + } + + console.log('values:', values); + + let add_hdr_data = `INSERT INTO ${AppTables.VISAUDIT_HDR_DATA} (PVIS_HEADER_ID,VID,STORE_ID,VISIT_DATE,PVIS_DEFINITION_ID,PVIS_ID,PVIS_NAME,PVIS_TABLE,PVIS_FIELD,PVIS_VALUE,CHILD_NAME,IS_PRESENT,PVIS_NA_IMAGE,REASON_ID,REASON,REMARK,ADDED_DATE) VALUES ${values} `; + let add_child_data = `INSERT INTO ${AppTables.VISAUDIT_CHILD_DATA} (PVIS_HEADER_ID,VID,STORE_ID,VISIT_DATE,PVIS_DEFINITION_ID,PVIS_ID,QUESTION_ID,QUESTION_CODE,QUESTION_TYPE,ANSWER,ANSWER_ID,MULTI_OPTIONS_IDS,IMAGE1,IMAGE_ALLOW1,ADDED_DATE) VALUES ${childV} `; + let add_images_data = `INSERT INTO ${AppTables.VISAUDIT_IMAGES} (PVIS_HEADER_ID,VID,STORE_ID,VISIT_DATE,PVIS_DEFINITION_ID,PVIS_ID,IMAGE1,IMAGE2,ADDED_DATE) VALUES ${imageV} `; + let add_stock_data = `INSERT INTO ${AppTables.VISAUDIT_STOCK_DATA} (PVIS_HEADER_ID,VID,STORE_ID,VISIT_DATE,PVIS_DEFINITION_ID,PVIS_ID,PVIS_STOCK_DEFINITION_ID,PVIS_STOCK_TABLE,PVIS_STOCK_FIELD,PVIS_STOCK_VALUE,PVIS_STOCK_MBQ,PRODUCT_NAME,STOCK,IS_PVIS_PRESENT,ADDED_DATE) VALUES ${stockV} `; + + + + await txn.executeSql(add_hdr_data, [], async function (txn2, txnres) { + console.log('st header data added'); + var isSplitImageAdded = true, isStockAdded = true, isChildAdded = true; + if (imageV != '') { + isSplitImageAdded = await executeQuery(add_images_data); + } + if (stockV != '') { + isStockAdded = await executeQuery(add_stock_data); + } + if (childV != '') { + isChildAdded = await executeQuery(add_child_data); + } + + if (!isSplitImageAdded) { + setProcessing(false); notify('Cannot add paid visibility images'); + } + else if (!isStockAdded) { + setProcessing(false); notify('Cannot add paid visibility stock data'); + } + else if (!isChildAdded) { + setProcessing(false); notify('Cannot add paid visibility questions data'); + } + else { + setProcessing(false); notify('Paid visibility updated successfully'); + props.navigation.goBack(); + } + + }, function (txn2, txnerr) { console.log(txnerr); setProcessing(false); notify('Cannot add paid visibility data'); },); + }); + } catch (err) { + console.log(err); + } + } + + async function executeQuery(q) { + return new Promise((resolve, reject) => { + db.transaction(async function (txn) { + await txn.executeSql(q, [], async function (txn2, txnres2) { + resolve(true); + }, function (txn2, txnerr) { console.log(txnerr); resolve(false) }); + }); + }).then((val) => { + return val; + }).catch((err) => { + console.log(err); + return false; + }) + } + + async function validate() { + let isValid = true; + + return new Promise((resolve, reject) => { + for (const wi in globalWindows) { + const window = globalWindows[wi]; + let isImage1 = window.VisibilityImage1 == 'true' || window.VisibilityImage1 == 1 ? 1 : 0; + let isImage2 = window.VisibilityImage2 == 'true' || window.VisibilityImage2 == 1 ? 1 : 0; + let isNAImageAvl = window.VisibilityNotExistCamera == 'true' || window.VisibilityNotExistCamera == 1 ? 1 : 0; + let isNAReasonEnable = window.VisibilityNotExistReasonEnable == 'true' || window.VisibilityNotExistReasonEnable == 1 ? 1 : 0; + let isReasonEnable = window.VisibilityExistReasonEnable == 'true' || window.VisibilityExistReasonEnable == 1 ? 1 : 0; + let isStockReq = window.VisibilityElementStockRequired == 'true' || window.VisibilityElementStockRequired == 1 ? 1 : 0; + let StockQtyRequired = window.StockQtyRequired == 'true' || window.StockQtyRequired == 1 ? 1 : 0; + let WindowQuestions = window.WindowQuestions || []; + let WindowStocks = window.WindowStocks || []; + + + const wind = WindowData.find(i => i.VisibilityId == window.VisibilityId && i.VisibilityDefinitionId == window.VisibilityDefinitionId); + let isPresent = wind.isPresent != null && wind.isPresent != '' ? wind.isPresent : '0'; + let ReasonId = wind.ReasonId != null ? wind.ReasonId : ''; + let Reason = wind.Reason != null ? wind.Reason : ''; + let NAImage1 = wind.NAImage1 != null ? wind.NAImage1 : ''; + let NAImage1Path = wind.NAImage1Path != null ? wind.NAImage1Path : ''; + let remark = wind.remark != null ? wind.remark : ''; + let WindowSplits = wind.WindowSplits || []; + let QD = wind.WindowQA || {}; + let WStocksData = wind.WStocksData || []; + + if (isPresent == '1') { + if (isReasonEnable == true && ReasonId == '') { + notify(`${ST.Pleaseselectreasonfor} ${window.VisibilityName} `, 'LONG'); + resolve(false); return; + } + // else if(remark==''){ + // notify(`Please enter remark for ${window.VisibilityName} `,'LONG'); + // resolve(false);return; + // } + else { + + if (StoreCameraAllow && window.NoOfSplit > 0 && WindowSplits.length > 0 && (isImage1 == 1 || isImage2 == 1)) { + for (const splitItemIndex in WindowSplits) { + const splitItem = WindowSplits[splitItemIndex]; + let Image1Name = splitItem['Image1Name'] != null && splitItem['Image1Name'] != '' ? splitItem['Image1Name'] : ''; + let Image2Name = splitItem['Image2Name'] != null && splitItem['Image2Name'] != '' ? splitItem['Image2Name'] : ''; + console.log('Image2Name', Image2Name, isImage2); + if (isImage1 == 1 && Image1Name == '') { + notify(`${ST.Pleaseclickallimagesfor} ${window.VisibilityName}`, 'LONG'); + resolve(false); return; + } + else if (isImage2 == 1 && Image2Name == '') { + notify(`${ST.Pleaseclickallimagesfor} ${window.VisibilityName}`, 'LONG'); + resolve(false); return; + } + } + } + + if (isStockReq == 1) { + let isProductSelected = false; + for (const stockProdIndex in WindowStocks) { + const stockProd = WindowStocks[stockProdIndex]; + + let sd = WStocksData.find(i => i.ProductId == stockProd.VisibilityStockValue) || {}; + let stock = sd.Stock != null ? sd.Stock : (sd.Stock == 0 ? sd.Stock : ''); + let isPVisPresent = sd.isPVisPresent != null ? sd.isPVisPresent : 0; + + if (isPVisPresent == 1) { + isProductSelected = true; + } + + if (isPVisPresent == 1 && StockQtyRequired == 1 && stock == '') { + notify(`${ST.Pleaseenterstockfor} ${window.VisibilityName} ( ${stockProd.ProductName} ) `, 'LONG'); + resolve(false); return; + } + + if (stockProdIndex == WindowStocks.length - 1) { + if (!isProductSelected) { + notify(`${ST.PleaseselectatleastoneSKUfor} ${window.VisibilityName} `, 'LONG'); + resolve(false); return; + } + } + + } + } + + if (WindowQuestions.length > 0) { + for (const qtnIndex in WindowQuestions) { + const qtn = WindowQuestions[qtnIndex]; + + let selansid = '', selanswer = '', selimg = '', showImageTag = false; + let id_key = qtn.VisibilityQuestionId + '_AnswerId'; + let ans_key = qtn.VisibilityQuestionId + '_Answer'; + let multi_key = qtn.VisibilityQuestionId + '_MultiOption'; + let date_key = qtn.VisibilityQuestionId + '_Date'; + let img_key = qtn.VisibilityQuestionId + '_ImagePath1'; + let imgname_key = qtn.VisibilityQuestionId + '_ImageName1'; + let rating_key = qtn.VisibilityQuestionId + '_Rating'; + let list_mcdata = []; + + let isImgAllowed = (qtn.VQShowCamera == 'true' || qtn.VQShowCamera == 1); + let checkForAnsKey = (qtn.QuestionType == 'Decimal' || qtn.QuestionType == 'Number' || qtn.QuestionType == 'Text' || qtn.QuestionType == 'Date' || qtn.QuestionType == 'Rating'); + if (qtn.QuestionType == 'Single choice list') { + selansid = QD[id_key]; + } + else if (qtn.QuestionType == 'Multi choice list') { + selansid = QD[multi_key] != null && QD[multi_key] != '' ? QD[multi_key].split(',') : []; + } + + + if (qtn.QuestionType == 'Multi choice list' && selansid.length <= 0) { + notify(`${Pleaseselectoptionsfortherequiredfield} ${ST.In} ${window.VisibilityName}`, 'SHORT'); + resolve(false); return; + } + else if (checkForAnsKey && (Object.keys(QD).indexOf(ans_key) < 0 || (Object.keys(QD).indexOf(ans_key) >= 0 && QD[ans_key] === ''))) { + let msg = (qtn.QuestionType == 'Date' ? `${ST.Pleasepickadatefortherequiredfield} ${ST.In} ${window.VisibilityName}` : (qtn.QuestionType == 'Rating' ? `${Pleaseselectratingfortherequiredfield} ${ST.In} ${window.VisibilityName}` : `${ST.Pleasefillalltherequiredfield} ${ST.In} ${window.VisibilityName}`)); + notify(msg, 'SHORT'); + resolve(false); return; + } + else if (Object.keys(QD).indexOf(id_key) < 0 || (Object.keys(QD).indexOf(id_key) >= 0 && (QD[id_key] === '' || (QD[id_key] === 0 && qtn.isDisabled === false)))) { + notify(`${ST.Pleasefillalltherequiredfield} ${ST.In} ${window.VisibilityName}`, 'SHORT'); + resolve(false); return; + } + else if (isImgAllowed && (Object.keys(QD).indexOf(img_key) < 0 || (Object.keys(QD).indexOf(img_key) >= 0 && QD[img_key] === ''))) { + notify(`${ST.Pleaseaddimages} ${ST.In} ${window.VisibilityName}`, 'SHORT'); + resolve(false); return; + } else { + console.log('no condition found'); + } + + if ((qtn.QuestionType == 'Single choice list' || qtn.QuestionType == 'Multi choice list')) { + if (qtn.Answers && qtn.Answers.length > 0) { + for (var j = 0; j < qtn.Answers.length; j++) { + let ansss = qtn.Answers[j]; + let isandImgAl = (ansss.VAShowCamera == 'true' || ansss.VAShowCamera == 1); + if (qtn.QuestionType == 'Single choice list' && (isandImgAl && ansss.AnswerId == selansid)) { + showImageTag = true; + } + else if (qtn.QuestionType == 'Multi choice list' && (isandImgAl && selansid.indexOf(ansss.AnswerId) >= 0)) { + showImageTag = true; + } + } + } + } + + if (showImageTag && (Object.keys(QD).indexOf(img_key) < 0 || (Object.keys(QD).indexOf(img_key) >= 0 && QD[img_key] === ''))) { + notify(`${ST.Pleaseaddimages} ${ST.In} ${window.VisibilityName}`, 'SHORT'); + resolve(false); return; + } + } + } + + } + } + else { + if (isNAReasonEnable == true && ReasonId == '') { + notify(`${ST.Pleaseselectreasonfor} ${window.VisibilityName} `, 'LONG'); + resolve(false); return; + } + else if (StoreCameraAllow && isNAImageAvl == true && NAImage1 == '') { + notify(`${ST.Pleaseclickimagefor} ${window.VisibilityName}`, 'LONG'); + resolve(false); return; + } + } + + if (wi == (Windows.length - 1)) { + resolve(true); return; + } + + } + + }).then((val) => { return val }) + .catch((err) => { console.log(err); return false }); + + } + + + function onselectionChange(option, keyLbl, keyVal, otherData) { + let item = otherData.window; + let allData = WindowData; + let defData = { 'VisibilityId': item.VisibilityId, 'VisibilityDefinitionId': item.VisibilityDefinitionId }; + const win_index = allData.findIndex(i => i.VisibilityId == item.VisibilityId && i.VisibilityDefinitionId == item.VisibilityDefinitionId); + let wind = win_index >= 0 ? (allData[win_index] || defData) : defData; + wind[keyVal] = option.value; + wind[keyLbl] = option.label; + + win_index >= 0 ? allData[win_index] = wind : allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onselectionChange2(option, qtn, window) { + let allData = WindowData; + let defData = { 'VisibilityId': window.VisibilityId, 'VisibilityDefinitionId': window.VisibilityDefinitionId }; + const wind_index = allData.findIndex(i => i.VisibilityId == window.VisibilityId && i.VisibilityDefinitionId == window.VisibilityDefinitionId); + let wind = wind_index >= 0 ? allData[wind_index] : defData; + let data = wind.WindowQA || {}; + let id_key = qtn.VisibilityQuestionId + '_AnswerId'; + let ans_key = qtn.VisibilityQuestionId + '_Answer'; + data[id_key] = option.value; + data[ans_key] = option.label; + + + wind['WindowQA'] = data; + wind_index >= 0 ? allData[wind_index] = wind : allData.push(wind); + + setWindowData(allData); + + let aq_ans = qtn.Answers != null ? qtn.Answers : []; + let ans_obj = aq_ans.find(i => i.AnswerId == option.value) || {}; + let EQtns = ans_obj.VAQuestionEnable != null && ans_obj.VAQuestionEnable != '' ? ans_obj.VAQuestionEnable.replace(' ', '').split(',') : []; + let DQtns = ans_obj.VAQuestionDisable != null && ans_obj.VAQuestionDisable != '' ? ans_obj.VAQuestionDisable.replace(' ', '').split(',') : []; + + let sqtns = window.WindowQuestions || [] + + if (EQtns.length > 0) { + enableQtns(sqtns, EQtns, DQtns, data, wind, wind_index, allData, window) + } + else if (DQtns.length > 0) { + disableQtns(sqtns, DQtns, data, wind, wind_index, allData, window) + } + else { + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + } + + async function disableQtns(sqtns, DQtns, data, wind = {}, wind_index = -1, allData = [], window = {}) { + + if (DQtns.length > 0) { + new Promise.all( + DQtns.map((qid, q_index) => { + let s_qtnindex = sqtns.findIndex(i => i.VisibilityQuestionId == qid) || {}; + let s_qtn = sqtns[s_qtnindex]; + s_qtn['isDisabled'] = true + sqtns[s_qtnindex] = s_qtn; + let id_key = s_qtn.VisibilityQuestionId + '_AnswerId'; + let ans_key = s_qtn.VisibilityQuestionId + '_Answer'; + data[id_key] = 0; + data[ans_key] = ''; + + wind['WindowQA'] = data; + wind_index >= 0 ? allData[wind_index] = wind : allData.push(wind); + + return false + }) + ).then(async (val) => { + + let allwindows = Windows; + let windowIndex = allwindows.findIndex(i => i.VisibilityDefinitionId == window.VisibilityDefinitionId && i.VisibilityId == window.VisibilityId) + if (windowIndex > 0) { + window['WindowQuestions'] = sqtns; + allwindows[windowIndex] = window; + setWindowData(allData); + setWindows(allwindows); + setGlobalWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + }) + } + } + + async function enableQtns(sqtns, EQtns, DQtns, data, wind = {}, wind_index = -1, allData = [], window = {}) { + new Promise.all( + EQtns.map((qid, q_index) => { + let s_qtnindex = sqtns.findIndex(i => i.VisibilityQuestionId == qid) || {}; + let s_qtn = sqtns[s_qtnindex]; + s_qtn['isDisabled'] = false + sqtns[s_qtnindex] = s_qtn; + return false + }) + ).then(async (val) => { + if (DQtns.length > 0) { + disableQtns(sqtns, DQtns, data, wind, wind_index, allData, window) + } + else { + let allwindows = Windows; + let windowIndex = allwindows.findIndex(i => i.VisibilityDefinitionId == window.VisibilityDefinitionId && i.VisibilityId == window.VisibilityId) + if (windowIndex > 0) { + window['WindowQuestions'] = sqtns; + allwindows[windowIndex] = window; + setWindows(allwindows); + setGlobalWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + } + }) + } + + async function setMultiSelectValue(selectedItems = [], qtn = {}, window = {}) { + let id_key = qtn.VisibilityQuestionId + '_AnswerId'; + let ans_key = qtn.VisibilityQuestionId + '_Answer'; + let multi_key = qtn.VisibilityQuestionId + '_MultiOption'; + + let allData = WindowData; + let defData = { 'VisibilityId': window.VisibilityId, 'VisibilityDefinitionId': window.VisibilityDefinitionId }; + const wind_index = allData.findIndex(i => i.VisibilityId == window.VisibilityId && i.VisibilityDefinitionId == window.VisibilityDefinitionId); + let wind = wind_index >= 0 ? allData[wind_index] : defData; + let obj = wind.WindowQA || {}; + obj[id_key] = 0; + obj[multi_key] = selectedItems.join(','); + let anss = []; + selectedItems.map((itemValue) => { + let ans = qtn.Answers.find(c1 => c1.AnswerId == itemValue); + if (ans.Answer) { anss.push(ans.Answer) } + }); + obj[ans_key] = anss.join(','); + + wind['WindowQA'] = obj; + wind_index >= 0 ? allData[wind_index] = wind : allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function setTextValue(value, qtn, window) { + let id_key = qtn.VisibilityQuestionId + '_AnswerId'; + let ans_key = qtn.VisibilityQuestionId + '_Answer'; + + let allData = WindowData; + let defData = { 'VisibilityId': window.VisibilityId, 'VisibilityDefinitionId': window.VisibilityDefinitionId }; + const wind_index = allData.findIndex(i => i.VisibilityId == window.VisibilityId && i.VisibilityDefinitionId == window.VisibilityDefinitionId); + let wind = wind_index >= 0 ? allData[wind_index] : defData; + let obj = wind.WindowQA || {}; + + if (qtn.QuestionType == 'Date') { + let date_key = qtn.VisibilityQuestionId + '_Date'; + let d = value != null ? new Date(value) : new Date(); + let mfdate = moment(d).format('MM/YYYY'); + showQtnDatePicker(qtn, window, false); + obj[id_key] = 0; + obj[ans_key] = mfdate; + obj[date_key] = moment(d).format('MM/DD/YYYY'); + } + else { + obj[id_key] = 0; + obj[ans_key] = value; + } + + console.log(value, obj); + wind['WindowQA'] = obj; + wind_index >= 0 ? allData[wind_index] = wind : allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function showQtnDatePicker(qtn, window, show = false) { + let allQtns = window.WindowQuestions || []; + let newqtnIndex = allQtns.findIndex(q => q.VisibilityQuestionId == qtn.VisibilityQuestionId); + + if (newqtnIndex >= 0) { + let newqtn = allQtns[newqtnIndex]; + newqtn.showDatePicker = show; + allQtns[newqtnIndex] = newqtn; + window['WindowQuestions'] = allQtns; + let allWindows = Windows; + const winIndex = allWindows.findIndex(i => i.VisibilityId == window.VisibilityId && i.VisibilityDefinitionId == window.VisibilityDefinitionId) || {}; + allWindows[winIndex] = window; + setWindows(allWindows); + setGlobalWindows(allwindows); + if (show == true) setrerenderdata(!rerenderdata); + } + } + + function setRatingValue(data) { + setRatingOrder(data); + } + + function onRatingCancel() { + setShowRating(false); + } + + function onRatingSave() { + setShowRating(false); + let qtn = RatingQtn; + let window = RatingWindow; + let id_key = qtn.VisibilityQuestionId + '_AnswerId'; + let ans_key = qtn.VisibilityQuestionId + '_Answer'; + let rating_key = qtn.VisibilityQuestionId + '_Rating'; + let ids = [], anss = []; + RatingOrder.map((item, index) => { + ids.push(item.AnswerId); + anss.push(item.Answer); + }) + + let allData = WindowData; + let defData = { 'VisibilityId': window.VisibilityId, 'VisibilityDefinitionId': window.VisibilityDefinitionId }; + const wind_index = allData.findIndex(i => i.VisibilityId == window.VisibilityId && i.VisibilityDefinitionId == window.VisibilityDefinitionId); + let wind = wind_index >= 0 ? allData[wind_index] : defData; + let obj = wind.WindowQA || {}; + + obj[rating_key] = ids.join(','); + obj[id_key] = 0; + obj[ans_key] = anss.join(','); + + wind['WindowQA'] = obj; + wind_index >= 0 ? allData[wind_index] = wind : allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function onChoiceSelect(item, val, key, animatedChoice) { + + var val1 = 0; + val == 1 ? val1 = 1 : ''; + + if (animatedChoice != null) { + Animated.timing(animatedChoice, { + toValue: val1, + duration: 400, + useNativeDriver: false, + }).start(); + } + onWindowDataChange(item, val, key) + } + + function onWindowDataChange(item, val, key) { + let allData = WindowData; + let defData = { 'VisibilityId': item.VisibilityId, 'VisibilityDefinitionId': item.VisibilityDefinitionId }; + const win_index = allData.findIndex(i => i.VisibilityId == item.VisibilityId && i.VisibilityDefinitionId == item.VisibilityDefinitionId); + let wind = win_index >= 0 ? (allData[win_index] || defData) : defData; + wind[key] = val; + + if (key == 'ReasonId') { + let rsn = reasons_list.find(r => r.ReasonId == val) || {}; + wind['Reason'] = rsn.Reason || ''; + } + + win_index >= 0 ? allData[win_index] = wind : allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + async function setWindowStockVal(val, window, stockProd, key, type = '') { + if (type == 'numeric' && val != '') { + const regex = new RegExp(/^\d+$/); + let isNUmeric = regex.test(val); + if (!isNUmeric) { + notify(ST.Pleaseenterwholenumbersonly, 'SHORT'); + return; + } + } + + let allData = WindowData; + let defData = { 'VisibilityId': window.VisibilityId, 'VisibilityDefinitionId': window.VisibilityDefinitionId }; + const win_index = allData.findIndex(i => i.VisibilityId == window.VisibilityId && i.VisibilityDefinitionId == window.VisibilityDefinitionId); + let wind = win_index >= 0 ? (allData[win_index] || defData) : defData; + let WStocksData = wind['WStocksData'] || []; + let sdIndex = WStocksData.findIndex(i => i.ProductId == stockProd.VisibilityStockValue); + let sd = sdIndex >= 0 ? WStocksData[sdIndex] : { 'ProductId': stockProd.VisibilityStockValue, 'Stock': '' }; + sd[key] = val; + sdIndex >= 0 ? WStocksData[sdIndex] = sd : WStocksData.push(sd); + wind['WStocksData'] = WStocksData; + win_index >= 0 ? allData[win_index] = wind : allData.push(wind); + if (key == 'isPVisPresent') { + let isAllChecked = await verifyAllChecked(val, window, stockProd, key); + wind['isAllSKUChecked'] = isAllChecked; + } + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata4(!rerenderdata4); + } + + async function onCatTextChange(window, key, val) { + let item = window; + let allData = WindowData; + let defData = { 'VisibilityId': item.VisibilityId, 'VisibilityDefinitionId': item.VisibilityDefinitionId }; + const win_index = allData.findIndex(i => i.VisibilityId == item.VisibilityId && i.VisibilityDefinitionId == item.VisibilityDefinitionId); + let wind = win_index >= 0 ? (allData[win_index] || defData) : defData; + wind[key] = val; + + win_index >= 0 ? allData[win_index] = wind : allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + async function verifyAllChecked(val, window, stockProd, key) { + return await new Promise((resolve, reject) => { + let WindowStocks = window.WindowStocks || []; + let allData = WindowData; + const win_index = allData.findIndex(i => i.VisibilityId == window.VisibilityId && i.VisibilityDefinitionId == window.VisibilityDefinitionId); + let wind = win_index >= 0 ? (allData[win_index] || defData) : defData; + let WStocksData = wind['WStocksData'] || []; + if (WindowStocks.length > 0) { + let isAllChecked = 1; + for (var i = 0; i < WindowStocks.length; i++) { + let stockProd = WindowStocks[i]; + + let sdIndex1 = WStocksData.findIndex(a => a.ProductId == stockProd.VisibilityStockValue); + let sd1 = sdIndex1 >= 0 ? WStocksData[sdIndex1] : {}; + let isPVisPresent = sd1.isPVisPresent; + if (isPVisPresent == null || isPVisPresent == '' || isPVisPresent == 0 || isPVisPresent == '0') { + isAllChecked = 0 + } + + if (i == WindowStocks.length - 1) { + resolve(isAllChecked); + } + } + } + else { + resolve(0); + } + + }).catch((err) => { + console.log(err); + return 0; + }); + } + + function checkAllSKUs(val, window) { + + let WindowStocks = window.WindowStocks || []; + let allData = WindowData; + let defData = { 'VisibilityId': window.VisibilityId, 'VisibilityDefinitionId': window.VisibilityDefinitionId }; + const win_index = allData.findIndex(i => i.VisibilityId == window.VisibilityId && i.VisibilityDefinitionId == window.VisibilityDefinitionId); + let wind = win_index >= 0 ? (allData[win_index] || defData) : defData; + let WStocksData = wind['WStocksData'] || []; + console.log('WStocksData before:', WStocksData) + for (var i = 0; i < WindowStocks.length; i++) { + let stockProd = WindowStocks[i]; + + let sdIndex = WStocksData.findIndex(a => a.ProductId == stockProd.VisibilityStockValue); + let sd = sdIndex >= 0 ? WStocksData[sdIndex] : { 'ProductId': stockProd.VisibilityStockValue, 'Stock': '' }; + let isPVisPresent = (val == 1 || val == '1') ? 1 : 0; + sd['isPVisPresent'] = isPVisPresent; + + sdIndex >= 0 ? (WStocksData[sdIndex] = sd) : (WStocksData.push(sd)); + } + + + wind['WStocksData'] = WStocksData; + wind['isAllSKUChecked'] = val == 1 ? 1 : 0; + console.log('wind updated'); + win_index >= 0 ? allData[win_index] = wind : allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onSaveCancel() { + setShowAlert(false); + } + + + + function openImageRefView(RefImage = '') { + setShow_zoomImage(true); + } + + function FilterStores(searchedQry) { + searchedQry = searchedQry.toLowerCase(); + console.log('searchedQry', searchedQry); + let arr = []; + let newWindows = []; + if (searchedQry != null && searchedQry != '') { + + for (let i = 0; i < globalWindows.length; i++) { + let item = globalWindows[i]; + let { VisibilityName } = item; + if (VisibilityName.toLowerCase().includes(searchedQry)) { + newWindows.push(item); + } + + if (i == globalWindows.length - 1) { + arr = newWindows; + } + } + } + else { + arr = globalWindows; + } + + setWindows(arr); + setrerenderdata(!rerenderdata) + setrerenderdata2(!rerenderdata2) + } + + function renderRatingView() { + let qtn = RatingQtn; + let Answers = qtn.Answers; + let id_key = qtn.VisibilityQuestionId + '_AnswerId'; + let ans_key = qtn.VisibilityQuestionId + '_Answer'; + let rating_key = qtn.VisibilityQuestionId + '_Rating'; + + let newarr = RatingOrder; + if (RatingOrder.length <= 0) { + newarr = Answers; + } + + return ( + + + {ST.DragItemsInOrder} + {ST.Pressandholdtodrag} + { setRatingValue(data) }} + keyExtractor={(item) => item.AnswerId} + renderItem={renderItem} + /> + + { onRatingCancel() }}> + {ST.Cancel} + + { onRatingSave() }}> + {ST.Save} + + + + + ) + } + + function render_Picker(label_key, value_key, onChange = () => { }, selected_data = {}) { + var data = []; + let qtn = selected_data.qtn || {}; + let window = selected_data.window || {}; + let isQtnDisabled = qtn.isDisabled != null || qtn.isDisabled != '' ? false : true; + let allAnswers = qtn.Answers || []; + + allAnswers.map((item, index) => { + let obj = { key: index, label: item[label_key], value: item[value_key] }; + if (selected_data.value == item[label_key]) + obj['component'] = {item[label_key]}; + data.push(obj); + }); + + return ( + { onChange(option, qtn, window) }} + overlayStyle={customStyle.addVisPickerOverlay} + cancelContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + optionStyle={customStyle.addvis_opStyle} + optionTextStyle={customStyle.addvis_opTextStyle} + optionContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + selectedKey={'1'} + disabled={isQtnDisabled} + > + {(selected_data.value != null && selected_data.value != '' ? selected_data.value : '-' + ST.select + '-')} + + ) + } + + function renderDatePicker(qtn, window) { + let qtnn = qtn; + let DateRange = qtn.DateRange; + let maxDate = moment().add(10, 'years').format('MM/DD/YYYY'); + let minDate = moment().subtract(10, 'years').format('MM/DD/YYYY'); + if (DateRange == 'RFD') { + maxDate = moment().format('MM/DD/YYYY'); + } + else if (DateRange == 'RPD') { + minDate = moment().format('MM/DD/YYYY'); + } + + return ( + { setTextValue(selectedDate, qtnn, window) }} + maximumDate={new Date(maxDate)} + minimumDate={new Date(minDate)} + /> + ); + } + + function _renderWindow() { + let RemarkEnableIndex = KPIFields.findIndex(i => i.KPIFieldName == 'RemarkEnable') + let RemarkEnableKPIObj = RemarkEnableIndex >= 0 ? KPIFields[RemarkEnableIndex] : {}; + let RemarkEnable = RemarkEnableIndex >= 0 ? RemarkEnableKPIObj['KPIFieldEnable'] : false; + + return ( + `window_${index.toString()}`} + renderItem={({ item, index }) => { + const window = item; + + let isImage1 = window.VisibilityImage1 == 'true' || window.VisibilityImage1 == 1 ? 1 : 0; + let isImage2 = window.VisibilityImage2 == 'true' || window.VisibilityImage2 == 1 ? 1 : 0; + let isNAImageAvl = window.VisibilityNotExistCamera == 'true' || window.VisibilityNotExistCamera == 1 ? 1 : 0; + let isNAReasonEnable = window.VisibilityNotExistReasonEnable == 'true' || window.VisibilityNotExistReasonEnable == 1 ? 1 : 0; + let isReasonEnable = window.VisibilityExistReasonEnable == 'true' || window.VisibilityExistReasonEnable == 1 ? 1 : 0; + let isStockReq = window.VisibilityElementStockRequired == 'true' || window.VisibilityElementStockRequired == 1 ? 1 : 0; + let StockQtyRequired = window.StockQtyRequired == 'true' || window.StockQtyRequired == 1 ? 1 : 0; + let PromoTitleEnable = window.PromoDefinitionTitleEnable == 'true' || window.PromoDefinitionTitleEnable == 1 ? 1 : 0; + let PromoTitle = window.PromoDefinitionTitle != null && window.PromoDefinitionTitle != 'undefined' ? window.PromoDefinitionTitle : ""; + + // let isStock_CheckAssrt=window.VisibilityElementCheckAssortment=='true' || window.VisibilityElementCheckAssortment==1?1:0; + let RefImage = window.VisibilityRefImage; + let camera1Label = window.VisibilityImage1Lable || ''; + let camera2Label = window.VisibilityImage2Lable || ''; + let WindowQuestions = window.WindowQuestions || []; + let WindowStocks = window.WindowStocks || []; + + + const wind = WindowData.find(i => i.VisibilityId == window.VisibilityId && i.VisibilityDefinitionId == window.VisibilityDefinitionId); + let isPresent = wind.isPresent != null && wind.isPresent != '' ? wind.isPresent : '0'; + let ReasonId = wind.ReasonId != null ? wind.ReasonId : ''; + let Reason = wind.Reason != null ? wind.Reason : ''; + let NAImage1 = wind.NAImage1 != null ? wind.NAImage1 : ''; + let NAImage1Path = wind.NAImage1Path != null ? wind.NAImage1Path : ''; + let remark = wind.remark != null ? wind.remark : ''; + let WindowSplits = wind.WindowSplits || []; + let QuestionsData = wind.WindowQA || {}; + let WStocksData = wind.WStocksData || []; + let isAllSKUChecked = wind.isAllSKUChecked == 1 || wind.isAllSKUChecked == "1"; + + let rsn; + if (window.VisibilityReasonId != 0) { + let rsn = reasons_list.find(r => r.ReasonId == window.VisibilityReasonId) || {}; + } + + let EmpImglistJson = window && window.VisibilityImages && JSON.parse(window.VisibilityImages) + let EmplImgList = (EmpImglistJson && EmpImglistJson.ImageList) || [] + + + var xpos = isPresent == '1' ? -75 : 0; + if (window.animatedChoice != null) { + xpos = window.animatedChoice.interpolate({ + inputRange: [0, 1], + outputRange: [0, -75], + }); + } + let PrStatus = window.Present == true || window.Present == "true" ? "Yes" : "No" + return ( + + + + {window.VisibilityName} + {(PromoTitleEnable == 1 && PromoTitle != null && PromoTitle != '') && {PromoTitle}} + { openImageRefView(RefImage) }}> + + + + + + + + {/* + {"IsPresent Emp"} + {window.Present} + */} + + + {"Visibility Status (Emp)"} + {PrStatus} + + + + {ST.IsPresent} + + + + { onChoiceSelect(window, 1, 'isPresent', window.animatedChoice) }}> + {ST.Yes} + + { onChoiceSelect(window, 0, 'isPresent', window.animatedChoice) }}> + {ST.No} + + + + + + {((isPresent != '1' && isNAReasonEnable == true) || (isPresent == '1' && isReasonEnable == true)) && + <> + {(window.VisibilityReasonId != 0 && window.Present != true && window.Present != "true") && + <> + {/* + {ST.SelectReason} + {rsn} + */} + + {`${ST.SelectReason} (Emp)`} + {rsn} + + + } + + + {ST.SelectReason} + {} + + + } + + + {(isPresent != '1' && isNAImageAvl == true) && + + + + {ST.CaptureImage} + + + + + {(NAImage1Path == '' || NAImage1Path == null) && + { openCamera(window, {}, 0, '1', '3') }}> + + + } + {(NAImage1Path != '' && NAImage1Path != null) && + + + { openCamera(window, {}, 0, '1', '3') }}> + + + + } + + + + + + } + + + + {(isPresent == '1') && + + + {(isStockReq == true && WindowStocks.length > 0) && + + + {ST.SelectProducts} + + + { checkAllSKUs((isAllSKUChecked == 1 ? 0 : 1), window) }}> + { let val1 = (val == true) ? 1 : 0; checkAllSKUs(val1, window) }} + style={[customStyle.WStkHdr_checkbox, (Platform.OS == 'ios' ? { height: 20, width: 20, marginLeft: 5 } : {})]} + tintColors={{ true: PageTheme.$primary_color, false: PageTheme.$text_color_light }} + /> + {ST.SelectAll} + + + `wstock_${index.toString()}`} + renderItem={({ item, index }) => { + let stockProd = item; + let stockProdIndex = index; + let sd = WStocksData.find(i => i.ProductId == stockProd.VisibilityStockValue) || {}; + let stock = sd.Stock != null ? sd.Stock : ''; + let isPVisPresent = sd.isPVisPresent != null ? sd.isPVisPresent : 0; + + return ( + + {/* {stockProd.ProductName} */} + + + { let val1 = (val == true) ? 1 : 0; setWindowStockVal(val1, window, stockProd, 'isPVisPresent') }} + style={[customStyle.WStkHdr_checkbox, (Platform.OS == 'ios' ? { height: 20, width: 20, marginTop: 5, marginLeft: 5, } : {})]} + tintColors={{ true: PageTheme.$primary_color, false: PageTheme.$text_color_light }} + /> + + {stockProd.ProductName} + + {StockQtyRequired == 1 && isPVisPresent == 1 && + + + + Stock + + + + { setWindowStockVal(val, window, stockProd, 'Stock', 'numeric') }} + autoComplete='off' + /> + + + + } + + ); + }} + /> + + } + {(window.NoOfSplit > 0 && WindowSplits.length > 0 && (isImage1 == 1 || isImage2 == 1)) && + <> + + {/* */} + {'Paid Visibility Images (Emp)'} + {/* */} + `spliItem_${index.toString()}`} + renderItem={({ item, index }) => { + let splitItem = item; + let splitItemIndex = index; + + let Image1 = splitItem['VisibilityImage1'] != null && splitItem['VisibilityImage1'] != '' ? splitItem['VisibilityImage1'] : ''; + let Image2 = splitItem['VisibilityImage2'] != null && splitItem['VisibilityImage2'] != '' ? splitItem['VisibilityImage2'] : ''; + + return ( + + {isImage1 == 1 && + + {(Image1 != '' && Image1 != null) && + + + + } + + } + {isImage2 == 1 && + + {(Image2 != '' && Image2 != null) && + + + + } + + } + + ); + }} + /> + + + + + + {'Paid Visibility Images'} + + `spliItem_${index.toString()}`} + renderItem={({ item, index }) => { + let splitItem = item; + let splitItemIndex = index; + let Image1Name = splitItem['Image1Name'] != null && splitItem['Image1Name'] != '' ? splitItem['Image1Name'] : ''; + let Image2Name = splitItem['Image2Name'] != null && splitItem['Image2Name'] != '' ? splitItem['Image2Name'] : ''; + let Image1 = splitItem['Image1'] != null && splitItem['Image1'] != '' ? splitItem['Image1'] : ''; + let Image2 = splitItem['Image2'] != null && splitItem['Image2'] != '' ? splitItem['Image2'] : ''; + + return ( + + {isImage1 == 1 && + + {(Image1 == '' || Image1 == null) && + { openCamera(window, splitItem, splitItemIndex, '1') }}> + + + } + {(Image1 != '' && Image1 != null) && + + + { openCamera(window, splitItem, splitItemIndex, '1') }}> + + + + } + {camera1Label} + + } + {isImage2 == 1 && + + {(Image2 == '' || Image2 == null) && + { openCamera(window, splitItem, splitItemIndex, '2') }}> + + + } + {(Image2 != '' && Image2 != null) && + + + { openCamera(window, splitItem, splitItemIndex, '2') }}> + + + + } + {camera2Label} + + } + + ); + }} + /> + + + } + + {(WindowQuestions.length > 0) && + + + {'Paid Visibility Questions'} + + {WindowQuestions.map((item, index) => { + + let qtn = item; + let qtnIndex = index; + let selansid = '', selanswer = '', selimg = '', showImageTag = false; + let id_key = qtn.VisibilityQuestionId + '_AnswerId'; + let ans_key = qtn.VisibilityQuestionId + '_Answer'; + let multi_key = qtn.VisibilityQuestionId + '_MultiOption'; + let date_key = qtn.VisibilityQuestionId + '_Date'; + let img_key = qtn.VisibilityQuestionId + '_ImagePath1'; + let imgname_key = qtn.VisibilityQuestionId + '_ImageName1'; + let rating_key = qtn.VisibilityQuestionId + '_Rating'; + + let list_mcdata = []; + + if (qtn.QuestionType == 'Single choice list') { + selansid = QuestionsData[id_key] != null ? QuestionsData[id_key] : ''; + selanswer = QuestionsData[ans_key] != null ? QuestionsData[ans_key] : ''; + } + else if (qtn.QuestionType == 'Multi choice list') { + if (qtn.Answers != null) { + for (var i = 0; i < qtn.Answers.length; i++) { + let obj = { 'AnswerId': parseInt(qtn.Answers[i].AnswerId), 'Answer': qtn.Answers[i].Answer }; + list_mcdata.push(obj); + } + } + selansid = QuestionsData[multi_key] != null && QuestionsData[multi_key] != '' ? QuestionsData[multi_key].split(',') : []; + // if(selansid!=null && selansid.length>0){ + // let arr=[]; + // for(var i=0;i 0) { + for (var i = 0; i < qtn.Answers.length; i++) { + let ansss = qtn.Answers[i]; + let isandImgAl = (ansss.VAShowCamera == 'true' || ansss.VAShowCamera == 1); + + if (qtn.QuestionType == 'Single choice list' && (isandImgAl && ansss.AnswerId == selansid)) { + showImageTag = true; + } + else if (qtn.QuestionType == 'Multi choice list' && (isandImgAl && selansid.indexOf(ansss.AnswerId) >= 0)) { + showImageTag = true; + } + + } + } + } + + if (showImageTag) { + selimg = QuestionsData[img_key] != null && QuestionsData[img_key] != '' ? 'file://' + QuestionsData[img_key] : ''; + } + + return ( + + {/* + {`${qtn.VisibilityQuestionName} Emp`} + {qtn.EmpData.VisibilityAnswerName} + */} + {/* + {`${qtn.VisibilityQuestionName} (Emp)`} + {qtn.EmpData.VisibilityAnswerName} + */} + {qtn.VisibilityQuestionName} + {qtn.QuestionType == 'Single choice list' && qtn.Answers && + render_Picker('Answer', 'AnswerId', onselectionChange2, { value: selanswer, qtn: qtn, window: window }) + } + {qtn.QuestionType == 'Multi choice list' && qtn.Answers && + { setMultiSelectValue(selectedItems, qtn, window) }} //setMultiSelectValue(selectedItems,qtn) + selectedItems={selansid} + selectText="Pick Items" + searchInputPlaceholderText={ST.SearchItems + "..."} + // onChangeInput={ (text)=> console.log(text)} + tagRemoveIconColor={PrimaryTheme.$primary_color} + tagBorderColor={PrimaryTheme.$primary_color} + tagTextColor={PrimaryTheme.$primary_color} + selectedItemTextColor={PrimaryTheme.$primary_color} + selectedItemIconColor={PrimaryTheme.$primary_color} + itemTextColor={PrimaryTheme.$text_color} + displayKey="Answer" + searchInputStyle={{ color: '#CCC' }} + submitButtonColor={PrimaryTheme.$primary_color} + submitButtonText={ST.Submit} + /> + } + {(qtn.QuestionType == 'Number' || qtn.QuestionType == 'Decimal' || qtn.QuestionType == 'Text') && + { setTextValue(val, qtn, window) }} + autoComplete='off' + /> + } + { + (qtn.QuestionType == 'Date') && + + {selansid != '' ? selansid : 'MM/YYYY'} + { setDateValue(selanswer); showQtnDatePicker(qtn, window, true) }}> + + + + } + {((qtn.showDatePicker == true || qtn.showDatePicker == 'true') && (qtn.QuestionType == 'Date')) && + renderDatePicker(qtn, window) + } + { + (qtn.QuestionType == 'Rating') && + + {selanswer} + { setRatingQtn(qtn); setRatingWindow(window); setShowRating(true); }}> + + + + } + + { + // (qtn.QuestionType=='Audio') && + // + // {selanswer} + // {show_recorder(qtn);}}> + // + // + // + } + + { + showImageTag && + + + { openCamera(window, {}, 0, '1', '2', qtn) }}> + + + + } + + + + ) + })} + + } + {RemarkEnable == true && + + {ST.Remark} + { onCatTextChange(window, 'remark', val) }} + autoComplete='off' + /> + + } + + + } + + + + + + + ); + }} + /> + ) + } + + function _renderHeader(currentIndex) { + return ( + + {/* {`${(currentIndex+1)}/${zoomImageUrl.length}`} */} + { console.log('tsth'); setShow_zoomImage(false) }}> + + + + ) + } + + return ( + + {processing && } + + {ConfirmSaveAlert(props, showAlert, onSaveCancel, saveData)} + { setShowCamera(false); getImage(imgData) }} showCamera={showCamera} onHideCamera={() => { setShowCamera(false); }} /> + + + + + { setSearchedItem(val); FilterStores(val) }} + autoComplete='off' + /> + { FilterStores(searchedItem) }}> + + + + {Object.keys(storeData).length > 0 && + + {_renderWindow()} + + } + + { onSubmitData() }} /> + + + + + {showRating == true && + renderRatingView() + } + {show_zoomImage && + + null} + /> + + } + + ); +} + + +export default connect(mapStateToProps, mapDispatchToProps)(VisibilityAudit); \ No newline at end of file diff --git a/src/screens/VisibilityAuditList.js b/src/screens/VisibilityAuditList.js new file mode 100644 index 0000000..9d18afc --- /dev/null +++ b/src/screens/VisibilityAuditList.js @@ -0,0 +1,165 @@ +import React,{useState,useEffect, useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { customStyles,GetPageTheme, STATUSBAR_HEIGHT } from "../styles/Global"; +import {Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,FlatList, Alert,Animated} from 'react-native'; +import { connect } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {db,} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { checkIf_VisiAuditDone, checkIf_surveyDone } from '../constants/ConstantQueries'; +import { AntDesign } from '../components/icons'; + + +function VisibilityAuditList(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [surveys, setSurveys] = useState([]); + const [EmpData, setEmpData] = useState([]); + + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let empData1=params.empData || {}; + let menu1=params.menu || {}; + let isAdhoc=params.isAdhocScreen || false; + + + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setEmpData(empData1); + setCurrentMenu(menu1); + getData(storeData1,false); + + const willFocusSubscription = props.navigation.addListener('focus', () => { + console.log('onfocus'); + getData(storeData1,false); + }); + + return willFocusSubscription; + }, []); + + useEffect(() => { + console.log('on AutoGoToPrev change (in list view)',props.AutoGoToPrev); + if(props.AutoGoToPrev==true){ + getData(storeData,true); + } + }, [props.AutoGoToPrev]); + + + async function getData(storeData1,isAutoBack=false){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + await db.transaction(async function (txn) { + let q2=`SELECT s.StoreId,w.VisibilityDefinitionId,w.VisibilityId,w.VisibilityName,s.VisibilityQuestion,s.VisibilityImages from Sup_Master_VisibilityDefinition w + inner join Sup_VisibilityAudit s on w.VisibilityDefinitionId=s.VisibilityDefinitionId + where s.StoreId='${StoreId}'` + + await txn.executeSql(q2,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[],isAllSurveyDone=true; + for(var i=0;i { + props.navigation.goBack(); + }, 1500); + } + } + } + + } + + },function (txn2, txnerr) { console.log(txnerr); },); + + }); + } catch (err) { + console.log(err); + } + } + + + function openSurveyView(item){ + let {ShowCat}=item + console.log('ShowCat:',ShowCat); + props.set_autoback({'AutoGoToPrev':false}); + if(ShowCat==1 || ShowCat=='true' || ShowCat==true){ + console.log('go to SurveyCat'); + props.navigation.navigate('VisibilityAudit',{'surveyData':item,'storeData':storeData,'empData':EmpData,'menu':currentMenu,'isAdhocScreen':isAdhocScreen}); + } + else{ + props.navigation.navigate('VisibilityAudit',{'surveyData':item,'storeData':storeData,'empData':EmpData,'menu':currentMenu,'isAdhocScreen':isAdhocScreen,'ShowCat':false}); + } + } + + + return ( + + {processing && } + + + + + { Object.keys(storeData).length>0 && + { + return( + {openSurveyView(item)}}> + + + {item.VisibilityName.substring(0,1)} + + {item.VisibilityName} + {(item.isDone!=null && item.isDone==true) && } + + + ); + }} + /> + } + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(VisibilityAuditList) \ No newline at end of file diff --git a/src/screens/VisitorLogin.js b/src/screens/VisitorLogin.js new file mode 100644 index 0000000..fb3e37b --- /dev/null +++ b/src/screens/VisitorLogin.js @@ -0,0 +1,832 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, Animated} from 'react-native'; +import { connect } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,marktext1,marktext2, UploadData2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {db, common_ImagePath, URL_IMAGE} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import { Ionicons, MaterialCommunityIcons} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import addImg from '../assets/performics/add_image.svg'; +import { CustomPicker, CustomPicker2 } from '../components/CustomPicker'; +import NoDataComponent from '../components/NoDataComponent'; +import { getMethodName, METHODS } from '../constants/methodNames'; + +import CustomCamera from '../components/Camera'; + + + +import cameraImg from '../assets/performics/camera_front_image.svg' +import CustomModal from '../components/CustomModal'; +import { getImagePOSTData, UploadImagesWithoutWait } from '../constants/uploadData'; + +function VisitorLogin(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const globalStyle = globalStyles(props.DarkMode, route.name); + + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [designation, setDesignation] = useState(''); + const [visitors, setVisitors] = useState([]); + const [searchedEmployees, setSearchedEmployees] = useState([]); + const [rerenderdata, setrerenderdata]= useState(0); + const [employeeCode, setEmployeeCode]= useState(''); + const [EmpData, setEmpData]= useState({}); + const [currentCheckOutItem, setCurrentCheckOutItem]= useState({}); + const [removedVisitor, setRemovedVisitor]= useState({}); + + const [showCheckOutModal, setShowCheckOutModal]= useState(false); + const [showRemoveVistor, setShowRemoveVistor]= useState(false); + + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + getData(); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + return; + } + } + + async function getData(){ + try { + + let token=await get_item('loginToken'); + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + let desg=loginDetails.Designation || ''; + setDesignation(desg); + + await db.transaction(async function (txn) { + + // let q1=`DELETE from ${AppTables.VISITOR_LOGIN} where EMP_CODE='C000363'`; + // await txn.executeSql(q1,[],async function (txn2, txnres) { + // console.log('deleted'); + // },function (txn2, txnerr) { console.log(txnerr); },); + + let q=`SELECT * from ${AppTables.VISITOR_LOGIN} where VISIT_DATE='${d2}'`; + await txn.executeSql(q,[],async function (txn2, txnres) { + if(txnres.rows.length>0){ + let arr=[]; + for(var i=0;i { + console.log('Visitor_Search:',res); + let emp=[]; + if(res.Visitor_Search!=null){ + emp=res.Visitor_Search || []; + } + else{ + notify(ST.Nodatafound); + } + setSearchedEmployees(emp); + setProcessing(false); + }) + .catch(err => { + console.log('onPage Team error', err); + setProcessing(false); + }); + } + } + + async function addEmpl(item){ + if(validateEmp(item,true)){ + console.log('addEmp') + setLoaderTitle(ST.AddingEmployee+'...'); + setProcessing(true); + + try{ + await db.transaction(async function (txn) { + let {EmpId,EmployeeName,DesignationName,LegacyCode}=item; + let currentTime=moment().format('HH:mm:ss'); + let d3=moment().format('MM/DD/YYYY'); + let image_key=item.EmpId+'In_Image'; + let image_path_key=item.EmpId+'In_ImagePath'; + let image1=EmpData[image_key] || ''; + let values=`('${EmpId}','${LegacyCode}','${EmployeeName}','${DesignationName}','I','${d3}','${currentTime}','','${image1}','','${d3}')`; + let q=`INSERT INTO ${AppTables.VISITOR_LOGIN}(EMP_ID,EMP_CODE,NAME,DESIGNATION,UPLOADSTATUS,VISIT_DATE,IN_TIME,OUT_TIME,IN_TIME_IMAGE,OUT_TIME_IMAGE,ADDED_DATE) VALUES ${values}`; + let q2=`SELECT * FROM ${AppTables.VISITOR_LOGIN} WHERE VISIT_DATE='${d3}'`; + + let q3=`SELECT * FROM ${AppTables.VISITOR_LOGIN} WHERE VISIT_DATE='${d3}' and EMP_CODE='${LegacyCode}'`; + await txn.executeSql(q3,[],async function (txn2, txnres3) { + if(txnres3.rows.length>0){ + setProcessing(false); + notify(ST.Visitor+' '+LegacyCode+' '+ST.Alreadyexists); + } + else{ + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('Visitor added'); + + await txn.executeSql(q2,[],async function (txn2, txnres2) { + console.log('Visitors',txnres2.rows.length); + if(txnres2.rows.length>0){ + + let arr=[]; + for(var i=0;i{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=item.EmpId+'_'+(props.UserId || '')+'_VisitorLoginImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let allData=EmpData; + + let image_key=type=='In'?item.EmpId+'In_Image':item.EmpId+'Out_Image'; + let image_path_key=type=='In'?item.EmpId+'In_ImagePath':item.EmpId+'Out_ImagePath'; + allData[image_key]=filename; + + // renamefile + let imagePath='file://'+common_ImagePath+filename; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri=imagePath; + console.log('image marker',uri); + allData[image_path_key]=uri; + setEmpData(allData); + setrerenderdata(!rerenderdata); + }) + .catch(err => { + console.log(ST.Errorimagefilewritefailed+'!!!'); + console.log(err.message, err.code); + notify(ST.CannotProcessImage); + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(item,type='In'){ + setGetImageProps({'item':item,'type':type}); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'front'}) + } + + async function onCheckOut(item){ + setCurrentCheckOutItem(item); + setShowCheckOutModal(true); + } + + async function onDelete(item){ + + if(item.UPLOADSTATUS=='U'){ + setProcessing(false); + notify(ST.Dataalreadyuploaded+' '+ST.Cannotdeletevisitornow); + } + else if(item.OUT_TIME!='' && item.OUT_TIME!=null){ + setProcessing(false); + notify(ST.Visitoralreadyhadcheckedout+' '+ST.Cannotdeletevisitornow); + } + else{ + console.log('delete emp') + setRemovedVisitor(item); + setShowRemoveVistor(true); + } + } + + async function removeVisitor(){ + let item=removedVisitor; + setShowRemoveVistor(false) + setLoaderTitle(ST.RemovingEmployee+'...'); + setProcessing(true); + try{ + await db.transaction(async function (txn) { + let {EMP_CODE,EMP_ID}=item; + let q2=`DELETE FROM ${AppTables.VISITOR_LOGIN} WHERE VISIT_DATE='${d2}' AND EMP_CODE='${EMP_CODE}'`; + let q=`SELECT * FROM ${AppTables.VISITOR_LOGIN} WHERE VISIT_DATE='${d2}' `; + await txn.executeSql(q2,[],async function (txn2, txnres3) { + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('Visitors',txnres2.rows.length); + let arr=[]; + if(txnres2.rows.length>0){ + + + for(var i=0;i0){ + + let arr=[],visitoreData={}; + for(var i=0;i{ + console.log('res:',res); + if(res.UploadJsonResult!=null && res.UploadJsonResult=='Success'){ + const url2=(props.imageUploadUrl || URL_IMAGE)+getMethodName(METHODS.UPLOADIMAGES_METHOD); + let allImageUploaded=true; + if(INIMAGE!=''){ + let isExists=await RNFS.exists(INIMAGE.uri).then((res)=>{return res;}); + console.log('isExists file',isExists); + if(isExists==true){ + let fileData=getImagePOSTData(INIMAGE,d2); + let isImageUploaded=await UploadImagesWithoutWait(fileData,url2); + if(isImageUploaded==false){ + allImageUploaded=false; + } + } + } + if(OUTIMAGE!=''){ + let isExists=await RNFS.exists(OUTIMAGE.uri).then((res)=>{return res;}); + console.log('isExists file',isExists); + if(isExists==true){ + let fileData=getImagePOSTData(OUTIMAGE,d2); + let isImageUploaded=await UploadImagesWithoutWait(fileData,url2); + if(isImageUploaded==false){ + allImageUploaded=false; + } + } + } + if(allImageUploaded==true){ + console.log('all Visitor image uploaded'); + let isupdated=await updateVLUploadStatus(item); + if(isupdated==true){ + setProcessing(false); + notify(ST.Visitordatauploaded); + } + else{ + setProcessing(false); + notify(ST.Cannotuploadvisitordata); + } + } + else{ + setProcessing(false); + notify(ST.Cannotuploadvisitordata); + } + + }else{ + setProcessing(false); + notify(ST.Cannotuploadvisitordata); + } + }) + .catch((err)=>{ + console.log(err); + setProcessing(false); + notify(ST.Cannotuploadvisitordata); + }); + + } + + async function updateVLUploadStatus(item){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + + let q=`Update ${AppTables.VISITOR_LOGIN} SET UPLOADSTATUS='U' WHERE EMP_CODE='${item.EMP_CODE}' AND VISIT_DATE='${d2}'`; + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('Visitor Updated'); + let allVisitors=visitors; + let thisVisIndex=allVisitors.findIndex(i=>i.EMP_CODE==item.EMP_CODE); + if(thisVisIndex>=0){ + let thisVis=allVisitors[thisVisIndex] || {}; + thisVis['UPLOADSTATUS']='U'; + allVisitors[thisVisIndex]=thisVis; + setVisitors(allVisitors); + setrerenderdata(!rerenderdata); + resolve(true); + } + else{ + resolve(false); + } + },function (txn2, txnerr) { console.log(txnerr);resolve(false); },); + + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }); + } + + function _render_CheckOutModal(){ + + let data=currentCheckOutItem; + let item={"EmpId":data.EMP_ID,"EmployeeName":data.NAME,"DesignationName":data.DESIGNATION,"LegacyCode":data.EMP_CODE}; + let image_key=item.EmpId+'Out_Image'; + let image_path_key=item.EmpId+'Out_ImagePath'; + let Image1=EmpData[image_path_key] || ''; + return ( + + + + + { (Image1=='' || Image1==null) && + {openCamera(item,'Out')}}> + + + } + { (Image1!='' && Image1!=null) && + + + {openCamera(item,'Out')}}> + + + + } + + + + {cancelCehckout()}}> + {ST.Cancel} + + {checkOutEmpl(item)}}> + {ST.Save} + + + + + + ) + } + + function _render_RemoveAlert(){ + let data=removedVisitor; + return ( + + + {setShowRemoveVistor(false)}}> + {ST.Cancel} + + {removeVisitor(removedVisitor)}}> + {ST.Yes} + + + + ) + } + + return ( + + {processing && } + + {_render_CheckOutModal()} + {_render_RemoveAlert()} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + { !props.isDataDownloaded && } + { props.isDataDownloaded==true && + + + + {ST.Username+' :'} + {props.UserId} + + + {ST.Designation+' :'} + {designation} + + + + + + + {/* {'Employee Code'} */} + {setEmployeeCode(val)}} + autoComplete='off' + /> + + {getEmplDetails()}}> + {ST.Go} + + + + + + + { + searchedEmployees.length>0 && + searchedEmployees.map((item,index)=>{ + let image_key=item.EmpId+'In_Image'; + let image_path_key=item.EmpId+'In_ImagePath'; + let Image1=EmpData[image_path_key] || ''; + + return( + + + {ST.Name+':'} + {(item.EmployeeName || '')} + + + {ST.Designation+':'} + {(item.DesignationName || '')} + + + + + { (Image1=='' || Image1==null) && + {openCamera(item,'In')}}> + + + } + { (Image1!='' && Image1!=null) && + + + {openCamera(item,'In')}}> + + + + } + + + + {addEmpl(item)}}> + {ST.AddVisitor} + + + + + + ) + }) + } + + + + {ST.Visitors} + + + {ST.Name} + + + {ST.Designation} + + + {ST.Actions} + + + + { + visitors.length>0 && + visitors.map((item,index)=>{ + return( + + + {item.NAME} + + + {item.DESIGNATION} + + {item.UPLOADSTATUS!='U' && (item.OUT_TIME=='' || item.OUT_TIME==null) && + + {onCheckOut(item)}}> + {ST.CheckOut} + + {onDelete(item)}}> + + + + } + {item.UPLOADSTATUS!='U' && (item.OUT_TIME!='' && item.OUT_TIME!=null) && + + + {ST.CheckedOut} + + } + + {item.UPLOADSTATUS=='U' && + + + {ST.Uploaded} + + } + + + ) + }) + } + + + + + } + + + + ); +} + +export default connect(mapStateToProps, mapDispatchToProps)(VisitorLogin); diff --git a/src/screens/Window.js b/src/screens/Window.js new file mode 100644 index 0000000..895e30d --- /dev/null +++ b/src/screens/Window.js @@ -0,0 +1,1816 @@ +import React,{useState,useEffect,useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList, Alert, Animated} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,marktext1,marktext2} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, colors_Arr, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card, Menu, Switch} from 'react-native-paper'; +import {AntDesign, Entypo, FontAwesome, Fontisto, MaterialCommunityIcons} from '../components/icons'; +import { stat } from 'react-native-fs'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import { AppTables } from '../constants/tableConstants'; +import { SvgXml } from 'react-native-svg'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import GradientButton from '../components/gradientButton'; +import addImg from '../assets/performics/add_image.svg'; +import CustomModal from '../components/CustomModal'; +import { Q_getpaidvisibility } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import ModalSelector from 'react-native-modal-selector' +import { CustomPicker, CustomPicker2 } from '../components/CustomPicker'; +import CustomCamera from '../components/Camera'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import DateTimePicker from '@react-native-community/datetimepicker'; + + +import cameraImg from '../assets/performics/camera_front_image.svg' +import MultiSelect from 'react-native-multiple-select'; + +function Window(props) { + const route = useRoute(); + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const animatedChoice=useRef(new Animated.Value(0)).current; + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState('loading...'); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [storeData, setStoreData] = useState({}); + const [currentMenu, setCurrentMenu] = useState({}); + const [rerenderdata, setrerenderdata]= useState(0); + const [rerenderdata2, setrerenderdata2]= useState(0); + const [rerenderdata3, setrerenderdata3]= useState(0); + const [rerenderdata4, setrerenderdata4]= useState(0); + + const [hasUnsavedChanges,setHasUnsavedChanges] = useState(false); + + const [WindowData, setWindowData] = useState([]); + const [reasons_list, setReasons_list] = useState([]); + const [Windows, setWindows] = useState([]); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [showAlert, setShowAlert] = useState(false); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + const zoomView=useRef(null); + const [showRating, setShowRating] = useState(false); + const [RatingQtn, setRatingQtn] = useState({}); + const [RatingWindow, setRatingWindow] = useState({}); + const [RatingOrder, setRatingOrder] = useState([]); + + const [Products, setProducts] = useState([]); + const [DisplayList, setDisplayList] = useState([]); + const [toRemoveId,setToRemoveId]= useState(''); + const [toRemoveItem,setToRemoveItem]= useState({}); + const [showRemoveConfirm_M,setshowRemoveConfirm_M]= useState(false); + const [showRAllC_M,setShowRAllC_M]= useState(false); + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let menu1=params.menu || {}; + + let isAdhoc=params.isAdhoc || false; + setIsAdhocScreen(isAdhoc); + setStoreData(storeData1); + setCurrentMenu(menu1); + + getData(storeData1); + + props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [hasUnsavedChanges]); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + if (hasUnsavedChanges==true) { + e.preventDefault(); // Prevent default behavior of leaving the screen + onRemoveScreen(e); + } + else{ + return; + } + } + } + function onRemoveScreen(e){ + Alert.alert( + "", + "Do you really want to exit the screen?", + [ + { + text: "Cancel", + onPress: () => {}, + style: "cancel" + }, + { text: "OK", onPress: () => {setHasUnsavedChanges(false);props.navigation.dispatch(e.data.action);} } + ] + ); + } + + + async function getData(storeData1){ + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData1; + + await db.transaction(async function (txn) { + + + let q3=`Select WindowReasonId as ReasonId,WindowReason as Reason From Master_WindowReason`; + await txn.executeSql(q3,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i0){ + let arr=[];let images=[],allWindowsData=[]; + for(var i=0;i0){ + let arr=[],images=[],allWindowsData=[]; + for(var i=0;i{ + + db.transaction(async function (txn) { + + let q=`select * from ${AppTables.WINDOW_IMAGES} where WINDOW_HEADER_ID='${window.windowHeaderId}' and STORE_ID='${storeData1.StoreId}' `; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return WindowSplits_def; + }); + } + + async function getWindowQuestions(window,storeData1,isInserted=false){ + let obj={'WindowQA':{},'WindowQuestions':[]} + return new Promise((resolve,reject)=>{ + + db.transaction(async function (txn) { + var q='',selectlist='',join='',join2=''; + if(isInserted==true){ + selectlist=` DISTINCT q.QUESTION_ID as WindowQuestionId,q.QUESTION_CODE as WindowQuestionCode,wq.WindowQuestionName,wq.QuestionType,wq.WQShowCamera,wq.WQCameraMandatory,wq.WQLengthValidationRequired,wq.WQMinimumChar,wq.WQMaximumChar,wq.WQDecimalPoint,wq.WQDateRangeMin,wq.WQDateRangeMax,wq.WQVoiceLengthInMinutes,wq.WQDefaultQuestionEnable,q.ANSWER as Answer,q.ANSWER_ID as AnswerId,q.MULTI_OPTIONS_IDS as multi_op_ids,q.IMAGE_ALLOW1 as WAShowCamera,q.IMAGE1 as Image1 `; + join2=` inner join Mapping_WindowQuestion mq on mq.WindowQuestionId=wq.WindowQuestionId `; + join=` inner join Master_WindowQuestion wq on wq.WindowQuestionId=q.QUESTION_ID `; + q=`select ${selectlist} from ${AppTables.WINDOW_CHILD_DATA} q ${join} ${join2} where q.STORE_ID='${storeData1.StoreId}' and q.WINDOW_DEFINITION_ID='${window.WindowDefinitionId}' and q.WINDOW_ID='${window.WindowId}' order by wq.WindowQuestionSequence `; + } + else{ + selectlist=` DISTINCT wq.WindowQuestionId,wq.WindowQuestionCode,wq.WindowQuestionName,wq.QuestionType,wq.WQShowCamera,wq.WQCameraMandatory,wq.WQLengthValidationRequired,wq.WQMinimumChar,wq.WQMaximumChar,wq.WQDecimalPoint,wq.WQDateRangeMin,wq.WQDateRangeMax,wq.WQVoiceLengthInMinutes,wq.WQDefaultQuestionEnable `; + join=` inner join Mapping_WindowQuestion mq on mq.WindowQuestionId=wq.WindowQuestionId `; + q=`select ${selectlist} from Master_WindowQuestion wq ${join} where mq.WindowDefinitionId='${window.WindowDefinitionId}' order by wq.WindowQuestionSequence `; + } + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + let wqa_obj={}; + for(var i=0;i0){ + for(var k=0;k=0)){ + showImageTag=true; + } + } + } + } + + if(showImageTag && data.Answer!=null){ + let imgPath=(Platform.OS=='ios'?'file://':'')+common_ImagePath+data.Image1; + wqa_obj[imgname_key]=data.Image1; + wqa_obj[img_key]=imgPath; + } + + + + if(data.QuestionType=='Date' && data.Answer!=null){ + let dayonly=moment().format('DD'); + let actual_date=data.Answer?data.Answer.split('/'):[]; + let month=actual_date[0],year=actual_date[1]; + let fulldate=month+'/'+dayonly+'/'+year; + wqa_obj[date_key]=fulldate; + + } + + arr.push(data); + if(i==txnres2.rows.length-1){ + obj['WindowQuestions']=arr; + obj['WindowQA']=wqa_obj; + resolve(obj) + } + } + } + else{ + resolve(obj) + } + },function (txn2, txnerr) { console.log(txnerr); resolve(obj) },); + }); + }).then((val)=>{ + return val + }).catch((err)=>{ + console.log(err); + return obj; + }); + } + + + async function getWindowAnswers(qtn){ + + return new Promise((resolve,reject)=>{ + + db.transaction(async function (txn) { + var q='',selectlist=''; + selectlist=` DISTINCT WindowAnswerId as AnswerId,WindowAnswerName as Answer,WAShowCamera,WACameraMandatory,WAQuestionEnable,WAQuestionDisable `; + q=`select ${selectlist} from Master_WindowQuestion where WindowQuestionId='${qtn.WindowQuestionId}' order by WASequence `; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[]; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return []; + }); + } + + async function getWindowStockData(window,storeData1,isInserted=false){ + let obj={'WStocks':[],'WStocksData':[]} + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + var q='',selectlist='',join=''; + let checkassrt=window.WindowElementCheckAssortment=='true' || window.WindowElementCheckAssortment==1?true:false; + + if(isInserted==true){ + if(checkassrt){ + join=` inner join Mapping_ProductAssortment a on a.ProductId=s.WINDOW_STOCK_VALUE `; + } + selectlist=` s.WINDOW_STOCK_DEFINITION_ID as WindowStockDefinitionId, s.WINDOW_DEFINITION_ID as WindowDefinitionId,s.WINDOW_STOCK_TABLE as WindowStockTable,s.WINDOW_STOCK_FIELD as WindowStockField,s.WINDOW_STOCK_VALUE as WindowStockValue,s.WINDOW_STOCK_MBQ as WindowStockMBQ,s.PRODUCT_NAME as ProductName, s.STOCK as Stock `; + q=`select ${selectlist} from ${AppTables.WINDOW_STOCK_DATA} s ${join} where s.WINDOW_DEFINITION_ID='${window.WindowDefinitionId}' and s.STORE_ID='${storeData1.StoreId}' `; + }else{ + if(checkassrt){ + join=` inner join Mapping_ProductAssortment a on a.ProductId=s.WindowStockValue `; + } + selectlist=` s.WindowStockDefinitionId, s.WindowDefinitionId,s.WindowStockTable,s.WindowStockField,s.WindowStockValue,s.WindowStockMBQ,s.ProductName `; + q=`select ${selectlist} from Master_WindowStockDefinition s ${join} where s.WindowDefinitionId='${window.WindowDefinitionId}' `; + } + if(checkassrt){ + q+=` and a.StateId='${storeData1.StateId}' `; + } + q+=isInserted?` order by s.PRODUCT_NAME `:` order by s.ProductName `; + + + + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let arr=[],WStocksData=[]; + for(var i=0;i{ + return val + }).catch((err)=>{ + console.log(err); + return obj; + }); + } + + + + + + async function getImage(imgdata){ + let type=getImageProps.type || ''; + let window=getImageProps.window || {}; + let splitItem=getImageProps.splitItem || {}; + let splitItemIndex=getImageProps.splitItemIndex || 0; + let qtn=getImageProps.qtn || {}; + let cameraType=getImageProps.cameraType!=null?getImageProps.cameraType:'1'; + + if(typeof imgdata=='object' && imgdata.errorCode=='camera_unavailable'){ + notify('Camera unavailable'); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='Store Name:'+storeData.StoreName+' | Store Id:'+storeData.StoreId+' | User Id:'+storeData.EmpId+' | Image Type: Window'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=storeData.StoreId+'_'+window.WindowDefinitionId+'_'+window.WindowId+'_'+(props.UserId || '')+'_WindowImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + let allData=WindowData; + let defData={'WindowId':window.WindowId,'WindowDefinitionId':window.WindowDefinitionId}; + const wind_index=allData.findIndex(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId) ; + let wind=wind_index>=0?allData[wind_index]:defData; + + if(cameraType=='2'){ + var QD=wind.WindowQA || {}; + var image_key=qtn.WindowQuestionId+'_ImageName1'; + var image_key_path=qtn.WindowQuestionId+'_ImagePath1'; + QD[image_key]=filename; + } + else if(cameraType=='3'){ + var image_key='NAImage1'; + var image_key_path='NAImage1Path'; + wind[image_key]=filename; + } + else{ + var WindowSplits=wind.WindowSplits || []; + var image_key=type=='1'?'Image1Name':'Image2Name'; + var image_key_path=type=='1'?'Image1':'Image2'; + splitItem[image_key]=filename; + } + + + + // renamefile + let imagePath=`${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker:',uri); + + if(cameraType=='2'){ + QD[image_key_path]=uri; + wind.WindowQA=QD; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata3(!rerenderdata3); + } + else if(cameraType=='3'){ + wind[image_key_path]=uri; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + else{ + console.log('split image updated'); + splitItem[image_key_path]=uri; + splitItemIndex>=0?WindowSplits[splitItemIndex]=splitItem:WindowSplits.push(splitItem); + wind.WindowSplits=WindowSplits; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata2(!rerenderdata2); + } + + + + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(window,splitItem,splitItemIndex,type='1',cameraType='1',qtn={}){ + setGetImageProps({'window':window,'splitItem':splitItem,'splitItemIndex':splitItemIndex,'type':type,'cameraType':cameraType,'qtn':qtn}); + setShowCamera(true); + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'back'}) + } + + + async function onSubmitData(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + async function saveData(){ + setHasUnsavedChanges(false); + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + let d1n=new Date(); + let d3=moment(d1n).format('MM/DD/YYYY'); + try { + let {StoreId,ChainId,StateId,StoreTypeId}=storeData; + await db.transaction(async function (txn) { + + // remove old data + await txn.executeSql(`DELETE FROM ${AppTables.WINDOW_HDR_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window hdr data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.WINDOW_CHILD_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window child data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.WINDOW_IMAGES} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window images data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + await txn.executeSql(`DELETE FROM ${AppTables.WINDOW_STOCK_DATA} WHERE STORE_ID='${StoreId}' and VISIT_DATE='${d2}' `,[],async function (txn2, txnres) { + console.log('window stock data deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + // add data + var values='',childV='',imageV='',stockV=''; + + for (const wi in Windows){ + const window=Windows[wi]; + let isImage1=window.WindowImage1=='true' || window.WindowImage1==1?1:0; + let isImage2=window.WindowImage2=='true' || window.WindowImage2==1?1:0; + let isNAImageAvl=window.WindowNotExistCamera=='true' || window.WindowNotExistCamera==1?1:0; + let isNAReasonEnable=window.WindowNotExistReasonEnable=='true' || window.WindowNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.WindowExistReasonEnable=='true' || window.WindowExistReasonEnable==1? 1:0; + let isStockReq=window.WindowElementStockRequired=='true' || window.WindowElementStockRequired==1?1:0; + let WindowQuestions=window.WindowQuestions || []; + let WindowStocks=window.WindowStocks || []; + + + const wind=WindowData.find(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:0; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let WindowSplits=wind.WindowSplits || []; + let QD=wind.WindowQA || {}; + let WStocksData=wind.WStocksData || []; + + let WINDOW_HEADER_ID='WIND'+wi+(Math.floor(Math.random()*1000)+1); + let {WindowDefinitionId,WindowId,WindowName,WindowTable,WindowField,WindowValue,ChildName}=window; + + + values+=values!=''?' , ':''; + values+=` ('${WINDOW_HEADER_ID}','${StoreId}','${d3}','${WindowDefinitionId}','${WindowId}','${WindowName}','${WindowTable}','${WindowField}','${WindowValue}','${ChildName}','${isPresent}','${NAImage1}','${ReasonId}','${Reason}','${d3}') `; + + if(isPresent==1){ + for(const qtnIndex in WindowQuestions){ + const qtn=WindowQuestions[qtnIndex]; + + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + let multi_key=qtn.WindowQuestionId+'_MultiOption'; + let date_key=qtn.WindowQuestionId+'_Date'; + let img_key=qtn.WindowQuestionId+'_ImagePath1'; + let imgname_key=qtn.WindowQuestionId+'_ImageName1'; + let rating_key=qtn.WindowQuestionId+'_Rating'; + let list_mcdata=[]; + + let {WindowQuestionId,WindowQuestionCode,QuestionType,WAShowCamera}=qtn + let answer=QD[ans_key] || 0; + let answerId=QD[id_key] || ''; + let multi_options_ids=QD[multi_key] || ''; + let isImage1All=WAShowCamera=='true' || WAShowCamera==1?1:0; + let Image1=isImage1All==1?QD[imgname_key]:''; + + + childV+=childV!=''?' , ':''; + childV+=` ('${WINDOW_HEADER_ID}','${StoreId}','${d3}','${WindowDefinitionId}','${WindowId}','${WindowQuestionId}','${WindowQuestionCode}','${QuestionType}','${answer}','${answerId}','${multi_options_ids}','${Image1}','${isImage1All}','${d3}') `; + } + for(const splitItemIndex in WindowSplits){ + const splitItem=WindowSplits[splitItemIndex]; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image2Name=splitItem['Image2Name']!=null && splitItem['Image2Name']!=''?splitItem['Image2Name']:''; + Image1Name=isImage1==1?Image1Name:''; + Image2Name=isImage2==1?Image2Name:''; + + imageV+=imageV!=''?' , ':''; + imageV+=` ('${WINDOW_HEADER_ID}','${StoreId}','${d3}','${WindowDefinitionId}','${WindowId}','${Image1Name}','${Image2Name}','${d3}') `; + } + for(const stockProdIndex in WindowStocks){ + const stockProd=WindowStocks[stockProdIndex]; + let sd=WStocksData.find(i=> i.ProductId==stockProd.WindowStockValue) || {}; + let stock=sd.Stock!=null?sd.Stock:(sd.Stock==0?sd.Stock:''); + let {WindowStockDefinitionId, WindowDefinitionId,WindowStockTable,WindowStockField,WindowStockValue,WindowStockMBQ,ProductName} =stockProd + stockV+=stockV!=''?' , ':''; + stockV+=` ('${WINDOW_HEADER_ID}','${StoreId}','${d3}','${WindowDefinitionId}','${WindowId}','${WindowStockDefinitionId}','${WindowStockTable}','${WindowStockField}','${WindowStockValue}','${WindowStockMBQ}','${ProductName}','${stock}','${d3}') `; + } + + } + } + + console.log('values:',values); + + + let add_hdr_data=`INSERT INTO ${AppTables.WINDOW_HDR_DATA} (WINDOW_HEADER_ID,STORE_ID,VISIT_DATE,WINDOW_DEFINITION_ID,WINDOW_ID,WINDOW_NAME,WINDOW_TABLE,WINDOW_FIELD,WINDOW_VALUE,CHILD_NAME,IS_PRESENT,WINDOW_NA_IMAGE,REASON_ID,REASON,ADDED_DATE) VALUES ${values} `; + let add_child_data=`INSERT INTO ${AppTables.WINDOW_CHILD_DATA} (WINDOW_HEADER_ID,STORE_ID,VISIT_DATE,WINDOW_DEFINITION_ID,WINDOW_ID,QUESTION_ID,QUESTION_CODE,QUESTION_TYPE,ANSWER,ANSWER_ID,MULTI_OPTIONS_IDS,IMAGE1,IMAGE_ALLOW1,ADDED_DATE) VALUES ${childV} `; + let add_images_data=`INSERT INTO ${AppTables.WINDOW_IMAGES} (WINDOW_HEADER_ID,STORE_ID,VISIT_DATE,WINDOW_DEFINITION_ID,WINDOW_ID,IMAGE1,IMAGE2,ADDED_DATE) VALUES ${imageV} `; + let add_stock_data=`INSERT INTO ${AppTables.WINDOW_STOCK_DATA} (WINDOW_HEADER_ID,STORE_ID,VISIT_DATE,WINDOW_DEFINITION_ID,WINDOW_ID,WINDOW_STOCK_DEFINITION_ID,WINDOW_STOCK_TABLE,WINDOW_STOCK_FIELD,WINDOW_STOCK_VALUE,WINDOW_STOCK_MBQ,PRODUCT_NAME,STOCK,ADDED_DATE) VALUES ${stockV} `; + + await txn.executeSql(add_hdr_data,[],async function (txn2, txnres) { + console.log('window header data added'); + var isSplitImageAdded=true,isStockAdded=true,isChildAdded=true; + if(imageV!=''){ + isSplitImageAdded=await executeQuery(add_images_data); + } + if(stockV!=''){ + isStockAdded=await executeQuery(add_stock_data); + } + if(childV!=''){ + isChildAdded=await executeQuery(add_child_data); + } + + if(!isSplitImageAdded){ + setProcessing(false);notify('Cannot add split window images'); + } + else if(!isStockAdded){ + setProcessing(false);notify('Cannot add window stock data'); + } + else if(!isChildAdded){ + setProcessing(false);notify('Cannot add window questions data'); + } + else{ + setProcessing(false);notify('Window data updated successfully'); + props.navigation.goBack(); + } + + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot add window data'); },); + }); + } catch (err) { + console.log(err); + } + } + + async function executeQuery(q){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + await txn.executeSql(q,[],async function (txn2, txnres2) { + resolve(true); + },function(txn2,txnerr){console.log(txnerr);resolve(false) }); + }); + }).then((val)=>{ + return val; + }).catch((err)=>{ + console.log(err); + return false; + }) + } + + + + async function validate(){ + let isValid=true; + + return new Promise((resolve,reject)=>{ + for (const wi in Windows){ + const window=Windows[wi]; + let isImage1=window.WindowImage1=='true' || window.WindowImage1==1?1:0; + let isImage2=window.WindowImage2=='true' || window.WindowImage2==1?1:0; + let isNAImageAvl=window.WindowNotExistCamera=='true' || window.WindowNotExistCamera==1?1:0; + let isNAReasonEnable=window.WindowNotExistReasonEnable=='true' || window.WindowNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.WindowExistReasonEnable=='true' || window.WindowExistReasonEnable==1? 1:0; + let isStockReq=window.WindowElementStockRequired=='true' || window.WindowElementStockRequired==1?1:0; + let WindowQuestions=window.WindowQuestions || []; + let WindowStocks=window.WindowStocks || []; + + + const wind=WindowData.find(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let WindowSplits=wind.WindowSplits || []; + let QD=wind.WindowQA || {}; + let WStocksData=wind.WStocksData || []; + + if(isPresent=='1'){ + if(isReasonEnable==true && ReasonId=='' ){ + notify(`Please select reason for ${window.WindowName} `,'LONG'); + resolve(false);return; + } + else{ + if(window.NoOfSplit>0 && WindowSplits.length>0 && (isImage1==1 || isImage2==1)) + { + for(const splitItemIndex in WindowSplits){ + const splitItem=WindowSplits[splitItemIndex]; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image2Name=splitItem['Image2Name']!=null && splitItem['Image2Name']!=''?splitItem['Image2Name']:''; + console.log('Image2Name',Image2Name,isImage2); + if(isImage1==1 && Image1Name==''){ + notify(`Please click all images for ${window.WindowName}`,'LONG'); + resolve(false);return; + } + else if(isImage2==1 && Image2Name==''){ + notify(`Please click all images for ${window.WindowName}`,'LONG'); + resolve(false);return; + } + } + } + + if(isStockReq==1){ + for(const stockProdIndex in WindowStocks){ + const stockProd=WindowStocks[stockProdIndex]; + let sd=WStocksData.find(i=> i.ProductId==stockProd.WindowStockValue) || {}; + let stock=sd.Stock!=null?sd.Stock:(sd.Stock==0?sd.Stock:''); + + if(stock==''){ + notify(`Please enter stock for ${window.WindowName} ( ${stockProd.ProductName} ) `,'LONG'); + resolve(false);return; + } + } + } + + if(WindowQuestions.length>0){ + for(const qtnIndex in WindowQuestions){ + const qtn=WindowQuestions[qtnIndex]; + + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + let multi_key=qtn.WindowQuestionId+'_MultiOption'; + let date_key=qtn.WindowQuestionId+'_Date'; + let img_key=qtn.WindowQuestionId+'_ImagePath1'; + let imgname_key=qtn.WindowQuestionId+'_ImageName1'; + let rating_key=qtn.WindowQuestionId+'_Rating'; + let list_mcdata=[]; + + let isImgAllowed=(qtn.WQShowCamera=='true' || qtn.WQShowCamera==1); + let checkForAnsKey=(qtn.QuestionType=='Decimal' || qtn.QuestionType=='Number' || qtn.QuestionType=='Text' || qtn.QuestionType=='Date' || qtn.QuestionType=='Rating') ; + if(qtn.QuestionType=='Single choice list') + { + selansid=QD[id_key]; + } + else if(qtn.QuestionType=='Multi choice list') + { + selansid=QD[multi_key]!=null && QD[multi_key]!=''?QD[multi_key].split(','):[]; + } + + + if(qtn.QuestionType=='Multi choice list' && selansid.length<=0){ + notify(`Please select options for the required field in ${window.WindowName}`,'SHORT'); + resolve(false);return; + } + else if( checkForAnsKey && (Object.keys(QD).indexOf(ans_key)<0 || (Object.keys(QD).indexOf(ans_key)>=0 && QD[ans_key]===''))){ + let msg=( qtn.QuestionType=='Date'?`Please pick a date for the required field in ${window.WindowName}`:(qtn.QuestionType=='Rating'?`Please select rating for the required field in ${window.WindowName}`:`Please fill all the required field in ${window.WindowName}`)); + notify(msg,'SHORT'); + resolve(false);return; + } + else if(Object.keys(QD).indexOf(id_key)<0 || (Object.keys(QD).indexOf(id_key)>=0 && (QD[id_key]==='' || (QD[id_key]===0 && qtn.isDisabled===false) ))){ + notify(`Please fill all the required field in ${window.WindowName}`,'SHORT'); + resolve(false);return; + } + else if(isImgAllowed && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + notify(`Please add images in ${window.WindowName}`,'SHORT'); + resolve(false);return; + }else{ + console.log('no condition found'); + } + + if((qtn.QuestionType=='Single choice list' || qtn.QuestionType=='Multi choice list' )){ + if (qtn.Answers && qtn.Answers.length>0){ + for(var j=0;j=0)){ + showImageTag=true; + } + } + } + } + + if(showImageTag && (Object.keys(QD).indexOf(img_key)<0 || (Object.keys(QD).indexOf(img_key)>=0 && QD[img_key]===''))){ + notify(`Please add images in ${window.WindowName}`,'SHORT'); + resolve(false);return; + } + } + } + + } + } + else{ + if(isNAReasonEnable==true && ReasonId=='' ){ + notify(`Please select reason for ${window.WindowName} `,'LONG'); + resolve(false);return; + } + else if(isNAImageAvl==true && NAImage1=='' ){ + notify(`Please click image for ${window.WindowName}`,'LONG'); + resolve(false);return; + } + } + + if(wi==(Windows.length-1)){ + resolve(true);return; + } + + } + + }).then((val)=>{return val}) + .catch((err)=>{console.log(err); return false}); + + } + + + function onselectionChange(option,keyLbl,keyVal,otherData){ + let item=otherData.window; + let allData=WindowData; + let defData={'WindowId':item.WindowId,'WindowDefinitionId':item.WindowDefinitionId}; + const win_index=allData.findIndex(i=>i.WindowId==item.WindowId && i.WindowDefinitionId==item.WindowDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[keyVal]=option.value; + wind[keyLbl]=option.label; + + win_index>=0?allData[win_index]=wind:allData.push(wind); + console.log('allData:',allData); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function onselectionChange2(option,qtn,window){ + let allData=WindowData; + let defData={'WindowId':window.WindowId,'WindowDefinitionId':window.WindowDefinitionId}; + const wind_index=allData.findIndex(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let data=wind.WindowQA || {}; + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + data[id_key]=option.value; + data[ans_key]=option.label; + + + wind['WindowQA']=data; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + + let aq_ans=qtn.Answers!=null?qtn.Answers:[]; + let ans_obj=aq_ans.find(i=>i.AnswerId==option.value) || {}; + let EQtns=ans_obj.WAQuestionEnable!=null && ans_obj.WAQuestionEnable!=''?ans_obj.WAQuestionEnable.replace(' ','').split(','):[]; + let DQtns=ans_obj.WAQuestionDisable!=null && ans_obj.WAQuestionDisable!=''?ans_obj.WAQuestionDisable.replace(' ','').split(','):[]; + + let sqtns=window.WindowQuestions || [] + + if(EQtns.length>0){ + enableQtns(sqtns,EQtns,DQtns,data,wind,wind_index,allData,window) + } + else if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data,wind,wind_index,allData,window) + } + else{ + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + } + + async function disableQtns(sqtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + + if(DQtns.length>0){ + new Promise.all( + DQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.WindowQuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=true + sqtns[s_qtnindex]=s_qtn; + let id_key=s_qtn.WindowQuestionId+'_AnswerId'; + let ans_key=s_qtn.WindowQuestionId+'_Answer'; + data[id_key]=0; + data[ans_key]=''; + + wind['WindowQA']=data; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + return false + }) + ).then(async (val)=>{ + + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.WindowDefinitionId==window.WindowDefinitionId && i.WindowId==window.WindowId) + if(windowIndex>0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindowData(allData); + setWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + }) + } + } + + async function enableQtns(sqtns,EQtns,DQtns,data,wind={},wind_index=-1,allData=[],window={}){ + new Promise.all( + EQtns.map((qid,q_index)=>{ + let s_qtnindex=sqtns.findIndex(i=>i.WindowQuestionId==qid) || {}; + let s_qtn=sqtns[s_qtnindex]; + s_qtn['isDisabled']=false + sqtns[s_qtnindex]=s_qtn; + return false + }) + ).then(async (val)=>{ + if(DQtns.length>0){ + disableQtns(sqtns,DQtns,data,wind,wind_index,allData,window) + } + else{ + let allwindows=Windows; + let windowIndex=allwindows.findIndex(i=>i.WindowDefinitionId==window.WindowDefinitionId && i.WindowId==window.WindowId) + if(windowIndex>0){ + window['WindowQuestions']=sqtns; + allwindows[windowIndex]=window; + setWindows(allwindows); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + } + }) + } + + async function setMultiSelectValue(selectedItems=[],qtn={},window={}) { + console.log('setMultiSelectValue',selectedItems); + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + let multi_key=qtn.WindowQuestionId+'_MultiOption'; + + let allData=WindowData; + let defData={'WindowId':window.WindowId,'WindowDefinitionId':window.WindowDefinitionId}; + const wind_index=allData.findIndex(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + obj[id_key]=0; + obj[multi_key]=selectedItems.join(','); + let anss=[]; + selectedItems.map((itemValue)=>{ + let ans = qtn.Answers.find(c1 => c1.AnswerId == itemValue); + if(ans.Answer){anss.push(ans.Answer)} + }); + obj[ans_key]=anss.join(','); + console.log('obj:',obj); + + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function setTextValue(value,qtn,window) { + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + + let allData=WindowData; + let defData={'WindowId':window.WindowId,'WindowDefinitionId':window.WindowDefinitionId}; + const wind_index=allData.findIndex(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + if(qtn.QuestionType=='Date' ){ + let date_key=qtn.WindowQuestionId+'_Date'; + let d=value!=null?new Date(value):new Date(); + let mfdate=moment(d).format('MM/YYYY'); + showQtnDatePicker(qtn,window,false); + obj[id_key]=0; + obj[ans_key]=mfdate; + obj[date_key]=moment(d).format('MM/DD/YYYY'); + } + else{ + obj[id_key]=0; + obj[ans_key]=value; + } + + console.log(value,obj); + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + function showQtnDatePicker(qtn,window,show=false){ + let allQtns=window.WindowQuestions || []; + let newqtnIndex=allQtns.findIndex(q=>q.WindowQuestionId==qtn.WindowQuestionId); + + if(newqtnIndex>=0){ + let newqtn=allQtns[newqtnIndex]; + newqtn.showDatePicker=show; + allQtns[newqtnIndex]=newqtn; + window['WindowQuestions']=allQtns; + let allWindows=Windows; + const winIndex=allWindows.findIndex(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId) || {}; + allWindows[winIndex]=window; + setWindows(allWindows); + + if(show==true) setrerenderdata(!rerenderdata); + } + } + + function setRatingValue(data){ + setRatingOrder(data); + } + + function onRatingCancel(){ + setShowRating(false); + } + + function onRatingSave(){ + setShowRating(false); + let qtn=RatingQtn; + let window=RatingWindow; + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + let rating_key=qtn.WindowQuestionId+'_Rating'; + let ids=[],anss=[]; + RatingOrder.map((item,index)=>{ + ids.push(item.AnswerId); + anss.push(item.Answer); + }) + + let allData=WindowData; + let defData={'WindowId':window.WindowId,'WindowDefinitionId':window.WindowDefinitionId}; + const wind_index=allData.findIndex(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let wind=wind_index>=0?allData[wind_index]:defData; + let obj=wind.WindowQA || {}; + + obj[rating_key]=ids.join(','); + obj[id_key]=0; + obj[ans_key]=anss.join(','); + + wind['WindowQA']=obj; + wind_index>=0?allData[wind_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function onChoiceSelect(item,val,key,animatedChoice){ + console.log('onChoiceSelect',animatedChoice) + var val1=0; + val==1?val1=1:''; + + if(animatedChoice!=null){ + Animated.timing(animatedChoice, { + toValue: val1, + duration:400, + useNativeDriver:false, + }).start(); + } + onWindowDataChange(item,val,key) + } + + function onWindowDataChange(item,val,key){ + let allData=WindowData; + let defData={'WindowId':item.WindowId,'WindowDefinitionId':item.WindowDefinitionId}; + const win_index=allData.findIndex(i=>i.WindowId==item.WindowId && i.WindowDefinitionId==item.WindowDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + wind[key]=val; + + if(key=='ReasonId'){ + let rsn=reasons_list.find(r=>r.ReasonId==val) || {}; + wind['Reason']=rsn.Reason || ''; + } + + win_index>=0?allData[win_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata(!rerenderdata); + } + + + function setWindowStockVal(val,window,stockProd){ + let allData=WindowData; + let defData={'WindowId':window.WindowId,'WindowDefinitionId':window.WindowDefinitionId}; + const win_index=allData.findIndex(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let wind=win_index>=0?(allData[win_index] || defData) : defData; + let WStocksData=wind['WStocksData'] || []; + let sdIndex=WStocksData.findIndex(i=> i.ProductId==stockProd.WindowStockValue); + let sd=sdIndex>=0?WStocksData[sdIndex]:{'ProductId':stockProd.WindowStockValue,'Stock':''}; + sd['Stock']=val; + sdIndex>=0?WStocksData[sdIndex]=sd:WStocksData.push(sd); + wind['WStocksData']=WStocksData; + win_index>=0?allData[win_index]=wind:allData.push(wind); + + setWindowData(allData); + setHasUnsavedChanges(true); + setrerenderdata4(!rerenderdata4); + } + + function onSaveCancel(){ + setShowAlert(false); + } + + + + function openImageRefView(RefImage=''){ + setShow_zoomImage(true); + } + + function renderRatingView(){ + let qtn=RatingQtn; + let Answers=qtn.Answers; + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + let rating_key=qtn.WindowQuestionId+'_Rating'; + + let newarr=RatingOrder; + if(RatingOrder.length<=0){ + newarr=Answers; + } + + return ( + + + Drag Items In Order + Press and hold to drag + {setRatingValue(data)}} + keyExtractor={(item) => item.AnswerId} + renderItem={renderItem} + /> + + {onRatingCancel()}}> + Cancel + + {onRatingSave()}}> + Save + + + + + ) + } + + function render_Picker(label_key,value_key,onChange=()=>{},selected_data={}){ + var data=[]; + let qtn=selected_data.qtn || {}; + let window=selected_data.window || {}; + let isQtnDisabled=qtn.isDisabled!=null || qtn.isDisabled!=''?false:true; + let allAnswers=qtn.Answers || []; + + allAnswers.map((item,index)=>{ + let obj={ key: index, label: item[label_key],value:item[value_key] }; + if(selected_data.value==item[label_key]) + obj['component']= {item[label_key]}; + data.push(obj); + }); + + return ( + {onChange(option,qtn,window) }} + overlayStyle={customStyle.addVisPickerOverlay} + cancelContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + optionStyle={customStyle.addvis_opStyle} + optionTextStyle={customStyle.addvis_opTextStyle} + optionContainerStyle={customStyle.addVisPicker_OptionContainerStyle} + selectedKey={'1'} + disabled={isQtnDisabled} + > + {(selected_data.value!=null && selected_data.value!=''?selected_data.value: '-select-')} + + ) + } + + function renderDatePicker(qtn,window){ + let qtnn=qtn; + let DateRange=qtn.DateRange; + let maxDate=moment().add(10,'years').format('MM/DD/YYYY'); + let minDate=moment().subtract(10,'years').format('MM/DD/YYYY'); + if(DateRange=='RFD'){ + maxDate=moment().format('MM/DD/YYYY'); + } + else if(DateRange=='RPD'){ + minDate=moment().format('MM/DD/YYYY'); + } + + return ( + {setTextValue(selectedDate,qtnn,window)}} + maximumDate={new Date(maxDate)} + minimumDate={new Date(minDate)} + /> + ); + } + + function _renderWindow(){ + return ( + `window_${index.toString()}`} + renderItem={({item,index})=>{ + const window=item; + + let isImage1=window.WindowImage1=='true' || window.WindowImage1==1?1:0; + let isImage2=window.WindowImage2=='true' || window.WindowImage2==1?1:0; + let isNAImageAvl=window.WindowNotExistCamera=='true' || window.WindowNotExistCamera==1?1:0; + let isNAReasonEnable=window.WindowNotExistReasonEnable=='true' || window.WindowNotExistReasonEnable==1? 1:0; + let isReasonEnable=window.WindowExistReasonEnable=='true' || window.WindowExistReasonEnable==1? 1:0; + let isStockReq=window.WindowElementStockRequired=='tre' || window.WindowElementStockRequired==1?1:0; + // let isStock_CheckAssrt=window.WindowElementCheckAssortment=='true' || window.WindowElementCheckAssortment==1?1:0; + let RefImage=window.WindowRefImage; + let camera1Label=window.WindowImage1Lable || ''; + let camera2Label=window.WindowImage2Lable || ''; + let WindowQuestions=window.WindowQuestions || []; + let WindowStocks=window.WindowStocks || []; + + const wind=WindowData.find(i=>i.WindowId==window.WindowId && i.WindowDefinitionId==window.WindowDefinitionId); + let isPresent=wind.isPresent!=null && wind.isPresent!=''?wind.isPresent:'0'; + let ReasonId=wind.ReasonId!=null?wind.ReasonId:''; + let Reason=wind.Reason!=null?wind.Reason:''; + let NAImage1=wind.NAImage1!=null?wind.NAImage1:''; + let NAImage1Path=wind.NAImage1Path!=null?wind.NAImage1Path:''; + let WindowSplits=wind.WindowSplits || []; + let QuestionsData=wind.WindowQA || {}; + let WStocksData=wind.WStocksData || []; + + // console.log('camera2Label:',window.WindowId,window.WindowDefinitionId,camera2Label); + + + var xpos=isPresent=='1'?-75:0; + if(window.animatedChoice!=null ){ + xpos=window.animatedChoice.interpolate({ + inputRange:[0,1], + outputRange:[0,-75], + }); + } + return( + + + + {window.WindowName} + {window.ChildName} + + {openImageRefView(RefImage)}}> + + + + + + + + + {'Is Present'} + + + + {onChoiceSelect(window,1,'isPresent',window.animatedChoice)}}> + Yes + + {onChoiceSelect(window,0,'isPresent',window.animatedChoice)}}> + No + + + + + {((isPresent!='1' && isNAReasonEnable==true) || (isPresent=='1' && isReasonEnable==true)) && + + Select Reason + {} + + } + + + {(isPresent!='1' && isNAImageAvl==true) && + + + + {'Capture Image'} + + + + + + { (NAImage1Path=='' || NAImage1Path==null) && + {openCamera(window,{},0,'1','3')}}> + + + } + { (NAImage1Path!='' && NAImage1Path!=null) && + + + {openCamera(window,{},0,'1','3')}}> + + + + } + + + + + } + + + + {(isPresent=='1') && + + {(isStockReq==true && WindowStocks.length>0) && + + + {'Enter Stocks'} + + `wstock_${index.toString()}`} + renderItem={({item,index})=>{ + let stockProd=item; + let stockProdIndex=index; + let sd=WStocksData.find(i=> i.ProductId==stockProd.WindowStockValue) || {}; + let stock=sd.Stock!=null?sd.Stock:''; + return( + + {stockProd.ProductName} + + + Stock + + + + {setWindowStockVal(val,window,stockProd)}} + autoComplete='off' + /> + + + + + ); + }} + /> + + } + {( window.NoOfSplit>0 && WindowSplits.length>0 && (isImage1==1 || isImage2==1)) && + + + {'Capture Window Images'} + + `spliItem_${index.toString()}`} + renderItem={({item,index})=>{ + let splitItem=item; + let splitItemIndex=index; + let Image1Name=splitItem['Image1Name']!=null && splitItem['Image1Name']!=''?splitItem['Image1Name']:''; + let Image2Name=splitItem['Image2Name']!=null && splitItem['Image2Name']!=''?splitItem['Image2Name']:''; + let Image1=splitItem['Image1']!=null && splitItem['Image1']!=''?splitItem['Image1']:''; + let Image2=splitItem['Image2']!=null && splitItem['Image2']!=''?splitItem['Image2']:''; + + return( + + {isImage1==1 && + + { (Image1=='' || Image1==null) && + {openCamera(window,splitItem,splitItemIndex,'1')}}> + + + } + { (Image1!='' && Image1!=null) && + + + {openCamera(window,splitItem,splitItemIndex,'1')}}> + + + + } + {camera1Label} + + } + {isImage2==1 && + + { (Image2=='' || Image2==null) && + {openCamera(window,splitItem,splitItemIndex,'2')}}> + + + } + { (Image2!='' && Image2!=null) && + + + {openCamera(window,splitItem,splitItemIndex,'2')}}> + + + + } + {console.log('camera2Label 2:',camera2Label)} + {camera2Label} + + } + + ); + }} + /> + + } + + {(WindowQuestions.length>0) && + + + {'Window Questions'} + + {WindowQuestions.map((item,index)=>{ + + let qtn=item; + let qtnIndex=index; + let selansid='',selanswer='',selimg='',showImageTag=false; + let id_key=qtn.WindowQuestionId+'_AnswerId'; + let ans_key=qtn.WindowQuestionId+'_Answer'; + let multi_key=qtn.WindowQuestionId+'_MultiOption'; + let date_key=qtn.WindowQuestionId+'_Date'; + let img_key=qtn.WindowQuestionId+'_ImagePath1'; + let imgname_key=qtn.WindowQuestionId+'_ImageName1'; + let rating_key=qtn.WindowQuestionId+'_Rating'; + + let list_mcdata=[]; + + if(qtn.QuestionType=='Single choice list') + { + selansid=QuestionsData[id_key]!=null ?QuestionsData[id_key] :''; + selanswer=QuestionsData[ans_key]!=null ?QuestionsData[ans_key] :''; + } + else if(qtn.QuestionType=='Multi choice list') + { + if(qtn.Answers!=null){ + for(var i=0;i0){ + // let arr=[]; + // for(var i=0;i0){ + for(var i=0;i=0)){ + showImageTag=true; + } + + } + } + } + + if(showImageTag){ + selimg=QuestionsData[img_key]!=null && QuestionsData[img_key]!=''?'file://'+QuestionsData[img_key]:''; + } + + return( + + {qtn.WindowQuestionName} + {qtn.QuestionType=='Single choice list' && qtn.Answers && + render_Picker('Answer','AnswerId',onselectionChange2,{value:selanswer,qtn:qtn,window:window}) + } + {qtn.QuestionType=='Multi choice list' && qtn.Answers && + { setMultiSelectValue(selectedItems,qtn,window) }} //setMultiSelectValue(selectedItems,qtn) + selectedItems={selansid} + selectText="Pick Items" + searchInputPlaceholderText="Search Items..." + // onChangeInput={ (text)=> console.log(text)} + tagRemoveIconColor={PrimaryTheme.$primary_color} + tagBorderColor={PrimaryTheme.$primary_color} + tagTextColor={PrimaryTheme.$primary_color} + selectedItemTextColor={PrimaryTheme.$primary_color} + selectedItemIconColor={PrimaryTheme.$primary_color} + itemTextColor={PrimaryTheme.$text_color} + displayKey="Answer" + searchInputStyle={{ color: '#CCC' }} + submitButtonColor={PrimaryTheme.$primary_color} + submitButtonText="Submit" + /> + } + { (qtn.QuestionType=='Number' || qtn.QuestionType=='Decimal' || qtn.QuestionType=='Text') && + {setTextValue(val,qtn,window)}} + autoComplete='off' + /> + } + { + (qtn.QuestionType=='Date') && + + {selansid!=''?selansid:'MM/YYYY'} + {setDateValue(selanswer);showQtnDatePicker(qtn,window,true)}}> + + + + } + { ((qtn.showDatePicker==true || qtn.showDatePicker=='true') && (qtn.QuestionType=='Date') ) && + renderDatePicker(qtn,window) + } + { + (qtn.QuestionType=='Rating') && + + {selanswer} + {setRatingQtn(qtn);setRatingWindow(window);setShowRating(true);}}> + + + + } + + { + // (qtn.QuestionType=='Audio') && + // + // {selanswer} + // {show_recorder(qtn);}}> + // + // + // + } + + { + showImageTag && + + + {openCamera(window,{},0,'1','2',qtn)}}> + + + + } + + + + ) + })} + + } + + + + } + + + + + + + ); + }} + /> + ) + } + + function _renderHeader(currentIndex){ + return( + + {/* {`${(currentIndex+1)}/${zoomImageUrl.length}`} */} + {console.log('tsth');setShow_zoomImage(false) }}> + + + + ) + } + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,saveData)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + { Object.keys(storeData).length>0 && + + {_renderWindow()} + + } + + {onSubmitData()}}/> + + + + + { showRating==true && + renderRatingView() + } + {show_zoomImage && + + null} + /> + + } + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(Window); \ No newline at end of file diff --git a/src/screens/test.json b/src/screens/test.json new file mode 100644 index 0000000..1ef7e54 --- /dev/null +++ b/src/screens/test.json @@ -0,0 +1,2750 @@ +"Sup_ImageAuditKPIImages" : [ + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798957, + "QuestionImageId": 0, + "DefId": 136, + "DefName": "Club one F&B", + "Image1": "19355_136_6_kavita.sg_STImg-20240822_143609.jpg", + "Image2": "19355_136_6_kavita.sg_STImg-20240822_143851.jpg", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799254, + "QuestionImageId": 0, + "DefId": 136, + "DefName": "Club one F&B", + "Image1": "21179_136_6_shravan.g_STImg-20240822_152621.jpg", + "Image2": "21179_136_6_shravan.g_STImg-20240822_152627.jpg", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803861, + "QuestionImageId": 0, + "DefId": 136, + "DefName": "Club one F&B", + "Image1": "21193_136_6_punniya.m_STImg-20240823_123055.jpg", + "Image2": "21193_136_6_punniya.m_STImg-20240823_123101.jpg", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803958, + "QuestionImageId": 0, + "DefId": 136, + "DefName": "Club one F&B", + "Image1": "19664_136_6_kavita.sg_STImg-20240823_131604.jpg", + "Image2": "19664_136_6_kavita.sg_STImg-20240823_131619.jpg", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798953, + "QuestionImageId": 13331143, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "19355_6_6_kavita.sg_STImg-20240822_144836.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798953, + "QuestionImageId": 13331144, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "19355_6_6_kavita.sg_STImg-20240822_144857.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798953, + "QuestionImageId": 13331146, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "19355_6_6_kavita.sg_STImg-20240822_144907.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798953, + "QuestionImageId": 13331151, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "19355_6_6_kavita.sg_STImg-20240822_144917.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798953, + "QuestionImageId": 13331152, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "19355_6_6_kavita.sg_STImg-20240822_144927.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798954, + "QuestionImageId": 13331155, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "19355_7_6_kavita.sg_STImg-20240822_133918.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798954, + "QuestionImageId": 13331156, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "19355_7_6_kavita.sg_STImg-20240822_133936.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798954, + "QuestionImageId": 13331160, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "19355_7_6_kavita.sg_STImg-20240822_134025.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798954, + "QuestionImageId": 13331161, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "19355_7_6_kavita.sg_STImg-20240822_134033.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798955, + "QuestionImageId": 13331164, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "19355_8_6_kavita.sg_STImg-20240822_134733.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798955, + "QuestionImageId": 13331165, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "19355_8_6_kavita.sg_STImg-20240822_134726.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798955, + "QuestionImageId": 13331170, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "19355_8_6_kavita.sg_STImg-20240822_135137.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798955, + "QuestionImageId": 13331171, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "19355_8_6_kavita.sg_STImg-20240822_134655.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798956, + "QuestionImageId": 13331178, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "19355_9_6_kavita.sg_STImg-20240822_132822.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798956, + "QuestionImageId": 13331182, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "19355_9_6_kavita.sg_STImg-20240822_132921.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798956, + "QuestionImageId": 13331183, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "19355_9_6_kavita.sg_STImg-20240822_132932.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798956, + "QuestionImageId": 13331174, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "19355_9_6_kavita.sg_STImg-20240822_132756.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798956, + "QuestionImageId": 13331175, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "19355_9_6_kavita.sg_STImg-20240822_132805.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769913, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1798956, + "QuestionImageId": 13331177, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "19355_9_6_kavita.sg_STImg-20240822_143449.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799250, + "QuestionImageId": 13333343, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21179_6_6_shravan.g_STImg-20240822_152301.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799250, + "QuestionImageId": 13333344, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21179_6_6_shravan.g_STImg-20240822_152311.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799250, + "QuestionImageId": 13333351, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21179_6_6_shravan.g_STImg-20240822_152340.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799250, + "QuestionImageId": 13333352, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21179_6_6_shravan.g_STImg-20240822_152347.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799251, + "QuestionImageId": 13333355, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21179_7_6_shravan.g_STImg-20240822_152401.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799251, + "QuestionImageId": 13333356, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21179_7_6_shravan.g_STImg-20240822_152455.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799251, + "QuestionImageId": 13333360, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21179_7_6_shravan.g_STImg-20240822_152514.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799251, + "QuestionImageId": 13333361, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21179_7_6_shravan.g_STImg-20240822_152520.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799252, + "QuestionImageId": 13333364, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21179_8_6_shravan.g_STImg-20240822_152532.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799252, + "QuestionImageId": 13333365, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21179_8_6_shravan.g_STImg-20240822_152539.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799252, + "QuestionImageId": 13333370, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21179_8_6_shravan.g_STImg-20240822_152602.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799252, + "QuestionImageId": 13333371, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21179_8_6_shravan.g_STImg-20240822_152609.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799253, + "QuestionImageId": 13333374, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21179_9_6_shravan.g_STImg-20240822_153119.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799253, + "QuestionImageId": 13333375, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21179_9_6_shravan.g_STImg-20240822_153129.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799253, + "QuestionImageId": 13333382, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21179_9_6_shravan.g_STImg-20240822_153147.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769966, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1799253, + "QuestionImageId": 13333383, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21179_9_6_shravan.g_STImg-20240822_153155.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797059, + "QuestionImageId": 13316997, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21213_6_6_narendra.kb_STImg-20240822_130256.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797059, + "QuestionImageId": 13316998, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21213_6_6_narendra.kb_STImg-20240822_130305.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797059, + "QuestionImageId": 13317005, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21213_6_6_narendra.kb_STImg-20240822_130317.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797059, + "QuestionImageId": 13317006, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21213_6_6_narendra.kb_STImg-20240822_130332.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797060, + "QuestionImageId": 13317009, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21213_7_6_narendra.kb_STImg-20240822_130201.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797060, + "QuestionImageId": 13317010, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21213_7_6_narendra.kb_STImg-20240822_130210.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797060, + "QuestionImageId": 13317014, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21213_7_6_narendra.kb_STImg-20240822_130231.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797060, + "QuestionImageId": 13317015, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21213_7_6_narendra.kb_STImg-20240822_130239.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797061, + "QuestionImageId": 13317018, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21213_8_6_narendra.kb_STImg-20240822_112711.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797061, + "QuestionImageId": 13317019, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21213_8_6_narendra.kb_STImg-20240822_112718.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797061, + "QuestionImageId": 13317024, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21213_8_6_narendra.kb_STImg-20240822_112732.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797061, + "QuestionImageId": 13317025, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21213_8_6_narendra.kb_STImg-20240822_112742.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797062, + "QuestionImageId": 13317028, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21213_9_6_narendra.kb_STImg-20240822_111112.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797062, + "QuestionImageId": 13317029, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21213_9_6_narendra.kb_STImg-20240822_111139.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797062, + "QuestionImageId": 13317031, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21213_9_6_narendra.kb_STImg-20240822_111513.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797062, + "QuestionImageId": 13317036, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21213_9_6_narendra.kb_STImg-20240822_111153.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1769967, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1797062, + "QuestionImageId": 13317037, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21213_9_6_narendra.kb_STImg-20240822_111203.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795450, + "QuestionImageId": 13305078, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21315_6_6_swapnali.m_STImg-20240822_112208.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795450, + "QuestionImageId": 13305079, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21315_6_6_swapnali.m_STImg-20240822_112219.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795450, + "QuestionImageId": 13305086, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21315_6_6_swapnali.m_STImg-20240822_112236.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795450, + "QuestionImageId": 13305087, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21315_6_6_swapnali.m_STImg-20240822_112246.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795451, + "QuestionImageId": 13305090, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21315_7_6_swapnali.m_STImg-20240822_111542.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795451, + "QuestionImageId": 13305091, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21315_7_6_swapnali.m_STImg-20240822_111550.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795451, + "QuestionImageId": 13305095, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21315_7_6_swapnali.m_STImg-20240822_111600.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795451, + "QuestionImageId": 13305096, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21315_7_6_swapnali.m_STImg-20240822_111610.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795452, + "QuestionImageId": 13305099, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21315_8_6_swapnali.m_STImg-20240822_111659.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795452, + "QuestionImageId": 13305100, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21315_8_6_swapnali.m_STImg-20240822_111706.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795452, + "QuestionImageId": 13305105, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21315_8_6_swapnali.m_STImg-20240822_111719.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795452, + "QuestionImageId": 13305106, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21315_8_6_swapnali.m_STImg-20240822_111727.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795453, + "QuestionImageId": 13305109, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21315_9_6_swapnali.m_STImg-20240822_112449.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795453, + "QuestionImageId": 13305110, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21315_9_6_swapnali.m_STImg-20240822_112457.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795453, + "QuestionImageId": 13305112, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21315_9_6_swapnali.m_STImg-20240822_113155.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795453, + "QuestionImageId": 13305117, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21315_9_6_swapnali.m_STImg-20240822_112506.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1770078, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1795453, + "QuestionImageId": 13305118, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21315_9_6_swapnali.m_STImg-20240822_112514.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801221, + "QuestionImageId": 13347883, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21294_6_6_shravan.g_STImg-20240823_103901.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801221, + "QuestionImageId": 13347884, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21294_6_6_shravan.g_STImg-20240823_103907.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801221, + "QuestionImageId": 13347891, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21294_6_6_shravan.g_STImg-20240823_103938.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801221, + "QuestionImageId": 13347892, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21294_6_6_shravan.g_STImg-20240823_103945.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801222, + "QuestionImageId": 13347895, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21294_7_6_shravan.g_STImg-20240823_104252.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801222, + "QuestionImageId": 13347896, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21294_7_6_shravan.g_STImg-20240823_104300.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801222, + "QuestionImageId": 13347900, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21294_7_6_shravan.g_STImg-20240823_104321.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801222, + "QuestionImageId": 13347901, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21294_7_6_shravan.g_STImg-20240823_104326.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801223, + "QuestionImageId": 13347904, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21294_8_6_shravan.g_STImg-20240823_104337.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801223, + "QuestionImageId": 13347905, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21294_8_6_shravan.g_STImg-20240823_104344.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801223, + "QuestionImageId": 13347910, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21294_8_6_shravan.g_STImg-20240823_104402.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801223, + "QuestionImageId": 13347911, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21294_8_6_shravan.g_STImg-20240823_104408.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801224, + "QuestionImageId": 13347914, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21294_9_6_shravan.g_STImg-20240823_104005.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801224, + "QuestionImageId": 13347915, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21294_9_6_shravan.g_STImg-20240823_104011.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801224, + "QuestionImageId": 13347917, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21294_9_6_shravan.g_STImg-20240823_104053.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801224, + "QuestionImageId": 13347922, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21294_9_6_shravan.g_STImg-20240823_104040.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775156, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1801224, + "QuestionImageId": 13347923, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21294_9_6_shravan.g_STImg-20240823_104045.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802691, + "QuestionImageId": 13359169, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21317_6_6_swapnali.m_STImg-20240823_121345.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802691, + "QuestionImageId": 13359170, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21317_6_6_swapnali.m_STImg-20240823_121354.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802691, + "QuestionImageId": 13359177, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21317_6_6_swapnali.m_STImg-20240823_121402.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802691, + "QuestionImageId": 13359178, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21317_6_6_swapnali.m_STImg-20240823_121413.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802692, + "QuestionImageId": 13359181, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21317_7_6_swapnali.m_STImg-20240823_120604.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802692, + "QuestionImageId": 13359182, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21317_7_6_swapnali.m_STImg-20240823_120610.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802692, + "QuestionImageId": 13359186, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21317_7_6_swapnali.m_STImg-20240823_120630.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802692, + "QuestionImageId": 13359187, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21317_7_6_swapnali.m_STImg-20240823_120641.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802693, + "QuestionImageId": 13359190, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21317_8_6_swapnali.m_STImg-20240823_120654.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802693, + "QuestionImageId": 13359191, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21317_8_6_swapnali.m_STImg-20240823_120701.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802693, + "QuestionImageId": 13359196, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21317_8_6_swapnali.m_STImg-20240823_120729.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802693, + "QuestionImageId": 13359197, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21317_8_6_swapnali.m_STImg-20240823_120740.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802694, + "QuestionImageId": 13359200, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21317_9_6_swapnali.m_STImg-20240823_121005.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802694, + "QuestionImageId": 13359201, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21317_9_6_swapnali.m_STImg-20240823_121011.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802694, + "QuestionImageId": 13359203, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21317_9_6_swapnali.m_STImg-20240823_120546.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802694, + "QuestionImageId": 13359204, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21317_9_6_swapnali.m_STImg-20240823_121027.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802694, + "QuestionImageId": 13359208, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21317_9_6_swapnali.m_STImg-20240823_121034.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775161, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1802694, + "QuestionImageId": 13359209, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21317_9_6_swapnali.m_STImg-20240823_121041.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803007, + "QuestionImageId": 13361581, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21221_6_6_shravan.g_STImg-20240823_121122.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803007, + "QuestionImageId": 13361582, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21221_6_6_shravan.g_STImg-20240823_121129.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803007, + "QuestionImageId": 13361589, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21221_6_6_shravan.g_STImg-20240823_121307.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803007, + "QuestionImageId": 13361590, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21221_6_6_shravan.g_STImg-20240823_121312.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803008, + "QuestionImageId": 13361593, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21221_7_6_shravan.g_STImg-20240823_121323.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803008, + "QuestionImageId": 13361594, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21221_7_6_shravan.g_STImg-20240823_121332.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803008, + "QuestionImageId": 13361598, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21221_7_6_shravan.g_STImg-20240823_121350.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803008, + "QuestionImageId": 13361599, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21221_7_6_shravan.g_STImg-20240823_121356.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803009, + "QuestionImageId": 13361602, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21221_8_6_shravan.g_STImg-20240823_121851.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803009, + "QuestionImageId": 13361603, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21221_8_6_shravan.g_STImg-20240823_121859.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803009, + "QuestionImageId": 13361608, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21221_8_6_shravan.g_STImg-20240823_121918.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803009, + "QuestionImageId": 13361609, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21221_8_6_shravan.g_STImg-20240823_121925.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803010, + "QuestionImageId": 13361612, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21221_9_6_shravan.g_STImg-20240823_121618.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803010, + "QuestionImageId": 13361613, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21221_9_6_shravan.g_STImg-20240823_121626.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803010, + "QuestionImageId": 13361616, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21221_9_6_shravan.g_STImg-20240823_121639.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803010, + "QuestionImageId": 13361620, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21221_9_6_shravan.g_STImg-20240823_121701.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775149, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803010, + "QuestionImageId": 13361621, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21221_9_6_shravan.g_STImg-20240823_121710.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803857, + "QuestionImageId": 13367870, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21193_6_6_punniya.m_STImg-20240823_124600.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803857, + "QuestionImageId": 13367871, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21193_6_6_punniya.m_STImg-20240823_124607.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803857, + "QuestionImageId": 13367878, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21193_6_6_punniya.m_STImg-20240823_124645.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803857, + "QuestionImageId": 13367879, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21193_6_6_punniya.m_STImg-20240823_124638.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803858, + "QuestionImageId": 13367882, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21193_7_6_punniya.m_STImg-20240823_123513.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803858, + "QuestionImageId": 13367883, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21193_7_6_punniya.m_STImg-20240823_123523.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803858, + "QuestionImageId": 13367887, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21193_7_6_punniya.m_STImg-20240823_123611.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803858, + "QuestionImageId": 13367888, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21193_7_6_punniya.m_STImg-20240823_123602.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803859, + "QuestionImageId": 13367891, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21193_8_6_punniya.m_STImg-20240823_122958.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803859, + "QuestionImageId": 13367892, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21193_8_6_punniya.m_STImg-20240823_123007.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803859, + "QuestionImageId": 13367894, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21193_8_6_punniya.m_STImg-20240823_123016.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803859, + "QuestionImageId": 13367897, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21193_8_6_punniya.m_STImg-20240823_123046.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803859, + "QuestionImageId": 13367898, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21193_8_6_punniya.m_STImg-20240823_123039.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803860, + "QuestionImageId": 13367901, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21193_9_6_punniya.m_STImg-20240823_125838.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803860, + "QuestionImageId": 13367902, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21193_9_6_punniya.m_STImg-20240823_125848.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803860, + "QuestionImageId": 13367904, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21193_9_6_punniya.m_STImg-20240823_130232.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803860, + "QuestionImageId": 13367909, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21193_9_6_punniya.m_STImg-20240823_125900.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775145, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803860, + "QuestionImageId": 13367910, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21193_9_6_punniya.m_STImg-20240823_125906.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803954, + "QuestionImageId": 13368608, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "19664_6_6_kavita.sg_STImg-20240823_125159.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803954, + "QuestionImageId": 13368609, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "19664_6_6_kavita.sg_STImg-20240823_125209.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803954, + "QuestionImageId": 13368611, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "19664_6_6_kavita.sg_STImg-20240823_125222.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803954, + "QuestionImageId": 13368616, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "19664_6_6_kavita.sg_STImg-20240823_125314.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803954, + "QuestionImageId": 13368617, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "19664_6_6_kavita.sg_STImg-20240823_125323.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803955, + "QuestionImageId": 13368620, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "19664_7_6_kavita.sg_STImg-20240823_125746.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803955, + "QuestionImageId": 13368621, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "19664_7_6_kavita.sg_STImg-20240823_125754.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803955, + "QuestionImageId": 13368623, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "19664_7_6_kavita.sg_STImg-20240823_125806.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803955, + "QuestionImageId": 13368625, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "19664_7_6_kavita.sg_STImg-20240823_125836.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803955, + "QuestionImageId": 13368626, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "19664_7_6_kavita.sg_STImg-20240823_125843.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803956, + "QuestionImageId": 13368629, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "19664_8_6_kavita.sg_STImg-20240823_125859.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803956, + "QuestionImageId": 13368630, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "19664_8_6_kavita.sg_STImg-20240823_125907.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803956, + "QuestionImageId": 13368635, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "19664_8_6_kavita.sg_STImg-20240823_125936.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803956, + "QuestionImageId": 13368636, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "19664_8_6_kavita.sg_STImg-20240823_125944.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803957, + "QuestionImageId": 13368639, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "19664_9_6_kavita.sg_STImg-20240823_130745.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803957, + "QuestionImageId": 13368640, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "19664_9_6_kavita.sg_STImg-20240823_130732.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803957, + "QuestionImageId": 13368643, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "19664_9_6_kavita.sg_STImg-20240823_130815.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803957, + "QuestionImageId": 13368647, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "19664_9_6_kavita.sg_STImg-20240823_130851.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775105, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803957, + "QuestionImageId": 13368648, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "19664_9_6_kavita.sg_STImg-20240823_130859.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803970, + "QuestionImageId": 13368739, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21304_6_6_swapnali.m_STImg-20240823_131143.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803970, + "QuestionImageId": 13368740, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21304_6_6_swapnali.m_STImg-20240823_131152.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803970, + "QuestionImageId": 13368747, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21304_6_6_swapnali.m_STImg-20240823_131203.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803970, + "QuestionImageId": 13368748, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21304_6_6_swapnali.m_STImg-20240823_131216.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803971, + "QuestionImageId": 13368751, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21304_7_6_swapnali.m_STImg-20240823_130701.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803971, + "QuestionImageId": 13368752, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21304_7_6_swapnali.m_STImg-20240823_130710.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803971, + "QuestionImageId": 13368756, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21304_7_6_swapnali.m_STImg-20240823_130720.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803971, + "QuestionImageId": 13368757, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21304_7_6_swapnali.m_STImg-20240823_130730.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803972, + "QuestionImageId": 13368760, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21304_8_6_swapnali.m_STImg-20240823_130759.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803972, + "QuestionImageId": 13368761, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21304_8_6_swapnali.m_STImg-20240823_130806.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803972, + "QuestionImageId": 13368766, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21304_8_6_swapnali.m_STImg-20240823_130818.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803972, + "QuestionImageId": 13368767, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21304_8_6_swapnali.m_STImg-20240823_130827.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803973, + "QuestionImageId": 13368770, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21304_9_6_swapnali.m_STImg-20240823_131854.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803973, + "QuestionImageId": 13368771, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21304_9_6_swapnali.m_STImg-20240823_131901.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803973, + "QuestionImageId": 13368773, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21304_9_6_swapnali.m_STImg-20240823_132202.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803973, + "QuestionImageId": 13368778, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21304_9_6_swapnali.m_STImg-20240823_131917.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775160, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1803973, + "QuestionImageId": 13368779, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21304_9_6_swapnali.m_STImg-20240823_131930.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804618, + "QuestionImageId": 13373656, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21327_6_6_narendra.kb_STImg-20240823_132132.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804618, + "QuestionImageId": 13373657, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21327_6_6_narendra.kb_STImg-20240823_132140.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804618, + "QuestionImageId": 13373664, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21327_6_6_narendra.kb_STImg-20240823_132204.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804618, + "QuestionImageId": 13373665, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "21327_6_6_narendra.kb_STImg-20240823_132216.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804619, + "QuestionImageId": 13373668, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21327_7_6_narendra.kb_STImg-20240823_131718.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804619, + "QuestionImageId": 13373669, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21327_7_6_narendra.kb_STImg-20240823_131731.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804619, + "QuestionImageId": 13373673, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21327_7_6_narendra.kb_STImg-20240823_131644.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804619, + "QuestionImageId": 13373674, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "21327_7_6_narendra.kb_STImg-20240823_131706.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804620, + "QuestionImageId": 13373677, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21327_8_6_narendra.kb_STImg-20240823_131551.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804620, + "QuestionImageId": 13373678, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21327_8_6_narendra.kb_STImg-20240823_131600.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804620, + "QuestionImageId": 13373683, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21327_8_6_narendra.kb_STImg-20240823_131617.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804620, + "QuestionImageId": 13373684, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "21327_8_6_narendra.kb_STImg-20240823_131626.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804621, + "QuestionImageId": 13373687, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21327_9_6_narendra.kb_STImg-20240823_130623.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804621, + "QuestionImageId": 13373688, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21327_9_6_narendra.kb_STImg-20240823_130632.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804621, + "QuestionImageId": 13373690, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21327_9_6_narendra.kb_STImg-20240823_131003.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804621, + "QuestionImageId": 13373695, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21327_9_6_narendra.kb_STImg-20240823_130644.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775162, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804621, + "QuestionImageId": 13373696, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "21327_9_6_narendra.kb_STImg-20240823_130656.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804790, + "QuestionImageId": 13374990, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "98631_6_6_swapnali.m_STImg-20240823_142141.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804790, + "QuestionImageId": 13374991, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "98631_6_6_swapnali.m_STImg-20240823_142149.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804790, + "QuestionImageId": 13374998, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "98631_6_6_swapnali.m_STImg-20240823_142201.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804790, + "QuestionImageId": 13374999, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "98631_6_6_swapnali.m_STImg-20240823_142211.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804791, + "QuestionImageId": 13375002, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "98631_7_6_swapnali.m_STImg-20240823_141656.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804791, + "QuestionImageId": 13375003, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "98631_7_6_swapnali.m_STImg-20240823_141705.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804791, + "QuestionImageId": 13375007, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "98631_7_6_swapnali.m_STImg-20240823_141716.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804791, + "QuestionImageId": 13375008, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "98631_7_6_swapnali.m_STImg-20240823_141724.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804792, + "QuestionImageId": 13375011, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "98631_8_6_swapnali.m_STImg-20240823_141819.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804792, + "QuestionImageId": 13375012, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "98631_8_6_swapnali.m_STImg-20240823_141827.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804792, + "QuestionImageId": 13375017, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "98631_8_6_swapnali.m_STImg-20240823_141836.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804792, + "QuestionImageId": 13375018, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "98631_8_6_swapnali.m_STImg-20240823_141844.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804793, + "QuestionImageId": 13375021, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "98631_9_6_swapnali.m_STImg-20240823_141416.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804793, + "QuestionImageId": 13375022, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "98631_9_6_swapnali.m_STImg-20240823_141424.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804793, + "QuestionImageId": 13375024, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "98631_9_6_swapnali.m_STImg-20240823_141500.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804793, + "QuestionImageId": 13375029, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "98631_9_6_swapnali.m_STImg-20240823_141434.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1776488, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1804793, + "QuestionImageId": 13375030, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "98631_9_6_swapnali.m_STImg-20240823_141442.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805510, + "QuestionImageId": 13380548, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "34006_6_6_prity.s_STImg-20240823_134016.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805510, + "QuestionImageId": 13380549, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "34006_6_6_prity.s_STImg-20240823_134025.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805510, + "QuestionImageId": 13380556, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "34006_6_6_prity.s_STImg-20240823_134325.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805510, + "QuestionImageId": 13380557, + "DefId": 6, + "DefName": "Club one Noodles", + "Image1": "34006_6_6_prity.s_STImg-20240823_134334.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805511, + "QuestionImageId": 13380560, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "34006_7_6_prity.s_STImg-20240823_134426.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805511, + "QuestionImageId": 13380561, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "34006_7_6_prity.s_STImg-20240823_134433.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805511, + "QuestionImageId": 13380565, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "34006_7_6_prity.s_STImg-20240823_134507.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805511, + "QuestionImageId": 13380566, + "DefId": 7, + "DefName": "Club one Coffee", + "Image1": "34006_7_6_prity.s_STImg-20240823_134514.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805512, + "QuestionImageId": 13380569, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "34006_8_6_prity.s_STImg-20240823_134536.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805512, + "QuestionImageId": 13380570, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "34006_8_6_prity.s_STImg-20240823_134543.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805512, + "QuestionImageId": 13380575, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "34006_8_6_prity.s_STImg-20240823_134617.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805512, + "QuestionImageId": 13380576, + "DefId": 8, + "DefName": "Club one Dairy", + "Image1": "34006_8_6_prity.s_STImg-20240823_134625.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805513, + "QuestionImageId": 13380579, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "34006_9_6_prity.s_STImg-20240823_135328.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805513, + "QuestionImageId": 13380580, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "34006_9_6_prity.s_STImg-20240823_135337.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805513, + "QuestionImageId": 13380587, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "34006_9_6_prity.s_STImg-20240823_135437.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + }, + { + "MID": 1775732, + "MenuId": 32, + "Menu": "Club Program", + "KPIImageId": 1805513, + "QuestionImageId": 13380588, + "DefId": 9, + "DefName": "Club one Chocolate", + "Image1": "34006_9_6_prity.s_STImg-20240823_135446.jpg", + "Image2": "", + "BaseUrl": "https:\/\/ni1.parinaam.in\/Upload\/ProgramImages" + } + ] \ No newline at end of file diff --git a/src/screensSup/Album.js b/src/screensSup/Album.js new file mode 100644 index 0000000..4ad9fc1 --- /dev/null +++ b/src/screensSup/Album.js @@ -0,0 +1,319 @@ +import React,{useState,useEffect, useRef} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,TouchableHighlight,Platform,PermissionsAndroid,FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,AddStore, checkRange, UploadData2, UploadData, UpdateStoreStatus, getKPIS, marktext1, marktext2, UploadFormData, getDownloadJson1} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, AppVersion} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign, Entypo, EvilIcons, Feather, FontAwesome, Fontisto, Ionicons, MaterialCommunityIcons} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import NoDataComponent from '../components/NoDataComponent'; +import {SvgXml} from 'react-native-svg'; +import MapIcon from '../assets/performics/map_icon.svg'; +import CustomModal from '../components/CustomModal'; +import { AppTables } from '../constants/tableConstants'; +import { _checkLocationPermission } from '../components/geolocation'; +import { getAvailblQuery, getIfAvlbl, getIfKPIDone, getQuery, Q_MenuList } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; +import { uploadAllImages, uploadStoreStatus } from '../constants/uploadData'; +import { PrimaryTheme } from '../styles/Themes'; +import NetworkStatusBar from '../components/NetworkStatusBar'; +import * as RNFS from 'react-native-fs'; + +import CameraImg2 from '../assets/performics/camera_icon.svg'; +import CustomCamera from '../components/Camera'; +import NoAttendance from '../components/NoAttendance'; +import ImageViewer from 'react-native-image-zoom-viewer'; +import ImageWithLoader from '../components/ImageWithLoader'; + +function Album(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + const [processing, setProcessing] = useState(true); + const [loaderTitle, setLoaderTitle] = useState(); + const [albumImages, setAlbumImages] = useState([]); + const [zoomImageUrl, setZoomImageUrl] = useState([]); + const [zoomImageIndex, setZoomImageIndex] = useState(0); + const [show_zoomImage, setShow_zoomImage] = useState(false); + const [EmpData, setEmpData] = useState([]); + const [storeData, setStoreData] = useState([]); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const zoomView=useRef(null); + + + useEffect(() => { + setLoaderTitle(ST.Loading+'...'); + let params=props.route.params? props.route.params:{}; + let storeData1=params.storeData || {}; + let isAdhoc=params.isAdhocScreen || false; + let empData1=params.empData || {}; + + setIsAdhocScreen(isAdhoc); + setEmpData(empData1); + setStoreData(storeData1); + + getData(storeData1); + }, []); + + + async function getData(storeData1){ + console.log("storeData itemmmm",storeData1) + console.log("storeData album",storeData1?.MerchandiserId) + try { + db.transaction(async function (txn) { + // get data with stores + + let sqlstmnt1 =`select * from Sup_Album where StoreId='${storeData1.StoreId}'`; + // if(storeData1.MerchandiserId == '0') { + // sqlstmnt1 =`select * from Sup_Album where StoreId='${storeData1.StoreId}'`; + // }else { + // sqlstmnt1 =`select * from Sup_Album where StoreId='${storeData1.StoreId}' and EmpId='${storeData1.MerchandiserId}'`; + // } // commented suggested by vinay sir . + + console.log("sqlstmnt1=======",sqlstmnt1) + await txn.executeSql(sqlstmnt1,[],async function (txn1, txnres) { + + if(txnres.rows.length>0){ + let AllAlbumImages=await get_albumData(txnres); + setAlbumImages(AllAlbumImages); + setProcessing(false); + } + else{ + let AllAlbumImages=await DownloadAlbum(storeData1); + if(AllAlbumImages.length>0){ + setAlbumImages(AllAlbumImages); + setProcessing(false); + } + else{ + notify('No data found'); + setProcessing(false); + } + } + },function (txn1, txnerr) {console.log(txnerr);setProcessing(false);},); + }); + } catch (err) {console.log(err);} + + } + + + async function get_album(storeData1){ + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + // get data with stores + let sqlstmnt1 =`select * from Sup_Album where StoreId='${storeData1.StoreId}' `; + await txn.executeSql(sqlstmnt1,[],async function (txn1, txnres) { + if(txnres.rows.length>0){ + let AllAlbumImages=await get_albumData(txnres); + resolve(AllAlbumImages); + } + else{ + resolve([]); + } + },function (txn1, txnerr) {console.log(txnerr);resolve([]);},); + }); + }).catch((err)=>{ + console.log('err:',err); + return []; + }); + } + + async function get_albumData(txnres){ + return new Promise((resolve,reject)=>{ + if(txnres.rows.length>0){ + let arr=[],images=[]; + for(var i=0;i{ + console.log('err:',err); + return []; + }); + } + + async function DownloadAlbum(storeData1){ + let downloadKey="Sup_Album"; + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url=props.baseurl+getMethodName(METHODS.DOWNLOADJSON_METHOD); + let data={ + Downloadtype:downloadKey, + Username: loginDetails.UserId, + Param1: storeData1.StoreId, + Param2: '', + }; + + console.log(url,data); + return await getDownloadJson1(url,data) + .then(async(res)=>{ + if (res.Sup_Album) { + let data_arr = res.Sup_Album || []; + console.log("data_arr===",data_arr) + let isInserted=await InsertAlbum(data_arr,storeData1); + console.log("isInserted===",isInserted) + if(isInserted){ + let AllImgs=await get_album(storeData1); + return AllImgs; + } + else{ + return []; + } + } + else{ + return []; + } + }) + .catch((err)=>{ + console.log('onPage Team error',err); + return []; + }); + } + + async function InsertAlbum(data_arr,storeData1){ + return new Promise((resolve,reject)=>{ + var values=[]; + data_arr.map((data_obj)=>{ + let {Srno,EmpId,StoreId,KPI,LastMerchandisedDate,ImageUrl}=data_obj; + values.push(` ('${Srno}','${EmpId}', '${StoreId}', '${KPI}', '${LastMerchandisedDate}', '${ImageUrl}')`); + }); + + var all_vals=values.join(','); + var sql_stmnt=`INSERT INTO Sup_Album(Srno,EmpId,StoreId,KPI,LastMerchandisedDate,ImageUrl) + values ${all_vals}`; + + db.transaction(function(txn) { + // delete all today data + txn.executeSql(`delete from Sup_Album where 1=1`,[],function(txn1,txnres){ + // insert or refresh all today data + txn.executeSql(sql_stmnt,[],function(txn1,txnres){ + console.log('Sup_Album added'); + resolve(true); + },function(txn1,txnerr){resolve(false);}); + },function(txn1,txnerr){resolve(false);}); + }); + }).catch((err)=>{ + console.log('err',err); + return false; + }) + } + + + + + async function openZoomImage(item){ + let index=zoomImageUrl.findIndex(i=> i.imgIndex== item.imgIndex); + console.log('index:',index,item) + if(index>=0) setZoomImageIndex(index) + setShow_zoomImage(true); + } + + + function _renderHeader(currentIndex){ + return( + + {`${(currentIndex+1)}/${zoomImageUrl.length}`} + {console.log('tsth');setShow_zoomImage(false) }}> + + + + ) + } + + // console.log("albumImages",albumImages) + + return ( + + {processing && } + + {!show_zoomImage && + + + + + + + + {storeData.StoreName} + + {storeData.StoreType} + + + + + + + {ST.StoreId+':'} + {storeData.StoreId} + + + {ST.StoreCode+':'} + {storeData.StoreCode} + + + + + + + + + { + return( + + {(item.StoreName?item.StoreName+' ':'')+'('+item.KPI+')'} + {openZoomImage(item)}}> + {/* {item.ImageUrl && } */} + {item.ImageUrl && } + + {console.log("item.LastMerchandisedDate",item.ImageUrl)} + {'Captured on : '+moment(item.LastMerchandisedDate,"MM/DD/YYYY").format('MM/DD/YYYY')} + + ); + }} + /> + + } + {show_zoomImage && + + null} + /> + + } + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(Album); \ No newline at end of file diff --git a/src/screensSup/Attendance.js b/src/screensSup/Attendance.js new file mode 100644 index 0000000..c239f15 --- /dev/null +++ b/src/screensSup/Attendance.js @@ -0,0 +1,520 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { customStyles,GetPageTheme } from "../styles/Global"; +import {Image,View,Text,ScrollView,TouchableOpacity,FlatList} from 'react-native'; +import { connect } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {marktext1,marktext2, UpdateStoreStatus, UploadData, UploadData2, UploadFormData} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {AppVersion, common_ImagePath, db, URL_IMAGE, version} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {AntDesign, Entypo, MaterialCommunityIcons,} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import NoDataComponent from '../components/NoDataComponent'; +import {SvgXml} from 'react-native-svg'; +import CustomModal from '../components/CustomModal'; +import GradientButton from '../components/gradientButton'; +import {launchCamera, launchImageLibrary,CameraOptions} from 'react-native-image-picker'; +import * as RNFS from 'react-native-fs'; +import {_checkLocationPermission} from '../components/geolocation'; +import CustomCamera from '../components/Camera'; + +import cameraImg from '../assets/performics/camera_front_image.svg'; +import CameraImg2 from '../assets/performics/camera_icon.svg'; +import CameraImg3 from '../assets/performics/camera_tick.svg'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; +import { AppTables } from '../constants/tableConstants'; +import { uploadStoreStatus } from '../constants/uploadData'; +import { ConfirmSaveAlert } from '../components/alert'; + + +function Attendance(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const [processing, setProcessing] = useState((props.isDataDownloaded?true:false)); + + + const [nonWorkingRsns, setNonWorkingRsns] = useState([]); + const [selectedReason, setSelectedReason] = useState({}); + const [reason, setReason] = useState(''); + const [reasonId, setReasonId] = useState(''); + const [Image1, setImage1] = useState(''); + const [Image1Path, setImage1Path] = useState(''); + const [showModal, setShowModal] = useState(false); + const [showImageSaveOp, setShowImageSaveOp] = useState(true); + const [rerenderdata, setrerenderdata]= useState(0); + const [location, setLocation] = useState({}); + const [loaderTitle, setLoaderTitle] = useState(); + const [showAlert, setShowAlert] = useState(false); + + + const [isAnyStoreUploaded, setIsAnyStoreUploaded] = useState(false); + + const [showCamera, setShowCamera] = useState(false); + const [getImageProps,setGetImageProps]= useState({}); + + + useEffect(() => { + setLoaderTitle(ST.Loading+'...') + getdata(); + + + const onremoveSubscription=props.navigation.addListener('beforeRemove', onBeforeRemove); + + return function cleanup() { + onremoveSubscription(); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + const onremoveSubscription=props.navigation.addListener('beforeRemove', onBeforeRemove); + return onremoveSubscription; + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + return; + } + } + + + async function getdata(){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + + let token=await get_item('loginToken'); + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + let nonWrkRsns=await getNonWorkingRsns() || []; + + if(nonWrkRsns.length>0){ + + await db.transaction(async function (txn) { + let q=`select * from ${AppTables.ATTENDANCE} where ATTENDANCE_DATE='${d2}' and EMP_ID='${props.UserId}'`; + await txn.executeSql(q,[],async function (txn2, txnres2) { + if(txnres2.rows.length>0){ + let data=txnres2.rows.item(0); + let {ATTENDANCE_DATE,STATUS,STATUS_Id,REMARK,REASON_ID, REASON,IMAGE1}=data + let path=IMAGE1!=null && IMAGE1!='' ? 'file://'+common_ImagePath+IMAGE1:''; + let selRsn=nonWrkRsns.find(i=>i.ReasonId==REASON_ID); + setSelectedReason(selRsn); + setReason(REASON); + setReasonId(REASON_ID); + setImage1Path(path); + setImage1(IMAGE1); + + setProcessing(false); + setrerenderdata(!rerenderdata); + } + else{ + + setProcessing(false); + } + },function(txn2,txnerr){console.log(txnerr); setProcessing(false);}); + }); + } + else{ + setProcessing(false); + } + + } + + async function getNonWorkingRsns(){ + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let token=await get_item('loginToken'); + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + + let nonWrkRsns=[]; + + return new Promise((resolve,reject)=>{ + db.transaction(async function (txn) { + let q=`SELECT * FROM Sup_NonWorkingReason where ShowAttendance='1'`; + + await txn.executeSql(q,[],async function (txn2, txnres2) { + console.log('data len:',txnres2.rows.length); + if(txnres2.rows.length>0){ + // show from local + + for(var i=0;i{ + console.log(err); + return nonWrkRsns; + }) + + } + + async function onSubmitData(){ + if(validate()){ + // setLoaderTitle(ST.UploadingData+'...'); + setShowAlert(true); + } + } + + function validate(){ + if(reasonId=='' || reasonId==null || reason=='' || reason==null){ + notify("Please select reason",'SHORT'); + return false; + } + if(( selectedReason.ImageAllow=='true' || selectedReason.ImageAllow=='1') && (Image1Path=='' || Image1Path==null)){ + notify("Please click selfie",'SHORT'); + return false; + } + return true; + } + + + async function uploadAttndance(){ + setShowAlert(false); + setLoaderTitle('Uploading Data...'); + setProcessing(true); + + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let {ImageAllow}=selectedReason; + + var data1 = new FormData(); + data1.append('file', { + uri: Image1Path, + type: 'image/jpg', + name: Image1, + }); + + data1.append('Foldername',"Attendance"); + data1.append('Path', d2); + let data={ + "UserId":props.UserId, + "AttendanceDate":d2, + "ReasonId":reasonId!=null && reasonId!=''?reasonId:0, + "ImageUrl":((ImageAllow=='1' || ImageAllow=='true')?Image1:''), + "Remark":"", + } + + + + const url=props.baseurl+getMethodName(METHODS.UPLOADATTENDANCE_METHOD); + const url1=(props.imageUploadUrl || URL_IMAGE)+getMethodName(METHODS.UPLOADIMAGES_METHOD); + console.log(url,data); + + await UploadData2(url,data) + .then(async(res)=>{ + console.log('res upload attend:',res); + if(parseInt(res)>0){ + saveData(); + if(selectedReason.ImageAllow=='1' || selectedReason.ImageAllow=='true' || selectedReason.ImageAllow==1) + { + // Upload Image + await UploadFormData(url1,data1) + .then(async(res1)=>{ + console.log('res1 image upload:',res1); + }) + .catch((err)=>{ + console.log(err); + }); + } + } + else{ + setProcessing(false); + } + }) + .catch((err)=>{ + console.log(err);setProcessing(false); + }); + } + + async function saveData(){ + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + try { + + await db.transaction(async function (txn) { + + let q=`DELETE FROM ${AppTables.ATTENDANCE} WHERE EMP_ID='${props.UserId}' and ATTENDANCE_DATE='${d2}' `; + + // remove old data + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('attend deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + var values=''; + let {EntryAllow}=selectedReason; + values+=` ('${props.UserId}','${d2}','${EntryAllow}','','${reasonId}','${reason}','${Image1}','${d2}') `; + + console.log('values:',values); + let add_data=`INSERT INTO ${AppTables.ATTENDANCE} (EMP_ID,ATTENDANCE_DATE,ENTRY_ALLOW,REMARK,REASON_ID, REASON,IMAGE1 ,ADDED_DATE) VALUES ${values} `; + + await txn.executeSql(add_data,[],async function (txn2, txnres) { + console.log('attend added'); + notify('Attendance submited successfully','SHORT'); + setProcessing(false); + props.setAttendanceStatus({isAttendanceMarked:true,isEntryAllow:(EntryAllow=='1' || EntryAllow=='true'?true:false)}); + props.navigation.goBack(); + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot submit Attendance!') },); + + + }); + } catch (err) { + console.log(err); + } + } + + + async function selectReason(item){ + + + setSelectedReason(item); + setReason(item.Reason); + setReasonId(item.ReasonId); + setrerenderdata(!rerenderdata); + + if(item.ImageAllow=='1' || item.ImageAllow=='true'){ + if((Image1Path!='' && Image1Path!=null)){ + setShowImageSaveOp(false); + } + else{ + setShowImageSaveOp(true); + } + openImageModal(); + } + } + + function onSaveCancel(){ + setShowAlert(false); + } + + function openImageModal(){ + setShowModal(true); + } + + function closeImageModal(){ + setShowModal(false); + } + + function cancelImage(){ + setImage1(''); + setImage1Path(''); + closeImageModal(); + } + + async function getImage(imgdata){ + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify(ST.Cameraunavailable); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='User Id:'+props.UserId+' | Image Type: Attendance'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=(props.UserId || '')+'_AttendanceImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + setImage1(filename); + // renamefile + let imagePath=`${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker',uri); + setImage1Path(uri); + }) + .catch(err => { + console.log(ST.Errorimagefilewritefailed+'!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify(ST.Pleasecaptureaimage); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(){ + setShowCamera(true); + setShowModal(false) + // props.navigation.navigate('CameraScreen',{'getImage':getImage,'cameraType':'front'}) + } + + function _OpenCaptureImage_Modal(){ + const isImageCap=(Image1Path=='' || Image1Path==null)?false:true; + return ( + + { + !isImageCap && + + {openCamera()}}> + + + {closeImageModal()}}> + {ST.Cancel} + + + } + { + isImageCap && + + + + + {openCamera()}}> + + + { showImageSaveOp && + + {cancelImage()}}> + {ST.Cancel} + + {closeImageModal()}}> + {ST.Save} + + } + {!showImageSaveOp && + {closeImageModal()}}> + {ST.Close} + + } + + + + } + + ) + } + + + return ( + + {processing && } + + + {showModal && _OpenCaptureImage_Modal()} + {showAlert && ConfirmSaveAlert(props,showAlert,onSaveCancel,uploadAttndance)} + {setShowCamera(false);setShowModal(true);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + { !props.isDataDownloaded && } + {props.isDataDownloaded && + + + Hi User + Please mark attendance before working! + + + + { + + const nWselStyle=reasonId==item.ReasonId?customStyle.selAttBtn_selected:{}; + const nWselStyleText=reasonId==item.ReasonId?customStyle.nWselStyleText:{}; + const CapImageShow=(Image1Path!='' && Image1Path!=null) && reasonId==item.ReasonId?true:false; + let isDisabled=props.isAttendanceMarked==true && reasonId!=item.ReasonId; + + + return ( + {props.isAttendanceMarked==true ?'':selectReason(item)}}> + {item.Reason} + { (item.ImageAllow=='1' || item.ImageAllow=='true') && + {selectReason(item)}}> + {!CapImageShow && } + {CapImageShow && } + + } + + ); + }} + /> + + + + {props.isAttendanceMarked==false && + + {onSubmitData();}}/> + } + + + + } + + + + + ); + } + + + + +export default connect(mapStateToProps, mapDispatchToProps)(Attendance); \ No newline at end of file diff --git a/src/screensSup/AttendanceOld.js b/src/screensSup/AttendanceOld.js new file mode 100644 index 0000000..3ad49c3 --- /dev/null +++ b/src/screensSup/AttendanceOld.js @@ -0,0 +1,520 @@ +import React,{useState,useEffect, memo} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,TouchableHighlight,Platform,PermissionsAndroid,FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,AddStore, checkRange, UploadData2, UploadData, UpdateStoreStatus, getKPIS, marktext1, marktext2, UploadFormData} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl,db, AppVersion, common_ImagePath} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign, Entypo, EvilIcons, Feather, FontAwesome, Fontisto, Ionicons, MaterialCommunityIcons} from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import NoDataComponent from '../components/NoDataComponent'; +import {SvgXml} from 'react-native-svg'; +import MapIcon from '../assets/performics/map_icon.svg'; +import CustomModal from '../components/CustomModal'; +import { AppTables } from '../constants/tableConstants'; +import { _checkLocationPermission } from '../components/geolocation'; +import Geolocation from '@react-native-community/geolocation'; +import { getAvailblQuery, getIfAvlbl, getIfKPIDone, getQuery, Q_MenuList } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; +import { uploadAllImages, uploadStoreStatus } from '../constants/uploadData'; +import { PrimaryTheme } from '../styles/Themes'; +import NetworkStatusBar from '../components/NetworkStatusBar'; +import * as RNFS from 'react-native-fs'; + +import cameraImg from '../assets/performics/camera_front_image.svg' +import CustomCamera from '../components/Camera'; +import GradientButton from '../components/gradientButton'; +import { CustomPicker } from '../components/CustomPicker'; + + +function Attendance(props) { + const route = useRoute(); + + const ST=props.StaticText || {}; + const AttendanceCons=[{"AttendanceId":1,"AttendanceName":"Holiday"},{"AttendanceId":2,"AttendanceName":"Leave"},{"AttendanceId":3,"AttendanceName":"Present"},{"AttendanceId":4,"AttendanceName":"Meeting"}] + + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const [loaderTitle, setLoaderTitle] = useState(); + const [processing, setProcessing] = useState((props.isDataDownloaded?true:false)); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [nodataFound, setNodataFound] = useState(false); + const [rerenderdata, setrerenderdata]= useState(false); + const [EmployeesList, setEmployeesList] = useState([]); + const [globalEmplist, setGlobalEmplist] = useState([]); + const [globalStorelist, setGlobalStorelist] = useState([]); + const [searchedItem, setSearchedItem]= useState(''); + const [showAlert, setShowAlert] = useState(false); + const [dataFound, setdataFound] = useState(false); + const [showCamera, setShowCamera] = useState(false); + const [CameraVis, setCameraVis] = useState(false); + const [showReason, setShowReason] = useState(false); + const [showRemark, setShowRemark] = useState(false); + const [AttData, setAttData] = useState({}); + const [getImageProps,setGetImageProps]= useState({}); + const [AttendanceLabels, setAttendanceLabels] = useState(AttendanceCons); + const [nonWorkingRsns, setNonWorkingRsns] = useState([{"ReasonId":"1","Reason":"Reason 1"},{"ReasonId":"2","Reason":"Reason 2"},{"ReasonId":"3","Reason":"Reason 3"}]); + + useEffect(() => { + setLoaderTitle(ST.Loading+'...'); + checkLocalData(); + + const onremoveSubscription=props.navigation.addListener('beforeRemove', onBeforeRemove); + return function cleanup() { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + }; + }, []); + + useEffect(() => { + props.navigation.removeListener('beforeRemove', onBeforeRemove); + props.navigation.addListener('beforeRemove', onBeforeRemove); + }, [showCamera]); + + function onBeforeRemove(e){ + if(showCamera==true){ + e.preventDefault(); + setShowCamera(false); + } + else{ + return; + } + } + + + async function checkLocalData(){ + + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + + let token=await get_item('loginToken'); + let loginInfo=await get_item('loginInfo'); + const loginDetails=JSON.parse(loginInfo); + + await db.transaction(async function (txn) { + + let q=`select * from ${AppTables.ATTENDANCE} where ATTENDANCE_DATE='${d2}' and EMP_ID='${props.UserId}'`; + await txn.executeSql(q,[],async function (txn2, txnres2) { + + if(txnres2.rows.length>0){ + + let data=txnres2.rows.item(0); + let {ATTENDANCE_DATE,STATUS,STATUS_Id,REMARK,REASON_ID, REASON,IMAGE1}=data + let obj={STATUS:STATUS,STATUS_Id:STATUS_Id,REMARK:REMARK,REASON_ID:REASON_ID, REASON:REASON,IMAGE1:IMAGE1}; + let path=IMAGE1!=null && IMAGE1!='' ? 'file://'+common_ImagePath+IMAGE1:''; + obj['IMAGE1_PATH']=path; + + + if(STATUS_Id==2){ + setShowRemark(true); + setShowReason(true); + setCameraVis(false); + } + else if(STATUS_Id==3){ + setShowRemark(true); + setShowReason(false); + setCameraVis(true); + } + else{ + setShowRemark(false); + setShowReason(false); + setCameraVis(false); + } + + setAttData(obj); + setdataFound(true); + setProcessing(false); + setrerenderdata(!rerenderdata); + + } + else{ + setProcessing(false); + } + },function(txn2,txnerr){console.log(txnerr); setProcessing(false);}); + }); + } + + + async function onSelectAttendance(item){ + + let alldata=AttData; + alldata['STATUS']=item.AttendanceName; + alldata['STATUS_Id']=item.AttendanceId; + console.log('alldata',alldata); + if(item.AttendanceId==2){ + setShowRemark(true); + setShowReason(true); + setCameraVis(false); + } + else if(item.AttendanceId==3){ + setShowRemark(true); + setShowReason(false); + setCameraVis(true); + } + else{ + setShowRemark(false); + setShowReason(false); + setCameraVis(false); + } + + setAttData(alldata); + setrerenderdata(!rerenderdata); + + } + + function onselectionChange(option,keyLbl,keyVal){ + let data=AttData; + data[keyVal]=option.value; + data[keyLbl]=option.label; + setAttData(data); + setrerenderdata(!rerenderdata) + } + + function onchangeText(val,key){ + console.log('onchangeText',key); + let data=AttData; + data[key]=val; + setAttData(data); + setrerenderdata(!rerenderdata) + + } + + async function getImage(imgdata){ + // let type=getImageProps.type || ''; + if(typeof imgdata =='object' && imgdata.errorCode=='camera_unavailable'){ + notify('Camera unavailable'); + } + else if(typeof imgdata =='object' && imgdata.uri!=null){ + const img=imgdata; + const imgurl=img.uri, imgWidth=img.width, imgHeight=img.height; + + + let picture_clicked_time=new Date(); + picture_clicked_time=moment(picture_clicked_time).format('DD-MM-YYYY HH:mm:ss') + + + const mark_text1=picture_clicked_time; + const mark_text2='User Id:'+props.UserId+' | Image Type: Attendance'+' | Date:'+picture_clicked_time; + + await marktext1(mark_text1,imgurl) + .then((res)=>{ + if(res.success){ + let uri=res.uri; + marktext2(mark_text2,uri,imgWidth,imgHeight) + .then((res)=>{ + if(res.success){ + let picture_clickedd=new Date(); + let picture_clicked_date=moment(picture_clickedd).format('YYYYMMDD'); + let picture_clicked_time=moment(picture_clickedd).format('HHmmss'); + let filename=(props.UserId || '')+'_AttendanceImg-'+picture_clicked_date+'_'+picture_clicked_time+'.jpg'; + + + let data=AttData; + let image_key='IMAGE1'; + let image_path_key='IMAGE1_PATH'; + data[image_key]=filename; + + // renamefile + let imagePath=`${common_ImagePath}${filename}`; + RNFS.copyFile(res.uri, imagePath) + .then(resn => { + let uri='file://'+imagePath; + console.log('image marker',uri); + data[image_path_key]=uri; + + setAttData(data); + setrerenderdata(!rerenderdata); + }) + .catch(err => { + console.log('ERROR: image file write failed!!!'); + console.log(err.message, err.code); + }); + + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + else{ + if(res.imagenotfound){ + notify('Please capture a image'); + } + else{ + notify(res.error); + } + } + }); + } + } + + async function openCamera(){ + setShowCamera(true); + } + + + async function onSubmitData(){ + let isvalid=await validate(); + if(isvalid){ + setShowAlert(true); + } + } + + function onSaveCancel(){ + setShowAlert(false); + } + + async function saveData(){ + + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + try { + + await db.transaction(async function (txn) { + + let q=`DELETE FROM ${AppTables.ATTENDANCE} WHERE EMP_ID='${props.UserId}' and ATTENDANCE_DATE='${d2}' `; + + // remove old data + await txn.executeSql(q,[],async function (txn2, txnres) { + console.log('attend deleted'); + },function (txn2, txnerr) { console.log(txnerr); },); + + var values=''; + let {STATUS,STATUS_Id,REMARK,REASON_ID, REASON,IMAGE1,IMAGE1_PATH}=AttData; + values+=` ('${props.UserId}','${d2}','${STATUS}','${STATUS_Id}','${REMARK}','${REASON_ID}','${REASON}','${IMAGE1}','${d2}') `; + + console.log('values:',values); + let add_data=`INSERT INTO ${AppTables.ATTENDANCE} (EMP_ID,ATTENDANCE_DATE,STATUS,STATUS_Id,REMARK,REASON_ID, REASON,IMAGE1 ,ADDED_DATE) VALUES ${values} `; + + + await txn.executeSql(add_data,[],async function (txn2, txnres) { + console.log('attend added'); + notify('Attendance submited successfully','SHORT'); + props.setAttendanceStatus({isAttendanceMarked:true}); + setdataFound(true); + setProcessing(false); + props.navigation.goBack(); + },function (txn2, txnerr) { console.log(txnerr);setProcessing(false);notify('Cannot submit Attendance!') },); + + + }); + } catch (err) { + console.log(err); + } + } + + + async function uploadAttndance(){ + setShowAlert(false); + setLoaderTitle('Saving Data...'); + setProcessing(true); + + let d1=new Date(); + let d2=moment(d1).format('MM/DD/YYYY'); + let {ATTENDANCE_DATE,STATUS,STATUS_Id,REMARK,REASON_ID, REASON,IMAGE1,IMAGE1_PATH}=AttData; + + var data1 = new FormData(); + data1.append('file', { + uri: IMAGE1_PATH, + type: 'image/jpg', + name: IMAGE1, + }); + + data1.append('Foldername',"Attendance"); + data1.append('Path', d2); + let data={ + "UserId":props.UserId, + "AttendanceDate":d2, + "ReasonId":REASON_ID!=null?REASON_ID:0, + "ImageUrl":IMAGE1, + "Remark":REMARK + } + + + + const url=props.baseurl+getMethodName(METHODS.UPLOADATTENDANCE_METHOD); + const url1=(props.imageUploadUrl || URL_IMAGE)+getMethodName(METHODS.UPLOADIMAGES_METHOD); + console.log(url,data); + + await UploadData2(url,data) + .then(async(res)=>{ + console.log('res upload attend:',res); + if(parseInt(res)>0){ + + saveData(); + + // Upload Image + await UploadFormData(url1,data1) + .then(async(res1)=>{ + console.log('res1 image upload:',res1); + }) + .catch((err)=>{ + console.log(err); + }); + } + else{ + setProcessing(false); + } + }) + .catch((err)=>{ + console.log(err);setProcessing(false); + }); + } + + + + + async function validate(){ + let isValid=true; + let {ATTENDANCE_DATE,STATUS,STATUS_Id,REMARK,REASON_ID, REASON,IMAGE1,IMAGE1_PATH}=AttData; + if(STATUS_Id==null || STATUS_Id==''){ + isValid=false; + notify('Please select Attendance Status','SHORT'); + } + else if(showReason==true && (REASON_ID==null || REASON_ID=='')){ + isValid=false; + notify('Please select reason','SHORT'); + } + else if(showRemark==true && (REMARK==null || REMARK=='')){ + isValid=false; + notify('Please enter remark','SHORT'); + } + else if(CameraVis==true && (IMAGE1==null || IMAGE1=='')){ + isValid=false; + notify('Please click image','SHORT'); + } + + console.log('isValid:',isValid); + return isValid; + } + + + return ( + + {processing && } + + {ConfirmSaveAlert(props,showAlert,onSaveCancel,uploadAttndance)} + {setShowCamera(false);getImage(imgData)}} showCamera={showCamera} onHideCamera={()=>{setShowCamera(false);}}/> + + + + { !props.isDataDownloaded && } + + { props.isDataDownloaded==true && + + + {rerenderdata==rerenderdata && + + + Hi User + Please mark attendance before working! + + { + AttendanceLabels.map((item,index)=>{ + let isSelected=AttData["STATUS_Id"]==item.AttendanceId; + return ( + {dataFound?'' :onSelectAttendance(item)}}> + {item.AttendanceName} + + ) + }) + } + { + + {showRemark==true && + + + + Remark + {dataFound && {AttData['REMARK']}} + {!dataFound && {onchangeText(val,'REMARK');}} + autoComplete='off' + />} + + + } + + {showReason==true && + + + + Reason + {CustomPicker(props,nonWorkingRsns,'Reason','ReasonId','REASON','REASON_ID',onselectionChange,{value:AttData["REASON"]})} + + + } + {CameraVis==true && + + + + Image + + + { (AttData["IMAGE1_PATH"]==null || AttData["IMAGE1_PATH"]=='') && + {openCamera()}}> + + + } + { (AttData["IMAGE1_PATH"]!=null && AttData["IMAGE1_PATH"]!='') && + + + {!dataFound && {openCamera()}}> + + } + + } + + + + + + } + + + } + + + + + } + + { + !dataFound && + + {onSubmitData()}}/> + + } + + } + + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(Attendance); \ No newline at end of file diff --git a/src/screensSup/ReportDetail.js b/src/screensSup/ReportDetail.js new file mode 100644 index 0000000..e5774fe --- /dev/null +++ b/src/screensSup/ReportDetail.js @@ -0,0 +1,473 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,DownloadData, getDownloadJson1} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl, db} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign} from '../components/icons'; +import { WebView } from 'react-native-webview'; +import CustomLoader from '../components/CustomLoader'; +import NoDataComponent from '../components/NoDataComponent'; +import LinearGradient from 'react-native-linear-gradient'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; + +function ReportDetail(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + + + const [processing, setProcessing] = useState(true); + const [isDataFound, setisDataFound] = useState(false); + const [reportData, setReportData] = useState([]); + const [reportConfig, setReportConfig] = useState([]); + const [aggrData, setAggrData] = useState({}); + const [cols, setcols] = useState([]); + const [colWidth, setColWidth] = useState('100%'); + const [currentReportMenu, setCurrentReportMenu] = useState({}); + const [designation, setDesignation] = useState(''); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let ReportMenu=params.ReportData || {}; + + setCurrentReportMenu(ReportMenu); + getData(ReportMenu); + }, []); + + + // async function getData(ReportMenu){ + // try { + // let config=ReportMenu?.ColumnConfig + // let configValue= (config && JSON.parse(config))||[] + // let configArr=configValue.length>0? configValue : [] + // setReportConfig(configArr) + + // let allReportData= await DownloadReport(ReportMenu); + // console.log('allReportData',allReportData); + // console.log('ReportMenu',ReportMenu); + // if(allReportData.length>0){ + // let data=allReportData[0]; + // console.log('data dynamicdata-----',data); + // let ShowField= ShowField ? JSON.parse(data.ShowField) :'' + + // console.log(ShowField, "ShowField") + + + // if(data.ReportValue!=null && data.ReportValue!=''){ + // let TotalIndex=allReportData.findIndex(i=>i.ReportValue=='Total'); + // console.log('TotalIndex:',TotalIndex) + // if(TotalIndex>=0){ + // let aggrgateData=allReportData[TotalIndex]; + // console.log('aggrgateData',aggrgateData); + // setAggrData(aggrgateData); + // let newReports=allReportData + // newReports.splice(TotalIndex,1); + // console.log('newReports',newReports); + // setReportData(newReports); + // } + // else{ + // setReportData(allReportData); + // } + // } + // else{ + // setReportData(allReportData); + // } + + // console.log("Object.key---",Object.keys(data).length) + // let allCols=[]; + // let i=0; + // let keylen=Object.keys(data).length; + + + // for(let key in data){ + // let obj={'actual_colname':key}; + // let colname=key.replace(/[$$]/g,' ').replace(/Percent/g,'%'); + // obj['colname']=colname; + // let dontShowCol=(colname=='Srno' || colname=='ReportValue'); + // if(!dontShowCol){ + // allCols.push(obj); + // } + + // if(i==keylen-1){ + // console.log('allCols:',allCols); + // setcols(allCols); + // let colLen=allCols.length; + // let width=94/colLen; + // setColWidth(width+'%'); + // } + // i++; + // } + + + // setProcessing(false); + // setisDataFound(true); + // } + // else{ + // notify('No data found'); + // setProcessing(false); + // } + + // } catch (err) { + // setProcessing(false); + // console.log(err); + // } + // } + + + + // async function getData(ReportMenu) { + // try { + // let config = ReportMenu?.ColumnConfig; + // let configValue = (config && JSON.parse(config)) || []; + // let configArr = configValue.length > 0 ? configValue : []; + // setReportConfig(configArr); + + // let allReportData = await DownloadReport(ReportMenu); + // console.log('allReportData', allReportData); + // console.log('ReportMenu', ReportMenu); + + // if (allReportData.length > 0) { + // let data = allReportData[0]; + // console.log('data dynamicdata-----', data); + // let ShowField = data.ShowField ? JSON.parse(data.ShowField) : []; + // let ColorField = data.ColorField ? JSON.parse(data.ColorField) : []; + // console.log(ShowField, "ShowField"); + + // if (data.ReportValue != null && data.ReportValue != '') { + // let TotalIndex = allReportData.findIndex(i => i.ReportValue === 'Total'); + // console.log('TotalIndex:', TotalIndex); + + // if (TotalIndex >= 0) { + // let aggrgateData = allReportData[TotalIndex]; + // console.log('aggrgateData', aggrgateData); + // setAggrData(aggrgateData); + // let newReports = [...allReportData]; + // newReports.splice(TotalIndex, 1); + // console.log('newReports', newReports); + // setReportData(newReports); + // } else { + // setReportData(allReportData); + // } + // } else { + // setReportData(allReportData); + // } + + // let allCols = []; + // if (ShowField.length > 0) { + // for (let i = 0; i < ShowField.length; i++) { + // let data1 = ShowField[i]; + // if (data1.Show === "Y") { + // let obj = { actual_colname: data1.FieldName }; + // let colname = data1.FieldName.replace(/[$$]/g, ' ').replace(/Percent/g, '%'); + // obj['colname'] = colname; + + // let colorobj = ColorField.find(c => c.FieldName === data1.FieldName); + // if (colorobj) { + // obj["Color"] = colorobj.Color; + // } + + // console.log("Item,--", obj); + // allCols.push(obj); + // } + // } + + // console.log('allCols:', allCols); + // setcols(allCols); + // let colLen = allCols.length; + // let width = 94 / colLen; + // setColWidth(width + '%'); + // } + + // setProcessing(false); + // setisDataFound(true); + // } else { + // notify('No data found'); + // setProcessing(false); + // } + // } catch (err) { + // setProcessing(false); + // console.log(err, "errorr"); + // } + // } + + /////////////////////////// + + async function getData(ReportMenu) { + try { + // Extract and parse configuration + let config = ReportMenu?.ColumnConfig; + let configValue = (config && JSON.parse(config)) || []; + let configArr = configValue.length > 0 ? configValue : []; + setReportConfig(configArr); + + // Download report data + let allReportData = await DownloadReport(ReportMenu); + console.log('allReportData:', allReportData); + console.log('ReportMenu:', ReportMenu); + + if (allReportData.length > 0) { + let data = allReportData[0]; + console.log('data dynamicdata-----', data); + let ShowField = data.ShowField ? JSON.parse(data.ShowField) : ''; + let ColorField = data.ColorField ? JSON.parse(data.ColorField) : ''; + console.log('ShowField:', ShowField); + console.log('ColorField:', ColorField); + + if (ShowField.length > 0) { + let allCols = []; + for (let i = 0; i < ShowField.length; i++) { + let data1 = ShowField[i]; + if (data1.Show === "Y") { + let obj = { actual_colname: data1.FieldName }; + let colname = data1.FieldName.replace(/[$$]/g, ' ').replace(/Percent/g, '%'); + obj['colname'] = colname; + + let colorobj = ColorField.find(c => c.FieldName === data1.FieldName); + if (colorobj) { + obj["Color"] = colorobj.Color; + } + + console.log("Item,--", obj); + allCols.push(obj); + } + } + + console.log('allCols:', allCols); + setcols(allCols); + let colLen = allCols.length; + let width = 94 / colLen; + setColWidth(width + '%'); + } else { + // If ShowField is empty, fall back to processing keys directly from data + let allCols = []; + let keylen = Object.keys(data).length; + let i = 0; + + for (let key in data) { + let obj = { 'actual_colname': key }; + let colname = key.replace(/[$$]/g, ' ').replace(/Percent/g, '%'); + obj['colname'] = colname; + let dontShowCol = (colname === 'Srno' || colname === 'ReportValue'); + if (!dontShowCol) { + allCols.push(obj); + } + + if (i === keylen - 1) { + console.log('allCols:', allCols); + setcols(allCols); + let colLen = allCols.length; + let width = 94 / colLen; + setColWidth(width + '%'); + } + i++; + } + } + + // Set the report data + setReportData(allReportData); + setProcessing(false); + setisDataFound(true); + } else { + notify('No data found'); + setProcessing(false); + } + } catch (err) { + setProcessing(false); + console.error('Error:', err); + } + } + + + + + async function DownloadReport(ReportMenu){ + let downloadKey=ReportMenu.DownloadKey; + console.log(downloadKey , "downloadKey") + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url=props.baseurl+getMethodName(METHODS.DOWNLOADJSON_METHOD); + let data={ + Downloadtype:downloadKey, + Username: loginDetails.UserId, + Param1: '', + Param2: '', + }; + + console.log(url,data); + return await getDownloadJson1(url,data) + .then(async(res)=>{ + if (res[downloadKey]) { + let data_arr = res[downloadKey] || []; + return data_arr; + } + else{ + return []; + } + }) + .catch((err)=>{ + console.log('onPage Team error',err); + return []; + }); + } + + + + + return ( + + {processing && } + + + + + {currentReportMenu?.ReportName || currentReportMenu?.ContentType} + + { !props.isDataDownloaded && } + { props.isDataDownloaded==true && + + + { isDataFound==false && + + {ST.NoDataAvailable} + + } + + { + isDataFound==true && + + + {currentReportMenu.ReportType=='Tabular' && + + + + + {cols?.map((col,colindex)=>{ + return ( + + {col.actual_colname?.replace(/\$\$/g, ' ')} + + ) + }) + } + + + { + reportData?.length>0 && + reportData?.map((item,index)=>{ + + let FieldName=reportConfig[0]?.FieldName + let FieldNameObj=reportConfig?.find((val)=>{ + return item[val?.FieldName]==val?.FieldValue + }) + let configValueMatch=item[FieldNameObj?.FieldName]==FieldNameObj?.FieldValue + + + return( + + {cols.map((col,colindex)=>{ + let keyValue=col.actual_colname!=null?item[col.actual_colname]:'' + + let ColorArr= configValueMatch? FieldNameObj?.Color : null + let str=String(keyValue).replace("%","") + let ColorCode=ColorArr?.find((item)=>{ + if(!isNaN(str)){ + return eval(str+(item?.MinRange||""))&& (eval(str+(item?.MaxRange||""))) + } + return false + }) + + return ( + + {keyValue} + + ) + }) + } + + ) + }) + } + + + } + + { + currentReportMenu.ReportType=='Card' && + + + {Object.keys(aggrData).length>0 && + + + {'Total'} + + + {cols.map((col,colindex)=>{ + let colindex1=colindex; + return ( + + {col.colname+' :'} + {col.colname!=null?aggrData[col.actual_colname]:''} + + ) + }) + } + + + } + { + reportData.length>0 && + reportData.map((item,index)=>{ + let isEvenRow=index%2!=0; + return( + + {cols.map((col,colindex)=>{ + let colindex1=colindex; + return ( + + {col.colname+' :'} + {col.colname!=null?item[col.actual_colname]:''} + + ) + }) + } + + ) + }) + } + + + } + + } + + + } + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(ReportDetail); \ No newline at end of file diff --git a/src/screensSup/ReportDetail1.js b/src/screensSup/ReportDetail1.js new file mode 100644 index 0000000..f43b364 --- /dev/null +++ b/src/screensSup/ReportDetail1.js @@ -0,0 +1,349 @@ +import React,{useState,useEffect} from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList} from 'react-native'; +import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import {notify} from '../components/notify'; +import moment from 'moment'; +import {getDownloadJson,DownloadData, getDownloadJson1, getDownloadJson12} from '../controller/functions'; +import {get_item,set_item,clear_item} from '../components/localStorage'; +import {version,sloganline,appname,testurl, db} from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import {Card} from 'react-native-paper'; +import {AntDesign} from '../components/icons'; +import { WebView } from 'react-native-webview'; +import CustomLoader from '../components/CustomLoader'; +import NoDataComponent from '../components/NoDataComponent'; +import LinearGradient from 'react-native-linear-gradient'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; + +function ReportDetail(props) { + const route = useRoute(); + const ST=props.StaticText || {}; + // get all theme styles acc to current theme set + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const [processing, setProcessing] = useState(true); + const [isDataFound, setisDataFound] = useState(false); + const [reportData, setReportData] = useState([]); + const [reportConfig, setReportConfig] = useState([]); + const [aggrData, setAggrData] = useState({}); + const [cols, setcols] = useState([]); + const [colWidth, setColWidth] = useState('100%'); + const [currentReportMenu, setCurrentReportMenu] = useState({}); + const [designation, setDesignation] = useState(''); + const d1=new Date(); + const d2=moment(d1).format('MM/DD/YYYY'); + + useEffect(() => { + let params=props.route.params? props.route.params:{}; + let ReportMenu=params.ReportData || {}; + + setCurrentReportMenu(ReportMenu); + getData(ReportMenu); + }, []); + + + async function getData(ReportMenu){ + try { + let allReportData= await DownloadReport(ReportMenu); + console.log('allReportData',ReportMenu?.ColumnConfig,"-----",allReportData); + if(allReportData.length>0){ + let data=allReportData[0]; + console.log('data--h',data); + if(data.ReportValue!=null && data.ReportValue!=''){ + let TotalIndex=allReportData.findIndex(i=>i.ReportValue=='Total'); + console.log('TotalIndex:',TotalIndex) + if(TotalIndex>=0 && currentReportMenu?.ReportType=='Tabular') + { + let aggrgateData=allReportData[TotalIndex]; + console.log('aggrgateData',aggrgateData); + setAggrData(aggrgateData); + let newReports=allReportData + newReports.splice(TotalIndex,1); + console.log('newReports',newReports); + setReportData(newReports); + } + else{ + setReportData(allReportData); + } + } + else{ + setReportData(allReportData); + } + let allCols=[]; + let i=0; + let keylen=Object.keys(data).length; + + let repoLen=ReportMenu?.ColumnConfig; + if(repoLen && repoLen.length){ + let repoLenStr=repoLen.replace(/[$$]/g,' ').replace(/Percent/g,'%'); + let config=JSON.parse(repoLenStr) + if(config && config.length>0){ + console.log("config------",config) + setReportConfig(config) + } + }else{ + setReportConfig([]) + } + + + for(let key in data) + { + let obj={'actual_colname':key}; + let colname=key.replace(/[$$]/g,' ').replace(/Percent/g,'%'); + obj['colname']=colname; + let dontShowCol=(colname=='Srno'); + // let dontShowCol=(colname=='Srno' || colname=='ReportValue'); + if(!dontShowCol){ + allCols.push(obj); + } + + if(i==keylen-1) + { + console.log('allCols:',allCols); + setcols(allCols); + let colLen=allCols.length; + let width=97/colLen; + setColWidth(width+'%'); + } + i++; + } + + + setProcessing(false); + setisDataFound(true); + } + else + { + notify('No data found'); + setProcessing(false); + } + + + } catch (err) { + setProcessing(false); + console.log(err); + } + } + + async function DownloadReport(ReportMenu){ + let downloadKey=ReportMenu.DownloadKey; + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + const url=props.baseurl+getMethodName(METHODS.DOWNLOADJSON_METHOD); + let data={ + Downloadtype:downloadKey, + Username: loginDetails.UserId, + Param1: '', + Param2: '', + }; + + console.log(url,data); + return await getDownloadJson12(url,data) + .then(async(res)=>{ + if (res[downloadKey]) { + let data_arr = res[downloadKey] || []; + return data_arr; + } + else{ + return []; + } + }) + .catch((err)=>{ + console.log('onPage Team error',err); + return []; + }); + } + + + + + return ( + + {processing && } + + + + + {currentReportMenu.ReportName} + + { !props.isDataDownloaded && } + { props.isDataDownloaded==true && + + { isDataFound==false && + + {ST.NoDataAvailable} + + } + { + isDataFound && + + { currentReportMenu.ReportType=='Tabular' && + + + + { + cols.length>0 && + cols.map((item,index)=>{ + let colorObj=reportConfig.find(i=>i.FieldName==item.colname); + if(reportConfig.length>0 && colorObj!==undefined && colorObj!="" ){ + console.log("colorObj------",colorObj) + if(colorObj?.Show=="Y"){ + return( + + {item.colname} + + ) + }else{ + return + } + + } + return( + + {item.colname} + + )}) + } + + + + { + reportData.length>0 && + reportData.map((item,index)=>{ + let colorCodeBg=""; + if(item?.ReportValue=='Total'){ + colorCodeBg="#FFFF00" + } + return( + + {cols.map((col,colindex)=>{ + {/* let colorCode=item && col? ( col.Color=="Y"?(item.COLOR||"black") :"black") :"black"; */} + + let colorObj=reportConfig.find(i=>i.FieldName==col.actual_colname); + if(reportConfig.length>0 && colorObj!==undefined && colorObj!="" ){ + if(colorObj?.Show=="Y"){ + let colorCode= colorObj.Color=="Y"?(colorObj?.ColorValue||"black") :"black"; + let colorCodeStr= colorCode.toLowerCase() + + return ( + + {col.actual_colname!=null?item[col.actual_colname]:''} + + ) + }else{ + return + } + } + + return ( + + {col.actual_colname!=null?item[col.actual_colname]:''} + + ) + })} + + ) + }) + } + + + + } + {currentReportMenu.ReportType=='Card' && + + + {Object.keys(aggrData).length>0 && + + + {'Total'} + + { + isDataFound==true && + + + {cols.map((col,colindex)=>{ + let colindex1=colindex; + return ( + + {col.colname+' :'} + {col.colname!=null?aggrData[col.actual_colname]:''} + + ) + }) + } + + + } + + } + { + + isDataFound==true && + + { + reportData.length>0 && + reportData.map((item,index)=>{ + let isEvenRow=index%2!=0; + return( + + {cols.map((col,colindex)=>{ + let colindex1=colindex; + return ( + + {col.colname+' :'} + {col.colname!=null?item[col.actual_colname]:''} + + ) + }) + } + + ) + }) + } + + } + + + } + + } + + + } + + + + + ); + } + + + +export default connect(mapStateToProps, mapDispatchToProps)(ReportDetail); \ No newline at end of file diff --git a/src/screensSup/ReportDetailBackup.js b/src/screensSup/ReportDetailBackup.js new file mode 100644 index 0000000..534c3cd --- /dev/null +++ b/src/screensSup/ReportDetailBackup.js @@ -0,0 +1,282 @@ +// import React,{useState,useEffect} from 'react'; +// import Container from '../components/container'; +// import { useRoute } from '@react-navigation/native'; +// import { globalStyles,customStyles,GetPageTheme } from "../styles/Global"; +// import {StatusBar,Image,TextInput,View,Text,ScrollView,TouchableOpacity,Platform,PermissionsAndroid,FlatList} from 'react-native'; +// import { ReactReduxContext,connect,useSelector, useDispatch } from 'react-redux'; +// import { mapStateToProps,mapDispatchToProps } from '../reducers/contextProvider'; +// import SQLite from 'react-native-sqlite-2'; +// import {notify} from '../components/notify'; +// import moment from 'moment'; +// import {getDownloadJson,DownloadData, getDownloadJson1} from '../controller/functions'; +// import {get_item,set_item,clear_item} from '../components/localStorage'; +// import {version,sloganline,appname,testurl, db} from '../constants/constants'; +// import CustomHeader from '../components/customHeader'; +// import {Card} from 'react-native-paper'; +// import {AntDesign} from '../components/icons'; +// import { WebView } from 'react-native-webview'; +// import CustomLoader from '../components/CustomLoader'; +// import NoDataComponent from '../components/NoDataComponent'; +// import LinearGradient from 'react-native-linear-gradient'; +// import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; + +// function ReportDetail(props) { +// const route = useRoute(); +// const ST=props.StaticText || {}; +// // get all theme styles acc to current theme set +// const PageTheme=GetPageTheme(props.DarkMode,route.name); +// const customStyle=customStyles(props.DarkMode,route.name); +// const [processing, setProcessing] = useState(true); +// const [isDataFound, setisDataFound] = useState(false); +// const [reportData, setReportData] = useState([]); +// const [aggrData, setAggrData] = useState({}); +// const [cols, setcols] = useState([]); +// const [colWidth, setColWidth] = useState('100%'); +// const [currentReportMenu, setCurrentReportMenu] = useState({}); +// const [designation, setDesignation] = useState(''); +// const d1=new Date(); +// const d2=moment(d1).format('MM/DD/YYYY'); + +// useEffect(() => { +// let params=props.route.params? props.route.params:{}; +// let ReportMenu=params.ReportData || {}; + +// setCurrentReportMenu(ReportMenu); +// getData(ReportMenu); +// }, []); + + +// async function getData(ReportMenu){ +// try { +// let allReportData= await DownloadReport(ReportMenu); +// console.log('allReportData',allReportData); +// if(allReportData.length>0){ +// let data=allReportData[0]; +// console.log('data',data); +// if(data.ReportValue!=null && data.ReportValue!=''){ +// let TotalIndex=allReportData.findIndex(i=>i.ReportValue=='Total'); +// console.log('TotalIndex:',TotalIndex) +// if(TotalIndex>=0) +// { +// let aggrgateData=allReportData[TotalIndex]; +// console.log('aggrgateData',aggrgateData); +// setAggrData(aggrgateData); +// let newReports=allReportData +// newReports.splice(TotalIndex,1); +// console.log('newReports',newReports); +// setReportData(newReports); +// } +// else{ +// setReportData(allReportData); +// } +// } +// else{ +// setReportData(allReportData); +// } +// let allCols=[]; +// let i=0; +// let keylen=Object.keys(data).length; + + +// for(let key in data) +// { +// let obj={'actual_colname':key}; +// let colname=key.replace(/[$$]/g,' ').replace(/Percent/g,'%'); +// obj['colname']=colname; +// let dontShowCol=(colname=='Srno' || colname=='ReportValue'); +// if(!dontShowCol){ +// allCols.push(obj); +// } + +// if(i==keylen-1) +// { +// console.log('allCols:',allCols); +// setcols(allCols); +// let colLen=allCols.length; +// let width=94/colLen; +// setColWidth(width+'%'); +// } +// i++; +// } +// setProcessing(false); +// setisDataFound(true); +// } +// else +// { +// notify('No data found'); +// setProcessing(false); +// } + +// } catch (err) { +// setProcessing(false); +// console.log(err); +// } +// } + +// async function DownloadReport(ReportMenu){ +// let downloadKey=ReportMenu.DownloadKey; +// let loginInfo = await get_item('loginInfo'); +// const loginDetails = JSON.parse(loginInfo); +// const url=props.baseurl+getMethodName(METHODS.DOWNLOADJSON_METHOD); +// let data={ +// Downloadtype:downloadKey, +// Username: loginDetails.UserId, +// Param1: '', +// Param2: '', +// }; + +// console.log(url,data); +// return await getDownloadJson1(url,data) +// .then(async(res)=>{ +// if (res[downloadKey]) { +// let data_arr = res[downloadKey] || []; +// return data_arr; +// } +// else{ +// return []; +// } +// }) +// .catch((err)=>{ +// console.log('onPage Team error',err); +// return []; +// }); +// } + + + + +// return ( +// +// {processing && } +// +// +// +// +// {currentReportMenu.ReportName} +// +// { !props.isDataDownloaded && } +// { props.isDataDownloaded==true && +// +// { isDataFound==false && +// +// {ST.NoDataAvailable} +// +// } +// {currentReportMenu.ReportType=='Tabular' && +// +// +// {console.log('colsreturn',cols)} +// {cols.map((col,colindex)=>{ +// return ( +// +// {col.colname} +// +// ) +// }) +// } +// +// {isDataFound==true && +// +// +// { +// reportData.length>0 && +// reportData.map((item,index)=>{ +// return( +// +// {cols.map((col,colindex)=>{ +// return ( +// +// {col.actual_colname!=null?item[col.actual_colname]:''} +// +// ) +// }) +// } +// +// ) +// }) +// } +// + + +// +// } +// +// } +// {currentReportMenu.ReportType=='Card' && +// +// +// {Object.keys(aggrData).length>0 && +// +// +// {'Total'} +// +// { +// isDataFound==true && +// +// +// {cols.map((col,colindex)=>{ +// let colindex1=colindex; +// return ( +// +// {col.colname+' :'} +// {col.colname!=null?aggrData[col.actual_colname]:''} +// +// ) +// }) +// } +// +// +// } +// +// } +// { + +// isDataFound==true && +// +// { +// reportData.length>0 && +// reportData.map((item,index)=>{ +// let isEvenRow=index%2!=0; +// return( +// +// {cols.map((col,colindex)=>{ +// let colindex1=colindex; +// return ( +// +// {col.colname+' :'} +// {col.colname!=null?item[col.actual_colname]:''} +// +// ) +// }) +// } +// +// ) +// }) +// } +// +// } +// +// +// } + +// +// } +// +// + +// +// ); +// } + + + +// export default connect(mapStateToProps, mapDispatchToProps)(ReportDetail); \ No newline at end of file diff --git a/src/screensSup/TeamList.js b/src/screensSup/TeamList.js new file mode 100644 index 0000000..6654fe2 --- /dev/null +++ b/src/screensSup/TeamList.js @@ -0,0 +1,530 @@ +import React, { useState, useEffect, memo } from 'react'; +import Container from '../components/container'; +import { useRoute } from '@react-navigation/native'; +import { globalStyles, customStyles, GetPageTheme } from "../styles/Global"; +import { StatusBar, Image, TextInput, View, Text, ScrollView, TouchableOpacity, TouchableHighlight, Platform, PermissionsAndroid, FlatList } from 'react-native'; +import { ReactReduxContext, connect, useSelector, useDispatch } from 'react-redux'; +import { mapStateToProps, mapDispatchToProps } from '../reducers/contextProvider'; +import SQLite from 'react-native-sqlite-2'; +import { notify } from '../components/notify'; +import moment from 'moment'; +import { getDownloadJson, AddStore, checkRange, UploadData2, UploadData, UpdateStoreStatus, getKPIS, marktext1, marktext2, UploadFormData } from '../controller/functions'; +import { get_item, set_item, clear_item } from '../components/localStorage'; +import { version, sloganline, appname, testurl, db, AppVersion } from '../constants/constants'; +import CustomHeader from '../components/customHeader'; +import { Card } from 'react-native-paper'; +import { AntDesign, Entypo, EvilIcons, Feather, FontAwesome, Fontisto, Ionicons, MaterialCommunityIcons } from '../components/icons'; +import CustomLoader from '../components/CustomLoader'; +import LinearGradient from 'react-native-linear-gradient'; +import NoDataComponent from '../components/NoDataComponent'; +import { SvgXml } from 'react-native-svg'; +import MapIcon from '../assets/performics/map_icon.svg'; +import CustomModal from '../components/CustomModal'; +import { AppTables } from '../constants/tableConstants'; +import { _checkLocationPermission } from '../components/geolocation'; +// import Geolocation from '@react-native-community/geolocation'; +import { getAvailblQuery, getIfAvlbl, getIfKPIDone, getQuery, Q_MenuList } from '../constants/ConstantQueries'; +import { ConfirmSaveAlert } from '../components/alert'; +import { getFolderName, getMethodName, METHODS } from '../constants/methodNames'; +import { uploadAllImages, uploadStoreStatus } from '../constants/uploadData'; +import { PrimaryTheme } from '../styles/Themes'; +import NetworkStatusBar from '../components/NetworkStatusBar'; +import * as RNFS from 'react-native-fs'; + +import CameraImg2 from '../assets/performics/camera_icon.svg'; +import CustomCamera from '../components/Camera'; +import NoAttendance from '../components/NoAttendance'; +import HeaderTabsTeam from '../components/HeaderTabsTeam'; + +const EmployeeItem = memo((props) => { + const route = useRoute(); + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const item = props.item; + + let params = props.route.params ? props.route.params : {}; + let isAdhoc = params.isAdhoc || false; + + console.log("params=====>",params) + + const ST = props.StaticText || {}; + + let hasCheckedInEmployee = props?.list?.some(emp => emp.ChekedInStatus === true); + // console.log("list============",props.list, hasCheckedInEmployee) + + + // const gotoPage = React.useCallback(() => { + // // If no one else is checked in or this employee has an empty CheckInStatus, allow navigation + + // const isCheckedIn = await checkStoreCheckIn(true, false, props); + // console.log("Checked In:", isCheckedIn); + + + // if (!hasCheckedInEmployee || item.ChekedInStatus === '') { + // props.navigation.navigate('StoreList', { empData: item, isAdhoc: false }); + + // } else if (item.ChekedInStatus === true) { + // // If the current employee is checked in, allow navigation + // props.navigation.navigate('StoreList', { empData: item, isAdhoc: false }); + // } else { + // // Restrict navigation if someone else is checked in + // notify("You have some Checked In data for other employee."); + // } + // }, [item, hasCheckedInEmployee, props.navigation]); + + //new React memo with async + + const gotoPage = React.useCallback(() => { + const checkAndNavigate = async () => { + try { + const isCheckedIn = await checkStoreCheckIn(item, props); + console.log("Checked In:", isCheckedIn); + + console.log('item===>',item); + + + if (isCheckedIn.length == 0) { + if (!hasCheckedInEmployee || item.ChekedInStatus === '') { + props.navigation.navigate('StoreList', { empData: item, isAdhoc: isAdhoc }); + } else if (item.ChekedInStatus === true) { + props.navigation.navigate('StoreList', { empData: item, isAdhoc: isAdhoc }); + } else { + notify("You have some Checked In data for other employee."); + } + } else { + notify("You have some Checked In data for other employee."); + } + + } catch (err) { + console.error('Error during check-in validation:', err); + notify("Something went wrong while checking status."); + } + }; + + checkAndNavigate(); + }, [item, hasCheckedInEmployee, props]); + + + async function checkStoreCheckIn(empData1, props) { + console.log("Get data callled dddd", empData1, isAdhoc); + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + let columKey = loginDetails?.Designation == "Supervisor" ? "MerchandiserId" : "EmpId"; + let q = ''; + + const configData = (() => { + try { + return typeof props.ManagerAppConfig === "string" + ? JSON.parse(props.ManagerAppConfig) + : props.ManagerAppConfig; + } catch (e) { + return null; + } + })(); + + + const configArray = configData?.ManagerAppConfig ?? []; + + const currentConfig = configArray.find( + item => item.Designation?.toLowerCase() === loginDetails.Designation?.toLowerCase() + ); + + const storewisePjp = currentConfig?.StorewisePJP; + + console.log("currentConfig:=>", currentConfig); + console.log("storewisePjp:=>", storewisePjp); + + var tables = [ + 'Sup_AdhocJourneyPlan', + 'Sup_NPNDStore', + 'Sup_JourneyPlan' + ]; + + + if (storewisePjp === true) { + tables = [ + 'Sup_JourneyPlanStorewiseSup_Adhoc', + 'Sup_NPNDStore', + 'Sup_JourneyPlanStorewiseSup' + ]; + } + + const whereClause = `VisitDate='${d2}' AND UploadStatus='I' AND ${columKey} != '${empData1?.EmpId}' `; + + const existingTables = []; + + // Check which tables exist + for (const table of tables) { + const exists = await new Promise((resolve) => { + db.transaction(tx => { + tx.executeSql( + `SELECT name FROM sqlite_master WHERE type='table' AND name=?`, + [table], + (tx, res) => resolve(res.rows.length > 0), + (tx, err) => { + console.error(`Error checking table ${table}:`, err); + resolve(false); + } + ); + }); + }); + + if (exists) { + existingTables.push(table); + } + } + + if (existingTables.length === 0) { + console.log('No valid tables found.'); + return []; + } + + const unionQuery = existingTables + .map(table => `SELECT * FROM ${table} WHERE ${whereClause}`) + .join(' UNION '); + // Run the final query + console.log("unionQuery", unionQuery, d2, empData1?.EmpId) + return new Promise((resolve, reject) => { + db.transaction(tx => { + tx.executeSql( + unionQuery, + [], + (tx, res) => { + const result = []; + for (let i = 0; i < res.rows.length; i++) { + console.log("unionQuery",) + result.push(res.rows.item(i)); + } + resolve(result); + }, + (tx, err) => { + console.error('Union query failed:', err); + reject(err); + } + ); + }); + }); + } + + + return ( + { gotoPage(item) }}> + + + + {item.EmployeeName} + + + + + + {'Employee Id:'} + {item.EmpId} + + + + + {'User Id:'} + {item.UserId} + + + { + (item.ChekedInStatus == true) && + + + + {'You have some Checked In data for this employee'} + + + } + + + + ); +}); + +function TeamList(props) { + const route = useRoute(); + + const ST = props.StaticText || {}; + + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const [loaderTitle, setLoaderTitle] = useState(); + const [processing, setProcessing] = useState((props.isDataDownloaded ? true : false)); + const [isAdhocScreen, setIsAdhocScreen] = useState(false); + const [nodataFound, setNodataFound] = useState(false); + const [showStoreVisitModal, setShowStoreVisitModal] = useState(false); + const [showGeoTagModal, setShowGeoTagModal] = useState(false); + const [showDistanceModal, setShowDistanceModal] = useState(false); + const [currentStore, setCurrentStore] = useState({}); + const [storeDistance, setStoreDistance] = useState('0 M'); + const [storeDistanceinM, setStoreDistanceinM] = useState(0); + const [showAlert, setShowAlert] = useState(false); + const [checkOutStore, setCheckOutStore] = useState({}); + const [rerenderdata, setrerenderdata] = useState(false); + const [EmployeesList, setEmployeesList] = useState([]); + const [globalEmplist, setGlobalEmplist] = useState([]); + + const [globalStorelist, setGlobalStorelist] = useState([]); + const [cancelCheckOutStore, setCancelCheckOutStore] = useState({}); + const [showCancelCIModal, setShowCancelCIModal] = useState(false); + const [searchedItem, setSearchedItem] = useState(''); + + + const [CheckOutImage, setCheckOutImage] = useState(''); + const [CheckOutImagePath, setCheckOutImagePath] = useState(''); + const [CheckOutImageModal, setCheckOutImageModal] = useState(false); + const [CheckOutLoc, setCheckOutLoc] = useState({}); + const [showImageSaveOp, setShowImageSaveOp] = useState(true); + const [showCamera, setShowCamera] = useState(false); + const [GeoFenceEnable_Checkout, setGeoFenceEnable_Checkout] = useState(false); + const [GeoFenceRadius_Checkout, setGeoFenceRadius_Checkout] = useState(''); + const [isCheckIn, setisCheckIn] = useState(false) + + useEffect(() => { + setLoaderTitle(ST.Loading + '...'); + + if (props.isDataDownloaded == true && !props.isAttendanceMarked) { + props.navigation.pop(); props.navigation.push('Attendance'); + } + else { + // checkLocalData(); + + const FocusUnsubscribe = props.navigation.addListener('focus', () => { checkLocalData(); }); + + return function cleanup() { + FocusUnsubscribe(); + return; + }; + } + + }, []); + + async function checkLocalData() { + let d1 = new Date(); + let d2 = moment(d1).format('MM/DD/YYYY'); + + let token = await get_item('loginToken'); + let loginInfo = await get_item('loginInfo'); + const loginDetails = JSON.parse(loginInfo); + let params = props.route.params ? props.route.params : {}; + let isAdhoc = params.isAdhoc || false; + console.log("isAdhoc===", isAdhoc) + setIsAdhocScreen(isAdhoc); + + var q = ''; + if (isAdhoc == true) { + q = `Select * from Sup_TeamList where TodayPJP='N'`; + } + else { + q = `Select * from Sup_TeamList where TodayPJP='Y'`; + } + console.log("teamlist q:", q); + await db.transaction(async function (txn) { + await txn.executeSql(q, [], async function (txn2, txnres2) { + console.log("teamlist length:", txnres2.rows.length); + if (txnres2.rows.length > 0) { + // show from local + var storeArr = []; + for (var i = 0; i < txnres2.rows.length; i++) { + let data = txnres2.rows.item(i); + console.log("data---", data) + let ChekedInStatus = await getCheckInStatus(data); + data['ChekedInStatus'] = ChekedInStatus; + storeArr.push(data); + + if (i == (txnres2.rows.length - 1)) { + setEmployeesList(storeArr); + console.log("storeArr", storeArr); + setGlobalEmplist(storeArr); + setProcessing(false); + } + } + } + else { + setProcessing(false); notify(ST.Nodatafound); setNodataFound(true); + } + }, function (txn2, txnerr) { console.log(txnerr); setProcessing(false); notify(ST.Nodatafound); setNodataFound(true); }); + }); + } + + + + // async function getCheckInStatus(emp){ + // let {EmpId} =emp + // let d1=new Date(); + // let d2=moment(d1).format('MM/DD/YYYY'); + // return new Promise((resolve,reject)=>{ + // db.transaction(async function (txn) { + + // //let join=`INNER JOIN ${AppTables.COVERAGE_DATA} t2 on t2.STORE_ID=t1.StoreId and t2.JCP_TYPE='Sup_JourneyPlan' `; + // let q=`Select t1.* from Sup_JourneyPlan t1 where t1.VisitDate='${d2}' and t1.MerchandiserId='${EmpId}' and t1.UploadStatus='I'` + + // //let join2=`INNER JOIN ${AppTables.COVERAGE_DATA} t2 on t2.STORE_ID=t1.StoreId and t2.JCP_TYPE='Sup_AdhocJourneyPlan' `; + // let q2=`Select t1.* from Sup_AdhocJourneyPlan t1 where t1.VisitDate='${d2}' and t1.MerchandiserId='${EmpId}' and t1.UploadStatus='I'` + + // await txn.executeSql(q,[],async function (txn2, txnres2) { + // if(txnres2.rows.length>0){ + // // show from local + // resolve(true); + // } + // else{ + // await txn.executeSql(q2,[],async function (txn2, txnres3) { + // if(txnres3.rows.length>0){ + // // show from local + // resolve(true); + // } + // else{ + // resolve(''); + // } + // },function(txn2,txnerr){console.log(txnerr);resolve(''); }); + // } + // },function(txn2,txnerr){console.log(txnerr);resolve(''); }); + + // }); + + // }).then((val)=>{ + // return val; + // }).catch((err)=>{ + // return false; + // }); + // } + + const getCheckInStatus = async (emp) => { + const { EmpId } = emp; + const d2 = moment(new Date()).format('MM/DD/YYYY'); + + return new Promise((resolve) => { + db.transaction(async (txn) => { + const q1 = `Select t1.* from Sup_JourneyPlan t1 where t1.VisitDate='${d2}' and t1.MerchandiserId='${EmpId}' and t1.UploadStatus='I'`; + const q2 = `Select t1.* from Sup_AdhocJourneyPlan t1 where t1.VisitDate='${d2}' and t1.MerchandiserId='${EmpId}' and t1.UploadStatus='I'`; + + await txn.executeSql(q1, [], async (txn2, txnres1) => { + if (txnres1.rows.length > 0) { + resolve(true); + } else { + await txn.executeSql(q2, [], (txn2, txnres2) => { + resolve(txnres2.rows.length > 0); + }); + } + }); + }); + }); + }; + + + + + function FilterStores(searchedQry) { + searchedQry = searchedQry.toLowerCase(); + console.log('searchedQry', searchedQry); + let arr = [] + if (searchedQry != null && searchedQry != '') { + globalEmplist.map((item, index) => { + let { EmpId, EmployeeName } = item; + if (EmployeeName.toLowerCase().includes(searchedQry) || JSON.stringify(EmpId).toLowerCase().includes(searchedQry)) { + arr.push(item); + } + }); + } + else { + // arr=globalStorelist; + arr = globalEmplist; // search fixed + } + setEmployeesList(arr); + setrerenderdata(!rerenderdata) + } + + + + + + + return ( + + {processing && } + + { setShowCamera(false); getImage(imgData) }} showCamera={showCamera} onHideCamera={() => { setShowCamera(false); }} /> + + + + + {!props.isDataDownloaded && } + {props.isDataDownloaded == true && !props.isAttendanceMarked && + + } + {props.isDataDownloaded == true && props.isAttendanceMarked == true && props.isEntryAllow == false && + + } + + + + + {/* + + {props.navigation.pop();props.navigation.push('TeamList')}}> + {ST.Planned} + + {props.navigation.pop();props.navigation.push('TeamList',{'isAdhoc': true})}}> + {ST.Adhoc} + + + */} + + + + + { setSearchedItem(val); FilterStores(val) }} + autoComplete='off' + /> + { FilterStores(searchedItem) }}> + + + + + {nodataFound && + + {ST.NoDataAvailable} + + } + {(props.isDataDownloaded == true && props.isAttendanceMarked == true && !nodataFound) && + + { + return ( + + ); + }} + /> + + } + + + + + + + + ); +} + + + +export default connect(mapStateToProps, mapDispatchToProps)(TeamList); \ No newline at end of file diff --git a/src/store/configureStore.js b/src/store/configureStore.js new file mode 100644 index 0000000..eb7c027 --- /dev/null +++ b/src/store/configureStore.js @@ -0,0 +1,21 @@ +import React from 'react'; +import { createStore, combineReducers } from 'redux'; +import projectReducer from '../reducers/projectReducers'; +import sessionReducer from '../reducers/sessionReducer'; +// import darkmodeReducer from '../reducers/darkmodeReducer'; +import themeReducer from '../reducers/themeReducer'; +import globalDataReducer from '../reducers/globalDataReducer'; + +const rootReducer = combineReducers( +{ + projectR:projectReducer, + sessionR:sessionReducer, + // darkmodeR:darkmodeReducer, + themeR:themeReducer, + globalR:globalDataReducer, +}); + +const store = createStore(rootReducer); + + +export default store; diff --git a/src/styles/Global.js b/src/styles/Global.js new file mode 100644 index 0000000..64cf634 --- /dev/null +++ b/src/styles/Global.js @@ -0,0 +1,2271 @@ +import { PrimaryTheme, MainThemeLight, DarkTheme } from "./Themes"; +import { Platform, StatusBar, StyleSheet } from 'react-native'; +import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen'; +import { black } from "react-native-paper/lib/typescript/styles/colors"; +import { green100, red100 } from "react-native-paper/lib/typescript/src/styles/themes/v2/colors"; +const defdt = false, defrn = ''; +export const GetPageTheme = (isDarkTheme = defdt, routeName = defrn) => { + let PageTheme = (routeName == 'Project' ? MainThemeLight : (isDarkTheme == true ? DarkTheme : PrimaryTheme)); + return PageTheme; +}; + +export const WP = wp; +export const HP = hp; +const borderRadius = 20; +export const STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 70 : StatusBar.currentHeight; +const EXTRA_SPACE = Platform.OS === 'ios' ? 20 : 0; +const EXTRA_SPACE_MD = Platform.OS === 'ios' ? 40 : 0; +const deffontfamily = 'Zocial'; +export const deffontfamily_bold = 'Roboto-Bold'; + +export const globalStyles = (isDarkTheme = defdt, routeName = defrn) => { + const PageTheme = GetPageTheme(isDarkTheme, routeName); + return StyleSheet.create({ + statusBar: { height: STATUSBAR_HEIGHT, width: wp('100%') }, + // drawerScreenHdr_bg: { backgroundColor: '#000', borderBottomWidth: 0, borderBottomColor: PrimaryTheme.$secondary_color_light, paddingHorizontal: 10, paddingBottom: 5, paddingTop: STATUSBAR_HEIGHT + 10 }, + // dScreenHdr_Content: { flexDirection: 'row', alignItems: 'center', position: 'relative' }, + // drawerScreenHdr_title: { width: '100%', textAlign: 'left', fontSize: 16, fontWeight: '500', color: PageTheme.$accent_color, paddingLeft: 50, paddingRight: 100, fontFamily: deffontfamily }, + // dScreen_LeftContainer: { position: 'absolute', left: 0 }, + // toggleDrawerBtn: { paddingVertical: 5, paddingHorizontal: 10 }, + // dScreen_RightContainer: { position: 'absolute', right: 0, flexDirection: 'row', alignItems: 'center' }, + // drawerProjectId: { fontSize: 14, fontWeight: '500', color: PageTheme.$accent_color, paddingHorizontal: 5, fontFamily: deffontfamily }, + // drawerNotifIcon: { marginLeft: 5, padding: 5 }, + // drawerContent: { + // flex: 1, + // marginTop: -10, + // paddingTop: 0, + // }, + // drawerContentScroll: {}, + // drawerContentScrollInner: { paddingTop: 10, padding: 0 }, + + drawerScreenHdr_bg:{backgroundColor:'#000', + borderBottomWidth:0, + borderBottomColor:PrimaryTheme.$secondary_color_light, + height:Platform.OS=='ios'?"15%":"10%", + }, + dScreenHdr_Content:{flexDirection:'row',alignItems:'center',position:'relative',height:"30%"}, + drawerScreenHdr_title:{width:'100%',textAlign:'left',fontSize:16,fontWeight:'500',color:PageTheme.$accent_color,paddingLeft:50,paddingRight:100,fontFamily:deffontfamily,}, + dScreen_LeftContainer:{position:'absolute',left:0}, + toggleDrawerBtn:{paddingVertical:5,paddingHorizontal:10}, + dScreen_RightContainer:{position:'absolute',right:0,flexDirection:'row',alignItems:'center'}, + drawerProjectId:{fontSize:14,fontWeight:'500',color:PageTheme.$accent_color,paddingHorizontal:5,fontFamily:deffontfamily,}, + drawerNotifIcon:{marginLeft:2,padding:10}, + drawerContent: { + flex: 1, + marginTop: -10, + paddingTop: 0, + }, + drawerContentScroll: {}, + drawerContentScrollInner: { paddingTop: 10, padding: 0 }, + + cardTitle: { + fontWeight: 'normal', + fontSize: hp('1.8%'), + }, + cardImage: { + width: 30, + height: 30, + resizeMode: 'contain', + }, + title: { + fontSize: 15, + marginTop: 10, + fontWeight: '500', + textTransform: 'capitalize', + color: PageTheme.$text_color, + textAlign: 'center', + marginLeft: -5, + fontFamily: deffontfamily + }, + caption: { + fontSize: hp('1.7%'), + lineHeight: 14, + }, + row: { + marginTop: 20, + flexDirection: 'row', + alignItems: 'center', + }, + section: { + flexDirection: 'row', + alignItems: 'center', + marginRight: 15, + }, + paragraph: { + fontWeight: 'bold', + marginRight: 3, + }, + drawerSection: { + marginTop: 7, + borderBottomColor: '#fff', + borderBottomWidth: 0, + }, + bottomDrawerSecion: { + borderTopColor: '#f4f4f4', + borderTopWidth: 1, + borderBottomWidth: 0, + marginBottom: 0, + }, + bottomDrawerCon: { + padding: 5, + flexDirection: 'column', + alignItems: 'center', + }, + bottomDrawerIcon: { + width: '50%', + height: 30, + resizeMode: 'contain', + }, + bottomDrawerLabel: { + fontSize: 14, + color: PageTheme.$text_color, + }, + preferenceCon: { + padding: 10, + }, + preferenceTitle: { + fontSize: 14, + color: PageTheme.$text_color, + }, + preference: { + flexDirection: 'row', + justifyContent: 'space-between', + marginTop: 12, + }, + userInfoSection: { + padding: 0, + borderBottomColor: '#f4f4f4', + borderBottomWidth: 1, + }, + container: { + flex: 1, alignItems: 'center', backgroundColor: PageTheme.$accent_color, fontFamily: deffontfamily + }, + logo: { + resizeMode: 'contain', + width: wp('50%') + }, + drawerIcon: { + width: 30, + height: 30, + left: 2, + position: "absolute", + paddingLeft: 15 + + }, + inputStyle: { + width: wp('85%'), + height: hp('8%'), + marginBottom: 12, + }, + otpStyle: { + marginBottom: 12, + borderRadius: 8, + width: wp('15%'), + height: hp('7%'), + }, + drawerItemStyle: { + flexDirection: 'row', + paddingHorizontal: 10, + paddingVertical: 8.5, + alignItems: 'center', + // height:35, + }, + drawerLogo: { + // width: wp('50%') - 20, + marginTop:"20%", + width: '100%', + height: 60, + resizeMode: 'contain', + }, + drawerItemIcon: { width: 30, justifyContent: 'center', flexDirection: 'row' }, + drawerLabel: { + fontSize: 15, + fontWeight: '400', + color: PageTheme.$accent_color2, + marginLeft: 10, + fontFamily: deffontfamily, + }, + otpContainer: { + width: wp('85%'), + flexDirection: 'row', + flexWrap: 'wrap', + justifyContent: 'space-between' + }, + labelStyle: { + color: PageTheme.$text_color_700, + textAlign: 'left', + width: wp('85%'), + fontSize: hp('1.7%'), + marginBottom: 20, + justifyContent: 'flex-start' + }, + + }); +} + +export const customStyles = (isDarkTheme = defdt, routeName = defrn) => { + const PageTheme = GetPageTheme(isDarkTheme, routeName); + return StyleSheet.create({ + drawerSubTitle: { + fontSize: 12, + color: PageTheme.$text_color + }, + loginIllutration: { + // marginTop:20, + }, + moreIconMpin: { + position:'absolute', + right: 12, + top: 16, + width: 40, + height: 40, + borderRadius: 24, + justifyContent: 'center', + alignItems:'center' + }, + performics_logo: { + width: wp('50%'), + height: 40, + marginTop: 20, + resizeMode: 'contain', + }, + company_logo: { width: wp('100%') - 40, height: 100, resizeMode: 'contain' }, + loginScrollCon: { + flex: 1, + width: wp('100%'), + }, + loginCon: { + flex: 1, + alignItems: "center", + position: 'relative', + + }, + projectScrollCon: { + width: wp('100%'), + flex: 1 + }, + projectCon: { + alignItems: "center", + position: 'relative', + }, + loginScrollCon2: { + flex: 1, + width: wp('100%'), + }, + projectPageWrapper: { width: '100%', height: hp('100%') }, + + //=============Bottom View============== + footerView: { width: '100%', alignItems: 'center', marginBottom: 20, }, + + + repoertDetailsPicker: { flexDirection: 'row', alignItems: 'center' }, + + //=============signatureBox============== + signatureBox: { + alignItems: "center", + width: wp('100%'), + padding: 10, + }, + signatureText: { + color: PageTheme.$text_color_light, + fontSize: 12, + fontWeight: '400', + textAlign: 'center', + fontFamily: deffontfamily + }, + signatureLogo: { + resizeMode: 'contain', + width: wp('30%'), + height: 50, + marginTop: 5, + }, + + pageContentWrapper: { backgroundColor: PageTheme.$bg_color, borderTopLeftRadius: borderRadius, borderTopRightRadius: borderRadius, elevation: 3, paddingTop: 10, flex: 1, }, + pageContentWrapper_bgLight: { backgroundColor: '#efefef' }, + pageContentWrappergm: { backgroundColor: 'black', borderTopLeftRadius: borderRadius, borderTopRightRadius: borderRadius, elevation: 3, paddingTop: 10, flex: 1, }, + + //=============general Style============= + // pt200:{paddingTop:200,}, + mb7: { marginBottom: 7, }, mb10: { marginBottom: 10, }, mb20: { marginBottom: 20, }, mb30: { marginBottom: 30, }, mb40: { marginBottom: 40, }, mb50: { marginBottom: 50, }, mb60: { marginBottom: 60, }, mb70: { marginBottom: 70, }, mb80: { marginBottom: 80, }, mb90: { marginBottom: 90, }, mb100: { marginBottom: 100, }, + mt10: { marginTop: 10, }, mt20: { marginTop: 20, }, mt30: { marginTop: 30, }, mt40: { marginTop: 40, }, mt50: { marginTop: 50, }, mt60: { marginTop: 60, }, mt70: { marginTop: 70, }, mt80: { marginTop: 80, }, mt90: { marginTop: 90, }, mt100: { marginTop: 100, }, + pl10: { paddingLeft: 10 }, pl20: { paddingLeft: 20 }, pl30: { paddingLeft: 30 }, pl40: { paddingLeft: 40 }, pl50: { paddingLeft: 50 }, + pr10: { paddingRight: 10 }, pr20: { paddingRight: 20 }, pr30: { paddingRight: 30 }, pr40: { paddingRight: 40 }, pr50: { paddingRight: 50 }, + mr10: { marginRight: 10 }, mr20: { marginRight: 20 }, mr30: { marginRight: 30 }, + ml10: { marginLeft: 10 }, ml20: { marginLeft: 20 }, ml30: { marginLeft: 30 }, ml40: { marginLeft: 40 }, ml50: { marginLeft: 50 }, + pt10: { paddingTop: 10 }, pt20: { paddingTop: 20 }, pt30: { paddingTop: 30 }, pt40: { paddingTop: 40 }, pt50: { paddingTop: 50 }, + mtb10: { marginTop: 10, marginBottom: 10, }, + mtb5: { marginTop: 5, marginBottom: 5, }, + zIndex0: { zIndex: 0 }, + logoImage_con: { flexDirection: 'row', justifyContent: 'center', marginBottom: 10 }, + logoImage: { width: 100, height: 50 }, + drawerInfoCon: { + // padding: 10, + // paddingLeft: 0, + alignItems: 'center', + height:"20%" + }, + // drawerInfoLeft:{paddingRight:10,marginRight:10,borderRightColor:PageTheme.$secondary_color_light,borderRightWidth:2}, + drawerLogo2: { width: 100, height: 50 }, + pageText: { + color: PageTheme.$text_color_dark, + fontSize: 16, + fontWeight: '500', + fontFamily: deffontfamily, + textAlign: 'center', + marginBottom: 10, + }, + pagedescText: { + color: PageTheme.$text_color, + fontSize: 13, + fontFamily: deffontfamily, + fontWeight: '400', + textAlign: 'center', + marginBottom: 5, + }, + formCon: {}, + formGroup: { position: 'relative' }, + inputStyle: { + textAlign: 'left', + fontFamily: deffontfamily, + backgroundColor: PageTheme.$secondary_color_light, + width: wp('85%'), + borderRadius: 7, + paddingVertical: 5, + paddingHorizontal: 15, + height: 50, + color: PageTheme.$accent_color2, + }, + formInputLabel: { position: 'absolute', left: 40, zIndex: 1, color: PageTheme.$placeholder_color, top: 15, }, + formInputLeftIcon: { position: 'absolute', left: 15, top: 15 }, + passField: { + position: 'relative', + }, + show_pass_btn: { + position: 'absolute', + top: 0, + right: 0, + width: 40, + height: 50, + alignItems: 'center', + justifyContent: 'center', + }, + keyba_view: { flex: 1, width: wp('100%'), alignItems: 'center' }, + keyba_viewContent: { overflow: 'hidden' }, + keyba_inner_view: { flex: 1, width: wp('100%'), alignItems: 'center', position: 'relative' }, + pass_input: { + paddingRight: 40, + }, + form_label: { + color: PageTheme.$text_color, + fontSize: 14, + fontWeight: '400', + textAlign: 'left', + paddingHorizontal: 0, + fontFamily: deffontfamily, + marginBottom: 10, + + }, + otp_inputStyle: { + textAlign: 'center', + backgroundColor: PageTheme.$secondary_color_light, + width: ((wp('85%') / 4) - 10), + borderRadius: 4, + paddingVertical: 10, + paddingHorizontal: 15, + height: 50, + color: PageTheme.$accent_color2, + marginBottom: 10, + marginRight: 10, + fontSize: 25, + fontFamily: deffontfamily, + }, + otp_field: { + flexDirection: 'row', + }, + otp_hiddeninput: { + display: 'none', + }, + fullwebview: { + width: '100%', + height: '100%', + flex: 1, + // borderTopLeftRadius:borderRadius,borderTopRightRadius:borderRadius, + marginBottom: 0, + }, + roundScrollWrapper: { flex: 1, width: '100%' }, + roundScrollZIndex: { zIndex: 1, }, + roundScrollCon: { backgroundColor: PageTheme.$bg_color, borderTopLeftRadius: borderRadius, borderTopRightRadius: borderRadius, }, + roundScrollInner: { height: '100%', width: '100%', flex: 1, backgroundColor: PageTheme.$bg_color, borderTopLeftRadius: borderRadius, borderTopRightRadius: borderRadius, elevation: 3, paddingTop: 40, }, + webViewCon: { height: '100%', flex: 1, borderTopLeftRadius: borderRadius, borderTopRightRadius: borderRadius, paddingTop: 0, }, + headetBgImage: { + height: hp('20%'), + width: wp('100%') + 2, + position: 'relative', + justifyContent: 'center', + alignItems: 'center', + }, + headerTitle: { + color: PageTheme.$accent_color, + fontSize: 20, + width: 150,//(wp('100%')-80), + textAlign: 'right', + }, + headerImg: { + width: wp('40%'), + height: 120, + resizeMode: 'contain', + top: 28, + left: -30, + }, + headerLeftIcon: { + width: 60, + height: 60, + alignItems: 'center', + justifyContent: 'center', + marginLeft: -10, + }, + headerContent: { + flex: 1, + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between', + position: 'absolute', + width: wp('100%'), + paddingHorizontal: 20, + }, + teaml_name: { + color: PageTheme.$text_color, + fontSize: 14, + fontWeight: '400', + textAlign: 'left', + paddingLeft: 20, + paddingRight: 10, + }, + teaml_img: { + width: 20, + height: 20, + }, + teaml: { + flexDirection: 'row', + paddingHorizontal: 20, + marginBottom: 10, + borderWidth: 2, + borderColor: PageTheme.$secondary_color_light, + shadowOffset: { width: 0, height: 2 }, + borderRadius: 5, + paddingVertical: 10, + alignItems: 'center' + }, + iteml_con: { + width: '100%', + marginTop: 10, + paddingBottom: 50, + paddingHorizontal: 20, + paddingTop: 10 + }, + iteml_conR: { paddingBottom: 20, paddingTop: 10, paddingHorizontal: 10 }, + iteml_conR2: { marginBottom: 20, backgroundColor: PageTheme.$bg_color, borderRadius: 5, elevation: 5, shadowColor: '#000', shadowOffset: { width: 0, height: 3 }, shadowOpacity: 0.15 }, + storel_Con: { width: '100%', height: '100%', paddingBottom: 150, }, + listcon: { + width: '100%', + height: '100%', + }, + storeR_listcon: { + width: '100%', + height: '100%', + paddingHorizontal: 0, + paddingBottom: 30, + }, + storelist_parentwrap: { width: '100%' }, + storeTab_Con: { width: '94%', minHeight: 40 }, + storeTab_MenuCon: { width: '94%', marginTop: 0, marginBottom: 0, marginHorizontal: 10, borderBottomColor: PageTheme.$text_color_light2, borderBottomWidth: 1 }, + storeTab_Menu: { alignItems: 'center', marginBottom: 10 }, + storeTab_pill: { paddingHorizontal: 20, paddingVertical: 5, borderRadius: 30, backgroundColor: '#efefef', marginRight: 7 }, + storeTab_pillText: { color: PageTheme.$text_color, fontSize: 14, fontWeight: '500', fontFamily: deffontfamily }, + storeTab_pillActive: { backgroundColor: '#ffb020' }, + storeTab_pillActiveText: { color: '#fff' }, + // storelist card style + storel: { + flexDirection: 'row', + paddingRight: 10, + marginBottom: 10, + // borderWidth:2, + // borderColor:PageTheme.$secondary_color_light, + backgroundColor: PageTheme.$bg_color, + borderRadius: 5, + paddingVertical: 10, + alignItems: 'center', + elevation: 5, shadowColor: '#000', shadowOffset: { width: 0, height: 3 }, shadowOpacity: 0.15 + }, + storel_card_outer: { + paddingVertical: 5, paddingHorizontal: 10, position: 'relative', width: '100%' + }, + storel_card: { + flexDirection: 'row', alignItems: 'center', + }, + storel_card_content: { marginHorizontal: 5, width: '100%', flexDirection: 'row', alignItems: 'baseline' }, + storel_card_title: { + fontSize: 15, + color: PageTheme.$text_color, + fontWeight: '500', + fontFamily: deffontfamily, + }, + storel_card_subtitle: { marginLeft: 10, paddingLeft: 10, borderLeftColor: PageTheme.$text_color_light, borderLeftWidth: 1, fontFamily: deffontfamily, }, + storel_card_subtitleTxt: { fontSize: 12, color: PageTheme.$text_color_light, fontFamily: deffontfamily, }, + storel_details: { + // flex:1, + paddingHorizontal: 5, + }, + storel_code: { flexDirection: 'row', marginTop: 0, paddingTop: 5, width: '100%' }, + storel_codeCon: { marginRight: 10, flexDirection: 'row', alignItems: 'center' }, + storel_codeConAddr: { alignItems: 'flex-start' }, + storel_codeIcon: { fontSize: 20, marginRight: 10, }, + storel_codeBorder: { borderRightColor: PageTheme.$secondary_color_dark, borderRightWidth: 1 }, + storel_codeBorderTop: { borderTopColor: PageTheme.$secondary_color_light, borderTopWidth: 1, }, + storel_codeLbl: { fontSize: 12, color: PageTheme.$secondary_color_dark, marginRight: 5, flexWrap: 'wrap', fontFamily: deffontfamily, }, + storel_codeText: { fontSize: 12, color: PageTheme.$text_color, marginRight: 5, fontFamily: deffontfamily, }, + storel_codeTextRed: { fontSize: 12, color: PageTheme.$red, marginRight: 5 }, + storel_codeTextAddr: { width: '80%' }, + storel_usWrap: { width: '100%', position: 'relative', justifyContent: 'center', paddingVertical: 10, }, + storel_usCon: { flexDirection: 'row', alignItems: 'center' }, + storel_usConBtn: { borderRadius: 30, width: 140, position: 'relative', backgroundColor: PageTheme.$secondary_color_light, paddingHorizontal: 5, paddingVertical: 6, elevation: 3, shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 } }, + storel_usConBtn2: { width: 150, }, + storel_usOpBtn: { flexDirection: 'row', alignItems: 'center', borderRadius: 30, position: 'relative', backgroundColor: PageTheme.$primary_color, paddingHorizontal: 15, paddingVertical: 6, elevation: 3, shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 } }, + storel_usOp: { flexDirection: 'row', alignItems: 'center' }, + storel_usOpBtnText: { color: PageTheme.$accent_color, fontSize: 14, fontWeight: '500', marginLeft: 5, fontFamily: deffontfamily, }, + storel_usBtnText: { paddingRight: 5, marginRight: 5, color: PageTheme.$text_color }, + storel_usBtnRemoveIcon: { backgroundColor: '#fff', position: 'absolute', top: 0, bottom: 0, right: 0, borderTopRightRadius: 30, borderBottomRightRadius: 30, paddingHorizontal: 10, alignItems: 'center', justifyContent: 'center' }, + storel_usText: { marginLeft: 5, color: PageTheme.$text_color, fontSize: 13, fontFamily: deffontfamily, }, + storel_geotag_btn: { position: 'absolute', top: -15, right: -10, width: 50, height: 50, borderRadius: 25, alignItems: 'center', justifyContent: 'center' }, + storel_CheckOutBtn: { position: 'absolute', right: 0, borderRadius: 30, backgroundColor: PageTheme.$primary_color, paddingHorizontal: 15, paddingVertical: 6, elevation: 3, shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 }, }, + storel_cancelBtn: {}, + storel_CheckOutBtnText: { color: PageTheme.$accent_color, fontSize: 14, fontWeight: '500', fontFamily: deffontfamily, }, + + // storel searchbar + storel_crossBtn: { width: 40, height: 40, top: 0, right: 40, position: 'absolute', borderTopRightRadius: 4, borderBottomRightRadius: 4, alignItems: 'center', justifyContent: 'center' }, + storel_searchbar: { marginTop: 10, marginHorizontal: 10, backgroundColor: PageTheme.$secondary_color_light, height: 40, borderRadius: 4, paddingHorizontal: 10, elevation: 1, shadowColor: '#000', shadowOpacity: 0.15, shadowOffset: { width: 0, height: 2 }, flexDirection: 'row' }, + storel_searchInput: { width: '86%', fontSize: 13, color: PageTheme.$text_color, fontFamily: deffontfamily, }, + storel_searchBtn: { width: 40, height: 40, top: 0, right: 0, position: 'absolute', backgroundColor: PageTheme.$primary_color, borderTopRightRadius: 4, borderBottomRightRadius: 4, alignItems: 'center', justifyContent: 'center' }, + storel_searchBtnIcon: { marginTop: -2 }, + + // storel searchbar 2 + storel_searchBtnMain: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', marginBottom: 10, marginHorizontal: 10, paddingVertical: 7, backgroundColor: PageTheme.$primary_color, borderRadius: 4, paddingHorizontal: 10, elevation: 1, shadowColor: '#000', shadowOpacity: 0.15, shadowOffset: { width: 0, height: 2 } }, + storel_searchBtnMainText: { fontSize: 14, marginLeft: 10, color: PageTheme.$accent_color, fontWeight: "600", textAlign: 'center' }, + storel_headCon: { paddingHorizontal: 5, marginHorizontal: 10, paddingBottom: 5, borderBottomWidth: 1, borderBottomColor: PageTheme.$secondary_color_light }, + storel_headingText: { fontSize: 14, color: PageTheme.$primary_color, fontWeight: "600" }, + + // Download Error Modal + dErrM_Style: { alignItems: 'center' }, + dErrMsg: { textAlign: 'center', marginTop: 20, marginBottom: 5, color: PageTheme.$red, fontSize: 14, fontFamily: deffontfamily, }, + dErrSubMsg: { fontSize: 14, fontWeight: '500', marginBottom: 10, color: PageTheme.$red, fontFamily: deffontfamily, }, + dErrDetail: { fontSize: 12, fontWeight: '400', marginBottom: 10, color: PageTheme.$text_color_dark, fontFamily: deffontfamily, }, + + + // storel searchbar for SearchStoreList + SSt_searchbar: { marginHorizontal: 10, flexDirection: 'row' }, + SSt_searchInput: { width: '86%', fontSize: 13, color: PageTheme.$text_color, backgroundColor: PageTheme.$secondary_color_light, height: 40, paddingHorizontal: 10, borderRadius: 4, elevation: 1, shadowColor: '#000', shadowOpacity: 0.15, shadowOffset: { width: 0, height: 2 } }, + SSt_searchBtn: { width: 40, height: 40, top: 0, right: 0, position: 'absolute', backgroundColor: PageTheme.$primary_color, borderRadius: 4, alignItems: 'center', justifyContent: 'center' }, + SSt_searchBtnIcon: { marginTop: -2 }, + + // color description box + colorDescriptionWrap: { marginTop: 5, marginHorizontal: 10, backgroundColor: PageTheme.$bg_color, paddingVertical: 5, borderRadius: 4, paddingHorizontal: 10, flexDirection: 'row', elevation: 1, shadowColor: '#000', shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 } }, + colorBoxCon: { flexDirection: 'row', alignItems: 'center', marginRight: 20 }, + colorBox: { elevation: 1, shadowColor: '#000', borderRadius: 4, shadowOpacity: 0.15, shadowOffset: { width: 0, height: 2 }, width: 20, height: 20, }, + colorBox1: { backgroundColor: PageTheme.$fifth_color, }, + colorBox2: { backgroundColor: PageTheme.$secondary_color_light, }, + colorDesc: { fontSize: 12, color: PageTheme.$text_color, marginLeft: 5, flexWrap: 'wrap' }, + + + // Page header + pageHdrWrap: { position: 'absolute', top: STATUSBAR_HEIGHT + (70 + (Platform.OS == 'ios' ? 0 : 5)), zIndex: 9, marginHorizontal: 10, justifyContent: 'center', backgroundColor: PageTheme.$primary_color, paddingVertical: 5, borderRadius: 20, paddingHorizontal: 10, flexDirection: 'row', flexWrap: 'wrap' }, + pageHdrWrapText: { textAlign: 'center', fontSize: 13, color: PageTheme.$accent_color, flexWrap: 'wrap' }, + + + // storelist row style + storelR: { flexDirection: 'row', paddingRight: 10, marginBottom: 5, paddingBottom: 5, paddingTop: 10, borderBottomColor: PageTheme.$fourth_color, borderBottomWidth: 1 }, + storelR_last: { borderBottomWidth: 0, paddingBottom: 0, marginBottom: 0 }, + + + // download APK + downloadAPk_Title: { color: PageTheme.$text_color, fontSize: 16, fontWeight: '500', marginBottom: 7, width: '100%', textAlign: 'center', fontFamilY: deffontfamily }, + downloadAPk_subtitleWrap: { flexDirection: 'row', marginBottom: 10, alignItems: 'center', justifyContent: 'center' }, + downloadAPk_subTitle: { color: PageTheme.$text_color_dark, fontSize: 12, fontWeight: '400', textAlign: 'center', fontFamily: deffontfamily }, + downloadAPkProgress: { position: 'relative', marginVertical: 7, alignItems: 'center', justifyContent: 'center' }, + downloadAPkProgress_gif: { transform: [{ scale: 0.6 }], width: '100%', marginBottom: 5 }, + downloadAPKModal_spin: { marginRight: 5 }, + + // dynamic storelist style + dstorel_card_outer: { + paddingVertical: 0, paddingHorizontal: 10, width: '100%', + }, + dstorel_row: { flexDirection: 'row', width: '100%', paddingBottom: 5, paddingTop: 5, borderBottomWidth: 1, borderBottomColor: PageTheme.$secondary_color_light }, + dstorel_row_last: { borderBottomWidth: 0 }, + dstorel_codeLbl: { fontSize: 12, color: PageTheme.$secondary_color_dark, marginRight: 5 }, + dstorel_codeText: { fontSize: 12, fontWeight: '400', color: PageTheme.$text_color, marginRight: 5 }, + dstorel_codeSep: { fontSize: 12, color: PageTheme.$text_color, marginRight: 5 }, + dstorel_codeCon: { marginRight: 0, flexDirection: 'row', alignItems: 'center' }, + + // storePhotos + storePhotosl_card: { + paddingVertical: 7, + paddingHorizontal: 10, + marginHorizontal: 10, + marginBottom: 5, + flexDirection: 'row', + borderRadius: 5, + borderWidth: 2, + borderColor: PageTheme.$secondary_color_light, + alignItems: 'center', + }, + storePhotosl_card_details: { width: 100, paddingLeft: 10, marginRight: 10, }, + storePhotosl_card_title: { + fontSize: 15, + color: PageTheme.$text_color, + fontWeight: '500', + }, + storePhotosl_card_subtitle: { fontSize: 11, color: PageTheme.$text_color_light, fontWeight: '400', }, + storePhotosl_card_img: { width: 50, height: 50 }, + storePhotosl_card_remove_btn: { position: 'absolute', right: 10, }, + // daily menu card style + dailym_scroll_con: { padding: 10, alignItems: 'center', width: '100%' }, + dailym_scroll: { width: '100%' }, + dailym_bgcolor1: { backgroundColor: '#e0f9a5' }, + dailym_bgcolor2: { backgroundColor: '#ffd667' }, + dailym_bgcolor3: { backgroundColor: '#c2ddff' }, + dailym_bgcolor4: { backgroundColor: '#d9c2ff' }, + dailym_card: { + paddingHorizontal: 20, + marginBottom: 10, + borderRadius: 5, + paddingVertical: 10, + justifyContent: 'center', + width: '100%', + height: 100, + elevation: 5, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, + }, + dailym_con: { flexDirection: 'row', alignItems: 'center' }, + dailym_photo: { + width: 100, + height: 80, + // marginTop:-20, + }, + dailym_title: { + textAlign: 'left', + color: PageTheme.$text_color, + fontSize: 20, + width: 150, + fontWeight: '500', + marginLeft: 20, + }, + dailym_done: { position: 'absolute', width: 31, height: 31, right: 15, top: 15, borderRadius: 15, elevation: 3, shadowColor: '#000' }, + dailym_done_icon: {}, + //download screen + download_scroll_con: { flex: 1, padding: 10, alignItems: 'center', width: '100%', justifyContent: 'center' }, + download_scroll: { flex: 1, width: '100%' }, + downloadbtn: { + paddingVertical: 10, + paddingHorizontal: 20, + borderRadius: 20, + backgroundColor: PageTheme.$primary_color, + }, + downloadbtn_label: { + textAlign: 'center', + color: PageTheme.$accent_color, + fontWeight: '500', + }, + // storephotos form + sform_con: { + paddingVertical: 10, + paddingHorizontal: 20, + borderBottomColor: PageTheme.$secondary_color_light, + borderBottomWidth: 1, + }, + sform_con2: { paddingHorizontal: 10 }, + sform_hd: { + textAlign: 'center', + color: PageTheme.$secondary_color_dark, + fontWeight: '500', + fontSize: 16, + marginBottom: 10, + }, + sform_hd2: { + textAlign: 'left', + width: '100%', + paddingVertical: 10, + paddingHorizontal: 20, + color: PageTheme.$secondary_color_dark, + fontWeight: '500', + fontSize: 16, + marginBottom: 10, + }, + sform_group: { + paddingHorizontal: 10, + }, + sform_group2: { + paddingHorizontal: 0, + marginBottom: 10, + }, + sform_50: { + width: '50%', + marginHorizontal: 5, + }, + sform_100: { + width: '100%', + marginHorizontal: 5, + }, + sform_flex: { flexDirection: 'row', alignItems: 'center' }, + sform_label: { + textAlign: 'left', + color: PageTheme.$text_color_dark, + fontWeight: '500', + fontSize: 14, + width: '40%', + marginBottom: 10, + }, + sform_selectStyle: { + textAlign: 'left', + backgroundColor: PageTheme.$secondary_color_light, + width: '60%', + borderRadius: 20, + paddingVertical: 0, + paddingHorizontal: 0, + padding: 0, + height: 30, + color: PageTheme.$accent_color2, + }, + sform_label2: { + textAlign: 'left', + color: PageTheme.$text_color_dark, + fontWeight: '500', + fontSize: 14, + width: '100%', + height: 25, + marginBottom: 0, + padding: 0, + }, + + sform_label3: { + textAlign: 'left', + color: PageTheme.$text_color_dark, + fontWeight: '500', + fontSize: 14, + marginBottom: 10, + padding: 0, + fontFamily: deffontfamily + }, + sform_selectStyle2: { + textAlign: 'left', + width: wp('40%'), + backgroundColor: PageTheme.$secondary_color_light, + borderRadius: 20, + paddingVertical: 0, + paddingHorizontal: 0, + padding: 0, + color: PageTheme.$accent_color2, + }, + sform_row: { + flexDirection: 'row', + }, + sform_row2: { + flexDirection: 'row', + width: wp('100%'), + paddingHorizontal: 10, + }, + sform_inputStyle: { + textAlign: 'left', + width: wp('40%'), + backgroundColor: PageTheme.$secondary_color_light, + paddingVertical: 5, + paddingHorizontal: 10, + color: PageTheme.$accent_color2, + }, + sform_inputStyle2: { + textAlign: 'left', + width: '100%', + backgroundColor: PageTheme.$secondary_color_light, + paddingVertical: 5, + paddingHorizontal: 10, + color: PageTheme.$accent_color2, + }, + + sform_selectItem: { borderBottomWidth: 1, borderBottomColor: PageTheme.$text_color }, + sform_selectedItem: { backgroundColor: PageTheme.$secondary_color_light, }, + sform_btn_con: { + width: '100%', + marginTop: 10, + marginBottom: 0, + alignItems: 'center', + justifyContent: 'center', + flexDirection: 'row' + }, + fixedbtn: { marginBottom: 20 }, + sform_btn: { + paddingVertical: 10, + paddingHorizontal: 20, + borderRadius: 20, + backgroundColor: PageTheme.$primary_color, + alignItems: 'center', + flexDirection: 'row', + justifyContent: 'center', + minWidth: 150, + }, + sform_btn_icon: { + marginRight: 5, + }, + sform_btn_text: { + textAlign: 'center', + color: PageTheme.$accent_color, + fontWeight: '500', + }, + sform_pic_row: { flexDirection: 'row', width: '100%', marginTop: 10, justifyContent: 'center' }, + sform_pic_row2: { justifyContent: 'flex-start' }, + sform_pic_con: { width: (wp('33%') - 25), marginHorizontal: 5, display: 'flex' }, + capture_image_btn: { width: 80, height: 40, alignItems: 'center', flexDirection: 'row', justifyContent: 'center', alignSelf: 'center' }, + store_img: { + width: '100%', height: 90, borderRadius: 5, marginBottom: 5, + backgroundColor: '#b5b5b5' + }, + csku_scroll_con: { padding: 10, width: '100%' }, + sf_datePicker_text: { + textAlign: 'left', + width: wp('40%'), + backgroundColor: PageTheme.$secondary_color_light, + paddingVertical: 5, + paddingHorizontal: 10, + color: PageTheme.$accent_color2, + }, + sf_datePicker: { position: 'absolute', width: 21, height: 21, right: 25, top: 3 }, + sf_datePicker_con: { position: 'relative' }, + select_ht: { height: 53 }, + // report menu + reportMenu_con: { paddingHorizontal: 20, paddingVertical: 20, }, + reportMenu_hd: { + textAlign: 'center', + width: '100%', + paddingVertical: 10, + paddingHorizontal: 20, + color: PageTheme.$secondary_color_dark, + fontSize: 20, + fontFamily: deffontfamily, + marginBottom: 10, + }, + reportMenu: { marginTop: 10 }, + reportMenu_item: { + paddingVertical: 10, + paddingHorizontal: 20, + borderRadius: 5, + minHeight: 50, + alignItems: 'center', + flexDirection: 'row', + justifyContent: 'center', + minWidth: 150, + marginBottom: 10, + }, + reportMenu_item_bg1: { backgroundColor: PageTheme.$primary_color, }, + reportMenu_item_bg2: { backgroundColor: '#ffd667', }, + reportMenu_item_text: { + textAlign: 'center', + color: PageTheme.$accent_color, + fontSize: 16, + fontFamily: deffontfamily + }, + // loaderSyle + loaderBackdrop: { + position: 'absolute', + width: '100%', + height: '100%', + backgroundColor: '#00000052', + padding: 10, + flex: 1, + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + top: 0, + zIndex: 9999, + }, + loaderCon: { + backgroundColor: PageTheme.$bg_color, + width: '80%', + height: 50, + borderRadius: 4, + elevation: 10, + shadowColor: '#000', + shadowOpacity: 0.5, + shadowOffset: { width: 0, height: 3 }, + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + + }, + download_loaderCon: { backgroundColor: PageTheme.$accent_color, width: '80%', borderRadius: 4, elevation: 10, shadowColor: '#000', shadowOpacity: 0.5, shadowOffset: { width: 0, height: 3 }, padding: 10, }, + download_Title: { color: PageTheme.$text_color, fontSize: 16, fontWeight: '500', marginBottom: 7, fontFamily: deffontfamily, }, + download_count: { color: PageTheme.$text_color_light, fontSize: 13, fontWeight: '400', fontFamily: deffontfamily, }, + download_subTitle: { color: PageTheme.$text_color_dark, fontSize: 12, fontWeight: '400', fontFamily: deffontfamily, }, + downloadProgress: { position: 'relative', marginVertical: 7 }, + downloadProgress_bg: { height: 10, borderRadius: 10, backgroundColor: PageTheme.$text_color_light2, width: '100%' }, + downloadProgress_filled: { position: 'absolute', top: 0, height: 10, borderRadius: 10, backgroundColor: PageTheme.$primary_color, width: '0%' }, + spinnerCon: { position: 'relative' }, + downloadModal_spin: { position: 'absolute', top: 10, right: 10, }, + downloadModal_btnWrap: { flexDirection: 'row', justifyContent: 'center' }, + downloadModal_OkBtn: { + paddingVertical: 5, + paddingHorizontal: 25, + borderRadius: 20, + backgroundColor: PageTheme.$primary_color, + alignItems: 'center', + flexDirection: 'row', + justifyContent: 'center', + marginTop: 10, + }, + downloadModal_OkBtnText: { color: PageTheme.$accent_color, fontSize: 16, fontFamily: deffontfamily }, + spinner: {}, + spinnerInner: { position: 'absolute', top: 4, left: 4 }, + spinnerInner2: { position: 'absolute', top: 2, left: 2 }, + loaderTitle: { + fontSize: 16, + color: PageTheme.$text_color, + fontFamily: deffontfamily, + marginLeft: 30, + }, + // store info + storeInfo_wrap: { borderRadius: 10 }, + dm_storeInfo: { width: wp('100%'), backgroundColor: PageTheme.$accent_color, padding: 10, borderRadius: 4, borderBottomWidth: 2, borderBottomColor: PageTheme.$secondary_color_light, marginTop: 10, paddingBottom: 20 }, + dm_storeInfo_title: { color: PageTheme.$text_color_dark, fontWeight: '500', fontSize: 16, }, + dm_storeInfo_subtitle: { color: PageTheme.$text_color_light, fontWeight: '400', fontSize: 13, }, + checkinbtn: { + paddingVertical: 10, + paddingHorizontal: 20, + borderRadius: 20, + backgroundColor: PageTheme.$primary_color, + alignItems: 'center', + flexDirection: 'row', + justifyContent: 'center', + minWidth: 150, + marginTop: 40, + }, + checkinbtn_text: { color: PageTheme.$accent_color, fontSize: 16 }, + // selfie box: + selfie_preview_con: { width: wp('100%'), paddingHorizontal: 20, alignItems: 'center', justifyContent: 'center' }, + selfie_preview_hd: { textAlign: 'left' }, + selfie_preview: { flexDirection: 'row', alignItems: 'center' }, + selfiep_img: { width: 100, height: 100, backgroundColor: '#b5b5b5' }, + take_selfie_btn: { + paddingVertical: 10, + paddingHorizontal: 20, + borderRadius: 20, + backgroundColor: PageTheme.$primary_color, + alignItems: 'center', + flexDirection: 'row', + justifyContent: 'center', + minWidth: 150, + marginLeft: 40, + }, + take_selfie_btn_text: { color: PageTheme.$accent_color, fontSize: 16, marginLeft: 10 }, + + // checkin info + checkinMainCon: { width: '100%' }, + checkinInfo: { width: '100%', paddingBottom: 10, marginBottom: 10, borderBottomColor: PageTheme.$secondary_color_light, borderBottomWidth: 2, }, + checkinInfo_hd: { color: PageTheme.$secondary_color_dark, fontSize: 15, marginRight: 10 }, + checkinInfo_hdr: { flexDirection: 'row', alignItems: 'center', marginBottom: 5, }, + checkinInfo_timecon: { flexDirection: 'row', }, + checkinInfo_timeinner: { marginLeft: 10, }, + checkinInfo_img: { width: 120, height: 150, backgroundColor: '#b5b5b5' }, + checkinInfo_time: { color: PageTheme.$text_color, fontSize: 14, }, + checkinInfo_btnCon: { flex: 1, alignItems: 'center' }, + goto_storemenu_btn: { flexDirection: 'row', marginTop: 20, borderColor: PageTheme.$primary_color, borderWidth: 2, borderRadius: 20, paddingHorizontal: 10, height: 30, alignItems: 'center' }, + goto_storemenu_btn_text: { color: PageTheme.$primary_color, fontSize: 14, marginRight: 20 }, + statusIcon: { position: 'absolute', top: 0, right: 0 }, + storeintro_scroll: { width: '100%', }, + storeintro_scrollcon: { + width: '100%', + paddingBottom: 10, + paddingHorizontal: 5, + }, + store_audit_img_con: { width: '100%', marginTop: 10, height: 150, marginHorizontal: 5, alignSelf: 'center', alignItems: 'center', justifyContent: 'center', position: 'relative', backgroundColor: '#f5f5f5' }, + store_audit_image: { width: '100%', height: 150, maxWidth: 200, backgroundColor: '#f5f5f5' }, + store_audit_pickimg_btn: { position: 'absolute', right: 5, top: 0, padding: 10 }, + clocktimer: { position: "absolute", right: 0, top: 10, flexDirection: 'row' }, + clocktimerWrap: { marginTop: 10, marginLeft: 10 }, + clocktimerRow: { flexDirection: 'row', alignItems: 'center', backgroundColor: PageTheme.$accent_color, width: 'auto', paddingHorizontal: 15, paddingVertical: 5, borderRadius: 30, width: 220, justifyContent: 'center' }, + clocktimerText: { color: PrimaryTheme.$primary_color, fontSize: 12, marginLeft: 5, fontWeight: '400', fontFamily: deffontfamily, }, + + // QAD styles + qad_bg: { flex: 1, alignItems: 'center', position: 'relative' }, + qad_hdr: { alignItems: 'center', width: '100%', paddingTop: 20, paddingBottom: 10, paddingLeft: 10, paddingRight: 10, position: 'absolute', top: 0, left: 0 }, + qad_text: { color: PageTheme.$accent_color, fontSize: 18, fontWeight: '500', textAlign: 'center', marginBottom: 5, textTransform: 'capitalize', fontFamily: deffontfamily }, + qad_subtext: { color: PageTheme.$accent_color, fontSize: 13, fontWeight: '400', textAlign: 'center', marginBottom: 5, fontFamily: deffontfamily }, + qadPopUp: { flex: 1, width: wp('100%'), marginTop: 160, backgroundColor: PageTheme.$accent_color, borderTopLeftRadius: 20, borderTopRightRadius: 20, elevation: 5, shadowOpacity: 1, shadowColor: '#323232', alignItems: 'center', padding: 20 }, + qadPopUpInner: { flex: 1 }, + qadScrollCon: { flex: 1, width: '100%', padding: 0, height: 420 }, + qadInnerCon: { alignItems: "center", position: 'relative' }, + + // QAD Progess bar + linear_progressBarWrapper: { backgroundColor: '#fff', paddingHorizontal: 10, paddingVertical: 10, flexDirection: 'row', width: '100%', position: 'relative', elevation: 5, borderRadius: 15, alignItems: 'center' }, + linear_progressBar: { width: '87%', marginRight: 10, position: 'relative' }, + linear_progressBar_bg: { width: '100%', borderRadius: 5, height: 10, backgroundColor: PageTheme.$text_color_light2 }, + linear_progressBar_filled: { width: '0%', borderRadius: 5, height: 10, backgroundColor: PageTheme.$primary_color, marginRight: 10, position: 'absolute', top: 0, left: 0 }, + linear_progressBarText: { paddingLeft: 10, borderLeftWidth: 1, borderLeftColor: PageTheme.$text_color_light, color: PageTheme.$text_color, fontFamily: deffontfamily }, + + + // QAD Form + qad_form: { marginTop: 10 }, + qad_questions: { width: '100%', display: 'none' }, + qad_questionsShow: { display: 'flex' }, + qad_qtnText: { color: PageTheme.$text_color, fontSize: 17, fontWeight: '600', fontFamily: deffontfamily }, + qad_optionsCon: { marginTop: 20, paddingHorizontal: 10 }, + qad_optionBtn: { backgroundColor: PageTheme.$secondary_color_light, paddingHorizontal: 15, paddingVertical: 12, marginBottom: 10, borderRadius: 10, elevation: 2 }, + qad_optionBtnText: { fontSize: 12, color: PageTheme.$text_color, fontFamily: deffontfamily }, + qad_qtnBtnsGrp: { width: wp('87%'), marginTop: 20, position: 'relative', height: 50, padding: 10 }, + qad_qtnBtn: { backgroundColor: PageTheme.$primary_color, elevation: 6, shadowColor: PageTheme.$primary_color, shadowOffset: { width: 0, height: 2 }, borderRadius: 40, width: '35%', height: 40, display: 'flex', alignItems: 'center', justifyContent: 'center' }, + qad_qtnBtnText: { color: PageTheme.$accent_color, textAlign: 'center', fontSize: 15, padding: 10, fontFamily: deffontfamily }, + qad_btnSubmitCon: { position: 'absolute', right: 0, width: '35%' }, + qad_btnSubmit: { elevation: 6, shadowColor: PageTheme.$primary_color, shadowOffset: { width: 0, height: 2 }, borderRadius: 40, width: '100%', height: 40, display: 'flex', alignItems: 'center', justifyContent: 'center' }, + qad_btnBack: { position: 'absolute', left: 0 }, + qad_btnBackText: { fontFamily: deffontfamily }, + qad_btnNext: { position: 'absolute', right: 0 }, + qad_btnNextText: { fontFamily: deffontfamily }, + qad_timer_wrapper: { flexDirection: 'row', marginTop: 5, alignItems: 'center', paddingHorizontal: 10 }, + qad_timerText: { marginLeft: 10, color: PageTheme.$text_color, fontSize: 16, marginRight: 10, fontFamily: deffontfamily }, + timerProgressBar: { position: 'relative', flex: 1, height: 10, overflow: "hidden" }, + timerProgressBar_bg: { height: 10, borderRadius: 10, backgroundColor: PageTheme.$text_color_light2, width: '100%' }, + timerProgressBar_filled: { height: 10, borderRadius: 10, backgroundColor: 'green', position: 'absolute', top: 0 }, + answerRemark: { padding: 10, backgroundColor: '#bdebbd', borderRadius: 10, marginTop: 5 }, + answerRemarkText: { fontSize: 14, color: 'green', fontFamily: deffontfamily }, + remarkRedbg: { backgroundColor: '#fdc0c0' }, + remarkRed: { color: 'red' }, + + // forgetMpin + forgetMpinWrap: { width: wp('80%'), paddingVertical: 10, position: 'relative', marginTop: 10 }, + forgetMpinBtn: { position: 'absolute', right: 0, top: 0 }, + forgetMpinText: { color: PageTheme.$text_color_light, fontFamily: deffontfamily, }, + + // modalWrapper + modalWrapper: { position: 'absolute', top: 0, left: 0, width: wp('100%'), height: hp('100%'), backgroundColor: '#000', zIndex: 999 }, + downloadModalWrapper: {}, + + // attendance_menu + attmenu_listcon: { width: wp('100%'), }, + attmenu_list: { width: wp('100%'), marginTop: 10, paddingBottom: 10, paddingHorizontal: 20, flexDirection: 'row', flexWrap: 'wrap' }, + attendance_menu_outer: { width: wp('50%') - 30, marginBottom: 20, }, + attendance_menu_first: { marginRight: 20, }, + attendance_menu: { padding: 10, borderRadius: 7, elevation: 3, height: 120, alignItems: 'center' }, + attendance_menu_inner: { alignItems: 'center', height: '60%', justifyContent: 'center' }, + attendance_Icon: { width: 50, height: 50 }, + attendance_menu_image: { height: 50, }, + attendance_menu_title: { fontSize: 16, fontWeight: 'bold', color: PageTheme.$text_color, marginTop: 10, textAlign: 'center' }, + + // backgroundVideo + backgroundVideo: { position: 'absolute', top: 0, bottom: 0, left: 0, right: 0 }, + + // no download data style + nodownloaddata_con: { width: '100%', height: '100%', alignItems: 'center', justifyContent: 'center' }, + nodownloaddata_row: { width: '100%', height: '100%', alignItems: 'center', justifyContent: 'center' }, + nodownloaddata_text: { fontSize: 15, fontWeight: "500", color: PageTheme.$text_color_light, textAlign: 'center', marginTop: 10 }, + + // no data available + noDataCon: { width: '100%', height: 400, alignItems: 'center', justifyContent: 'center' }, + noDataText: { fontSize: 15, fontWeight: "500", color: PageTheme.$text_color_light, textAlign: 'center', fontFamily: deffontfamily, }, + + // geotag screen + geotag_scroll: { justifyContent: 'center', padding: 10, paddingBottom: 10, paddingTop: 5 }, + geotag_scroll_pb: { paddingBottom: 50, }, + gtag_sImageWrap: { position: 'absolute', bottom: -60, alignItems: 'center', left: 0, right: 0, width: '100%' }, + gtag_sImage_View: { position: 'absolute', top: -60, elevation: 1, backgroundColor: '#fff', borderRadius: 15, padding: 3, shadowOpacity: 0.1, shadowColor: '#000', shadowOffset: { width: 0, height: 2 } }, + gTag_sImageBtn: { position: 'absolute', zIndex: 2, top: 5, elevation: 2, backgroundColor: PageTheme.$red, borderRadius: 20, padding: 9, shadowOpacity: 0.25, shadowColor: PageTheme.$red, shadowOffset: { width: 0, height: 2 } }, + gtag_sImagelbl: { alignItems: 'center', paddingHorizontal: 20, paddingTop: 30, paddingBottom: 10, borderRadius: 10, backgroundColor: PageTheme.$bg_color, elevation: 2, shadowOpacity: 0.2, shadowColor: '#000', shadowOffset: { width: 0, height: 2 } }, + gtag_sImagelblText: { fontSize: 14, fontWeight: '500', color: PageTheme.$text_color, zIndex: 1, marginTop: 20, fontFamily: deffontfamily, }, + gTag_btnWrap: { alignItems: 'center', marginTop: 40 }, + gTag_btnWrapCI: { marginTop: 40, }, + gTag_Image: { width: 80, height: 80, borderRadius: 13 }, + gTag_distanceAway: { paddingHorizontal: 13, paddingVertical: 7, borderRadius: 6, backgroundColor: '#f5aeae78', width: '90%' }, + gTag_distanceAwayLbl: { fontSize: 14, color: 'red', textAlign: 'center', fontWeight: '500', fontFamily: deffontfamily, }, + android_flipIMageView: { transform: [{ scaleX: -1 }] }, + // geotag_Page:{marginTop:StatusBar.currentHeight+10,position:'relative'}, + // geotag_BackBtn:{position:'absolute',top:20,left:20,backgroundColor:PageTheme.$primary_color,padding:10,borderRadius:40,elevation:4,shadowColor:'#676767'}, + // geotag_BackBtnIcon:{}, + + // map + mapWrapCon: { marginBottom: 10, position: 'relative' }, + mapWrapConIOS: { backgroundColor: '#fff', padding: 1, borderRadius: 15, elevation: 5, shadowColor: '#000', shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 } }, + mapWrapper: { width: '100%', height: hp('100%') - (350 + EXTRA_SPACE), backgroundColor: '#fff', borderRadius: 15, overflow: 'hidden', elevation: 5, shadowColor: '#000', shadowOpacity: 0.6, shadowOffset: { width: 0, height: 2 } }, + mapWrapperView: { height: hp('100%') - (310 + EXTRA_SPACE) }, + mapWrapperSmall: { height: hp('100%') - (380 + EXTRA_SPACE) }, + mapStyle: { width: '100%', height: '100%' }, + customMapStyle: { borderRadius: 10, }, + // Store Visited Modal Style + storelVisitM_Style: { alignItems: 'center' }, + storelVisitM_titleStyle: { textAlign: 'center', marginTop: 20, marginBottom: 20, fontFamily: deffontfamily, }, + storelVisitM_options: { flexDirection: 'row', marginBottom: 20, justifyContent: 'space-between', width: '65%',marginHorizontal:10 }, + storelVisitM_op_btn: { backgroundColor: PageTheme.$primary_color, color: PageTheme.$accent_color, paddingHorizontal: 20, paddingVertical: 6, borderRadius: 20, minWidth: 70, fontFamily: deffontfamily, }, + storelVisitM_op_btnText: { textAlign: 'center', color: PageTheme.$accent_color, fontFamily: deffontfamily, }, + + // MPin MOdal + MPinM_Style: { alignItems: 'center', paddingTop: 20, width: '90%' }, + MPinM_title_Style: { textAlign: 'center', marginBottom: 10, fontSize: 15, color: PageTheme.$text_color, fontWeight: '500' }, + MPinM_subtitle_Style: { textAlign: 'center', fontSize: 13, marginLeft: 5, color: PageTheme.$red, fontFamily: deffontfamily }, + MPinM_subtitle_Style2: { textAlign: 'center', fontSize: 13, marginBottom: 10, color: PageTheme.$red, fontFamily: deffontfamily }, + MPinM_subtitleCon: { flexDirection: 'row', marginLeft: -5, marginBottom: 5, justifyContent: 'center', alignItems: 'center' }, + MPinM_con: { marginBottom: 10, padding: 10, }, + MPinM_otp_inputStyle: { + textAlign: 'center', + backgroundColor: PageTheme.$secondary_color_light, + width: '80%', + borderRadius: 4, + paddingVertical: 10, + paddingHorizontal: 15, + height: 50, + color: PageTheme.$accent_color2, + marginBottom: 10, + marginRight: 10, + fontSize: 25, + }, + MPinM_otp_field: { + flexDirection: 'row', + }, + + // app update modal + appUpdateMStyle: { alignItems: 'center' }, + appUpdateMT_Style: { marginTop: 10, marginBottom: 10, fontSize: 13, fontWeight: "500", color: PageTheme.$text_color }, + appUpdateMT_SubStyle: { paddingHorizontal: 10, marginBottom: 20, fontSize: 12, fontWeight: "400", color: PageTheme.$text_color_light }, + + // Store Cancel visit modal + storelCM_alertCon: { marginBottom: 20, flexDirection: 'row', alignItems: 'center' }, + storelCM_alert: { textAlign: 'center', color: '#ff0000', fontSize: 14, fontWeight: '400', marginLeft: 10, fontFamily: deffontfamily, }, + storelCancelM_titleStyle: { textAlign: 'center', marginTop: 10, fontSize: 14, fontWeight: '500', fontFamily: deffontfamily, }, + storelCancelM_subtitleStyle: { marginBottom: 10, fontSize: 13, fontWeight: '400', color: PageTheme.$primary_color, textTransform: 'capitalize' }, + + // custom modal + customModal: { backgroundColor: PageTheme.$accent_color, width: '80%', borderRadius: 4, elevation: 10, shadowColor: '#000', shadowOpacity: 0.5, padding: 10, shadowOffset: { width: 0, height: 2 }, }, + customModal_Title: { color: PageTheme.$text_color, fontSize: 16, fontWeight: '500', marginBottom: 7, fontFamily: deffontfamily, }, + customModal_Message: { color: PageTheme.$text_color_light, fontSize: 14, fontWeight: '400', marginBottom: 10, fontFamily: deffontfamily, }, + + + // non working rsns style + storeD_Main: { width: '100%', height: '100%', paddingVertical: 10, }, + storeD_storelMain: { width: '100%', paddingHorizontal: 10, }, + storeD_scrollCon: { width: '100%', height: hp('100%') - (340 + EXTRA_SPACE) }, + storeD_scroll: { width: '100%', marginBottom: 20, paddingHorizontal: 10, }, + nonWorking_con: { width: '100%' }, + nonWorking_form: { width: '100%' }, + nonWform_hd: { textAlign: 'left', color: PageTheme.$text_color, fontSize: 15, paddingVertical: 5, paddingHorizontal: 10, fontWeight: '600', marginBottom: 10, fontFamily: deffontfamily, }, + // nonWorking_imgWrap:{width:'100%',height:200,backgroundColor:PageTheme.$text_color_light2,marginTop:20,}, + // nonWorking_form_selectBox:{width:'100%',textAlign:'left',paddingVertical:0,paddingHorizontal:0,padding:0,height:30,color:PageTheme.$accent_color2,}, + nonW_btnWrap: { position: 'absolute', bottom: 10, left: 10, alignItems: 'center', width: '100%', alignItems: 'center' }, + + nonWlist: { position: 'relative', flexDirection: 'row', marginBottom: 10, alignItems: 'center', width: '100%', backgroundColor: PageTheme.$bg_color, elevation: 2, borderRadius: 7, paddingHorizontal: 10, paddingVertical: 10, shadowColor: '#000', shadowOpacity: 0.15, shadowOffset: { width: 0, height: 2 } }, + nonWlist_camera: { position: 'absolute', right: 0, alignItems: 'center', justifyContent: 'center', padding: 10, }, + nonWlist_camera_icon: {}, + nonWlist_Text: { fontSize: 14, color: PageTheme.$text_color, marginRight: 10, fontFamily: deffontfamily }, + + nWselStyle: { backgroundColor: PageTheme.$secondary_color_dark, }, + nWselStyleText: { color: PageTheme.$accent_color }, + + // nonWCapImgModal + nonWCapImgModal: { alignItems: 'center' }, + nonWCapImgModal_title: { fontSize: 14, fontFamily: deffontfamily, }, + nonWCapImgModal_subtitle: { fontFamily: deffontfamily, }, + nonWCapImgModalCon: { width: '100%', alignItems: 'center', position: 'relative' }, + nonWCapImgModal_Camera: { marginTop: 10, marginBottom: 20, padding: 10, }, + nonWCapImgModal_btng: { flexDirection: 'row', justifyContent: 'space-evenly', width: '100%' }, + nonWCapImgModal_Cancel_btn: { marginBottom: 10, paddingHorizontal: 15, paddingVertical: 10, minWidth: 100, backgroundColor: PageTheme.$accent_color, borderColor: PageTheme.$primary_color, borderWidth: 1, borderRadius: 40, elevation: 1 }, + nonWCapImgModal_Cancel_btnText: { textAlign: 'center', color: PageTheme.$primary_color }, + nonWCapImgModal_Save_btn: { marginBottom: 10, paddingHorizontal: 15, paddingVertical: 10, minWidth: 100, backgroundColor: PageTheme.$primary_color, borderRadius: 40, elevation: 1 }, + nonWCapImgModal_Save_btnText: { textAlign: 'center', color: PageTheme.$accent_color }, + nonWCapImgModal_ImgWrap: { marginTop: 10, marginBottom: 20, padding: 10, width: '100%', alignItems: 'center' }, + nonWCapImgModal_Img: { backgroundColor: '#efefef', width: 150, height: 100, resizeMode: 'contain' }, + nonWCapImgModal_CameraSmall: { position: 'absolute', right: 40, top: 0, padding: 5, backgroundColor: PageTheme.$bg_color, borderRadius: 40, elevation: 3 }, + + PromoImgModal_CameraSmall: { position: 'absolute', right: 40, top: 0, padding: 5, backgroundColor: PageTheme.$bg_color, borderRadius: 40, elevation: 3 }, + + // store Distance Modal + storeDistance_Modal: { padding: 20, width: '90%', alignItems: 'center' }, + storeDistanceM_title: { fontSize: 18, fontFamily: deffontfamily, }, + storeDistanceM_Con: { alignItems: 'center' }, + storeDistanceM_message: { fontSize: 14, color: PageTheme.$text_color, fontWeight: '400', textAlign: 'center', fontFamily: deffontfamily }, + storeDistanceM_submessage: { fontSize: 14, fontWeight: '400', textAlign: 'center', color: PageTheme.$text_color, fontFamily: deffontfamily }, + storeDistanceM_btn: { minWidth: 100, paddingHorizontal: 20, paddingVertical: 10, marginTop: 20, backgroundColor: PageTheme.$primary_color, borderRadius: 20, elevation: 3 }, + storeDistanceM_btnText: { textAlign: 'center', color: PageTheme.$accent_color, fontFamily: deffontfamily }, + + // daily_menu + dailymenu_listcon: { width: '100%', alignItems: 'center' }, + dailymenu_list: { paddingHorizontal: 10, marginTop: 10, paddingBottom: 10, }, + dialyMenu_Rows: { width: '100%', flexDirection: 'row', marginBottom: 0 }, + daily_menu_outer: { width: '50%', position: 'relative', padding: 10, }, + + daily_menu_first: {}, + daily_menu_tilebgShadow: { borderRadius: 7, elevation: 3, height: 160, alignItems: 'center', shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.3, backgroundColor: '#0000' }, + daily_menu: { width: '100%', height: '100%', padding: 10, borderRadius: 7, position: 'absolute', top: 0, left: 0 }, + daily_menu_inner: { alignItems: 'center', backgroundColor: PageTheme.$bg_color, borderRadius: 10, paddingHorizontal: 20, paddingVertical: 5, marginTop: -20, marginBottom: 10, elevation: 2, shadowColor: '#000', shadowOffset: { width: 0, height: 0 }, shadowOpacity: 0.2, justifyContent: 'center' }, + daily_menu_inner2: { alignItems: 'center', paddingHorizontal: 20, paddingTop: 25, marginBottom: 10, justifyContent: 'center' }, + daily_menu_innerImgCon: { position: 'absolute', top: 20, width: 90, height: 90 }, + daily_menu_bgImg: { width: '100%', height: '100%' }, + daily_menu_Icon: { width: 80, height: 80 }, + + daily_menu_title: { fontSize: 14, fontWeight: '400', color: PageTheme.$text_color, marginTop: 5, textAlign: 'center', fontFamily: deffontfamily }, + daily_menu_done: { position: 'absolute', width: 31, height: 31, right: 10, top: -10, borderRadius: 15, elevation: 3, shadowColor: '#000' }, + + + // Dail menu Category + + catDMenuI_Wrap: { flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', width: '100%', marginBottom: 10, borderRadius: 4, paddingHorizontal: 10, paddingVertical: 8, backgroundColor: PageTheme.$secondary_color_light, elevation: 1, shadowColor: '#000', shadowOpacity: 0.1, shadowOffset: { width: 0, height: 2 } }, + catDMenuI_CheckBoxCon: { position: 'absolute', width: 25, height: 25, top: 4, left: 5, }, + catDMenuI_CheckBox: { alignSelf: 'flex-start' }, + catDMenuI_CheckBox_pName: { width: '85%', marginLeft: 30 }, + catDMenu_listcon: { width: '100%' }, + catDMenu_list: { marginTop: 10, paddingBottom: 10, }, + catDmenu_scroll: { justifyContent: 'center', paddingBottom: 10, paddingTop: 5 }, + + // opening stock kpi + opening_Stock_wrap: { width: '100%', marginBottom: 10 }, + opening_Stock_scroll: { justifyContent: 'center', padding: 10, paddingBottom: 10, }, + opening_Stock_scrollOuter: { marginBottom: 80, width: wp('100%') }, + opening_Stock_cat: { width: '100%' }, + opening_Stock_catHdr: { width: '100%', position: 'relative' }, + opening_Stock_catHdrIcon: { position: 'absolute', right: 10, top: 5 }, + opening_Stock_catInner: { width: '100%', paddingHorizontal: 10, paddingVertical: 7, backgroundColor: PageTheme.$primary_color, borderRadius: 5, }, + opening_Stock_catText: { fontSize: 14, fontWeight: '500', color: PageTheme.$accent_color }, + + opening_Stock_SubCatHdr: { width: '100%', position: 'relative' }, + opening_Stock_SubCatIcon: { position: 'absolute', right: 10, top: 10 }, + opening_Stock_SubCatInner: { width: '100%', paddingHorizontal: 10, marginTop: 10, paddingVertical: 7, backgroundColor: PageTheme.$primary_color, borderRadius: 5, }, + opening_Stock_SubCatText: { fontSize: 14, fontWeight: '500', color: PageTheme.$text_color, textAlign: 'center' }, + + osCat_actions: { width: '100%', marginVertical: 10, marginTop: 20, paddingBottom: 10, alignItems: 'center', borderBottomColor: PageTheme.$text_color_light2, borderBottomWidth: 1, }, + osCat_action_openCam: {}, + osCat_action_add_image: {}, + osCatImageView: { position: 'relative', backgroundColor: PageTheme.$secondary_color_light, padding: 5, borderRadius: 10, }, + osCat_action_reCap: { position: 'absolute', top: -10, right: -10, padding: 8, backgroundColor: PageTheme.$primary_color, borderRadius: 30, elevation: 2 }, + osCatImage: { width: 80, height: 80, borderRadius: 10, backgroundColor: '#232323' }, + osCat_actn_margin: {}, + osCatImage: { width: 80, height: 80, borderRadius: 10, backgroundColor: '#232323' }, + osCatImage2: { width: 55, height: 47, backgroundColor: 'transparent' }, + opening_Stock_prds: { paddingBottom: 20, }, + openStk_prd_Con: { paddingHorizontal: 10, position: 'relative', marginTop: 10, paddingVertical: 10, backgroundColor: PageTheme.$secondary_color_light, borderRadius: 5, elevation: 1, shadowColor: '#484848', shadowOpacity: 0.1, shadowOffset: { width: 0, height: 2 } }, + openStk_prd_name: { fontSize: 15, color: PageTheme.$text_color, fontWeight: '600' }, + openStk_prd_nameB: { fontSize: 15, color: PageTheme.$text_color, fontWeight: '600', borderBottomColor: PageTheme.$fourth_color, borderBottomWidth: 1, paddingBottom: 5 }, + openStk_prd_name2: { fontSize: 14, color: PageTheme.$text_color, fontWeight: '400', marginTop: 4, }, + openStk_refImageBtn: { position: 'absolute', right: 20, top: 5, width: 40, height: 40, borderRadius: 20, alignItems: 'center', justifyContent: 'center' }, + openStk_prd_form: { marginTop: 10, }, + openStk_prd_row: { width: '100%', flexDirection: 'row', }, + openStk_prd_cols: { width: '100%', }, + openStk_prd_colflex: { + width: '100%', + flexDirection: 'row', + alignItems: 'center', + }, + openStk_prd_col50: { width: '48.5%' }, + openStk_prd_col50_1: { marginRight: 5, }, + openStk_prd_col50_2: { marginLeft: 5 }, + openStkP_checkboxWrap: { flexDirection: 'row', alignItems: 'flex-start', justifyContent: 'flex-start', borderBottomColor: PageTheme.$bg_color, borderBottomWidth: 1, paddingBottom: 10, }, + openStkP_checkbox: { alignSelf: 'flex-start' }, + openStkP_checkboxCon: { position: 'absolute', width: 25, height: 25, top: -5, left: -10, }, + openStkP_checkbox_pName: { width: '85%', marginLeft: 25 }, + openStk_prd_label: { fontSize: 13, color: PageTheme.$text_color_dark, fontWeight: '400' }, + openStk_prd_flexlabel: { marginRight: 10, width: '35%', color: PageTheme.$text_color_dark }, + openStk_prd_inputStyle: { backgroundColor: PageTheme.$bg_color, borderRadius: 4, marginTop: 5, height: 30, paddingVertical: 3, paddingHorizontal: 5, minWidth: 100, color: PageTheme.$text_color }, + openStk_prd_flex_inputStyle: { marginTop: 0, width: '60%' }, + openStk_prd_selectStyle: { backgroundColor: PageTheme.$bg_color, borderRadius: 4, height: 40, minWidth: 100 }, + openStk_prd_selectStyle_item: { height: 40, fontSize: 14, }, + openStk_prd_choiceBoxCon: { height: 40, width: '60%', paddingHorizontal: (Platform.OS == 'ios' ? 10 : 0), }, + openStk_prd_choiceBox: { position: 'relative', backgroundColor: PageTheme.$bg_color, flexDirection: 'row', height: 40, alignItems: 'center', width: '80%', maxWidth: 150, minWidth: 100, borderRadius: 5 }, + openStkCh_con1: { width: '50%', height: '100%', paddingVertical: 5, paddingHorizontal: 10, justifyContent: 'center', borderRadius: 5, }, + openStkCh_text: { textAlign: 'center', color: PageTheme.$text_color, fontFamily: deffontfamily }, + openStkCh_textactive: { color: PageTheme.$accent_color }, + openStkCh_con_red: { backgroundColor: 'red' }, + openStkCh_con_green: { backgroundColor: 'green' }, + openStkCh_con_active: { borderRadius: 5, elevation: 4, shadowColor: '#000', shadowOpacity: 0.4, shadowOffset: { width: 0, height: 2 }, shadowRadius: 5, backgroundColor: '#0000' }, + openStkCh_absolutebg: { position: 'absolute', top: 0, bottom: 0, width: '50%', left: '50%' }, + opening_Stock_btnWrap: { position: 'absolute', bottom: 0, left: 0, right: 0, width: wp('100%'), paddingBottom: 20, alignItems: 'center' }, + openStk_prddetails: { flexDirection: 'row', marginTop: 10, paddingTop: 10, paddingBottom: 10, alignItems: 'center' }, + openStk_prd_borderT: { borderTopColor: PageTheme.$fourth_color, borderTopWidth: 1 }, + openStk_prd_borderB: { borderBottomColor: PageTheme.$fourth_color, borderBottomWidth: 1 }, + openStk_prd_borderL: { borderLeftColor: PageTheme.$fourth_color, borderLeftWidth: 1 }, + openStk_prd_borderR: { borderRightColor: PageTheme.$fourth_color, borderRightWidth: 1 }, + openStk_prdd_wrap: { flexDirection: 'row', alignItems: 'center' }, + openStk_prdd_flabel: { fontSize: 13, fontWeight: '500', color: PageTheme.$secondary_color_dark, marginRight: 10, }, + openStk_prdd_fvalue: { fontSize: 13, fontWeight: '500', color: PageTheme.$secondary_color_dark, marginRight: 10, }, + openStk_prdCameras: { marginTop: 10, flexDirection: 'row', flexWrap: 'wrap' }, + openStkCameraCon: { marginRight: 10, }, + + // Visibility audit + VAudi_prd_choiceBox: { position: 'relative', backgroundColor: PageTheme.$bg_color, flexDirection: 'row', height: 40, alignItems: 'center', width: '100%', maxWidth: "100%", minWidth: 100, borderRadius: 5 }, + VAudi_drTextCon: { position: 'relative', backgroundColor: PageTheme.$fourth_color, paddingHorizontal: 7, flexDirection: 'row', alignItems: 'center', paddingVertical: 5, marginBottom: 10, borderRadius: 4, elevation: 5, shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 }, shadowColor: '#000' }, + + // product cats in Stock with cat screen + prodCatsScroll: { justifyContent: 'center', padding: 10, paddingBottom: 10, }, + prodCatsScroll_Outer: { marginBottom: 5, width: wp('100%') }, + prodCatPageWrap: { alignItems: 'center' }, + prodCatsHdr: { backgroundColor: PageTheme.$primary_color, width: wp('100%') - 20, paddingVertical: 8, paddingHorizontal: 10, marginBottom: 15, borderRadius: 6, elevation: 1, shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.2, }, + prodCatsHdrText: { textAlign: 'center', fontSize: 14, color: PageTheme.$accent_color, fontFamily: deffontfamily }, + prodCatsHdr_Stockprds: { paddingBottom: 10 }, + prdCat_hdIMgWrap: { width: wp('100%') - 20, marginVertical: 10, marginTop: 20, paddingBottom: 10, alignItems: 'center', justifyContent: 'center', borderBottomColor: PageTheme.$text_color_light2, borderBottomWidth: 1, }, + prdCat_hdImgCon: { width: wp('100%'), alignItems: 'center' }, + stockCatDone_check: { position: 'absolute', width: 24, height: 24, right: 10, top: 5, borderRadius: 15, elevation: 3, paddingLeft: 0.2, shadowColor: '#000' }, + + + // SOS + SOS_subCatImgCon: {}, + SOS_imageWrap: { width: '100%', paddingVertical: 10, alignItems: 'center', borderBottomColor: PageTheme.$text_color_light2, borderBottomWidth: 1, }, + + + // Stock + stockPrdInfo: { flexDirection: 'row', width: '100%', paddingHorizontal: 10, paddingVertical: 4, backgroundColor: PageTheme.$fourth_color, borderRadius: 5, }, + stockPrdInfoLabelHd: { fontSize: 13, fontWeight: '500', color: PageTheme.$text_color_dark, marginRight: 10, }, + stockPrdInfoLabel: { fontSize: 13, fontWeight: '500', color: PageTheme.$text_color, }, + + + // shelf talker + st_TextLbl: { marginBottom: 10, }, + + // Stock page + stk_inptSTyle: { textAlign: 'center' }, + stk_inptSTyle_error: { borderColor: 'red', borderWidth: 2 }, + stk_MultiSSTyle_error: { borderColor: 'red', borderWidth: 2, color: '#CCC' }, + stk_mfdView: { marginTop: 10, borderTopColor: PageTheme.$accent_color, borderTopWidth: 2, paddingTop: 10, }, + stk_mfdTbl_hd: { marginBottom: 10, marginTop: 10, color: PageTheme.$text_color, fontSize: 14, fontWeight: '500' }, + stk_mfdTblHeader: { marginBottom: 10, marginTop: 10, backgroundColor: PageTheme.$primary_color, borderRadius: 10, padding: 5, elevation: 3, shadowColor: '#747474', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }, + stk_mfdTblHeaderBox: { width: '24%', height: '100%', alignItems: 'center', backgroundColor: PageTheme.$secondary_color_light, paddingVertical: 5, borderRadius: 5, }, + stk_mfdTblHeaderBox1: {}, + stk_mfdTblHeaderBox2: {}, + stk_mfdTblHeaderBox3: {}, + stk_mfdTblHeaderBox4: {}, + stk_mfdTblHeaderTxt: { fontSize: 13, color: PageTheme.$text_color, marginRight: 5, textTransform: 'capitalize', fontWeight: '700' }, + stk_addStockBtn: { position: 'absolute', right: 0, top: 10, backgroundColor: PageTheme.$primary_color, borderRadius: 4, paddingHorizontal: 10, paddingVertical: 5, elevation: 1, shadowColor: '#747474', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.1 }, + stk_addStockBtnText: { fontSize: 13, fontWeight: '500', color: PageTheme.$accent_color }, + AddStockM_View: { width: '100%', marginBottom: 10, }, + AddStockM_row: { marginBottom: 10, marginTop: 0, width: '100%', paddingHorizontal: 10 }, + AddStockM_label: { color: PageTheme.$text_color, fontSize: 14, fontWeight: '400', marginBottom: 5 }, + AddStockM_col: {}, + AddStockM_MFDInputCon: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }, + AddStockM_MFDInput: { height: 30, alignItems: 'center', justifyContent: 'center', width: '84%', borderRadius: 5, backgroundColor: PageTheme.$secondary_color_light, paddingHorizontal: 10, paddingVertical: 5, color: PageTheme.$text_color }, + AddStockM_DatePicker: { width: 30, height: 30, backgroundColor: PageTheme.$primary_color, alignItems: 'center', justifyContent: 'center', borderRadius: 5 }, + AddStockM_InputStyle: { height: 30, borderRadius: 5, backgroundColor: PageTheme.$secondary_color_light, paddingHorizontal: 10, paddingVertical: 5, color: PageTheme.$text_color }, + AddStockM_cancelBtn: { backgroundColor: PageTheme.$bg_color, borderWidth: 1, borderColor: PageTheme.$primary_color, minWidth: 90 }, + AddStockM_cancelBtnText: { color: PageTheme.$primary_color }, + AddStockM_Btn: { minWidth: 90 }, + + stk_mfdTblBody: { backgroundColor: PageTheme.$bg_color, borderRadius: 5, paddingVertical: 5 }, + stk_mfdTblrow: { marginBottom: 5, borderBottomColor: PageTheme.$secondary_color_light, borderBottomWidth: 1, padding: 5, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }, + stk_mfdTblrow_last: { borderBottomWidth: 0, marginBottom: 0 }, + stk_mfdTblCol: { paddingHorizontal: 10, alignItems: 'center', width: '24%', }, + stk_mfdTblCol1: {}, + stk_mfdTblCol2: {}, + stk_mfdTblCol3: {}, + stk_mfdTblCol4: { height: 35 }, + stk_mfdTblColText: { color: PageTheme.$text_color, fontSize: 13, fontWeight: '400' }, + stk_mfdTbl_DeleteBtn: { position: 'absolute', right: 5, backgroundColor: PageTheme.$bg_color, borderRadius: 20, width: 30, height: 30, alignItems: 'center', justifyContent: 'center', elevation: 2, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.2 }, + + //possale + posS_hdrWrap: { paddingHorizontal: 10 }, + posSale_getdata_btnWrap: { backgroundColor: PageTheme.$sidemenuColor, borderRadius: 5, paddingHorizontal: 20, paddingVertical: 10, width: '40%', alignSelf: 'flex-end', marginHorizontal: 10 }, + posSale_getdata_disable_btnWrap: { backgroundColor: PageTheme.$text_color_light, borderRadius: 5, paddingHorizontal: 20, paddingVertical: 10, width: '40%', alignSelf: 'flex-end', marginHorizontal: 10 }, + picker_design: { width: '65%' }, + text_month: { width: '35%', color: PageTheme.$text_color_dark }, + possale_prd_label: { fontSize: 15, color: PageTheme.$text_color_dark, fontWeight: '400', fontFamily: deffontfamily }, + possale_headerview: {}, + possale_sImageWraps: { flexDirection: 'row' }, + possale_sImagelbl: { marginTop: -70, paddingTop: 5, paddingBottom: 5, borderRadius: 5, backgroundColor: PageTheme.$bg_color, elevation: 2, shadowOpacity: 0.2, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, marginLeft: 20, paddingLeft: 10, paddingRight: 10 }, + possale_sImagelbl2: { marginTop: -70, paddingTop: 5, paddingBottom: 5, borderRadius: 5, backgroundColor: PageTheme.$bg_color, elevation: 2, shadowOpacity: 0.2, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, marginLeft: 80 }, + + possale_sImageWrap: { position: 'absolute', alignItems: 'center', left: 0, right: 0, width: '100%' }, + possale_sImage_View: { position: 'absolute', elevation: 1, backgroundColor: '#fff', borderRadius: 15, padding: 3, shadowOpacity: 0.1, shadowColor: '#000', shadowOffset: { width: 0, height: 2 } }, + + posS_flex_inputStyle: { marginTop: 0, width: '65%', backgroundColor: PageTheme.$secondary_color_light }, + posS_flex_label: { paddingRight: 10, width: '35%', color: PageTheme.$text_color_dark }, + posS_field: { paddingHorizontal: 10 }, + posS_fieldBorder: { borderTopColor: PageTheme.$fourth_color, borderTopWidth: 1, paddingTop: 10, marginTop: 10 }, + posS_flex_inputStyle2: { backgroundColor: PageTheme.$bg_color, width: '50%', borderRadius: 4, marginTop: 5, height: 30, paddingVertical: 3, paddingHorizontal: 5, minWidth: 100, color: PageTheme.$text_color }, + + + // album designs + alumbl: { backgroundColor: PageTheme.$bg_color, elevation: 3, padding: 10, marginBottom: 10, borderRadius: 4 }, + alumblsurvey: { backgroundColor: PageTheme.$bg_color, elevation: 3, padding: 10, marginTop: +10, borderRadius: 4 }, + alumbl_img: { height: 200, width: '100%', resizeMode: 'contain' }, + alumbl_topText: { color: PageTheme.$text_color, fontWeight: '600', fontSize: 14, fontFamily: deffontfamily, }, + alumbl_bottomText: { color: PageTheme.$text_color_light, fontWeight: '400', marginTop: 10, fontSize: 13, fontFamily: deffontfamily, }, + album_ZOOM: { backgroundColor: '#000', width: ('100%'), height: hp('100%'), }, + album_ZOOM_wrap: { backgroundColor: '#000', position: 'absolute', top: 0, left: 0, width: ('100%'), height: hp('100%') + (Platform.OS == 'android' ? STATUSBAR_HEIGHT : 0), zIndex: 1 }, + album_ZOOM_img: { backgroundColor: '#fff', width: '100%', height: 400 }, + album_ZOOM_topBar: { position: 'relative', top:"10%",backgroundColor: '#fff', width: '100%', height: 50, paddingHorizontal: 10, paddingVertical: 15, alignItems: 'center', flexDirection: 'row' }, + album_ZOOM_backBtn: { position: 'absolute', left: 5, padding: 10,zIndex:100 }, + album_ZOOM_indicator: { width: '100%', textAlign: 'center', fontSize: 14, color: PageTheme.$text_color, fontFamily: deffontfamily }, + + // AddVisibilityPresent + addVis_Wrapper: { width: '100%', height: '100%', padding: 10, paddingTop: 0 }, + addvisCon: {}, + addvis_pCon: { flexDirection: 'row', alignItems: 'center', paddingHorizontal: 10, paddingBottom: 10, marginBottom: 10, borderBottomColor: PageTheme.$secondary_color_light, borderBottomWidth: 2, }, + addvis_pText: { width: '40%', color: PageTheme.$text_color, fontWeight: '500', fontSize: 15, fontFamily: deffontfamily }, + addvis_pChoiceBoxCon: { width: '60%', alignItems: 'flex-end' }, + addvis_pChoiceBoxbg: { backgroundColor: '#efefef' }, + addVisForm: { paddingHorizontal: 10, }, + addVisRow: { flexDirection: 'row', width: '100%', flexWrap: 'wrap', justifyContent: 'center' }, + addVisCol50: { width: '47%', marginBottom: 10, }, + addVisCol100: { width: '100%', marginBottom: 10, }, + addVisColspace: { paddingHorizontal: 5 }, + addVisCol1: { marginRight: 5, }, + addVisCol2: { marginLeft: 5, }, + addVisFormGrp: {}, + addVisInputStyle: { height: 40, borderRadius: 5, backgroundColor: PageTheme.$secondary_color_light, paddingHorizontal: 10, color: PageTheme.$text_color, fontFamily: deffontfamily }, + addVisLabel: { color: PageTheme.$text_color, fontSize: 14, fontWeight: '400', marginBottom: 6, fontFamily: deffontfamily }, + addVisPickerStyle: { height: 40, borderRadius: 5, }, + addVisPickerOverlay: { backgroundColor: '#00000057' }, + addVisPicker_OptionContainerStyle: { backgroundColor: '#fff', paddingHorizontal: 0 }, + PV_selectStyle: { width: '60%' }, + PV_selectInputStyle: { backgroundColor: PageTheme.$bg_color, width: '100%' }, + addVisPicker_InputStyle: { backgroundColor: PageTheme.$secondary_color_light, borderRadius: 5, overflow: 'hidden', textAlign: 'center', fontSize: 14, color: PageTheme.$text_color, paddingVertical: 12, paddingHorizontal: 12, fontFamily: deffontfamily }, + addVisPicker_Dis_InputStyle: { backgroundColor: '#bbbbbb' }, + // addVisPickerStyle_and:{backgroundColor:PageTheme.$secondary_color_light,borderRadius:5}, + // addVisPickerStyle_IOS:{height:40,borderRadius:5,fontSize:14,marginLeft:-10}, + addvis_opStyle: { padding: 0 }, + addvis_opTextStyle: { paddingVertical: 8, paddingHorizontal: 10, fontSize: 15, color: PageTheme.$text_color, fontFamily: deffontfamily }, + addvis_selectedOpStyle: { backgroundColor: PageTheme.$secondary_color_light }, + addvis_selectedOpTextStyle: { paddingVertical: 8, paddingHorizontal: 10, color: PageTheme.$primary_color, textAlign: 'center', fontSize: 17 }, + addVisCameras: { flexDirection: 'row', flexWrap: 'wrap' }, + + addVisScroll: { height: hp('100%') - 260 }, + DBVisScroll: { height: hp('100%') - 160 }, + addVisScrollCon: {}, + addVis_btnWrap: { width: '100%', flexDirection: 'row', alignItems: 'center', justifyContent: 'center', paddingBottom: 15, paddingTop: 5, borderBottomColor: PageTheme.$secondary_color_light, borderBottomWidth: 2 }, + addVis_btnWrap2: { borderBottomWidth: 0, justifyContent: 'center' }, + addVis_btn: { paddingHorizontal: 20, minWidth: 100, paddingVertical: 10, borderRadius: 40, backgroundColor: PageTheme.$primary_color, alignItems: 'center', elevation: 2, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.3 }, + addVisBtnText: { fontSize: 14, color: PageTheme.$accent_color, fontFamily: deffontfamily }, + addVis_list: { paddingTop: 10, paddingHorizontal: 10, width: '100%' }, + addVis_listhdrText: { color: PageTheme.$primary_color, fontFamily: deffontfamily }, + addVis_listInner: { marginTop: 10, }, + addVis_listItem: { position: 'relative', backgroundColor: PageTheme.$secondary_color_light, width: '100%', padding: 10, borderRadius: 5, marginBottom: 20, elevation: 2, shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.15, shadowColor: '#000' }, + addVis_listI_row: { flexDirection: 'row', paddingBottom: 5, marginBottom: 5, borderBottomColor: PageTheme.$accent_color, borderBottomWidth: 2, }, + addVis_listI_lastrow: { borderBottomWidth: 0, marginBottom: 0 }, + addVis_listI_Label: { fontSize: 15, fontWeight: '500', color: PageTheme.$secondary_color_dark, marginRight: 5, width: '50%', flexWrap: 'wrap', fontFamily: deffontfamily }, + + addVis_listI_Label2: { fontSize: 15, fontWeight: '500', color: PageTheme.$secondary_color_dark, marginRight: 5 }, + addVis_listI_Val: { fontSize: 14, fontFamily: deffontfamily, fontWeight: '400', color: PageTheme.$text_color, width: '50%', flexWrap: 'wrap' }, + addVis_listI_Val2: { fontSize: 14, fontFamily: deffontfamily, fontWeight: '400', color: PageTheme.$text_color, width: '40%', flexWrap: 'wrap' }, + addVis_listI_Image: { width: 80, height: 80, borderRadius: 5, }, + addVis_listI_row2: { flexDirection: 'row', width: '100%' }, + addVis_listIcol1: { width: '60%' }, + addVis_listIcol2: { width: '40%', paddingLeft: 10, alignItems: 'center' }, + addVis_btnRemove: { padding: 8, alignItems: 'center', justifyContent: 'center', paddingHorizontal: 10, borderRadius: 40, position: 'absolute', right: 0, top: -30, backgroundColor: PageTheme.$accent_color, elevation: 2, shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 } }, + addVis_listPcon: { width: '48%', marginTop: 10, flexDirection: 'row', backgroundColor: PageTheme.$bg_color, paddingVertical: 3, paddingHorizontal: 5, borderRadius: 4, }, + addVis_listPcon1: { marginRight: 5 }, + addVis_listPcon2: { marginLeft: 5 }, + addVis_listR: { flexDirection: "row", marginTop: 10, flexWrap: 'wrap' }, + addVis_listRlbl: { fontSize: 15, fontWeight: '500', color: PageTheme.$secondary_color_dark, marginRight: 5, width: '60%', flexWrap: 'wrap', fontFamily: deffontfamily }, + + contactConvWrap: { paddingHorizontal: 10, paddingTop: 10, width: '100%', height: '100%' }, + contactConvCard: { backgroundColor: PageTheme.$bg_color, elevation: 2, shadowColor: '#000', shadowOpacity: 0.15, borderRadius: 5, shadowOffset: { width: 0, height: 2 }, padding: 10 }, + contactConvCardRow: { flexDirection: 'row', flexWrap: 'wrap' }, + contactConvCardCol: { width: '100%', marginBottom: 10, }, + ccCard_FormGrp: { flexDirection: 'row', alignItems: 'center' }, + ccCard_lbl: { fontSize: 15, fontWeight: '500', color: PageTheme.$secondary_color_dark, width: '45%', paddingRight: 10, flexWrap: 'wrap' }, + ccCard_input: { width: '55%', backgroundColor: PageTheme.$secondary_color_light, borderRadius: 5, overflow: 'hidden', textAlign: 'left', fontSize: 14, color: PageTheme.$text_color, paddingVertical: 12, paddingHorizontal: 12, fontFamily: deffontfamily }, + + // survey list + surveyPageWrapper: { marginTop: 10, paddingTop: 10, backgroundColor: PageTheme.$secondary_color_light, borderTopLeftRadius: 40, borderTopRightRadius: 40, }, + surveyList: { width: '100%' }, + surveyListInner: { justifyContent: 'center', padding: 10, paddingHorizontal: 15, width: '100%' }, + surveyItem: { elevation: 1, shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 }, shadowColor: '#efefef', backgroundColor: '#0000', marginBottom: 10, }, + surveyItem_tile: { flexDirection: 'row', alignItems: 'center', width: '100%', borderRadius: 10 }, + surveyItem_name: { fontSize: 16, fontWeight: '500', color: PageTheme.$text_color, fontFamily: deffontfamily }, + surveyItemCircle: { backgroundColor: '#fff', width: 40, height: 40, borderRadius: 20, alignItems: 'center', justifyContent: 'center', marginRight: 10, }, + surveyItemCircle_Text: { fontSize: 16, fontWeight: '500', color: PageTheme.$primary_color, fontFamily: deffontfamily }, + surveyItem_Check: { position: 'absolute', width: 24, height: 24, right: 10, borderRadius: 15, elevation: 3, paddingLeft: 0.2, shadowColor: '#000' }, + + // survey cat + surveyCatList: { width: '100%', marginTop: 20 }, + surveyCatItem: { elevation: 1, shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 }, shadowColor: '#000', backgroundColor: PageTheme.$bg_color, marginBottom: 10, flexDirection: 'row', alignItems: 'center', borderRadius: 5, paddingHorizontal: 10, paddingVertical: 5 }, + surveyCatItem_name: { fontSize: 14, fontWeight: '500', color: PageTheme.$text_color, paddingRight: 10, width: wp('100%') - 125 }, + surveyCatItem_Circle: { backgroundColor: PageTheme.$secondary_color_light, width: 40, height: 40, borderRadius: 20, alignItems: 'center', justifyContent: 'center', marginRight: 10, }, + surveyCatItem_CircleText: { fontSize: 16, fontWeight: '500', color: PageTheme.$primary_color, }, + surveyCatItem_Check: { position: 'absolute', width: 24, height: 24, right: 10, borderRadius: 15, elevation: 3, shadowColor: '#000' }, + + + // survey toggle view + SurveyView: { position: 'absolute', padding: 10, paddingTop: 30, paddingBottom: 20, top: 20, left: 0, right: 0, width: '100%', height: hp('100%') - (STATUSBAR_HEIGHT + 50), shadowOpacity: 1, shadowColor: '#8d8d8d', shadowRadius: 5, alignItems: 'center', borderTopLeftRadius: 40, borderTopRightRadius: 40, }, + SurveyViewCloseBtn: { position: 'absolute', top: -17, right: 30, paddingHorizontal: 6, paddingVertical: 5, borderRadius: 20, backgroundColor: PageTheme.$primary_color, shadowColor: '#8d8d8d', shadowOpacity: 1, elevation: 2, shadowOffset: { width: 0, height: 2 } }, + SurveyViewContent: { width: '100%' }, + SurveyViewContentInner: { padding: 10, height: hp('100%') - 200 }, + SV_activeSurvey: { position: 'absolute', top: -17, left: 30, shadowColor: '#8d8d8d', shadowOpacity: 1, elevation: 2, shadowOffset: { width: 0, height: 2 }, backgroundColor: '#0000', marginBottom: 10, width: wp('100%') - 115 }, + SV_activeSurvey_tile: { padding: 10, borderRadius: 30, paddingHorizontal: 20, backgroundColor: PageTheme.$primary_color }, + SV_activeSurvey_name: { fontSize: 16, fontWeight: '500', color: PageTheme.$accent_color, fontFamily: deffontfamily }, + + // survey questions + surveyQtnScroll: { width: '100%' }, + surveyQtnScrollInner: { width: '100%', paddingBottom: 10, paddingHorizontal: 5, }, + surveyQtn_InputStyle: { backgroundColor: PageTheme.$secondary_color_light, borderRadius: 5, overflow: 'hidden', textAlign: 'left', fontSize: 14, color: PageTheme.$text_color, paddingVertical: 12, paddingHorizontal: 12, height: 40, fontFamily: deffontfamily }, + + surveyQtn_datePicker_text: { + textAlign: 'left', + width: '100%', + backgroundColor: PageTheme.$secondary_color_light, + paddingVertical: 10, + paddingHorizontal: 10, + color: PageTheme.$accent_color2, + height: '100%', + justifyContent: 'center', + alignItems: 'center', + borderRadius: 5, + fontFamily: deffontfamily + }, + surveyQtn_datePicker: { position: 'absolute', width: 40, height: 40, right: 0, top: 0, backgroundColor: PageTheme.$primary_color, alignItems: 'center', justifyContent: 'center', borderTopRightRadius: 5, borderBottomRightRadius: 5 }, + surveyQtn_datePicker_con: { position: 'relative', justifyContent: 'center', height: 40, }, + surveyQtnRatingIcon: { position: 'absolute', width: 40, height: 40, right: 0, top: 0, backgroundColor: PageTheme.$primary_color, alignItems: 'center', justifyContent: 'center', borderTopRightRadius: 5, borderBottomRightRadius: 5 }, + + // survey Screen View + SVn_ContentCon: { paddingHorizontal: 10, paddingBottom: 70 }, + SVn_ContentOuter: { width: '100%', height: '100%' }, + SVn_ContentInner: { padding: 10 }, + SVn_activeSurvey: { zIndex: 1, position: 'absolute', top: -15, left: 0, right: 0, alignItems: 'center', marginBottom: 10 }, + SVn_activeSurvey_tile: { shadowColor: '#8d8d8d', shadowOpacity: 1, elevation: 2, shadowOffset: { width: 0, height: 2 }, backgroundColor: '#0000', borderRadius: 30, paddingHorizontal: 15, alignItems: 'center', paddingVertical: 7, width: wp('100%') - 50 }, + SVn_SubmitBtn: { position: 'absolute', bottom: Platform.OS == 'ios' ? 30 : 10, left: 0, right: 0, width: '100%', alignItems: 'center' }, + SVn_PageWrapper: { marginTop: 10, paddingTop: 10, backgroundColor: PageTheme.$bg_color, borderTopLeftRadius: 40, borderTopRightRadius: 40, }, + SVn_QtnScroll: { width: '100%', paddingTop: 20 }, + SVn_QtnScrollInner: { width: '100%', paddingBottom: 40, paddingHorizontal: 5, }, + SVn_GroupView: { paddingTop: 20, paddingBottom: 30 }, + SVn_GroupView_hdr: { paddingHorizontal: 10, paddingVertical: 5, alignItems: 'center' }, + SVn_GroupView_hdrText: { fontSize: 13, color: PageTheme.$accent_color, fontFamily: deffontfamily }, + SVn_GroupViewList: { paddingTop: 10, }, + + // Feedback + FeedbVn_GroupView: { paddingBottom: 20 }, + + // RatingModal + RatingModal: { position: 'absolute', zIndex: 99, backgroundColor: '#00000055', alignItems: 'center', justifyContent: 'center', top: 0, left: 0, right: 0, bottom: 0, width: '100%', height: '100%' }, + RatingModalCon: { zIndex: 9999, backgroundColor: PageTheme.$bg_color, borderRadius: 10, padding: 10, width: '80%', elevation: 3, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.3, }, + RatingModalHeding: { textAlign: 'center', fontSize: 14, color: PageTheme.$text_color, fontWeight: '500', marginBottom: 20, marginTop: 10, }, + RModal_list: { padding: 10, }, + RModal_listInner: {}, + RModal_Btns: { flexDirection: 'row', width: '100%', marginTop: 20, marginBottom: 20, justifyContent: 'space-evenly' }, + RModal_BtnCancel: { minWidth: 100, paddingHorizontal: 15, paddingVertical: 7, borderColor: PageTheme.$primary_color, borderWidth: 1, borderRadius: 30, }, + RModal_BtnTextCancel: { textAlign: 'center', fontSize: 14, color: PageTheme.$primary_color, fontWeight: '500' }, + RModal_Btnsave: { minWidth: 100, paddingHorizontal: 15, paddingVertical: 7, backgroundColor: PageTheme.$primary_color, borderRadius: 30, }, + RModal_BtnTextsave: { textAlign: 'center', fontSize: 14, color: PageTheme.$accent_color, fontWeight: '500' }, + RModal_listItem: { paddingHorizontal: 10, paddingVertical: 7, borderRadius: 4, marginBottom: 10, }, + RModal_listItemText: { textAlign: 'center', fontSize: 14, color: PageTheme.$text_color, fontWeight: '500' }, + + // Voice Rcorder + VRModalHeding: { textAlign: 'center', fontSize: 14, color: PageTheme.$text_color, fontWeight: '500', marginTop: 10, }, + VRSubHeding: { textAlign: 'center', fontSize: 12, color: PageTheme.$red, fontWeight: '400', marginBottom: 20, marginTop: 10, }, + VRSubHeding2: { textAlign: 'center', fontSize: 12, color: PageTheme.$primary_color, fontWeight: '400', marginTop: 10, }, + VRMicBgRipple1: { width: 80, height: 80, borderWidth: 5, borderColor: '#f5acb4c2', borderRadius: 40, position: 'absolute', top: 0, left: 0 }, + VRMicBgRipple2: { width: 80, height: 80, borderWidth: 5, borderColor: '#fce6e9e3', borderRadius: 70, position: 'absolute', top: 0, left: 0 }, + + + VoiceRecorder: { width: '100%', alignItems: 'center' }, + VoiceRecorderMic: { padding: 10, }, + VoiceRecorderMicBtn: { width: 60, height: 60, backgroundColor: PageTheme.$red, alignItems: 'center', justifyContent: 'center', borderRadius: 40, elevation: 3, shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 }, shadowColor: '#bdbdbd' }, + VoiceRecorderStopBtn: { width: 60, height: 60, backgroundColor: PageTheme.$red, position: 'absolute', top: 10, left: 10, alignItems: 'center', justifyContent: 'center', borderRadius: 40, elevation: 3, shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 }, shadowColor: '#bdbdbd' }, + VoiceRecordedView: { marginTop: 30, alignItems: 'center', width: '100%' }, + VoiceRecorderTimer: { textAlign: 'center', fontSize: 13, color: PageTheme.$text_color, fontWeight: '400' }, + + VRPlayBack: { alignItems: 'center', flexDirection: 'row', marginTop: 10, paddingTop: 10, borderTopColor: PageTheme.$secondary_color_light, borderTopWidth: 2, width: '100%', paddingHorizontal: 10, }, + VRPlayBackBarView: { width: '70%', alignItems: 'center', }, + VRPlayBackBar: { position: 'relative', width: '100%' }, + VRPlayBackBarBg: { width: '100%', height: 10, borderRadius: 20, backgroundColor: '#efefef' }, + VRPlayBackBarFilled: { width: '10%', position: 'absolute', top: 0, left: 0, height: 10, borderRadius: 20, backgroundColor: PageTheme.$primary_color }, + VRPlayBackTimer: {}, + VRPlayBackControls: { width: '30%', alignItems: 'flex-end' }, + VRPB_Play: { width: 40, height: 40, backgroundColor: PageTheme.$primary_color, alignItems: 'center', justifyContent: 'center', borderRadius: 40, elevation: 3, shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 }, shadowColor: '#bdbdbd' }, + VRPB_Pause: { width: 40, height: 40, backgroundColor: PageTheme.$primary_color, position: 'absolute', top: 0, right: 0, alignItems: 'center', justifyContent: 'center', borderRadius: 40, elevation: 3, shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 }, shadowColor: '#bdbdbd' }, + + SurveyL_SubmitBtn: { position: 'absolute', bottom: Platform.OS == 'ios' ? 30 : 10, left: 10, right: 0, width: '100%', paddingBottom: 20, alignItems: 'center' }, + + // Visitor Login + vl_scrollView: { width: wp('100%') }, + vl_scrollViewInner: { width: '100%', paddingHorizontal: 10, }, + vlPageWrapper: { paddingTop: 10, backgroundColor: PageTheme.$secondary_color_light }, + + vlUinfo_Card: { marginBottom: 10, backgroundColor: PageTheme.$bg_color, borderRadius: 10, padding: 10, elevation: 3, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.15 }, + vlUinfo_CardRow: { flexDirection: 'row', paddingHorizontal: 5, paddingVertical: 5 }, + vlUinfo_CardBorder: { borderBottomColor: PageTheme.$secondary_color_light, borderBottomWidth: 2 }, + vlUinfo_lbl: { fontSize: 14, color: PageTheme.$secondary_color_dark, marginRight: 5, fontFamily: deffontfamily }, + vlUinfo_text: { fontSize: 14, color: PageTheme.$text_color, fontFamily: deffontfamily }, + vlEmplForm: { marginTop: 10, marginBottom: 10, }, + vlEmplFormRow: { flexDirection: 'row', alignItems: 'center', }, + vlEmplForm_field: { width: '80%' }, + vlEmplForm_InputStyle: { marginRight: 10, backgroundColor: PageTheme.$bg_color, borderRadius: 7, elevation: 3, shadowOffset: { width: 0, height: 2 }, shadowColor: '#afafaf', shadowOpacity: 1.15, paddingVertical: 10, paddingHorizontal: 10, color: PageTheme.$text_color }, + vlEmplSearchBtn: { width: '20%', paddingVertical: 10, paddingHorizontal: 10, alignItems: 'center', justifyContent: 'center', backgroundColor: PageTheme.$primary_color, borderRadius: 7, elevation: 3, shadowOffset: { width: 0, height: 2 }, shadowColor: '#747474', shadowOpacity: 1.15 }, + vlEmplSearchBtnText: { fontSize: 14, fontWeight: '500', color: '#fff', }, + + vlEmplList: { marginTop: 10, }, + vlEmplLDtl: { marginBottom: 10, backgroundColor: PageTheme.$primary_color, borderRadius: 10, padding: 10, elevation: 3, shadowColor: '#747474', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0 }, + vlEmplLDtlRow: { flexDirection: 'row', paddingHorizontal: 5, paddingVertical: 5 }, + vlEmplLDtlRow_Lbl: { fontSize: 14, color: PageTheme.$accent_color, marginRight: 5, fontWeight: '700' }, + vlEmplLDtlRow_Text: { fontSize: 14, color: PageTheme.$text_color_light2, marginRight: 5, textTransform: 'capitalize' }, + vlEmplLDtlRow_Border: { borderBottomColor: PageTheme.$secondary_color_light, borderBottomWidth: 1 }, + vlEmplLDtlAct: { paddingTop: 10, flexDirection: 'row', }, + vlED_Act_Cameras: { width: '80%' }, + vlED_Act_CameraCon: { marginRight: 10, marginTop: 5, }, + vlED_Act_openCam: {}, + vlED_Act_ImageView: { position: 'relative', backgroundColor: PageTheme.$secondary_color_light, padding: 5, borderRadius: 10, width: 60, height: 60 }, + vlED_Act_Image: { width: 50, height: 50, borderRadius: 10, backgroundColor: '#232323' }, + vlED_Act_reCap: { position: 'absolute', top: -10, right: -10, padding: 8, backgroundColor: PageTheme.$bg_color, borderRadius: 30, elevation: 2, shadowColor: '#8d8d8d', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.5 }, + vlED_Act_addEmplCon: { width: '20%', justifyContent: 'flex-end' }, + vlED_Act_addEmpl: { height: 40, paddingHorizontal: 10, marginBottom: 5, alignItems: 'center', justifyContent: 'center', backgroundColor: PageTheme.$accent_color, borderRadius: 7, elevation: 3, shadowOffset: { width: 0, height: 2 }, shadowColor: '#efefef', shadowOpacity: 1 }, + vlED_Act_addEmplText: { fontSize: 14, color: PageTheme.$primary_color, textTransform: 'capitalize', fontWeight: '600' }, + + + vl_visitorsList: { marginTop: 10, borderTopColor: PageTheme.$accent_color, borderTopWidth: 2, paddingTop: 10, }, + vl_visitorsListText: { fontSize: 14, color: PageTheme.$secondary_color_dark, marginRight: 5, fontWeight: '500', fontFamily: deffontfamily }, + vl_TblHeader: { marginBottom: 10, marginTop: 10, backgroundColor: PageTheme.$primary_color, borderRadius: 10, padding: 5, elevation: 3, shadowColor: '#747474', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0, flexDirection: 'row', alignItems: 'center' }, + vl_TblHeaderBox: { alignItems: 'center', backgroundColor: PageTheme.$secondary_color_light, paddingVertical: 5, borderRadius: 5, marginTop: 10, marginLeft: 10 }, + vl_TblHeaderBox1: { width: wp('30%') - 15, marginRight: 5 }, + vl_TblHeaderBox2: { width: wp('30%') - 15, marginRight: 5 }, + vl_TblHeaderBox3: { width: '40%' }, + vl_TblHeaderTxt: { fontSize: 13, color: PageTheme.$text_color, marginRight: 5, textTransform: 'capitalize', fontFamily: deffontfamily }, + + vl_TblBody: { backgroundColor: PageTheme.$bg_color, borderRadius: 10, padding: 5, elevation: 3, shadowColor: '#afafaf', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0 }, + vl_visitorsLItem: { flexDirection: 'row', alignItems: 'center', paddingVertical: 10 }, + vl_visitorsLItemB: { borderBottomColor: PageTheme.$secondary_color_light, borderBottomWidth: 1 }, + vl_visitorsLI_Box: { alignItems: 'center', }, + vl_visitorsLI_Box1: { width: wp('30%') - 15, marginRight: 5, alignItems: 'flex-start', paddingLeft: 5, }, + vl_visitorsLI_Box2: { width: wp('30%') - 15, marginRight: 5 }, + vl_visitorsLI_Box3: { width: '40%', flexDirection: 'row', alignItems: 'center', position: 'relative' }, + vl_visitorsLI_Txt: { fontSize: 13, color: PageTheme.$text_color, marginRight: 5, textTransform: 'capitalize', fontWeight: '400' }, + vl_CheckOutBtn: { backgroundColor: PageTheme.$primary_color, marginRight: 5, borderRadius: 10, padding: 5, paddingHorizontal: 10, elevation: 3, shadowColor: '#afafaf', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0 }, + vl_CheckOutBtnText: { color: PageTheme.$accent_color, fontSize: 14, fontWeight: '600' }, + vl_DeleteBtn: { position: 'absolute', right: 5, backgroundColor: PageTheme.$bg_color, borderRadius: 20, width: 35, height: 35, alignItems: 'center', justifyContent: 'center', elevation: 2, shadowColor: '#afafaf', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0 }, + + vl_checkoutModal: { alignItems: 'center', }, + vl_checkoutModalTitle: { fontSize: 14, fontWeight: '500', color: PageTheme.$primary_color, marginBottom: 10, }, + vl_removeModalTitle: { fontSize: 14, fontWeight: '500', color: PageTheme.$text_color, marginBottom: 10, marginTop: 10, }, + vl_removeModalSubTitle: { fontSize: 14, fontWeight: '500', color: PageTheme.$primary_color, marginBottom: 20, }, + vl_checkoutM_Con: { width: '100%' }, + vl_checkoutM_Camera: { alignItems: 'center', }, + vl_checkoutM_CameraCon: {}, + vl_checkoutM_openCam: {}, + vl_checkoutM_ImageView: { position: 'relative', backgroundColor: PageTheme.$secondary_color_light, padding: 5, borderRadius: 10, width: 90, height: 90 }, + vl_checkoutM_Image: { width: 80, height: 80, borderRadius: 10, backgroundColor: '#232323' }, + vl_checkoutM_recap: { position: 'absolute', top: -10, right: -10, padding: 8, backgroundColor: PageTheme.$primary_color, borderRadius: 30, elevation: 2, shadowColor: '#8d8d8d', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.5 }, + vl_checkoutM_btng: { marginTop: 20, }, + vlStatus: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }, + vlStatus2: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }, + + // Dashboard Report Styling + // all reports wrapper + DashB_ReportWrap: { paddingHorizontal: 3 }, + DashB_ReportsHdr: { padding: 15, justifyContent: "center", borderRadius: 5, shadowColor: '#d8d8d8', shadowOpacity: 1, elevation: 1, shadowOffset: { width: 0, height: 2 }, backgroundColor: '#eaf0fe' }, + DashB_ReportsHdrTxt: { color: PageTheme.$primary_color, fontWeight: '600', fontSize: 14, fontFamily: deffontfamily }, + DashB_ReportsHdrIcon: { position: 'absolute', right: 20, shadowColor: '#8d8d8d', shadowOpacity: 1, elevation: 2, shadowOffset: { width: 0, height: 2 }, padding: 4, alignItems: 'center', justifyContent: 'center', backgroundColor: PageTheme.$primary_color, borderRadius: 20 }, + DashB_RefrehsHdrIcon: { shadowColor: '#8d8d8d', paddingLeft: 10, alignItems: 'center', justifyContent: 'center', borderRadius: 20 }, + + // report coontainer + DashB_ReportCon: { padding: 10, marginBottom: 10, marginTop: 10, borderRadius: 5, shadowColor: '#000', shadowOpacity: 1, elevation: 2, shadowOffset: { width: 0, height: 2 }, backgroundColor: PageTheme.$secondary_color_light }, + DashB_DetailReport: { padding: 10, marginBottom: 10, marginTop: 10, borderRadius: 5, backgroundColor: PageTheme.$bg_color }, + + DashB_ReportConNB: { paddingHorizontal: 3, marginBottom: 0, marginTop: 5, borderRadius: 5, backgroundColor: PageTheme.$bg_color }, + DashB_ReportConHdr: { borderBottomWidth: 0, borderBottomColor: PrimaryTheme.$fifth_color, paddingBottom: 0, marginBottom: 0 }, + DashB_ReportConHdrTxt: { color: PageTheme.$text_color_dark, fontWeight: '600', fontSize: 14, fontFamily: deffontfamily }, + DashB_ReportConHdrIcon: { position: 'absolute', right: 10, shadowColor: '#8d8d8d', shadowOpacity: 1, elevation: 2, shadowOffset: { width: 0, height: 2 }, padding: 4, alignItems: 'center', justifyContent: 'center', backgroundColor: PageTheme.$primary_color, borderRadius: 20 }, + DashB_ReportContent: {}, + + // tabular style + DashBTbl_ReportWrap: { width: '100%', minHeight: 40 }, + DashBTbl_ReportColWrap: { width: 100, }, + DashBTbl_ReportColW: { width: 90, }, + DashBTbl_NoDataCon: { width: '100%', alignItems: 'center', justifyContent: 'center', backgroundColor: PageTheme.$bg_color, borderRadius: 10, padding: 5, elevation: 1, shadowColor: '#efefef', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.1, borderColor: "#D6DBE4", borderWidth: 1 }, + DashBTbl_NoDataText: { color: PageTheme.$text_color_light, fontWeight: '500', fontSize: 14, fontFamily: deffontfamily }, + DashBTbl_ReportHdr: { marginBottom: 10, marginTop: 10, backgroundColor: PageTheme.$primary_color, borderRadius: 10, padding: 5, elevation: 3, shadowColor: '#747474', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0, flexDirection: 'row', alignItems: 'center' }, + + DashBTbl_ReportHdrColTxt: { color: PageTheme.$text_color, fontWeight: '600', fontSize: 14, fontFamily: deffontfamily }, + DashBTbl_ReportHdrCol: { alignItems: 'center', height: '100%', marginRight: 2, marginLeft: 2, backgroundColor: PageTheme.$bg_color, paddingVertical: 5, paddingHorizontal: 5, borderRadius: 5, }, + // DashBTab_ReportHdrBox1:{width:wp('40%')-15,marginRight:5}, + // DashBTab_ReportHdrBox2:{width:wp('30%')-15,marginRight:5}, + // DashBTab_ReportHdrBox2:{width:'30%'}, + // report_TblHeaderTxt:{fontSize:13,color:PageTheme.$text_color,marginRight:5,fontWeight:'700',fontFamily:deffontfamily}, + + DashBTblBody: { backgroundColor: PageTheme.$bg_color, borderRadius: 5, padding: 5, elevation: 3, shadowColor: '#5f5f5f', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0 }, + + DashBTblBodyNB1: { paddingVertical: 0, paddingBottom: 8, backgroundColor: '#ACB7C233', borderRadius: 10, }, + DashBTblBodyNB2: { paddingVertical: 10, paddingHorizontal: 5, backgroundColor: PageTheme.$bg_color, borderRadius: 10, borderColor: "#D6DBE4", borderWidth: 1 }, + + DashBTbl_Item: { flexDirection: 'row', alignItems: 'center' }, + DashBTbl_ItemB: { borderBottomColor: PageTheme.$text_color_light2, borderBottomWidth: 1, paddingBottom: 5, marginBottom: 5 }, + DashBTbl_ItemBg: { backgroundColor: PageTheme.$text_color_light2 }, + DashBTbl_ItemCol: { alignItems: 'center', marginRight: 2, marginLeft: 2, width: '100%', height: '100%', borderRadius: 4, paddingVertical: 7, paddingHorizontal: 2 }, + DashBTbl_ItemCol2: { alignItems: 'center', marginRight: 2, marginLeft: 2, justifyContent: 'center' }, + // DashBTbl_ItemBox1:{width:wp('40%')-15,marginRight:5,alignItems:'flex-start',paddingLeft:5,}, + // DashBTbl_ItemBox2:{width:wp('30%')-15,marginRight:5}, + // DashBTbl_ItemBox3:{width:'30%',alignItems:'center'}, + DashBTbl_ItemColText: { fontSize: 14, color: PageTheme.$text_color_900, marginRight: 5, fontWeight: '400', fontFamily: deffontfamily, }, + DashBTbl_ReportColContent: { backgroundColor: PageTheme.$secondary_color_light, borderRadius: 5, padding: 5, marginHorizontal: 2 }, + + // dashboard card style + DashBCard_Wrap: { flexDirection: 'row', paddingVertical: 5, paddingHorizontal: 3 }, + DashBCard_ItemNB1: { width: 180, paddingVertical: 0, paddingBottom: 8, backgroundColor: '#ACB7C233', borderRadius: 10 }, + DashBCard_ItemNB2: { width: 180, paddingHorizontal: 5, backgroundColor: PageTheme.$bg_color, borderRadius: 10, borderColor: "#D6DBE4", borderWidth: 1 }, + + DashBCard_Item: { width: 180, paddingVertical: 5, paddingHorizontal: 10, backgroundColor: PageTheme.$bg_color, borderRadius: 10, elevation: 3, shadowColor: '#878787', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.3, }, + DashBCard_ItemMid: { marginLeft: 5, marginRight: 5 }, + DashBCard_ItemFirst: { marginRight: 5 }, + DashBCard_ItemLast: { marginLeft: 5 }, + DashBCard_Itemhdr: { flexDirection: 'row', paddingHorizontal: 5, borderBottomColor: PageTheme.$fourth_color, paddingBottom: 10, paddingTop: 5, marginBottom: 10 }, + DashBCard_ItemhdrText: { color: PageTheme.$text_color, fontWeight: '600', fontSize: 14, fontFamily: deffontfamily_bold, width: '50%', paddingTop: 20 }, + DashBCard_ItemhdrIcon: { width: '50%', alignItems: 'flex-end', justifyContent: 'flex-start' }, + DashBCard_ItemContent: { paddingHorizontal: 1, }, + DashBCard_IInn_row: { flexDirection: 'row', paddingVertical: 5 }, + DashBCard_DetailIInn_row: { flexDirection: 'row', paddingVertical: 5, justifyContent: 'space-between', alignItems: 'center' }, + DashBCard_IInn_rowdironly: { flexDirection: 'row', alignItems: 'center' }, + + DashBCard_IInn_rowB: { borderBottomColor: PageTheme.$secondary_color_light, marginBottom: 5 }, + DashBCard_IInn_hd: { color: PageTheme.$text_color_900, fontWeight: '600', fontSize: 13, fontFamily: deffontfamily, width: '50%' }, + DashBCard_IInn_valueTxt: { color: PageTheme.$text_color_900, fontWeight: '600', fontSize: 14, fontFamily: deffontfamily_bold, paddingLeft: 5, width: '50%' }, + Dashboard_viewButton: { borderRadius: 20, paddingVertical: 6, paddingHorizontal: 10, borderColor: '#B2BCCE', borderWidth: 1, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', backgroundColor: '#FAFAFA' }, + Dashboard_refrehButton: { borderRadius: 20, paddingVertical: 6, paddingHorizontal: 10, borderColor: '#B2BCCE', borderWidth: 1, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', backgroundColor: '#E9F1FE' }, + + + // PeopleReport + modalContainer: { flex: 1, alignItems: 'center', backgroundColor: 'rgba(0.5, 0.5, 0.5, 0.5)', justifyContent: 'flex-end' }, + modalContent: { backgroundColor: 'white', justifyContent: 'flex-end', width: '100%', borderTopLeftRadius: 10, borderTopRightRadius: 10 }, + modealH2: { flexDirection: 'row', alignItems: 'center', paddingHorizontal: 15 }, + modalH1: { marginVertical: 40, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingHorizontal: 20 }, + centeredView: { flex: 1, justifyContent: 'center', alignItems: 'center', marginTop: 22 }, + modalView: { margin: 20, backgroundColor: 'white', borderRadius: 20, padding: 15, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.25, shadowRadius: 4, elevation: 5 }, + modalText: { marginBottom: 15, textAlign: 'center', color: '#000' }, + modalrow: { flexDirection: 'row', alignItems: 'center', marginBottom: 10 }, + modalInView: { borderColor: '#7CAAF8', borderWidth: 5, padding: 20, borderRadius: 15 }, + // REports + rp_scrollView: { width: '100%', height: '100%' }, + rp_scrollViewInner: { width: '100%', paddingHorizontal: 5 }, + rp_scrollViewInner1: { paddingHorizontal: 5, height: '100%' }, + reportCon: { paddingBottom: 30 }, + reportConHdr: { backgroundColor: PageTheme.$primary_color, borderRadius: 7, paddingVertical: 10, paddingHorizontal: 10, elevation: 3, shadowColor: '#747474', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0, flexDirection: 'row', justifyContent: 'center', marginBottom: 5, marginTop: 5 }, + reportConHdrText: { color: PageTheme.$accent_color, fontSize: 14, fontFamily: deffontfamily }, + report_TblHeader: { marginBottom: 10, marginTop: 10, backgroundColor: PageTheme.$primary_color, borderRadius: 10, padding: 5, elevation: 3, shadowColor: '#747474', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0, flexDirection: 'row', alignItems: 'center' }, + report_TblHeaderBox: { alignItems: 'center', marginRight: 2, marginLeft: 2, height: '100%', backgroundColor: PageTheme.$secondary_color_light, paddingVertical: 5, borderRadius: 5, }, + report_TblHeaderBox1: { width: wp('40%') - 15, marginRight: 5 }, + report_TblHeaderBox2: { width: wp('30%') - 15, marginRight: 5 }, + report_TblHeaderBox3: { width: '30%' }, + report_TblHeaderTxt: { fontSize: 13, color: PageTheme.$text_color, marginRight: 5, textTransform: 'capitalize', fontFamily: deffontfamily }, + + report_TblBody: { backgroundColor: PageTheme.$bg_color, borderRadius: 10, padding: 5, elevation: 3, shadowColor: '#5f5f5f', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0 }, + // report_TblBody:{backgroundColor:PageTheme.$bg_color, borderRadius:10,paddingLeft:5,paddingBottom:'10%',marginBottom:'60%',paddingright:5,paddingTop:5, elevation:3,shadowColor:'#5f5f5f',shadowOffset: { width: 0, height: 2 } , shadowOpacity:1.0}, + reportItem: { flexDirection: 'row', alignItems: 'center', paddingVertical: 10 }, + reportItemB: { borderBottomColor: PageTheme.$secondary_color_light, borderBottomWidth: 1 }, + reportItemBg: { backgroundColor: PageTheme.$text_color_light2 }, + reportItemCol: { alignItems: 'center', marginRight: 2, marginLeft: 2 }, + reportItemCol1: { width: wp('40%') - 15, marginRight: 5, alignItems: 'flex-start', paddingLeft: 5, }, + reportItemCol2: { width: wp('30%') - 15, marginRight: 5 }, + reportItemCol3: { width: '30%', alignItems: 'center' }, + reportItemColText: { fontSize: 13, color: PageTheme.$text_color, marginRight: 5, fontFamily: deffontfamily }, + DYreportItemCol: { alignItems: 'center', marginRight: 1, marginLeft: 1, justifyContent: 'center' }, + DYStSC_RItem: { flexDirection: 'row' }, + + StSC_RtemB: { borderBottomColor: PageTheme.$secondary_color_light, borderBottomWidth: 1 }, + + report_CardsWrap: { marginTop: 10 }, + report_CardI: { padding: 10, marginBottom: 15, backgroundColor: PageTheme.$bg_color, borderRadius: 10, elevation: 3, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.2 }, + report_CITotal: { backgroundColor: PageTheme.$fourth_color, paddingHorizontal: 0, paddingTop: 0, }, + report_CardIRow: { flexDirection: 'row', alignItems: 'center', paddingVertical: 2 }, + report_CardIRow_BorderBtm: { borderBottomColor: PageTheme.$secondary_color_light, borderBottomWidth: 1 }, + report_CIRT_BorderBtm: { borderBottomColor: PageTheme.$text_color_light2, borderBottomWidth: 1 }, + report_CardIRow_Lbl: { fontSize: 14, color: PageTheme.$primary_color, marginRight: 5, fontFamily: deffontfamily }, + report_CardIRow_Val: { fontSize: 13, color: PageTheme.$text_color, marginRight: 5, fontFamily: deffontfamily }, + report_CIR_LblTotal: { color: PageTheme.$accent_color, }, + report_CIR_ValTotal: { color: PageTheme.$accent_color, }, + report_CardITHdr: { backgroundColor: PageTheme.$primary_color, borderTopLeftRadius: 10, paddingHorizontal: 15, paddingVertical: 5, borderTopRightRadius: 10, borderBottomColor: PageTheme.$secondary_color_light, borderBottomWidth: 1, paddingBottom: 5, marginBottom: 10 }, + report_CardITBody: { backgroundColor: PageTheme.$fourth_color, paddingHorizontal: 10 }, + report_CardITHdrText: { fontSize: 16, color: PageTheme.$accent_color, marginRight: 5, fontFamily: deffontfamily }, + + + // report menu + reportMenuCon: { backgroundColor: PageTheme.$bg_color, borderRadius: 10, padding: 5, marginTop: 20 }, + reportMenuItem: { flexDirection: 'row', alignItems: 'center', paddingVertical: 10, justifyContent: 'center', paddingHorizontal: 10, backgroundColor: PageTheme.$primary_color, borderRadius: 6, marginBottom: 15, elevation: 3, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0, }, + reportMenuItemText: { fontSize: 13, fontFamily: deffontfamily, color: PageTheme.$accent_color }, + + + settingsWrap: { padding: 10, paddingHorizontal: 10, }, + settingsBtn: { flexDirection: 'row', alignItems: 'center', position: 'relative', backgroundColor: PageTheme.$secondary_color_light, paddingVertical: 15, paddingHorizontal: 10, borderRadius: 2, elevation: 1, shadowColor: '#afafaf', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.15, marginBottom: 10, }, + settingsBtnText: { fontSize: 15, color: PageTheme.$text_color, fontFamily: deffontfamily }, + settingsBtnIcon: { position: 'absolute', right: 10 }, + + + // network status bar + netSBar: { position: 'absolute', bottom: 0, width: '100%', backgroundColor: '#000', alignItems: 'center', justifyContent: 'center', paddingHorizontal: 10, paddingVertical: 6 }, + netSBarText: { fontSize: 13, fontWeight: '500', color: '#fff' }, + netSBarGreen: { backgroundColor: 'green' }, + netSBarGrey: { backgroundColor: 'red' }, + netSBarGrey_Text: { color: '#fff' }, + netSBarGreen_Text: { color: '#fff' }, + + + // Window styles + Windows_Wrap: {}, + Win_scroll: { justifyContent: 'center', padding: 10, paddingBottom: 10, }, + Win_scrollO: { marginBottom: 80, }, + WItem_wrap: { width: '100%', marginBottom: 20, }, + WItem_Hdr: {}, + WItem_Hdrbg: { width: '100%', paddingHorizontal: 10, paddingVertical: 7, backgroundColor: PageTheme.$primary_color, borderRadius: 5, justifyContent: 'center', position: 'relative' }, + WItem_HdrText: { fontSize: 14, fontWeight: '500', color: PageTheme.$accent_color, width: '90%' }, + WItem_HdrSubTitleText: { fontSize: 13, fontWeight: '400', color: PageTheme.$accent_color, width: '80%', marginTop: 10 }, + WItem_Hdrname2: { fontSize: 14, color: PageTheme.$accent_color, fontWeight: '400', marginTop: 4, }, + WForm: { marginTop: 10, paddingHorizontal: 10, position: 'relative', marginTop: 10, paddingVertical: 10, backgroundColor: PageTheme.$secondary_color_light, borderRadius: 5, elevation: 1, shadowColor: '#484848', shadowOpacity: 0.1, shadowOffset: { width: 0, height: 2 } }, + WItem_RefImgBtn: { position: 'absolute', right: 0, top: -5, width: 40, height: 40, borderRadius: 20, alignItems: 'center', justifyContent: 'center' }, + WSCameraWrap: { justifyContent: 'center' }, + WSCameraCon: {}, + WSCameraLabel: { fontSize: 13, fontWeight: '400', color: '#000', textAlign: 'center', marginTop: 5 }, + WQPicker_InputStyle: { backgroundColor: PageTheme.$bg_color, borderRadius: 5, overflow: 'hidden', textAlign: 'center', fontSize: 14, color: PageTheme.$text_color, paddingVertical: 12, paddingHorizontal: 12 }, + WStkWrap: { backgroundColor: PageTheme.$bg_color, marginBottom: 10, paddingHorizontal: 10, paddingVertical: 5, borderRadius: 5, elevation: 1, shadowColor: '#efefef', shadowOpacity: 0.05, shadowOffset: { width: 0, height: 2 } }, + WStkHdrText: { fontSize: 13, fontWeight: '500', color: PageTheme.$text_color_dark, marginBottom: 10, paddingBottom: 5, borderBottomWidth: 1, borderBottomColor: PageTheme.$secondary_color_light }, + WStkHdrText2: { fontSize: 13, fontWeight: '500', color: PageTheme.$text_color_dark, paddingBottom: 5, }, + WStkHdr_checkboxWrap: { flexDirection: 'row', alignItems: 'flex-start', justifyContent: 'flex-start' }, + WStkHdr_checkbox: { alignSelf: 'flex-start' }, + WStkHdr_checkboxCon: { position: 'absolute', width: 25, height: 25, top: -5, left: -10, }, + WStkHdr_checkboxpName: { width: '85%', marginLeft: 25 }, + WStkHdr_PrdcontentWrap: { borderTopColor: PageTheme.$secondary_color_light, borderTopWidth: 1, marginTop: 5, paddingTop: 5, }, + WStkCon: {}, + WStkInputStyle: { backgroundColor: PageTheme.$secondary_color_light, borderRadius: 5, overflow: 'hidden', textAlign: 'center', fontSize: 14, color: PageTheme.$text_color, paddingVertical: 2, paddingHorizontal: 12, height: 35 }, + windhdrTextCon: { position: 'relative', backgroundColor: PageTheme.$fourth_color, paddingHorizontal: 10, justifyContent: 'center', alignItems: 'center', paddingVertical: 5, marginBottom: 10, borderRadius: 4, elevation: 5, shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 }, shadowColor: '#000' }, + windhdrText: { fontSize: 13, fontWeight: '500', color: PageTheme.$text_color, }, + windhdr_checkAllBtnCon: { alignItems: 'flex-start', marginBottom: 10 }, + windhdr_checkAllBtn: { flexDirection: 'row', backgroundColor: PageTheme.$fourth_color, paddingRight: 10, paddingVertical: 3, alignItems: 'center', justifyContent: 'center', borderRadius: 4, elevation: 2, shadowOpacity: 0.1, shadowOffset: { width: 0, height: 2 }, shadowColor: '#000' }, + windhdr_checkAllBtnText: { marginLeft: 10, fontSize: 13, fontWeight: '500', color: PageTheme.$text_color, }, + WQ_InputStyle: { backgroundColor: PageTheme.$bg_color, borderRadius: 5, overflow: 'hidden', textAlign: 'left', fontSize: 14, color: PageTheme.$text_color, paddingVertical: 12, paddingHorizontal: 12, height: 40 }, + WQ_datePicker_text: { textAlign: 'left', width: '100%', backgroundColor: PageTheme.$bg_color, paddingVertical: 10, paddingHorizontal: 10, color: PageTheme.$accent_color2, height: '100%', justifyContent: 'center', alignItems: 'center', borderRadius: 5 }, + // contact us + ContUs_Wrap: { padding: 10, marginTop: 10, }, + ContUs_Hdr: { backgroundColor: PageTheme.$secondary_color_dark, borderRadius: 4, justifyContent: 'center', alignItems: 'center', paddingVertical: 10, paddingHorizontal: 12 }, + ContUs_HdrText: { color: PageTheme.$accent_color, fontSize: 14, fontWeight: '500' }, + ContUs_infoBox: { backgroundColor: PageTheme.$secondary_color_light, marginBottom: 10, flexDirection: 'row', alignItems: 'center', borderRadius: 5, paddingVertical: 10, paddingHorizontal: 10 }, + ContUs_IB_desc: { marginLeft: 10, flexWrap: 'wrap', width: '85%', color: PageTheme.$text_color }, + + // Image Types + ImageTypesPageWrap: { paddingHorizontal: 10, }, + ImageTypesLHd: { backgroundColor: PageTheme.$primary_color, marginBottom: 10, alignItems: 'center', borderRadius: 5, paddingVertical: 10, paddingHorizontal: 10, elevation: 0.5, shadowOpacity: 0.1, shadowOffset: { width: 0, height: 2 }, shadowColor: '#000' }, + ImageTypesLHdText: { fontSize: 14, fontFamily: deffontfamily, fontWeight: '500', color: PageTheme.$accent_color, textAlign: 'center' }, + + Remarkdirection: { width: wp('100%') - 140 }, + TextRemarkfont: { marginRight: 20, borderRadius: 5, color: PageTheme.$text_color }, + textRemark_background: {}, + textRemark_Input: { fontSize: 14, color: PageTheme.$text_color, backgroundColor: PageTheme.$secondary_color_light, borderRadius: 4, marginTop: 5, fontFamily: deffontfamily }, + + + ImageTypesLOuter: { marginTop: 10, }, + ImageTypesL: {}, + ImageTypesLCon: { position: 'relative', backgroundColor: PageTheme.$secondary_color_light, marginBottom: 10, alignItems: 'center', borderRadius: 5, paddingVertical: 10, paddingHorizontal: 10, elevation: 0.5, shadowOpacity: 0.1, shadowOffset: { width: 0, height: 2 }, shadowColor: '#000', }, + ImageTypesLName: { fontSize: 13, fontWeight: '500', color: PageTheme.$text_color, fontFamily: deffontfamily }, + ImageTypesLImageCountBox: { position: 'absolute', top: 7, right: 10, backgroundColor: PageTheme.$primary_color, width: 25, height: 25, borderRadius: 30, alignItems: 'center', justifyContent: 'center' }, + ImageTypesLImageCountText: { fontSize: 13, fontWeight: '600', color: PageTheme.$accent_color, }, + + // Image Cap Screen + ImageCapCamWrap: { alignItems: 'flex-start', marginTop: 15 }, + ImageCapViewWrap: { alignItems: 'flex-start', marginTop: 20, marginBottom: 80 }, + ImageCapCamCon: { marginRight: 10, }, + ImgCapWrap: { paddingHorizontal: 10, }, + ImgCapCon: {}, + ImgCapBox: {}, + ImgCapBoxTDF: {}, + ImageCapImgViewOuter: { width: '100%', flexDirection: 'row' }, + ImageCapImgView: { position: 'relative', width: 90, padding: 5, borderRadius: 10, marginRight: 20, }, + ImageCapImgViewR: { width: 90, padding: 5, borderRadius: 10, marginRight: 20, }, + ImageCapImgView1: { flexDirection: 'row' }, + ImageCapImgView2: { flexDirection: 'row' }, + ImageCapImgView3: { flexDirection: 'row' }, + ImageCapImg: { width: 80, height: 80, borderRadius: 10, backgroundColor: '#232323', borderWidth: 2, }, + ImageCapImgRemove: { position: 'absolute', top: -10, right: -10, padding: 6, backgroundColor: PageTheme.$red, borderRadius: 30, elevation: 1, shadowColor: '#000', shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 } }, + + + // SOS one app + SOSForm: { width: '100%' }, + SOSheadingsCon: { position: 'relative', backgroundColor: PageTheme.$primary_color, paddingHorizontal: 10, justifyContent: 'center', alignItems: 'center', paddingVertical: 5, marginBottom: 10, borderRadius: 4 }, + SOSheadingsCon2: { backgroundColor: PageTheme.$fourth_color }, + SOSheadingsCon3: { marginBottom: 0 }, + SOSheadingsText: { fontSize: 13, fontWeight: '500', color: PageTheme.$accent_color, }, + SOSheadingsText2: { color: PageTheme.$text_color, }, + SOSHdrForm: { paddingHorizontal: 10, position: 'relative', marginTop: 10, paddingVertical: 10, backgroundColor: PageTheme.$fourth_color, borderRadius: 5, elevation: 1, shadowColor: '#484848', shadowOpacity: 0.1, shadowOffset: { width: 0, height: 2 } }, + SOSChildlist: {}, + SOSInputStyle: { backgroundColor: PageTheme.$bg_color, borderRadius: 5, overflow: 'hidden', fontSize: 14, color: PageTheme.$text_color, paddingVertical: 2, paddingHorizontal: 12, height: 35 }, + SOSlist_form: { marginTop: 10, borderTopColor: PageTheme.$secondary_color_light, borderTopWidth: 1, marginTop: 5, paddingTop: 5, }, + SOSform_row: { width: '100%', flexDirection: 'row', marginBottom: 10 }, + SOSform_colflex: { width: '100%', flexDirection: 'row', alignItems: 'center', }, + SOSform_cols: { width: '100%', }, + SOSform_colsCommon: {}, + SOSform_col1: { width: '30%', paddingRight: 5, }, + SOSform_col2: { width: '70%', paddingLeft: 5 }, + SOSform_collabel: { width: '100%', color: PageTheme.$text_color_dark, fontSize: 13 }, + SOSListHdr: { marginTop: 10, }, + SOShdrImagesWrap: { width: '100%', flexDirection: 'row', flexWrap: 'wrap' }, + SOSChildImagesWrap: { width: '100%', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'center' }, + SOSCameraBtn: { width: 80, height: 80, justifyContent: 'center', alignItems: 'center', backgroundColor: PageTheme.$primary_color, padding: 8, borderRadius: 18, elevation: 2 }, + + + // Attendance + attend_PageWrap: { width: '100%', height: '100%', flex: 1 }, + attend_scrollView: { width: wp('100%'), height: '100%' }, + attend_scrollViewInner: { width: '100%', paddingHorizontal: 10, height: '100%' }, + attenContent: { width: '100%', height: '100%', paddingHorizontal: 10, }, + attend_infoCon: { backgroundColor: PageTheme.$primary_color, paddingHorizontal: 10, paddingVertical: 10, justifyContent: 'center', alignItems: 'center', marginBottom: 10, borderRadius: 4 }, + attend_infoText1: { fontSize: 14, fontWeight: '500', color: PageTheme.$accent_color, fontFamily: deffontfamily }, + attend_infoText2: { fontSize: 13, fontWeight: '500', color: PageTheme.$accent_color, marginTop: 5, fontFamily: deffontfamily }, + selAttBtn: { backgroundColor: PageTheme.$secondary_color_light, paddingHorizontal: 10, paddingVertical: 10, justifyContent: 'center', alignItems: 'center', marginBottom: 10, borderRadius: 4 }, + selAttBtnText: { fontSize: 14, fontFamily: deffontfamily, fontWeight: '500', color: PageTheme.$text_color }, + selAttBtn_selected: { backgroundColor: PageTheme.$primary_color, }, + selAttBtnText_selected: { color: PageTheme.$accent_color, }, + attend_extraDetails: { marginTop: 40 }, + attendList_scrollCon: { width: '100%', height: hp('100%') - 240 }, + attendList_scrollCon2: { width: '100%', height: hp('100%') - 180 }, + attendList_scroll: { width: '100%', marginBottom: 20, paddingHorizontal: 10, }, + + + + // + noticeboard_container: { + flex: 1 + }, + noticeboard_customstylewrapper: { backgroundColor: PageTheme.$bg_color, borderTopLeftRadius: borderRadius, borderTopRightRadius: borderRadius, elevation: 3, flex: 1, }, + noticeboard_background: { borderTopLeftRadius: 20, borderTopRightRadius: 20, shadowColor: '#fff', shadowOffset: { width: 0, height: 2 }, marginTop: -2, shadowOpacity: 0.1, shadowRadius: 2, elevation: 2, paddingVertical: 5, paddingHorizontal: 10 }, + noticeboard_text: { color: 'black', fontSize: 15, fontFamily: deffontfamily }, + + noticeboard_tblHdrparent: { paddingLeft: 5, paddingRight: 5, paddingTop: 10, width: (wp('100%') - 20) / 4 }, + noticeboard_tblHdr: { width: '90%', height: 60, backgroundColor: '#eaf0fe', borderRadius: 10, alignItems: 'center', flexDirection: 'row', justifyContent: 'center' }, + noticeboard_tblHdr2: { paddingBottom: 10 }, + noticeboard_tblIconItem: { alignContent: 'center', alignItems: 'center' }, + noticeboard_tblTextItem: { textAlign: 'center', alignContent: 'center', alignItems: 'center', fontFamily: deffontfamily, fontSize: 10, marginHorizontal: 2, paddingHorizontal: 5, color: PageTheme.$text_color, paddingTop: 5 }, + + //bannerimage + bannerimagebackground: { borderTopLeftRadius: 0, borderTopRightRadius: 0, shadowColor: '#3d3d3d', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.1, shadowRadius: 2, elevation: 2, paddingVertical: 15, paddingHorizontal: 10, width: '100%', marginTop: 0, marginBottom: 10 }, + bannerCard: { width: wp('100%') - 40, height: 172, resizeMode: 'contain', marginRight: 10, soverflow: 'hidden', elevation: 1, borderRadius: 20, shadowColor: '#d3d3d3' }, + bannerCardImg: { width: '100%', height: 170, backgroundColor: '#efefef', borderRadius: 20 }, + //storeperformancecard + + sfimagebackground: { + borderTopLeftRadius: 0, borderTopRightRadius: 0, shadowColor: '#3d3d3d', + shadowOffset: { width: 0, height: 2 }, + shadowOpacity: 0.1, + shadowRadius: 2, elevation: 2, paddingVertical: 15, paddingHorizontal: 10, marginBottom: 10 + }, + sftblHdrparent: { paddingLeft: 5, paddingRight: 5, paddingTop: 10, width: (wp('100%') - 20) / 2 }, + sftblHdr: { width: '100%', height: 140, backgroundColor: PageTheme.$secondary_color_light, borderRadius: 5 }, + sftblIconItem: { alignContent: 'flex-end', alignItems: 'flex-end' }, + sftblTextItem: { fontSize: 12, color: PageTheme.$text_color, marginTop: 15, paddingLeft: 10, fontFamily: deffontfamily }, + sftblTextValue: { fontSize: 30, paddingLeft: 40, color: PageTheme.$text_color, fontFamily: deffontfamily }, + sf_storecol: { flexDirection: 'row', marginTop: 10 }, + + + + //HR + + hr_parentlayout: { backgroundColor: PageTheme.$bg_color, borderRadius: borderRadius, elevation: 4, flex: 1, margin: 10 }, + hr_childlayout: { marginTop: 10, }, + hr_TypesLHdText: { fontSize: 14, color: PageTheme.$accent_color, textAlign: 'center', alignContent: 'center' }, + hr_viewButton: { position: 'absolute', right: 5, backgroundColor: PageTheme.$sidemenuColor, borderRadius: 5, paddingTop: 5, paddingBottom: 5, paddingLeft: 10, paddingRight: 10, alignContent: 'flex-end' }, + hr_LHd: { backgroundColor: '#e3e3e3', height: 2, widh: '80%' }, + hr_viewButtonText: { color: '#fff', fontFamily: deffontfamily }, + hr_scroll: { justifyContent: 'center', paddingBottom: 10 }, + hr_scrollOuter: { marginBottom: 80, width: '100%' }, + hr_flex: { width: '100%', flexDirection: 'column' }, + hr_prd_col100: { width: '100%' }, + hr_prd_colexp: { flexDirection: 'row' }, + hr_prd_flexlabel: { color: PageTheme.$text_color_dark, marginBottom: 1, fontFamily: deffontfamily }, + hrInputStylepdf: { width: '85%', backgroundColor: PageTheme.$secondary_color_light, borderRadius: 5, paddingHorizontal: 12, paddingVertical: 5, textAlign: 'left', textAlignVertical: 'top', marginRight: 5 }, + hrInputStyleexp: { backgroundColor: PageTheme.$secondary_color_light, borderRadius: 5, paddingHorizontal: 12, paddingVertical: 5, textAlign: 'left', textAlignVertical: 'top', fontFamily: deffontfamily }, + hrInputStyle: { backgroundColor: PageTheme.$secondary_color_light, borderRadius: 5, overflow: 'hidden', textAlign: 'left', fontSize: 14, color: PageTheme.$text_color, paddingVertical: 2, paddingHorizontal: 12, height: 35, marginTop: 5, fontFamily: deffontfamily }, + hrScrollView: { width: '100%' }, + hrsearchIcon: { padding: 10, }, + hr_customstylewrapper: { backgroundColor: PageTheme.$bg_color, borderTopLeftRadius: borderRadius, borderTopRightRadius: borderRadius, elevation: 3, flex: 1 }, + hr_SubmitBtn: { position: 'absolute', bottom: Platform.OS == 'ios' ? 30 : 10, left: 10, right: 0, width: '100%', alignItems: 'center', }, + + //resumeview + + resume_customstylewrapper: { backgroundColor: PageTheme.$bg_color, borderTopLeftRadius: borderRadius, borderTopRightRadius: borderRadius, elevation: 3, flex: 1 }, + resume_parentbg: { flexDirection: 'row', flexWrap: 'wrap' }, + resume_background: { width: ((wp('100%') - 20) / 3), paddingHorizontal: 5, }, + resume_cBG_g: { width: '100%', height: '100%', padding: 10, borderRadius: 7, position: 'absolute', top: 0, left: 0 }, + resume_cBG: { shadowColor: '#3d3d3d', shadowOffset: { width: 0, height: 2 }, elevation: 1, marginBottom: 10, alignItems: 'center', backgroundColor: '#0000', borderRadius: 10 }, + // resumev_CircleShape: {width: 50,height: 50,borderRadius: 150 / 2,backgroundColor: '#fff',alignSelf:'center',alignItems:'center', justifyContent:'center'}, + resume_text: { textAlign: 'center', color: '#000', marginTop: 5, fontFamily: deffontfamily }, + resume_textchild: { textAlign: 'center', color: '#000', marginTop: 5, fontSize: 10, fontFamily: deffontfamily }, + resume_aText: { color: PageTheme.$primary_color, fontSize: 20, textAlign: 'center', fontFamily: deffontfamily }, + resume_dateChild: { color: '#000', padding: 2, backgroundColor: '#fff', fontSize: 8, alignSelf: 'flex-end', margin: 5, borderRadius: 4, fontFamily: deffontfamily }, + resume_scrollOuter: { width: '100%', marginBottom: 80 }, + + + + drawerLabel: { + fontSize: 15, + fontWeight: '400', + color: PageTheme.$accent_color2, + marginLeft: 10, + }, + tblHeaderView: { width: '100%', height: 50 }, + + + trainingl: { + flexDirection: 'row', + paddingRight: 10, + marginBottom: 10, + margin: 10, + // borderWidth:2, + // borderColor:PageTheme.$secondary_color_light, + backgroundColor: PageTheme.$bg_color, + borderRadius: 5, + paddingVertical: 10, + alignItems: 'center', + elevation: 5, shadowColor: '#000', shadowOffset: { width: 0, height: 3 }, shadowOpacity: 0.15 + }, + trainingView: { margin: 16, marginVertical: 8, width: '100%' }, + trainingView2: { flexDirection: "column", width: "70%" }, + trainingl_card_title: { + fontSize: 15, + color: PageTheme.$text_color, + fontFamily: deffontfamily + + }, + trainingl_codeText: { fontSize: 12, color: PageTheme.$text_color, marginRight: 5 }, + trainingHdr: { width: "100%", backgroundColor: PageTheme.$primary_color, borderRadius: 7, paddingVertical: 10, paddingHorizontal: 10, elevation: 3, shadowColor: '#747474', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0, flexDirection: 'row', justifyContent: 'center', marginBottom: 5, marginTop: 5 }, + trainingHdrText: { color: PageTheme.$accent_color, fontSize: 14, fontWeight: '500', fontFamily: deffontfamily }, + + //gatemeeting + + gmeet_header: { flexDirection: 'row', borderBottomColor: PageTheme.$secondary_color_dark, borderBottomWidth: 2, paddingVertical: 5, paddingBottom: 10, marginHorizontal: 10 }, + gmeet_scroll: { justifyContent: 'center', paddingBottom: 10 }, + gmeet_scrollOuter: { width: '100%' }, + gmVisCameras: { flexDirection: 'row', justifyContent: 'center' }, + gm_childlayout: { fontFamily: deffontfamily }, + + gm_scrollView: { paddingHorizontal: 10, marginBottom: 100 }, + gm_DisPList: {}, + gm_DiscPWrap: { borderTopWidth: 1, borderTopColor: PageTheme.$secondary_color_light, marginTop: 5, paddingTop: 5, marginBottom: 5, paddingBottom: 10, borderBottomWidth: 1, borderBottomColor: PageTheme.$secondary_color_light }, + gm_DiscProw: { flexDirection: 'row', justifyContent: 'space-between' }, + gm_DiscPInputStyle: { width: '85%', backgroundColor: PageTheme.$secondary_color_light, borderRadius: 5, overflow: 'hidden', textAlign: 'left', fontSize: 14, color: PageTheme.$text_color, paddingVertical: 2, paddingHorizontal: 12, height: 40, fontFamily: deffontfamily }, + gm_DiscPAddBtn: { paddingHorizontal: 10, paddingVertical: 10, borderRadius: 5, width: 50, height: 40, backgroundColor: PageTheme.$primary_color, alignItems: 'center', elevation: 2, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.3 }, + + gm_listI_row: { paddingBottom: 5, marginBottom: 10, borderBottomColor: PageTheme.$accent_color, backgroundColor: PageTheme.$secondary_color_light, padding: 10 }, + gm_btnRemove: { padding: 2, alignItems: 'center', justifyContent: 'center', paddingHorizontal: 5, borderRadius: 40, position: 'absolute', right: 0, top: -30, backgroundColor: PageTheme.$accent_color, elevation: 2, shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 }, marginTop: 35, marginRight: 10 }, + gm_listI_Val: { fontSize: 14, fontWeight: '400', color: PageTheme.$text_color, width: '50%', flexWrap: 'wrap', fontFamily: deffontfamily }, + gm_TblHeaderBox1: { width: '100%', flexDirection: 'row', padding: 2 }, + gm_TblHeaderBox2: { width: '100%', padding: 2 }, + gm_TblHeaderBox3: { width: '100%', padding: 2 }, + gm_TblHeaderBox4: { width: '20%' }, + gm_viewpage: { marginLeft: 5, marginRight: 5 }, + gm_visitorsLI_Box: { alignItems: 'center', }, + gm_visitorsLI_Box1: { width: wp('30%') - 45, alignItems: 'flex-start', paddingLeft: 5, flexDirection: 'column' }, + gm_visitorsLI_Box2: { width: wp('30%') - 15, marginRight: 5 }, + gm_visitorsLI_Box3: { width: '40%', flexDirection: 'row', alignItems: 'center', position: 'relative' }, + gm_CheckOutBtn: { backgroundColor: PageTheme.$primary_color, borderRadius: 20, padding: 5, paddingHorizontal: 20, elevation: 3, shadowColor: '#afafaf', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0 }, + gm_DeleteBtn: { position: 'absolute', borderRadius: 20, width: 35, height: 35, justifyContent: 'flex-end', alignSelf: 'flex-end', shadowOpacity: 1.0, }, + gm_TblHeader: { marginBottom: 10, marginTop: 10, borderRadius: 2, padding: 5, elevation: 1, shadowColor: '#747474', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0, flexDirection: 'column', margin: 5 }, + gm_visitorsLItem: { column: 'row', alignItems: 'center', paddingVertical: 10 }, + gm_TblHeaderTxt2: { flexWrap: 'wrap', width: '100%', color: PageTheme.$text_color, fontWeight: '400', marginTop: 3, marginBottom: 5, fontSize: 13, fontFamily: deffontfamily }, + gm_TblHeaderTxt: { flexWrap: 'wrap', width: '50%', color: PageTheme.$text_color, fontWeight: '400', fontSize: 13, fontFamily: deffontfamily }, + vlStatus: { flexDirection: 'row', alignItems: 'flex-end', justifyContent: 'flex-end' }, + vlStatus2: { flexDirection: 'row', alignItems: 'flex-end', justifyContent: 'flex-end' }, + gm_TblHeaderTxt3: { marginTop: 5, marginLeft: 2, marginRight: 2, backgroundColor: PrimaryTheme.$secondary_color_light, borderRadius: 2, paddingTop: 3, paddingBottom: 3, paddingLeft: 10, paddingRight: 10, elevation: 1, shadowColor: '#afafaf', flexDirection: 'column', marginBottom: 5, color: PrimaryTheme.$primary_color, fontFamily: deffontfamily }, + + //attendancesupervisor + attsupdate_Text: { fontWeight: 500, fontSize: 14, color: PageTheme.$primary_color }, + attsupdate_HText: { fontSize: 14, color: PageTheme.$secondary_color_dark, marginRight: 5, fontWeight: '500', fontSize: 15, }, + attsup_HText: { flexDirection: 'row', marginLeft: 5, padding: 5, marginRight: 5, borderRadius: 10 }, + attsup_HeaderTxt: { fontSize: 13, color: PageTheme.$text_color, marginRight: 5, textTransform: 'capitalize', fontWeight: '700' }, + attsup_TblHeader: { backgroundColor: PageTheme.$primary_color, borderRadius: 10, paddingBottom: 5, elevation: 3, shadowColor: '#747474', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0, flexDirection: 'row', alignItems: 'center', marginLeft: 4, marginRight: 4, marginTop: 10 }, + attsup_HeaderBox: { alignItems: 'center', backgroundColor: PageTheme.$secondary_color_light, paddingVertical: 5, borderRadius: 5, marginTop: 5, }, + attsup_HeaderBox1: { width: (wp('100%') / 3) - 10, marginLeft: 7 }, + attsup_HeaderBox2: { width: (wp('100%') / 3) - 10, marginLeft: 4 }, + attsup_HeaderBox3: { width: (wp('100%') / 3) - 10, marginLeft: 4 }, + attsup_View: { backgroundColor: PageTheme.$primary_color, height: 2, marginTop: 5, weight: '100%,', borderColor: '#000', marginRight: 5, marginLeft: 5 }, + attsup_TblBody: { backgroundColor: PageTheme.$bg_color, borderRadius: 10, padding: 5, elevation: 3, shadowColor: '#afafaf', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1.0, marginLeft: 5, marginRight: 5, marginTop: 5 }, + attsup_Txt: { fontSize: 13, color: PageTheme.$text_color, textTransform: 'capitalize', fontWeight: '400', marginLeft: 10 }, + attsup_Box1: { width: (wp('100%') / 3) - 10 }, + attsup_Box2: { width: (wp('100%') / 3) - 10 }, + attsup_Box3: { width: (wp('100%') / 3) - 10, alignItems: 'center' }, + + attsup_statusCon: { flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-end' }, + attsup_utext: { flexDirection: 'column', color: 'green', fontWeight: '500', textAlign: 'right' }, + attsup_ntext: { flexDirection: 'column', color: 'red', fontWeight: '500', textAlign: 'right' }, + attsup_vtext: { width: '100%', margin: 2, padding: 5 }, + attsup_dl: { width: 120, marginLeft: 5 }, + + + + + + + + + + + + + // text: { + // padding: 12, + // fontSize: 22, + // textAlign: 'center', + // fontWeight: 'bold', + // color: 'black' + // } + + }); +} + +export const customeButtons = (isDarkTheme = defdt, routeName = defrn) => { + const PageTheme = GetPageTheme(isDarkTheme, routeName); + return StyleSheet.create({ + buttonStyle: { + backgroundColor: PageTheme.$primary_color, + elevation: 5, shadowColor: PageTheme.$primary_color, shadowOffset: { width: 0, height: 5 }, shadowRadius: 7, shadowOpacity: 0.4, + borderRadius: 40, width: wp('85%'), height: 50, display: 'flex', marginTop: 25, alignItems: 'center', justifyContent: 'center' + }, + textStyle: { color: PageTheme.$text_color_100, textAlign: 'center', fontSize: 15, padding: 10, }, + g_buttonStyle: { + marginTop: 25, height: 50, shadowColor: PageTheme.$primary_color, shadowRadius: 7, shadowOffset: { width: 0, height: 5 }, shadowOpacity: 0.4, borderRadius: 40, backgroundColor: '#0000' + }, + g_linearGradient: { + backgroundColor: PageTheme.$primary_color, + elevation: 5, shadowColor: PageTheme.$primary_color, + borderRadius: 40, width: wp('85%'), display: 'flex', height: '100%', alignItems: 'center', justifyContent: 'center' + }, + g_textStyle: { color: PageTheme.$text_color_100, textAlign: 'center', fontSize: 15, padding: 10, fontFamily: deffontfamily }, + + + }); +} + +// export const customCamera = (isDarkTheme = defdt, routeName = defrn) => { +// const PageTheme = GetPageTheme(isDarkTheme, routeName); +// const bottomBarHeight = 100, imageControlBarHeight = 60; +// const topBarHeight = Platform.OS == 'ios' ? STATUSBAR_HEIGHT + 40 : 40; +// const topBarHeight2 = Platform.OS == 'ios' ? STATUSBAR_HEIGHT : 0; +// return StyleSheet.create({ +// IOS_StatusBar: { height: STATUSBAR_HEIGHT, width: wp('100%'), backgroundColor: 'transparent', zIndex: 100000, position: 'absolute', left: 0, top: 0, right: 0 }, +// scrollMain: { flex: 1, backgroundColor: '#000', width: '100%', height: '100%', +// position: 'absolute', +// zIndex: 99999, +// }, +// // scrollMainInner:{alignItems:'center',height:'100%'}, +// btnStyle: { backgroundColor: '#0096d7', paddingVertical: 10, paddingHorizontal: 30, borderRadius: 20, marginTop: 50, elevation: 5, shadowColor: '#232323', shadowOffset: { width: 0, height: 2 } }, +// btnText: { color: '#fff' }, +// imgView: { flex: 1, height: 300, width: '100%', marginTop: 100, paddingHorizontal: 20 }, +// image: { width: '100%', height: 300, backgroundColor: '#efefef' }, +// customCamera_Wrap: { position: 'absolute', backgroundColor: '#000', top: 0, left: 0, right: 0, bottom: 0, zIndex: 9999 }, +// customCamera: { position: 'absolute', top: 0, left: 0, right: 0, bottom: 100 }, +// customCameraLS: { top: 0, bottom: 0 }, +// customCameraTop: { top: Platform.OS == 'ios' ? STATUSBAR_HEIGHT : 0, }, +// customCamera_bottomBar: { padding: 10, flexDirection: 'row', backgroundColor: 'transparent', height: bottomBarHeight, position: 'absolute', bottom: 0, width: '100%', alignItems: 'center', justifyContent: 'center' }, +// customCamera_bottomBarLS: { padding: 10, flexDirection: 'row', backgroundColor: 'transparent', height: bottomBarHeight, position: 'absolute', top: "35%", width: '100%', alignItems: 'flex-end', justifyContent: 'flex-end' }, +// customCamera_capbtn: { elevation: 4, shadowColor: '#efefef', width: 60, height: 60, borderRadius: 30, }, +// customCamera_capbtn_Outer: { width: 60, height: 60, borderRadius: 30, backgroundColor: '#e4e4e4', paddingLeft: 5, paddingTop: 5 }, +// customCamera_capbtn_Inner: { width: 50, height: 50, borderRadius: 30, backgroundColor: '#fff' }, +// customCamera_Gallerybtn: { elevation: 4, shadowColor: '#efefef', width: 60, height: 60, borderRadius: 30, position: 'absolute', right: 30 }, +// customCamera_Gallerybtn_Outer: { width: 60, height: 60, borderRadius: 30, backgroundColor: '#e4e4e4', paddingLeft: 5, paddingTop: 5 }, +// customCamera_Gallerybtn_Inner: { width: 50, height: 50, borderRadius: 30, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center' }, +// customCamera_Gallerybtn_Icon: { marginTop: -2, marginLeft: -2 }, + +// customCamera_bottomBar2: { paddingVertical: 5, paddingHorizontal: 10, backgroundColor: '#5c5c5cb3', height: imageControlBarHeight, position: 'absolute', bottom: 0, width: '100%', justifyContent: 'center' }, +// imgControls_btnCon: { minWidth: 100, paddingHorizontal: 10 }, +// imgControls_btn: { alignItems: 'center' }, +// imgControls_btnText: { fontSize: 13, fontWeight: '400', color: '#fff', textAlign: 'center' }, +// imgControls: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }, +// cameraImgCaptured: { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }, +// icbtTop: { marginTop: 0, }, +// imgControls_centerBtn: { marginTop: -15, minWidth: 100, paddingHorizontal: 10 }, +// imgControls_retakeBtn: { width: 40, height: 40, borderRadius: 30, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', elevation: 2, shadowColor: '#000', shadowOpacity: 0.2, shadowOffset: { width: 0, height: 2 } }, +// // flashBtn:{width:35,height:35,borderRadius:30,backgroundColor:'#fff',alignItems:'center',justifyContent:'center',elevation:4,shadowColor:'#fff',shadowOpacity:0.3,shadowOffset:{width:0,height:2}}, +// flashBtn: { padding: 5, backgroundColor: '#4c4c4cdb', borderRadius: 30, width: 40, height: 40, marginBottom: 10, elevation: 2, alignItems: 'center', justifyContent: 'center', shadowColor: '#000', shadowOpacity: 0.3, shadowOffset: { width: 0, height: 2 } }, +// topControls: { position: 'absolute', top: 0, backgroundColor: 'transparent', width: '100%', height: topBarHeight }, +// topControlsInner: { flexDirection: 'row', paddingVertical: 5, paddingHorizontal: 10, justifyContent: 'center' }, +// sideControls: { position: 'absolute', right: 0, top: '40%', backgroundColor: 'transparent', padding: 10 }, +// sideControl: { position: 'absolute', right: 0, top: '0%', backgroundColor: 'transparent', padding: 10 }, +// sideControlsInner: {}, + + +// }); +// } + +export const customCamera=(isDarkTheme=defdt,routeName=defrn)=>{ + const PageTheme=GetPageTheme(isDarkTheme,routeName); + const bottomBarHeight=100,imageControlBarHeight=60; + const topBarHeight=Platform.OS=='ios'?STATUSBAR_HEIGHT+40:40; + const topBarHeight2=Platform.OS=='ios'?STATUSBAR_HEIGHT:0; + return StyleSheet.create({ + IOS_StatusBar:{height:STATUSBAR_HEIGHT,width:wp('100%'),backgroundColor:'transparent',zIndex:100000,position:'absolute',left:0,top:0,right:0}, + CameraWrapper:{flex: 1,backgroundColor: '#000',width:'100%',height:'100%',position:'absolute',zIndex:9999,top:0,left:0,right:0}, + CameraWrapperHide:{zIndex:0,opacity:0}, + scrollMain:{flex: 1,backgroundColor: '#000',width:'100%',height:'100%',position:'absolute',zIndex:99999,top:0,left:0,right:0}, + // scrollMainInner:{alignItems:'center',height:'100%'}, + btnStyle:{ backgroundColor:'#0096d7',paddingVertical:10,paddingHorizontal:30,borderRadius:20,marginTop:50,elevation:5,shadowColor:'#232323',shadowOffset:{width:0,height:2}}, + btnText:{color:'#fff'}, + imgView:{flex:1,height:300,width:'100%',marginTop:100,paddingHorizontal:20}, + image:{width:'100%',height:300,backgroundColor:'#efefef'}, + customCamera_Wrap:{position:'absolute',backgroundColor:'#000',top:0,left:0,right:0,bottom:0,zIndex:9999}, + customCamera:{position:'absolute',top:0,left:0,right:0,bottom:100}, + customCameraLS:{top:0,bottom:0}, + customCameraTop:{top:Platform.OS=='ios'?STATUSBAR_HEIGHT:0,}, + customCamera_bottomBar:{padding:10,flexDirection:'row',backgroundColor:'transparent',height:bottomBarHeight,position:'absolute',bottom:0,width:'100%',alignItems:'center',justifyContent:'center'}, + customCamera_bottomBarLS:{padding:10,flexDirection:'row',backgroundColor:'transparent',height:bottomBarHeight,position:'absolute',top:"35%",width:'100%',alignItems:'flex-end',justifyContent:'flex-end'}, + customCamera_capbtn:{elevation:4,shadowColor:'#efefef',width:60,height:60,borderRadius:30,}, + customCamera_capbtn_Outer:{width:60,height:60,borderRadius:30,backgroundColor:'#e4e4e4',paddingLeft:5,paddingTop:5}, + customCamera_capbtn_Inner:{width:50,height:50,borderRadius:30,backgroundColor:'#fff'}, + customCamera_Gallerybtn:{elevation:4,shadowColor:'#efefef',width:60,height:60,borderRadius:30,position:'absolute',right:30}, + customCamera_Gallerybtn_Outer:{width:60,height:60,borderRadius:30,backgroundColor:'#e4e4e4',paddingLeft:5,paddingTop:5}, + customCamera_Gallerybtn_Inner:{width:50,height:50,borderRadius:30,backgroundColor:'#fff',alignItems:'center',justifyContent:'center'}, + customCamera_Gallerybtn_Icon:{marginTop:-2,marginLeft:-2}, + + customCamera_bottomBar2:{paddingVertical:5,paddingHorizontal:10,backgroundColor:'#5c5c5cb3',height:imageControlBarHeight,position:'absolute',bottom:0,width:'100%',justifyContent:'center'}, + imgControls_btnCon:{minWidth:100,paddingHorizontal:10}, + imgControls_btn:{alignItems:'center'}, + imgControls_btnText:{fontSize:13,fontWeight:'400',color:'#fff',textAlign:'center',fontFamily:deffontfamily}, + imgControls:{flexDirection:'row',alignItems:'center',justifyContent:'space-between'}, + cameraImgCaptured:{position:'absolute',top:0,left:0,right:0,bottom:0}, + icbtTop:{marginTop:0,}, + imgControls_centerBtn:{marginTop:-15,minWidth:100,paddingHorizontal:10}, + imgControls_retakeBtn:{width:40,height:40,borderRadius:30,backgroundColor:'#fff',alignItems:'center',justifyContent:'center',elevation:2,shadowColor:'#000',shadowOpacity:0.2,shadowOffset:{width:0,height:2}}, + // flashBtn:{width:35,height:35,borderRadius:30,backgroundColor:'#fff',alignItems:'center',justifyContent:'center',elevation:4,shadowColor:'#fff',shadowOpacity:0.3,shadowOffset:{width:0,height:2}}, + flashBtn:{padding:5,backgroundColor:'#4c4c4cdb',borderRadius:30,width:40,height:40,marginBottom:10,elevation:2,alignItems:'center',justifyContent:'center',shadowColor:'#000',shadowOpacity:0.3,shadowOffset:{width:0,height:2}}, + topControls:{position:'absolute',top:0,backgroundColor:'transparent',width:'100%',height:topBarHeight}, + topControlsInner:{flexDirection:'row',paddingVertical:5,paddingHorizontal:10,justifyContent:'center'}, + sideControls:{position:'absolute',right:0,top:'40%',backgroundColor:'transparent',padding:10}, + sideControl:{position:'absolute',right:0,top:'0%',backgroundColor:'transparent',padding:10}, + sideControlsInner:{}, + or_icon:{position:'absolute',top:10,right:10,padding:7,borderRadius:40,backgroundColor:'#4c4c4ccc'} + + + }); +} + +export const ModalStyles = (isDarkTheme = defdt, routeName = defrn) => { + const PageTheme = GetPageTheme(isDarkTheme, routeName); + return StyleSheet.create({ + centeredView: { + backgroundColor: 'rgba(0,0,0,0.5)', + flex: 1, + justifyContent: "center", + alignItems: "center", + }, + modalView: { + margin: 20, + backgroundColor: "white", + borderRadius: 10, + padding: 35, + alignItems: "center", + shadowColor: "#000", + shadowOffset: { + width: 0, + height: 2 + }, + shadowOpacity: 0.25, + shadowRadius: 4, + elevation: 5 + }, + button: { + paddingLeft: 40, + paddingRight: 40, + elevation: 2 + }, + buttonOpen: { + backgroundColor: "#F194FF", + }, + buttonClose: { + backgroundColor: "#2196F3", + }, + textStyle: { + color: "white", + fontWeight: "bold", + textAlign: "center" + }, + modalText: { + marginBottom: 15, + textAlign: "center", + color: "#000", + } + }); +} + diff --git a/src/styles/Global_LS.js b/src/styles/Global_LS.js new file mode 100644 index 0000000..b655b7e --- /dev/null +++ b/src/styles/Global_LS.js @@ -0,0 +1,1699 @@ +import { PrimaryTheme,MainThemeLight,DarkTheme } from "./Themes"; +import {Platform, StatusBar,StyleSheet} from 'react-native'; +import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen'; +const defdt=false,defrn=''; +export const GetPageTheme=(isDarkTheme=defdt,routeName=defrn)=>{ + let PageTheme=(routeName=='Project'?MainThemeLight:(isDarkTheme==true?DarkTheme:PrimaryTheme)); + return PageTheme; +}; + +export const WP=wp; +export const HP=hp; +const borderRadius=20; +export const STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 25 : StatusBar.currentHeight; +const EXTRA_SPACE = Platform.OS === 'ios' ? 20 : 0; +const EXTRA_SPACE_MD= Platform.OS === 'ios' ? 40 : 0; +export const globalStyles=(isDarkTheme=defdt,routeName=defrn)=>{ + const PageTheme=GetPageTheme(isDarkTheme,routeName); + return StyleSheet.create({ + statusBar:{height:STATUSBAR_HEIGHT,width:wp('100%')}, + drawerScreenHdr_bg:{backgroundColor:'#000', borderBottomWidth:0,borderBottomColor:PrimaryTheme.$secondary_color_light,paddingHorizontal:10,paddingBottom:5,paddingTop:STATUSBAR_HEIGHT+10}, + dScreenHdr_Content:{flexDirection:'row',alignItems:'center',position:'relative'}, + drawerScreenHdr_title:{width:'100%',textAlign:'left',fontSize:16,fontWeight:'500',color:PageTheme.$accent_color,paddingLeft:50,paddingRight:100}, + dScreen_LeftContainer:{position:'absolute',left:0}, + toggleDrawerBtn:{paddingVertical:5,paddingHorizontal:10}, + dScreen_RightContainer:{position:'absolute',right:0,flexDirection:'row',alignItems:'center'}, + drawerProjectId:{fontSize:14,fontWeight:'500',color:PageTheme.$accent_color,paddingHorizontal:5}, + drawerNotifIcon:{marginLeft:5,padding:5}, + drawerContent: { + flex: 1, + marginTop: -10, + paddingTop:0, + }, + drawerContentScroll:{}, + drawerContentScrollInner:{paddingTop:10,padding:0}, + cardTitle: { + fontWeight:'normal', + fontSize: hp('1.8%'), + }, + cardImage: { + width: 30, + height: 30, + resizeMode: 'contain', + }, + title: { + fontSize: 15, + marginTop: 10, + fontWeight:'500', + textTransform:'capitalize', + color:PageTheme.$text_color, + textAlign:'center', + marginLeft:-5 + }, + caption: { + fontSize: hp('1.7%'), + lineHeight: 14, + }, + row: { + marginTop: 20, + flexDirection: 'row', + alignItems: 'center', + }, + section: { + flexDirection: 'row', + alignItems: 'center', + marginRight: 15, + }, + paragraph: { + fontWeight: 'bold', + marginRight: 3, + }, + drawerSection: { + marginTop: 7, + borderBottomColor:'#fff', + borderBottomWidth:0, + }, + bottomDrawerSecion: { + borderTopColor: '#f4f4f4', + borderTopWidth: 1, + borderBottomWidth:0, + marginBottom:0, + }, + bottomDrawerCon:{ + padding:5, + flexDirection:'column', + alignItems:'center', + }, + bottomDrawerIcon:{ + width: '50%', + height: 30, + resizeMode: 'contain', + }, + bottomDrawerLabel:{ + fontSize: 14, + color:PageTheme.$text_color, + }, + preferenceCon:{ + padding:10, + }, + preferenceTitle:{ + fontSize:14, + color:PageTheme.$text_color, + }, + preference: { + flexDirection: 'row', + justifyContent: 'space-between', + marginTop: 12, + }, + userInfoSection: { + padding: 0, + borderBottomColor: '#f4f4f4', + borderBottomWidth: 1, + }, + container: { + flex: 1,alignItems: 'center',backgroundColor: PageTheme.$accent_color, + }, + logo: { + resizeMode: 'contain', + width: wp('50%') + }, + drawerIcon: { + width: 30, + height: 30, + left: 2, + position: "absolute", + paddingLeft: 15 + + }, + inputStyle: { + width: wp('85%'), + height: hp('8%'), + marginBottom: 12, + }, + otpStyle: { + marginBottom: 12, + borderRadius: 8, + width: wp('15%'), + height: hp('7%'), + }, + drawerItemStyle:{ + flexDirection:'row', + paddingHorizontal:10, + paddingVertical:8.5, + alignItems:'center', + // height:35, + }, + drawerLogo: { + width: wp('50%')-20, + height: 60, + resizeMode: 'contain', + // borderWidth:1, + // borderColor:'#000' + }, + drawerItemIcon:{width:30,justifyContent:'center',flexDirection:'row'}, + drawerLabel: { + fontSize: 15, + fontWeight:'400', + color:PageTheme.$accent_color2, + marginLeft:10, + }, + otpContainer: { + width: wp('85%'), + flexDirection: 'row', + flexWrap: 'wrap', + justifyContent: 'space-between' + }, + labelStyle: { + color: PageTheme.$text_color_700, + textAlign: 'left', + width: wp('85%'), + fontSize: hp('1.7%'), + marginBottom: 20, + justifyContent: 'flex-start' + }, + + }); +} + +export const customStyles=(isDarkTheme=defdt,routeName=defrn)=>{ + const PageTheme=GetPageTheme(isDarkTheme,routeName); + return StyleSheet.create({ + drawerSubTitle:{ + fontSize:12, + color:PageTheme.$text_color + }, + loginIllutration:{ + // marginTop:20, + }, + performics_logo:{ + width:wp('50%'), + height:40, + marginTop:20, + resizeMode:'contain', + }, + company_logo:{width:wp('100%')-40,height:100,resizeMode:'contain'}, + loginScrollCon:{ + flex:1, + width:wp('100%'), + }, + loginCon:{ + flex:1, + alignItems:"center", + position:'relative', + + }, + projectScrollCon:{ + width:wp('100%'), + flex:1 + }, + projectCon:{ + alignItems:"center", + position:'relative', + }, + loginScrollCon2:{ + flex:1, + width:wp('100%'), + }, + projectPageWrapper:{width:'100%',height:hp('100%')}, + + //=============Bottom View============== + footerView:{width:'100%',alignItems:'center',marginBottom:20,}, + + //=============signatureBox============== + signatureBox:{ + alignItems:"center", + width:wp('100%'), + padding:10, + }, + signatureText:{ + color:PageTheme.$text_color_light, + fontSize:12, + fontWeight:'400', + textAlign:'center', + }, + signatureLogo:{ + resizeMode: 'contain', + width: wp('30%'), + height:50, + marginTop:5, + }, + pageContentWrapper:{backgroundColor:PageTheme.$bg_color,borderTopLeftRadius:borderRadius,borderTopRightRadius:borderRadius,elevation:3,paddingTop:10,flex:1,}, + pageContentWrapper_bgLight:{backgroundColor:'#efefef'}, + //=============general Style============= + // pt200:{paddingTop:200,}, + mb7:{marginBottom:7,},mb10:{marginBottom:10,},mb20:{marginBottom:20,},mb30:{marginBottom:30,},mb40:{marginBottom:40,},mb50:{marginBottom:50,},mb60:{marginBottom:60,},mb70:{marginBottom:70,},mb80:{marginBottom:80,},mb90:{marginBottom:90,},mb100:{marginBottom:100,}, + mt10:{marginTop:10,},mt20:{marginTop:20,},mt30:{marginTop:30,},mt40:{marginTop:40,},mt50:{marginTop:50,},mt60:{marginTop:60,},mt70:{marginTop:70,},mt80:{marginTop:80,},mt90:{marginTop:90,},mt100:{marginTop:100,}, + pl10:{paddingLeft:10},pl20:{paddingLeft:20},pl30:{paddingLeft:30},pl40:{paddingLeft:40},pl50:{paddingLeft:50}, + pr10:{paddingRight:10},pr20:{paddingRight:20},pr30:{paddingRight:30},pr40:{paddingRight:40},pr50:{paddingRight:50}, + mr10:{marginRight:10},mr20:{marginRight:20},mr30:{marginRight:30}, + ml10:{marginLeft:10},ml20:{marginLeft:20},ml30:{marginLeft:30},ml40:{marginLeft:40},ml50:{marginLeft:50}, + pt10:{paddingTop:10},pt20:{paddingTop:20},pt30:{paddingTop:30},pt40:{paddingTop:40},pt50:{paddingTop:50}, + zIndex0:{zIndex:0}, + logoImage_con:{flexDirection:'row',justifyContent:'center',marginBottom:10}, + logoImage:{width:100,height:50}, + drawerInfoCon:{padding:10,paddingLeft:0,paddingTop:STATUSBAR_HEIGHT+10,alignItems:'center'}, + // drawerInfoLeft:{paddingRight:10,marginRight:10,borderRightColor:PageTheme.$secondary_color_light,borderRightWidth:2}, + drawerLogo2:{width:100,height:50}, + pageText:{ + color:PageTheme.$text_color_dark, + fontSize:16, + fontWeight:'500', + textAlign:'center', + marginBottom:10, + }, + pagedescText:{ + color:PageTheme.$text_color, + fontSize:13, + fontWeight:'400', + textAlign:'center', + marginBottom:5, + }, + formCon:{}, + formGroup:{position:'relative'}, + inputStyle:{ + textAlign:'left', + backgroundColor:PageTheme.$secondary_color_light, + width:wp('85%'), + borderRadius:7, + paddingVertical:5, + paddingHorizontal:15, + height:50, + color:PageTheme.$accent_color2, + }, + formInputLabel:{position:'absolute',left:40,zIndex:1,color:PageTheme.$placeholder_color,top:15,}, + formInputLeftIcon:{position:'absolute',left:15,top:15}, + passField:{ + position:'relative', + }, + show_pass_btn:{ + position:'absolute', + top:0, + right:0, + width:40, + height:50, + alignItems:'center', + justifyContent:'center', + }, + keyba_view:{ flex: 1,width: wp('100%'),alignItems:'center'}, + keyba_viewContent:{overflow:'hidden'}, + keyba_inner_view:{ flex: 1,width: wp('100%'),alignItems:'center',position:'relative'}, + pass_input:{ + paddingRight:40, + }, + form_label:{ + color:PageTheme.$text_color, + fontSize:14, + fontWeight:'400', + textAlign:'left', + paddingHorizontal:0, + marginBottom:10, + + }, + otp_inputStyle:{ + textAlign:'center', + backgroundColor:PageTheme.$secondary_color_light, + width:((wp('85%')/4)-10), + borderRadius:4, + paddingVertical:10, + paddingHorizontal:15, + height:50, + color:PageTheme.$accent_color2, + marginBottom:10, + marginRight:10, + fontSize:25, + }, + otp_field:{ + flexDirection:'row', + }, + otp_hiddeninput:{ + display:'none', + }, + fullwebview:{ + width:'100%', + height:'100%', + flex:1, + // borderTopLeftRadius:borderRadius,borderTopRightRadius:borderRadius, + marginBottom:0, + }, + roundScrollWrapper:{paddingTop:10,flex:1,width:'100%'}, + roundScrollZIndex:{zIndex:1,}, + roundScrollCon:{backgroundColor:PageTheme.$bg_color,borderTopLeftRadius:borderRadius,borderTopRightRadius:borderRadius,}, + roundScrollInner:{height:'100%',width:'100%',flex:1,backgroundColor:PageTheme.$bg_color,borderTopLeftRadius:borderRadius,borderTopRightRadius:borderRadius,elevation:3,paddingTop:40,}, + webViewCon:{height:'100%',flex:1,borderTopLeftRadius:borderRadius,borderTopRightRadius:borderRadius,paddingTop:0,}, + headetBgImage:{ + height:hp('20%'), + width:wp('100%')+2, + position:'relative', + justifyContent:'center', + alignItems:'center', + }, + headerTitle:{ + color:PageTheme.$accent_color, + fontSize:20, + width:150,//(wp('100%')-80), + textAlign:'right', + }, + headerImg:{ + width:wp('40%'), + height:120, + resizeMode:'contain', + top:28, + left:-30, + }, + headerLeftIcon:{ + width:60, + height:60, + alignItems:'center', + justifyContent:'center', + marginLeft:-10, + }, + headerContent:{ + flex:1, + flexDirection:'row', + alignItems:'center', + justifyContent:'space-between', + position:'absolute', + width:wp('100%'), + paddingHorizontal:20, + }, + teaml_name:{ + color:PageTheme.$text_color, + fontSize:14, + fontWeight:'400', + textAlign:'left', + paddingLeft:20, + paddingRight:10, + }, + teaml_img:{ + width:20, + height:20, + }, + teaml:{ + flexDirection:'row', + paddingHorizontal:20, + marginBottom:10, + borderWidth:2, + borderColor:PageTheme.$secondary_color_light, + shadowOffset:{width:0,height:2}, + borderRadius:5, + paddingVertical:10, + alignItems:'center' + }, + iteml_con:{ + width:'100%', + marginTop:10, + paddingBottom:50, + paddingHorizontal:20, + paddingTop:10 + }, + iteml_conR:{paddingBottom:20,paddingTop:10,paddingHorizontal:10}, + iteml_conR2:{marginBottom:20,backgroundColor:PageTheme.$bg_color,borderRadius:5,elevation:5,shadowColor:'#000',shadowOffset: { width: 0, height: 3 } , shadowOpacity:0.15}, + listcon:{ + width:wp('100%'), + height:hp('100%')-(180+EXTRA_SPACE_MD), + }, + storeR_listcon:{ + width:wp('100%'), + height:hp('100%')-(180+EXTRA_SPACE_MD), + paddingHorizontal:0, + paddingBottom:30, + }, + storelist_parentwrap:{width:'100%'}, + storeTab_MenuCon:{width:'94%',marginTop:0,marginBottom:0,marginHorizontal:10,borderBottomColor:PageTheme.$text_color_light2,borderBottomWidth:1}, + storeTab_Menu:{alignItems:'center',marginBottom:10,}, + storeTab_pill:{paddingHorizontal:20,paddingVertical:5,borderRadius:30,backgroundColor:'#efefef',marginRight:7}, + storeTab_pillText:{color:PageTheme.$text_color,fontSize:14,fontWeight:'500'}, + storeTab_pillActive:{backgroundColor:'#ffb020'}, + storeTab_pillActiveText:{color:'#fff'}, + // storelist card style + storel:{ + flexDirection:'row', + paddingRight:10, + marginBottom:10, + // borderWidth:2, + // borderColor:PageTheme.$secondary_color_light, + backgroundColor:PageTheme.$bg_color, + borderRadius:5, + paddingVertical:10, + alignItems:'center', + elevation:5,shadowColor:'#000',shadowOffset: { width: 0, height: 3 } , shadowOpacity:0.15 + }, + storel_card_outer:{ + paddingVertical:5,paddingHorizontal:10,position:'relative',width:'100%' + }, + storel_card:{ + flexDirection:'row',alignItems:'center', + }, + storel_card_content:{marginHorizontal:5,width:'100%',flexDirection:'row',alignItems:'baseline'}, + storel_card_title:{ + fontSize:15, + color:PageTheme.$text_color, + fontWeight:'500', + + }, + storel_card_subtitle:{marginLeft:10,paddingLeft:10,borderLeftColor:PageTheme.$text_color_light,borderLeftWidth:1}, + storel_card_subtitleTxt:{fontSize:12, color:PageTheme.$text_color_light,}, + storel_details:{ + // flex:1, + paddingHorizontal:5, + }, + storel_code:{flexDirection:'row',marginTop:0,paddingTop:5,width:'100%'}, + storel_codeCon:{marginRight:10,flexDirection:'row',alignItems:'center'}, + storel_codeConAddr:{alignItems:'flex-start'}, + storel_codeIcon:{fontSize:20,marginRight:10,}, + storel_codeBorder:{borderRightColor:PageTheme.$secondary_color_dark,borderRightWidth:1}, + storel_codeBorderTop:{borderTopColor:PageTheme.$secondary_color_light,borderTopWidth:1,}, + storel_codeLbl:{fontSize:12,color:PageTheme.$secondary_color_dark,marginRight:5,flexWrap:'wrap'}, + storel_codeText:{fontSize:12,color:PageTheme.$text_color,marginRight:5}, + storel_codeTextAddr:{width:'80%'}, + storel_usWrap:{width:'100%',position:'relative',justifyContent:'center',paddingVertical:10,}, + storel_usCon:{flexDirection:'row',alignItems:'center'}, + storel_usConBtn:{borderRadius:30,width:140,position:'relative',backgroundColor:PageTheme.$secondary_color_light,paddingHorizontal:5,paddingVertical:6,elevation:3,shadowOpacity:0.2,shadowOffset:{width:0,height:2}}, + storel_usConBtn2:{width:150,}, + storel_usBtnText:{paddingRight:5,marginRight:5,color:PageTheme.$text_color}, + storel_usBtnRemoveIcon:{backgroundColor:'#fff',position:'absolute',top:0,bottom:0,right:0,borderTopRightRadius:30,borderBottomRightRadius:30,paddingHorizontal:10,alignItems:'center',justifyContent:'center'}, + storel_usText:{marginLeft:5,color:PageTheme.$text_color,fontSize:13}, + storel_geotag_btn:{position:'absolute',top:-15,right:-10,width:50,height:50,borderRadius:25,alignItems:'center',justifyContent:'center'}, + storel_CheckOutBtn:{position:'absolute',right:0,borderRadius:30,backgroundColor:PageTheme.$primary_color,paddingHorizontal:15,paddingVertical:6,elevation:3,shadowOpacity:0.2,shadowOffset:{width:0,height:2}}, + storel_cancelBtn:{}, + storel_CheckOutBtnText:{color:PageTheme.$accent_color,fontSize:14,fontWeight:'500'}, + + // storel searchbar + storel_searchbar:{marginTop:10,marginHorizontal:10,backgroundColor:PageTheme.$secondary_color_light,height:40,borderRadius:4,paddingHorizontal:10,elevation:1,shadowColor:'#000',shadowOpacity:0.15,shadowOffset:{width:0,height:2},flexDirection:'row'}, + storel_searchInput:{width:'86%',fontSize:13,color:PageTheme.$text_color}, + storel_searchBtn:{width:40,height:40,top:0,right:0,position:'absolute',backgroundColor:PageTheme.$primary_color,borderTopRightRadius:4,borderBottomRightRadius:4,alignItems:'center',justifyContent:'center'}, + storel_searchBtnIcon:{marginTop:-2}, + + // color description box + colorDescriptionWrap:{marginTop:5,marginHorizontal:10,backgroundColor:PageTheme.$bg_color,paddingVertical:5,borderRadius:4,paddingHorizontal:10,flexDirection:'row',elevation:1,shadowColor:'#000',shadowOpacity:0.2,shadowOffset:{width:0,height:2}}, + colorBoxCon:{flexDirection:'row',alignItems:'center',marginRight:20}, + colorBox:{elevation:1,shadowColor:'#000',borderRadius:4,shadowOpacity:0.15,shadowOffset:{width:0,height:2},width:20,height:20,}, + colorBox1:{backgroundColor:PageTheme.$fifth_color,}, + colorBox2:{backgroundColor:PageTheme.$secondary_color_light,}, + colorDesc:{fontSize:12,color:PageTheme.$text_color,marginLeft:5,flexWrap:'wrap'}, + + + // Page header + pageHdrWrap:{position:'absolute',top:STATUSBAR_HEIGHT+(70+(Platform.OS=='ios'?0:5)),zIndex:9,marginHorizontal:10,justifyContent:'center',backgroundColor:PageTheme.$primary_color,paddingVertical:5,borderRadius:20,paddingHorizontal:10,flexDirection:'row',flexWrap:'wrap'}, + pageHdrWrapText:{textAlign:'center',fontSize:13,color:PageTheme.$accent_color,flexWrap:'wrap'}, + + + // storelist row style + storelR:{flexDirection:'row',paddingRight:10,marginBottom:5,paddingBottom:5,paddingTop:10,borderBottomColor:PageTheme.$fourth_color,borderBottomWidth:1}, + storelR_last:{borderBottomWidth:0,paddingBottom:0,marginBottom:0}, + + + // dynamic storelist style + dstorel_card_outer:{ + paddingVertical:0,paddingHorizontal:10,width:'100%', + }, + dstorel_row:{flexDirection:'row',width:'100%',paddingBottom:5,paddingTop:5,borderBottomWidth:1,borderBottomColor:PageTheme.$secondary_color_light}, + dstorel_row_last:{borderBottomWidth:0}, + dstorel_codeLbl:{fontSize:12,color:PageTheme.$secondary_color_dark,marginRight:5}, + dstorel_codeText:{fontSize:12,fontWeight:'400',color:PageTheme.$text_color,marginRight:5}, + dstorel_codeSep:{fontSize:12,color:PageTheme.$text_color,marginRight:5}, + dstorel_codeCon:{marginRight:0,flexDirection:'row',alignItems:'center'}, + + // storePhotos + storePhotosl_card:{ + paddingVertical:7, + paddingHorizontal:10, + marginHorizontal:10, + marginBottom:5, + flexDirection:'row', + borderRadius:5, + borderWidth:2, + borderColor:PageTheme.$secondary_color_light, + alignItems:'center', + }, + storePhotosl_card_details:{width:100,paddingLeft:10,marginRight:10,}, + storePhotosl_card_title:{ + fontSize:15, + color:PageTheme.$text_color, + fontWeight:'500', + }, + storePhotosl_card_subtitle:{fontSize:11,color:PageTheme.$text_color_light,fontWeight:'400',}, + storePhotosl_card_img:{width:50,height:50}, + storePhotosl_card_remove_btn:{position:'absolute',right:10,}, + // daily menu card style + dailym_scroll_con:{padding:10,alignItems:'center',width:'100%'}, + dailym_scroll:{width:'100%'}, + dailym_bgcolor1:{backgroundColor:'#e0f9a5'}, + dailym_bgcolor2:{backgroundColor:'#ffd667'}, + dailym_bgcolor3:{backgroundColor:'#c2ddff'}, + dailym_bgcolor4:{backgroundColor:'#d9c2ff'}, + dailym_card:{ + paddingHorizontal:20, + marginBottom:10, + borderRadius:5, + paddingVertical:10, + justifyContent:'center', + width:'100%', + height:100, + elevation:5,shadowColor:'#000',shadowOffset:{width:0,height:2}, + }, + dailym_con:{flexDirection:'row',alignItems:'center'}, + dailym_photo:{ + width:100, + height:80, + // marginTop:-20, + }, + dailym_title:{ + textAlign:'left', + color:PageTheme.$text_color, + fontSize:20, + width:150, + fontWeight:'500', + marginLeft:20, + }, + dailym_done:{position:'absolute',width:31,height:31,right:15,top:15,borderRadius:15,elevation:3,shadowColor:'#000'}, + dailym_done_icon:{}, + //download screen + download_scroll_con:{flex:1,padding:10,alignItems:'center',width:'100%',justifyContent:'center'}, + download_scroll:{flex:1,width:'100%'}, + downloadbtn:{ + paddingVertical:10, + paddingHorizontal:20, + borderRadius:20, + backgroundColor:PageTheme.$primary_color, + }, + downloadbtn_label:{ + textAlign:'center', + color:PageTheme.$accent_color, + fontWeight:'500', + }, + // storephotos form + sform_con:{ + paddingVertical:10, + paddingHorizontal:20, + borderBottomColor:PageTheme.$secondary_color_light, + borderBottomWidth:1, + }, + sform_con2:{paddingHorizontal:10}, + sform_hd:{ + textAlign:'center', + color:PageTheme.$secondary_color_dark, + fontWeight:'500', + fontSize:16, + marginBottom:10, + }, + sform_hd2:{ + textAlign:'left', + width:'100%', + paddingVertical:10, + paddingHorizontal:20, + color:PageTheme.$secondary_color_dark, + fontWeight:'500', + fontSize:16, + marginBottom:10, + }, + sform_group:{ + paddingHorizontal:10, + }, + sform_group2:{ + paddingHorizontal:0, + marginBottom:10, + }, + sform_50:{ + width:'50%', + marginHorizontal:5, + }, + sform_100:{ + width:'100%', + marginHorizontal:5, + }, + sform_flex:{flexDirection:'row',alignItems:'center'}, + sform_label:{ + textAlign:'left', + color:PageTheme.$text_color_dark, + fontWeight:'500', + fontSize:14, + width:'40%', + marginBottom:10, + }, + sform_selectStyle:{ + textAlign:'left', + backgroundColor:PageTheme.$secondary_color_light, + width:'60%', + borderRadius:20, + paddingVertical:0, + paddingHorizontal:0, + padding:0, + height:30, + color:PageTheme.$accent_color2, + }, + sform_label2:{ + textAlign:'left', + color:PageTheme.$text_color_dark, + fontWeight:'500', + fontSize:14, + width:'100%', + height:25, + marginBottom:0, + padding:0, + }, + sform_label3:{ + textAlign:'left', + color:PageTheme.$text_color_dark, + fontWeight:'500', + fontSize:14, + marginBottom:10, + padding:0, + }, + sform_selectStyle2:{ + textAlign:'left', + width:wp('40%'), + backgroundColor:PageTheme.$secondary_color_light, + borderRadius:20, + paddingVertical:0, + paddingHorizontal:0, + padding:0, + color:PageTheme.$accent_color2, + }, + sform_row:{ + flexDirection:'row', + }, + sform_row2:{ + flexDirection:'row', + width:wp('100%'), + paddingHorizontal:10, + }, + sform_inputStyle:{ + textAlign:'left', + width:wp('40%'), + backgroundColor:PageTheme.$secondary_color_light, + paddingVertical:5, + paddingHorizontal:10, + color:PageTheme.$accent_color2, + }, + sform_inputStyle2:{ + textAlign:'left', + width:'100%', + backgroundColor:PageTheme.$secondary_color_light, + paddingVertical:5, + paddingHorizontal:10, + color:PageTheme.$accent_color2, + }, + + sform_selectItem:{borderBottomWidth:1,borderBottomColor:PageTheme.$text_color}, + sform_selectedItem:{backgroundColor:PageTheme.$secondary_color_light,}, + sform_btn_con:{ + width:'100%', + marginTop:10, + marginBottom:0, + alignItems:'center', + justifyContent:'center', + flexDirection:'row' + }, + fixedbtn:{marginBottom:20}, + sform_btn:{ + paddingVertical:10, + paddingHorizontal:20, + borderRadius:20, + backgroundColor:PageTheme.$primary_color, + alignItems:'center', + flexDirection:'row', + justifyContent:'center', + minWidth:150, + }, + sform_btn_icon:{ + marginRight:5, + }, + sform_btn_text:{ + textAlign:'center', + color:PageTheme.$accent_color, + fontWeight:'500', + }, + sform_pic_row:{flexDirection:'row',width:'100%',marginTop:10,justifyContent:'center'}, + sform_pic_row2:{justifyContent:'flex-start'}, + sform_pic_con:{width:(wp('33%')-25),marginHorizontal:5,display:'flex'}, + capture_image_btn:{width:80,height:40,alignItems:'center',flexDirection:'row',justifyContent:'center',alignSelf:'center'}, + store_img:{width:'100%',height:90,borderRadius:5,marginBottom:5, + backgroundColor:'#b5b5b5' + }, + csku_scroll_con:{padding:10,width:'100%'}, + sf_datePicker_text: { + textAlign:'left', + width:wp('40%'), + backgroundColor:PageTheme.$secondary_color_light, + paddingVertical:5, + paddingHorizontal:10, + color:PageTheme.$accent_color2, + }, + sf_datePicker:{position:'absolute',width:21,height:21,right:25,top:3}, + sf_datePicker_con:{position:'relative'}, + select_ht:{height:53}, + // report menu + reportMenu_con:{paddingHorizontal:20,paddingVertical:20,}, + reportMenu_hd:{ + textAlign:'center', + width:'100%', + paddingVertical:10, + paddingHorizontal:20, + color:PageTheme.$secondary_color_dark, + fontWeight:'500', + fontSize:20, + marginBottom:10, + }, + reportMenu:{marginTop:10}, + reportMenu_item:{ + paddingVertical:10, + paddingHorizontal:20, + borderRadius:5, + minHeight:50, + alignItems:'center', + flexDirection:'row', + justifyContent:'center', + minWidth:150, + marginBottom:10, + }, + reportMenu_item_bg1:{backgroundColor:PageTheme.$primary_color,}, + reportMenu_item_bg2:{backgroundColor:'#ffd667',}, + reportMenu_item_text:{ + textAlign:'center', + color:PageTheme.$accent_color, + fontWeight:'500', + fontSize:16, + }, + // loaderSyle + loaderBackdrop:{ + position:'absolute', + width:wp('100%'), + height:hp('100%'), + backgroundColor:'#00000052', + padding:10, + flex:1, + flexDirection:'row', + alignItems:'center', + justifyContent:'center', + top:0, + zIndex:9999, + }, + loaderCon:{ + backgroundColor:PageTheme.$bg_color, + width:'80%', + height:50, + borderRadius:4, + elevation:10, + shadowColor:'#000', + shadowOpacity:0.5, + shadowOffset:{width:0,height:3}, + flexDirection:'row', + alignItems:'center', + justifyContent:'center', + + }, + download_loaderCon:{backgroundColor:PageTheme.$accent_color,width:'80%',borderRadius:4,elevation:10,shadowColor:'#000', shadowOpacity:0.5,shadowOffset:{width:0,height:3},padding:10,}, + download_Title:{color:PageTheme.$text_color, fontSize:16,fontWeight:'500',marginBottom:7}, + download_count:{color:PageTheme.$text_color_light, fontSize:13,fontWeight:'400'}, + download_subTitle:{color:PageTheme.$text_color_dark, fontSize:12,fontWeight:'400'}, + downloadProgress:{position:'relative',marginVertical:7}, + downloadProgress_bg:{height:10,borderRadius:10,backgroundColor:PageTheme.$text_color_light2,width:'100%'}, + downloadProgress_filled:{position:'absolute',top:0,height:10,borderRadius:10,backgroundColor:PageTheme.$primary_color,width:'0%'}, + spinnerCon:{position:'relative'}, + downloadModal_spin:{position:'absolute',top:10,right:10,}, + spinner:{}, + spinnerInner:{position:'absolute',top:4,left:4}, + spinnerInner2:{position:'absolute',top:2,left:2}, + loaderTitle:{ + fontSize:16, + color:PageTheme.$text_color, + marginLeft:30, + }, + // store info + storeInfo_wrap:{borderRadius:10}, + dm_storeInfo:{width:wp('100%'),backgroundColor:PageTheme.$accent_color,padding:10,borderRadius:4,borderBottomWidth:2,borderBottomColor:PageTheme.$secondary_color_light,marginTop:10,paddingBottom:20}, + dm_storeInfo_title:{color:PageTheme.$text_color_dark,fontWeight:'500',fontSize:16,}, + dm_storeInfo_subtitle:{color:PageTheme.$text_color_light,fontWeight:'400',fontSize:13,}, + checkinbtn:{ + paddingVertical:10, + paddingHorizontal:20, + borderRadius:20, + backgroundColor:PageTheme.$primary_color, + alignItems:'center', + flexDirection:'row', + justifyContent:'center', + minWidth:150, + marginTop:40, + }, + checkinbtn_text:{color:PageTheme.$accent_color,fontSize:16}, + // selfie box: + selfie_preview_con:{width:wp('100%'),paddingHorizontal:20,alignItems:'center',justifyContent:'center'}, + selfie_preview_hd:{textAlign:'left'}, + selfie_preview:{flexDirection:'row',alignItems:'center'}, + selfiep_img:{width:100,height:100,backgroundColor:'#b5b5b5'}, + take_selfie_btn:{ + paddingVertical:10, + paddingHorizontal:20, + borderRadius:20, + backgroundColor:PageTheme.$primary_color, + alignItems:'center', + flexDirection:'row', + justifyContent:'center', + minWidth:150, + marginLeft:40, + }, + take_selfie_btn_text:{color:PageTheme.$accent_color,fontSize:16,marginLeft:10}, + + // checkin info + checkinMainCon:{width:'100%'}, + checkinInfo:{width:'100%',paddingBottom:10,marginBottom:10,borderBottomColor:PageTheme.$secondary_color_light,borderBottomWidth:2,}, + checkinInfo_hd:{color:PageTheme.$secondary_color_dark,fontSize:15,marginRight:10}, + checkinInfo_hdr:{flexDirection:'row',alignItems:'center',marginBottom:5,}, + checkinInfo_timecon:{flexDirection:'row',}, + checkinInfo_timeinner:{marginLeft:10,}, + checkinInfo_img:{width:120,height:150,backgroundColor:'#b5b5b5'}, + checkinInfo_time:{color:PageTheme.$text_color,fontSize:14,}, + checkinInfo_btnCon:{flex:1,alignItems:'center'}, + goto_storemenu_btn:{flexDirection:'row',marginTop:20,borderColor:PageTheme.$primary_color,borderWidth:2,borderRadius:20,paddingHorizontal:10,height:30,alignItems:'center'}, + goto_storemenu_btn_text:{color:PageTheme.$primary_color,fontSize:14,marginRight:20}, + statusIcon:{position:'absolute',top:0,right:0}, + storeintro_scroll:{width:'100%',}, + storeintro_scrollcon:{width:'100%', + paddingBottom:10, + paddingHorizontal:5,}, + store_audit_img_con:{width:'100%',marginTop:10,marginHorizontal:5,alignSelf:'center',position:'relative',backgroundColor:'#f5f5f5'}, + store_audit_image:{width:'100%',height:150,backgroundColor:'#f5f5f5'}, + store_audit_pickimg_btn:{position:'absolute',right:5,top:0,padding:10}, + clocktimer:{position:"absolute",right:0,top:10,flexDirection:'row'}, + clocktimerWrap:{marginTop:10,marginLeft:10}, + clocktimerRow:{flexDirection:'row',alignItems:'center', backgroundColor:PageTheme.$accent_color,width:'auto',paddingHorizontal:15,paddingVertical:5,borderRadius:30,width:220,justifyContent:'center'}, + clocktimerText:{color:PrimaryTheme.$primary_color,fontSize:12,marginLeft:5,fontWeight:'400'}, + + // QAD styles + qad_bg:{flex:1,alignItems:'center',position:'relative'}, + qad_hdr:{alignItems:'center',width:'100%',paddingTop:20,paddingBottom:10,paddingLeft:10,paddingRight:10,position:'absolute',top:0,left:0}, + qad_text:{color:PageTheme.$accent_color,fontSize:18,fontWeight:'500',textAlign:'center',marginBottom:5,textTransform:'capitalize'}, + qad_subtext:{color:PageTheme.$accent_color,fontSize:13,fontWeight:'400',textAlign:'center',marginBottom:5,}, + qadPopUp:{flex:1,width:wp('100%'),marginTop:160,backgroundColor:PageTheme.$accent_color,borderTopLeftRadius:20,borderTopRightRadius:20,elevation:5,shadowOpacity:1,shadowColor:'#323232',alignItems:'center',padding:20}, + qadPopUpInner:{flex:1}, + qadScrollCon:{flex:1,width:'100%',padding:0,height:420}, + qadInnerCon:{alignItems:"center",position:'relative'}, + + // QAD Progess bar + linear_progressBarWrapper:{backgroundColor:'#fff',paddingHorizontal:10,paddingVertical:10,flexDirection:'row',width:'100%',position:'relative',elevation:5,borderRadius:15,alignItems:'center'}, + linear_progressBar:{width:'87%',marginRight:10,position:'relative'}, + linear_progressBar_bg:{width:'100%',borderRadius:5,height:10,backgroundColor:PageTheme.$text_color_light2}, + linear_progressBar_filled:{width:'0%',borderRadius:5,height:10,backgroundColor:PageTheme.$primary_color,marginRight:10,position:'absolute',top:0,left:0}, + linear_progressBarText:{paddingLeft:10,borderLeftWidth:1,borderLeftColor:PageTheme.$text_color_light,color:PageTheme.$text_color}, + + + // QAD Form + qad_form:{marginTop:10}, + qad_questions:{width:'100%',display:'none'}, + qad_questionsShow:{display:'flex'}, + qad_qtnText:{color:PageTheme.$text_color,fontSize:17,fontWeight:'600'}, + qad_optionsCon:{marginTop:20,paddingHorizontal:10}, + qad_optionBtn:{backgroundColor:PageTheme.$secondary_color_light,paddingHorizontal:15,paddingVertical:12,marginBottom:10,borderRadius:10,elevation:2}, + qad_optionBtnText:{fontSize:12,color:PageTheme.$text_color}, + qad_qtnBtnsGrp:{width:wp('87%'),marginTop:20,position:'relative',height:50,padding:10}, + qad_qtnBtn:{backgroundColor: PageTheme.$primary_color,elevation:6,shadowColor:PageTheme.$primary_color,shadowOffset:{width:0,height:2},borderRadius: 40,width:'35%',height: 40,display: 'flex',alignItems: 'center',justifyContent: 'center'}, + qad_qtnBtnText:{color: PageTheme.$accent_color,textAlign: 'center',fontSize: 15,padding: 10,}, + qad_btnSubmitCon:{position:'absolute',right:0,width:'35%'}, + qad_btnSubmit:{elevation:6,shadowColor:PageTheme.$primary_color,shadowOffset:{width:0,height:2},borderRadius: 40,width:'100%',height: 40,display: 'flex',alignItems: 'center',justifyContent: 'center'}, + qad_btnBack:{position:'absolute',left:0}, + qad_btnBackText:{}, + qad_btnNext:{position:'absolute',right:0}, + qad_btnNextText:{}, + qad_timer_wrapper:{flexDirection:'row',marginTop:5,alignItems:'center',paddingHorizontal:10}, + qad_timerText:{marginLeft:10,color:PageTheme.$text_color,fontSize:16,marginRight:10}, + timerProgressBar:{position:'relative',flex:1,height:10,overflow:"hidden"}, + timerProgressBar_bg:{height:10,borderRadius:10,backgroundColor:PageTheme.$text_color_light2,width:'100%'}, + timerProgressBar_filled:{height:10,borderRadius:10,backgroundColor:'green',position:'absolute',top:0}, + answerRemark:{padding:10,backgroundColor:'#bdebbd',borderRadius:10,marginTop:5}, + answerRemarkText:{fontSize:14,color:'green'}, + remarkRedbg:{backgroundColor:'#fdc0c0'}, + remarkRed:{color:'red'}, + + // forgetMpin + forgetMpinWrap:{width:wp('80%'),paddingVertical:10,position:'relative',marginTop:10}, + forgetMpinBtn:{position:'absolute',right:0,top:0}, + forgetMpinText:{color:PageTheme.$text_color_light}, + + // modalWrapper + modalWrapper:{position:'absolute',top:0,left:0,width:wp('100%'),height:hp('100%'),backgroundColor:'#000',zIndex:999}, + downloadModalWrapper:{}, + + // attendance_menu + attmenu_listcon:{width:wp('100%'), }, + attmenu_list:{ width:wp('100%'),marginTop:10,paddingBottom:10,paddingHorizontal:20,flexDirection:'row',flexWrap:'wrap'}, + attendance_menu_outer:{width:wp('50%')-30,marginBottom:20,}, + attendance_menu_first:{marginRight:20,}, + attendance_menu:{padding:10,borderRadius:7,elevation:3,height:120,alignItems:'center'}, + attendance_menu_inner:{alignItems:'center',height:'60%',justifyContent:'center'}, + attendance_Icon:{width:50,height:50}, + attendance_menu_image:{height:50,}, + attendance_menu_title:{fontSize:16,fontWeight:'bold',color:PageTheme.$text_color,marginTop:10,textAlign:'center'}, + + // backgroundVideo + backgroundVideo:{position:'absolute',top:0,bottom:0,left:0,right:0}, + + // no download data style + nodownloaddata_con:{width:'100%',height:'100%',alignItems:'center',justifyContent:'center'}, + nodownloaddata_row:{width:'100%',height:'100%',alignItems:'center',justifyContent:'center'}, + nodownloaddata_text:{fontSize:15,fontWeight:"500",color:PageTheme.$text_color_light,textAlign:'center',marginTop:10}, + + // no data available + noDataCon:{width:'100%',height:400,alignItems:'center',justifyContent:'center'}, + noDataText:{fontSize:15,fontWeight:"500",color:PageTheme.$text_color_light,textAlign:'center'}, + + // geotag screen + geotag_scroll:{justifyContent:'center',padding:10,paddingBottom:10,paddingTop:5}, + geotag_scroll_pb:{paddingBottom:50,}, + gtag_sImageWrap:{position:'absolute',bottom:-60,alignItems:'center',left:0,right:0, width:'100%'}, + gtag_sImage_View:{position:'absolute',top:-60,elevation:1,backgroundColor:'#fff',borderRadius:15,padding:3,shadowOpacity:0.1,shadowColor:'#000',shadowOffset:{width:0,height:2}}, + gTag_sImageBtn:{position:'absolute',zIndex:2,top:5,elevation:2,backgroundColor:PageTheme.$red,borderRadius:20,padding:9,shadowOpacity:0.25,shadowColor:PageTheme.$red,shadowOffset:{width:0,height:2}}, + gtag_sImagelbl:{alignItems:'center',paddingHorizontal:20,paddingTop:30,paddingBottom:10,borderRadius:10,backgroundColor:PageTheme.$bg_color,elevation:2,shadowOpacity:0.2,shadowColor:'#000',shadowOffset:{width:0,height:2}}, + gtag_sImagelblText:{fontSize:14,fontWeight:'500',color:PageTheme.$text_color,zIndex:1,marginTop:20,}, + gTag_btnWrap:{alignItems:'center',marginTop:40}, + gTag_btnWrapCI:{marginTop:40,}, + gTag_Image:{width:80,height:80,borderRadius:13}, + gTag_distanceAway:{paddingHorizontal:13,paddingVertical:7,borderRadius:6,backgroundColor:'#f5aeae78',width:'90%'}, + gTag_distanceAwayLbl:{fontSize:14,color:'red',textAlign:'center',fontWeight:'500'}, + android_flipIMageView:{transform:[{scaleX:-1}]}, + // geotag_Page:{marginTop:StatusBar.currentHeight+10,position:'relative'}, + // geotag_BackBtn:{position:'absolute',top:20,left:20,backgroundColor:PageTheme.$primary_color,padding:10,borderRadius:40,elevation:4,shadowColor:'#676767'}, + // geotag_BackBtnIcon:{}, + + // map + mapWrapCon:{marginBottom:10,position:'relative'}, + mapWrapConIOS:{backgroundColor:'#fff',padding:1,borderRadius:15,elevation:5,shadowColor:'#000',shadowOpacity:0.2,shadowOffset: { width: 0, height: 2 }}, + mapWrapper:{width:'100%',height:hp('100%')-(350+EXTRA_SPACE),backgroundColor:'#fff',borderRadius:15,overflow:'hidden',elevation:5,shadowColor:'#000',shadowOpacity:0.6,shadowOffset: { width: 0, height: 2 }}, + mapWrapperView:{height:hp('100%')-(310+EXTRA_SPACE)}, + mapWrapperSmall:{height:hp('100%')-(380+EXTRA_SPACE)}, + mapStyle:{width:'100%',height:'100%'}, + customMapStyle:{borderRadius:10,}, + // Store Visited Modal Style + storelVisitM_Style:{alignItems:'center'}, + storelVisitM_titleStyle:{textAlign:'center',marginTop:20,marginBottom:20}, + storelVisitM_options:{flexDirection:'row',marginBottom:20,justifyContent:'space-evenly',width:'80%'}, + storelVisitM_op_btn:{backgroundColor:PageTheme.$primary_color,color:PageTheme.$accent_color,paddingHorizontal:20,paddingVertical:6,borderRadius:20,minWidth:70}, + storelVisitM_op_btnText:{textAlign:'center',color:PageTheme.$accent_color}, + + // MPin MOdal + MPinM_Style:{alignItems:'center',paddingTop:20,width:'90%'}, + MPinM_title_Style:{textAlign:'center',marginBottom:10,fontSize:15,color:PageTheme.$text_color,fontWeight:'500'}, + MPinM_subtitle_Style:{textAlign:'center',fontSize:13,marginLeft:5,color:PageTheme.$red,fontWeight:'400'}, + MPinM_subtitle_Style2:{textAlign:'center',fontSize:13,marginBottom:10,color:PageTheme.$red,fontWeight:'400'}, + MPinM_subtitleCon:{flexDirection:'row',marginLeft:-5,marginBottom:5,justifyContent:'center',alignItems:'center'}, + MPinM_con:{marginBottom:10,padding:10,}, + MPinM_otp_inputStyle:{ + textAlign:'center', + backgroundColor:PageTheme.$secondary_color_light, + width:'80%', + borderRadius:4, + paddingVertical:10, + paddingHorizontal:15, + height:50, + color:PageTheme.$accent_color2, + marginBottom:10, + marginRight:10, + fontSize:25, + }, + MPinM_otp_field:{ + flexDirection:'row', + }, + + // app update modal + appUpdateMStyle:{alignItems:'center'}, + appUpdateMT_Style:{marginTop:10,marginBottom:10,fontSize:13,fontWeight:"500",color:PageTheme.$text_color}, + appUpdateMT_SubStyle:{paddingHorizontal:10,marginBottom:20,fontSize:12,fontWeight:"400",color:PageTheme.$text_color_light}, + + // Store Cancel visit modal + storelCM_alertCon:{marginBottom:20,flexDirection:'row',alignItems:'center'}, + storelCM_alert:{textAlign:'center',color:'#ff0000',fontSize:14,fontWeight:'400',marginLeft:10}, + storelCancelM_titleStyle:{textAlign:'center',marginTop:10,fontSize:14,fontWeight:'500'}, + storelCancelM_subtitleStyle:{marginBottom:10,fontSize:13,fontWeight:'400',color:PageTheme.$primary_color,textTransform:'capitalize'}, + + // custom modal + customModal:{backgroundColor:PageTheme.$accent_color,width:'80%',borderRadius:4,elevation:10,shadowColor:'#000', shadowOpacity:0.5,padding:10,shadowOffset: { width: 0, height: 2 },}, + customModal_Title:{color:PageTheme.$text_color, fontSize:16,fontWeight:'500',marginBottom:7}, + customModal_Message:{color:PageTheme.$text_color_light, fontSize:14,fontWeight:'400',marginBottom:10}, + + + // non working rsns style + storeD_Main:{width:'100%',height:'100%',paddingVertical:10,}, + storeD_storelMain:{width:'100%',paddingHorizontal:10,}, + storeD_scrollCon:{width:'100%',height:hp('100%')-(340+EXTRA_SPACE)}, + storeD_scroll:{width:'100%',marginBottom:20,paddingHorizontal:10,}, + nonWorking_con:{width:'100%'}, + nonWorking_form:{width:'100%'}, + nonWform_hd:{textAlign:'left',color:PageTheme.$text_color,fontSize:15,paddingVertical:5,paddingHorizontal:10,fontWeight:'600',marginBottom:10,}, + // nonWorking_imgWrap:{width:'100%',height:200,backgroundColor:PageTheme.$text_color_light2,marginTop:20,}, + // nonWorking_form_selectBox:{width:'100%',textAlign:'left',paddingVertical:0,paddingHorizontal:0,padding:0,height:30,color:PageTheme.$accent_color2,}, + nonW_btnWrap:{position:'absolute',bottom:10,left:10,alignItems:'center',width:'100%',alignItems:'center'}, + + nonWlist:{position:'relative',flexDirection:'row',marginBottom:10,alignItems:'center',width:'100%',backgroundColor:PageTheme.$bg_color,elevation:2,borderRadius:7,paddingHorizontal:10,paddingVertical:10,shadowColor:'#000',shadowOpacity:0.15,shadowOffset:{width:0,height:2}}, + nonWlist_camera:{position:'absolute',right:0,alignItems:'center',justifyContent:'center',padding:10,}, + nonWlist_camera_icon:{}, + nonWlist_Text:{fontSize:14,color:PageTheme.$text_color,marginRight:10,}, + nWselStyle:{backgroundColor:PageTheme.$secondary_color_dark,}, + nWselStyleText:{color:PageTheme.$accent_color}, + + // nonWCapImgModal + nonWCapImgModal:{alignItems:'center'}, + nonWCapImgModal_title:{fontSize:14,}, + nonWCapImgModal_subtitle:{}, + nonWCapImgModalCon:{width:'100%',alignItems:'center',position:'relative'}, + nonWCapImgModal_Camera:{marginTop:10,marginBottom:20,padding:10,}, + nonWCapImgModal_btng:{flexDirection:'row',justifyContent:'space-evenly',width:'100%'}, + nonWCapImgModal_Cancel_btn:{marginBottom:10,paddingHorizontal:15,paddingVertical:10,minWidth:100,backgroundColor:PageTheme.$accent_color,borderColor:PageTheme.$primary_color,borderWidth:1,borderRadius:40,elevation:1}, + nonWCapImgModal_Cancel_btnText:{textAlign:'center',color:PageTheme.$primary_color}, + nonWCapImgModal_Save_btn:{marginBottom:10,paddingHorizontal:15,paddingVertical:10,minWidth:100,backgroundColor:PageTheme.$primary_color,borderRadius:40,elevation:1}, + nonWCapImgModal_Save_btnText:{textAlign:'center',color:PageTheme.$accent_color}, + nonWCapImgModal_ImgWrap:{marginTop:10,marginBottom:20,padding:10,width:'100%',alignItems:'center'}, + nonWCapImgModal_Img:{backgroundColor:'#efefef',width:150,height:100,resizeMode:'contain'}, + nonWCapImgModal_CameraSmall:{position:'absolute',right:40,top:0,padding:5,backgroundColor:PageTheme.$bg_color,borderRadius:40,elevation:3}, + + // store Distance Modal + storeDistance_Modal:{padding:20,width:'90%',alignItems:'center'}, + storeDistanceM_title:{fontSize:18,}, + storeDistanceM_Con:{alignItems:'center'}, + storeDistanceM_message:{fontSize:14,color:PageTheme.$text_color,fontWeight:'400',textAlign:'center'}, + storeDistanceM_submessage:{fontSize:14,fontWeight:'400',textAlign:'center',color:PageTheme.$text_color}, + storeDistanceM_btn:{minWidth:100,paddingHorizontal:20,paddingVertical:10,marginTop:20,backgroundColor:PageTheme.$primary_color,borderRadius:20,elevation:3}, + storeDistanceM_btnText:{textAlign:'center',color:PageTheme.$accent_color}, + + // daily_menu + dailymenu_listcon:{width:'100%',alignItems:'center'}, + dailymenu_list:{ paddingHorizontal:10,marginTop:10,paddingBottom:10,}, + dialyMenu_Rows:{width:'100%',flexDirection:'row',marginBottom:0}, + daily_menu_outer:{width:'50%',position:'relative',padding:10,}, + + daily_menu_first:{}, + daily_menu_tilebgShadow:{borderRadius:7,elevation:3,height:160,alignItems:'center',shadowColor:'#000',shadowOffset:{width:0,height:2},shadowOpacity:0.3,backgroundColor:'#0000'}, + daily_menu:{width:'100%',height:'100%',padding:10,borderRadius:7,position:'absolute',top:0,left:0}, + daily_menu_inner:{alignItems:'center',backgroundColor:PageTheme.$bg_color,borderRadius:10,paddingHorizontal:20,paddingVertical:5,marginTop:-20,marginBottom:10,elevation:2,shadowColor:'#000',shadowOffset:{width:0,height:0},shadowOpacity:0.2,justifyContent:'center'}, + daily_menu_inner2:{alignItems:'center',paddingHorizontal:20,paddingTop:25,marginBottom:10,justifyContent:'center'}, + daily_menu_innerImgCon:{position:'absolute',top:20,width:90,height:90}, + daily_menu_bgImg:{width:'100%',height:'100%'}, + daily_menu_Icon:{width:80,height:80}, + + daily_menu_title:{fontSize:14,fontWeight:'400',color:PageTheme.$text_color,marginTop:5,textAlign:'center'}, + daily_menu_done:{position:'absolute',width:31,height:31,right:10,top:-10,borderRadius:15,elevation:3,shadowColor:'#000'}, + + + // Dail menu Category + + catDMenuI_Wrap:{flexDirection:'row',alignItems:'center',justifyContent:'flex-start',width:'100%',marginBottom:10,borderRadius:4,paddingHorizontal:10,paddingVertical:8,backgroundColor:PageTheme.$secondary_color_light,elevation:1,shadowColor:'#000',shadowOpacity:0.1,shadowOffset:{width:0,height:2}}, + catDMenuI_CheckBoxCon:{position:'absolute',width:25,height:25,top:4,left:5,}, + catDMenuI_CheckBox:{alignSelf:'flex-start'}, + catDMenuI_CheckBox_pName:{width:'85%',marginLeft:30}, + catDMenu_listcon:{width:'100%'}, + catDMenu_list:{ marginTop:10,paddingBottom:10,}, + catDmenu_scroll:{justifyContent:'center',paddingBottom:10,paddingTop:5}, + + // opening stock kpi + opening_Stock_wrap:{width:'100%',marginBottom:10}, + opening_Stock_scroll:{justifyContent:'center',padding:10,paddingBottom:10,}, + opening_Stock_scrollOuter:{marginBottom:80,width:wp('100%')}, + opening_Stock_cat:{width:'100%'}, + opening_Stock_catHdr:{width:'100%',position:'relative'}, + opening_Stock_catHdrIcon:{position:'absolute',right:10,top:5}, + opening_Stock_catInner:{width:'100%',paddingHorizontal:10,paddingVertical:7,backgroundColor:PageTheme.$primary_color,borderRadius:5,}, + opening_Stock_catText:{fontSize:14,fontWeight:'500',color:PageTheme.$accent_color}, + + opening_Stock_SubCatHdr:{width:'100%',position:'relative'}, + opening_Stock_SubCatIcon:{position:'absolute',right:10,top:10}, + opening_Stock_SubCatInner:{width:'100%',paddingHorizontal:10,marginTop:10,paddingVertical:7,backgroundColor:PageTheme.$primary_color,borderRadius:5,}, + opening_Stock_SubCatText:{fontSize:14,fontWeight:'500',color:PageTheme.$text_color,textAlign:'center'}, + + osCat_actions:{width:'100%',marginVertical:10,marginTop:20,paddingBottom:10,alignItems:'center',borderBottomColor:PageTheme.$text_color_light2,borderBottomWidth:1,}, + osCat_action_openCam:{}, + osCat_action_add_image:{}, + osCatImageView:{position:'relative',backgroundColor:PageTheme.$secondary_color_light,padding:5,borderRadius:10,}, + osCat_action_reCap:{position:'absolute',top:-10,right:-10,padding:8,backgroundColor:PageTheme.$primary_color,borderRadius:30,elevation:2}, + osCatImage:{width:80,height:80,borderRadius:10,backgroundColor:'#232323'}, + osCat_actn_margin:{}, + opening_Stock_prds:{paddingBottom:20,}, + openStk_prd_Con:{paddingHorizontal:10,position:'relative',marginTop:10,paddingVertical:10,backgroundColor:PageTheme.$secondary_color_light,borderRadius:5,elevation:1,shadowColor:'#484848',shadowOpacity:0.1,shadowOffset:{width:0,height:2}}, + openStk_prd_name:{fontSize:15,color:PageTheme.$text_color,fontWeight:'600'}, + openStk_prd_nameB:{fontSize:15,color:PageTheme.$text_color,fontWeight:'600',borderBottomColor:PageTheme.$fourth_color,borderBottomWidth:1,paddingBottom:5}, + openStk_prd_name2:{fontSize:14,color:PageTheme.$text_color,fontWeight:'400',marginTop:4,}, + openStk_refImageBtn:{position:'absolute',right:20,top:5,width:40,height:40,borderRadius:20,alignItems:'center',justifyContent:'center'}, + openStk_prd_form:{marginTop:10,}, + openStk_prd_row:{width:'100%',flexDirection:'row',}, + openStk_prd_cols:{width:'100%',}, + openStk_prd_colflex:{width:'100%',flexDirection:'row',alignItems:'center',}, + openStk_prd_col50:{width:'48.5%'}, + openStk_prd_col50_1:{marginRight:5,}, + openStk_prd_col50_2:{marginLeft:5}, + openStkP_checkboxWrap:{flexDirection:'row',alignItems:'flex-start',justifyContent:'flex-start',borderBottomColor:PageTheme.$bg_color,borderBottomWidth:1,paddingBottom:10,}, + openStkP_checkbox:{alignSelf:'flex-start'}, + openStkP_checkboxCon:{position:'absolute',width:25,height:25,top:-5,left:-10,}, + openStkP_checkbox_pName:{width:'85%',marginLeft:25}, + openStk_prd_label:{fontSize:13,color:PageTheme.$text_color_dark,fontWeight:'400'}, + openStk_prd_flexlabel:{marginRight:10,width:'35%',color:PageTheme.$text_color_dark}, + openStk_prd_inputStyle:{backgroundColor:PageTheme.$bg_color,borderRadius:4,marginTop:5,height:30,paddingVertical:3,paddingHorizontal:5,minWidth:100,color:PageTheme.$text_color}, + openStk_prd_flex_inputStyle:{marginTop:0,width:'60%'}, + openStk_prd_selectStyle:{backgroundColor:PageTheme.$bg_color,borderRadius:4,height:40,minWidth:100}, + openStk_prd_selectStyle_item:{height:40,fontSize:14,}, + openStk_prd_choiceBoxCon:{height:40,width:'60%',paddingHorizontal:(Platform.OS=='ios'?10:0),}, + openStk_prd_choiceBox:{position:'relative',backgroundColor:PageTheme.$bg_color,flexDirection:'row',height:40,alignItems:'center',width:'80%',maxWidth:150,minWidth:100,borderRadius:5}, + openStkCh_con1:{width:'50%',height:'100%',paddingVertical:5,paddingHorizontal:10,justifyContent:'center',borderRadius:5,}, + openStkCh_text:{textAlign:'center',color:PageTheme.$text_color}, + openStkCh_textactive:{color:PageTheme.$accent_color}, + openStkCh_con_red:{backgroundColor:'red'}, + openStkCh_con_green:{backgroundColor:'green'}, + openStkCh_con_active:{borderRadius:5,elevation:4,shadowColor:'#000',shadowOpacity:0.4,shadowOffset:{width:0,height:2},shadowRadius:5,backgroundColor:'#0000'}, + openStkCh_absolutebg:{position:'absolute',top:0,bottom:0,width:'50%',left:'50%'}, + opening_Stock_btnWrap:{position:'absolute',bottom:0,left:0,right:0,width:wp('100%'),paddingBottom:20,alignItems:'center'}, + openStk_prddetails:{flexDirection:'row',marginTop:10,paddingTop:10,paddingBottom:10,alignItems:'center'}, + openStk_prd_borderT:{borderTopColor:PageTheme.$fourth_color,borderTopWidth:1}, + openStk_prd_borderB:{borderBottomColor:PageTheme.$fourth_color,borderBottomWidth:1}, + openStk_prd_borderL:{borderLeftColor:PageTheme.$fourth_color,borderLeftWidth:1}, + openStk_prd_borderR:{borderRightColor:PageTheme.$fourth_color,borderRightWidth:1}, + openStk_prdd_wrap:{flexDirection:'row',alignItems:'center'}, + openStk_prdd_flabel:{fontSize:13,fontWeight:'500',color:PageTheme.$secondary_color_dark,marginRight:10,}, + openStk_prdd_fvalue:{fontSize:13,fontWeight:'500',color:PageTheme.$secondary_color_dark,marginRight:10,}, + openStk_prdCameras:{marginTop:10,flexDirection:'row',flexWrap:'wrap'}, + openStkCameraCon:{marginRight:10,}, + + // product cats in Stock with cat screen + prodCatsScroll:{justifyContent:'center',padding:10,paddingBottom:10,}, + prodCatsScroll_Outer:{marginBottom:5,width:wp('100%')}, + prodCatPageWrap:{alignItems:'center'}, + prodCatsHdr:{backgroundColor:PageTheme.$primary_color,width:wp('100%')-20,paddingVertical:8,paddingHorizontal:10,marginBottom:15,borderRadius:6,elevation:1,shadowOffset: { width: 0, height: 2 } , shadowOpacity:0.2,}, + prodCatsHdrText:{textAlign:'center',fontSize:14,color:PageTheme.$accent_color}, + prodCatsHdr_Stockprds:{paddingBottom:10}, + prdCat_hdIMgWrap:{width:wp('100%')-20,marginVertical:10,marginTop:20,paddingBottom:10,alignItems:'center',justifyContent:'center',borderBottomColor:PageTheme.$text_color_light2,borderBottomWidth:1,}, + prdCat_hdImgCon:{width:wp('100%'),alignItems:'center'}, + stockCatDone_check:{position:'absolute',width:24,height:24,right:10,top:5,borderRadius:15,elevation:3,paddingLeft:0.2,shadowColor:'#000'}, + + + // SOS + SOS_subCatImgCon:{}, + SOS_imageWrap:{width:'100%',paddingVertical:10,alignItems:'center',borderBottomColor:PageTheme.$text_color_light2,borderBottomWidth:1,}, + + + // shelf talker + st_TextLbl:{marginBottom:10,}, + + // Stock page + stk_inptSTyle:{textAlign:'center'}, + stk_mfdView:{marginTop:10,borderTopColor:PageTheme.$accent_color,borderTopWidth:2,paddingTop:10,}, + stk_mfdTbl_hd:{marginBottom:10,marginTop:10,color:PageTheme.$text_color,fontSize:14,fontWeight:'500'}, + stk_mfdTblHeader:{marginBottom:10,marginTop:10,backgroundColor:PageTheme.$primary_color, borderRadius:10,padding:5,elevation:3,shadowColor:'#747474',shadowOffset: { width: 0, height: 2 } , shadowOpacity:1.0,flexDirection:'row',alignItems:'center',justifyContent:'space-between'}, + stk_mfdTblHeaderBox:{width:'24%',alignItems:'center',backgroundColor:PageTheme.$secondary_color_light,paddingVertical:5,borderRadius:5,}, + stk_mfdTblHeaderBox1:{}, + stk_mfdTblHeaderBox2:{}, + stk_mfdTblHeaderBox3:{}, + stk_mfdTblHeaderBox4:{}, + stk_mfdTblHeaderTxt:{fontSize:13,color:PageTheme.$text_color,marginRight:5,textTransform:'capitalize',fontWeight:'700'}, + stk_addStockBtn:{position:'absolute',right:0,top:10,backgroundColor:PageTheme.$primary_color,borderRadius:4,paddingHorizontal:10,paddingVertical:5,elevation:1,shadowColor:'#747474',shadowOffset: { width: 0, height: 2 } , shadowOpacity:0.1}, + stk_addStockBtnText:{fontSize:13,fontWeight:'500',color:PageTheme.$accent_color}, + AddStockM_View:{width:'100%',marginBottom:10,}, + AddStockM_row:{marginBottom:10,marginTop:0,width:'100%',paddingHorizontal:10}, + AddStockM_label:{color:PageTheme.$text_color,fontSize:14,fontWeight:'400',marginBottom:5}, + AddStockM_col:{}, + AddStockM_MFDInputCon:{flexDirection:'row',alignItems:'center',justifyContent:'space-between'}, + AddStockM_MFDInput:{height:30,alignItems:'center',justifyContent:'center',width:'84%',borderRadius:5,backgroundColor:PageTheme.$secondary_color_light,paddingHorizontal:10,paddingVertical:5,color:PageTheme.$text_color}, + AddStockM_DatePicker:{width:30,height:30,backgroundColor:PageTheme.$primary_color,alignItems:'center',justifyContent:'center',borderRadius:5}, + AddStockM_InputStyle:{height:30,borderRadius:5,backgroundColor:PageTheme.$secondary_color_light,paddingHorizontal:10,paddingVertical:5,color:PageTheme.$text_color}, + AddStockM_cancelBtn:{backgroundColor:PageTheme.$bg_color,borderWidth:1,borderColor:PageTheme.$primary_color,minWidth:90}, + AddStockM_cancelBtnText:{color:PageTheme.$primary_color}, + AddStockM_Btn:{minWidth:90}, + + stk_mfdTblBody:{backgroundColor:PageTheme.$bg_color,borderRadius:5,paddingVertical:5}, + stk_mfdTblrow:{marginBottom:5,borderBottomColor:PageTheme.$secondary_color_light,borderBottomWidth:1,padding:5,flexDirection:'row',alignItems:'center',justifyContent:'space-between'}, + stk_mfdTblrow_last:{borderBottomWidth:0,marginBottom:0}, + stk_mfdTblCol:{paddingHorizontal:10,alignItems:'center',width:'24%',}, + stk_mfdTblCol1:{}, + stk_mfdTblCol2:{}, + stk_mfdTblCol3:{}, + stk_mfdTblCol4:{height:35}, + stk_mfdTblColText:{color:PageTheme.$text_color,fontSize:13,fontWeight:'400'}, + stk_mfdTbl_DeleteBtn:{position:'absolute',right:5,backgroundColor:PageTheme.$bg_color,borderRadius:20,width:30,height:30,alignItems:'center',justifyContent:'center',elevation:2,shadowColor:'#000',shadowOffset: { width: 0, height: 2 } , shadowOpacity:0.2}, + + + // album designs + alumbl:{backgroundColor:PageTheme.$bg_color,elevation:3,padding:10,marginBottom:10,borderRadius:4}, + alumbl_img:{height:200,width:'100%',resizeMode:'contain'}, + alumbl_topText:{color:PageTheme.$text_color,fontWeight:'600',marginBottom:10,fontSize:14}, + alumbl_bottomText:{color:PageTheme.$text_color_light,fontWeight:'400',marginTop:10,fontSize:13}, + album_ZOOM:{backgroundColor:'#000',width:wp('100%'),height:hp('100%'),}, + album_ZOOM_wrap:{backgroundColor:'#000',position:'absolute',top:0,left:0,width:wp('100%'),height:hp('100%')+(Platform.OS=='android'?STATUSBAR_HEIGHT:0),zIndex:1}, + album_ZOOM_img:{backgroundColor:'#fff',width:'100%',height:400}, + album_ZOOM_topBar:{position:'relative',backgroundColor:'#fff',width:'100%',height:50,paddingHorizontal:10,paddingVertical:15,marginTop:STATUSBAR_HEIGHT+10,alignItems:'center',flexDirection:'row'}, + album_ZOOM_backBtn:{position:'absolute',left:5,padding:10,}, + album_ZOOM_indicator:{width:'100%',textAlign:'center',fontSize:14,color:PageTheme.$text_color}, + + // AddVisibilityPresent + addVis_Wrapper:{width:'100%',height:'100%',padding:10,paddingTop:0}, + addvisCon:{}, + addvis_pCon:{flexDirection:'row',alignItems:'center',paddingHorizontal:10,paddingBottom:10,marginBottom:10,borderBottomColor:PageTheme.$secondary_color_light,borderBottomWidth:2,}, + addvis_pText:{width:'40%',color:PageTheme.$text_color,fontWeight:'500',fontSize:15}, + addvis_pChoiceBoxCon:{width:'60%',alignItems:'flex-end'}, + addvis_pChoiceBoxbg:{backgroundColor:'#efefef'}, + addVisForm:{paddingHorizontal:10,}, + addVisRow:{flexDirection:'row',width:'100%',flexWrap:'wrap',justifyContent:'center'}, + addVisCol50:{width:'47%',marginBottom:10,}, + addVisCol100:{width:'100%',marginBottom:10,}, + addVisColspace:{paddingHorizontal:5}, + addVisCol1:{marginRight:5,}, + addVisCol2:{marginLeft:5,}, + addVisFormGrp:{}, + addVisInputStyle:{height:40,borderRadius:5,backgroundColor:PageTheme.$secondary_color_light,paddingHorizontal:10,color:PageTheme.$text_color}, + addVisLabel:{color:PageTheme.$text_color,fontSize:14,fontWeight:'400',marginBottom:6}, + addVisPickerStyle:{height:40,borderRadius:5,}, + addVisPickerOverlay:{backgroundColor:'#00000057'}, + addVisPicker_OptionContainerStyle:{backgroundColor:'#fff',paddingHorizontal:0}, + PV_selectStyle:{width:'60%'}, + PV_selectInputStyle:{backgroundColor:PageTheme.$bg_color,width:'100%'}, + addVisPicker_InputStyle:{backgroundColor:PageTheme.$secondary_color_light,borderRadius:5,overflow:'hidden',textAlign:'center',fontSize:14,color:PageTheme.$text_color,paddingVertical:12,paddingHorizontal:12}, + addVisPicker_Dis_InputStyle:{backgroundColor:'#bbbbbb'}, + // addVisPickerStyle_and:{backgroundColor:PageTheme.$secondary_color_light,borderRadius:5}, + // addVisPickerStyle_IOS:{height:40,borderRadius:5,fontSize:14,marginLeft:-10}, + addvis_opStyle:{padding:0}, + addvis_opTextStyle:{paddingVertical:8,paddingHorizontal:10,fontSize:15,color:PageTheme.$text_color}, + addvis_selectedOpStyle:{backgroundColor:PageTheme.$secondary_color_light}, + addvis_selectedOpTextStyle:{paddingVertical:8,paddingHorizontal:10,color:PageTheme.$primary_color,textAlign:'center',fontSize:17}, + addVisCameras:{flexDirection:'row',flexWrap:'wrap'}, + addVisScroll:{height:hp('100%')-260}, + addVisScrollCon:{}, + addVis_btnWrap:{width:'100%',flexDirection:'row',alignItems:'center',justifyContent:'center',paddingBottom:15,paddingTop:5,borderBottomColor:PageTheme.$secondary_color_light,borderBottomWidth:2}, + addVis_btnWrap2:{borderBottomWidth:0,justifyContent:'flex-start'}, + addVis_btn:{paddingHorizontal:20,minWidth:100,paddingVertical:10,borderRadius:40,backgroundColor:PageTheme.$primary_color,alignItems:'center',elevation:2,shadowColor:'#000',shadowOffset:{width:0,height:2},shadowOpacity:0.3}, + addVisBtnText:{fontSize:14,color:PageTheme.$accent_color}, + addVis_list:{paddingTop:10,paddingHorizontal:10,width:'100%'}, + addVis_listhdrText:{color:PageTheme.$primary_color,}, + addVis_listInner:{marginTop:10,}, + addVis_listItem:{position:'relative',backgroundColor:PageTheme.$secondary_color_light,width:'100%',padding:10,borderRadius:5,marginBottom:20,elevation:2,shadowOffset:{width:0,height:2},shadowOpacity:0.15,shadowColor:'#000'}, + addVis_listI_row:{flexDirection:'row',paddingBottom:5,marginBottom:5,borderBottomColor:PageTheme.$accent_color,borderBottomWidth:2,}, + addVis_listI_lastrow:{borderBottomWidth:0,marginBottom:0}, + addVis_listI_Label:{fontSize:15,fontWeight:'500',color:PageTheme.$secondary_color_dark,marginRight:5,width:'50%',flexWrap:'wrap'}, + + addVis_listI_Label2:{fontSize:15,fontWeight:'500',color:PageTheme.$secondary_color_dark,marginRight:5}, + addVis_listI_Val:{fontSize:14,fontWeight:'400',color:PageTheme.$text_color,width:'50%',flexWrap:'wrap'}, + addVis_listI_Val2:{fontSize:14,fontWeight:'400',color:PageTheme.$text_color,width:'40%',flexWrap:'wrap'}, + addVis_listI_Image:{width:80,height:80,borderRadius:5,}, + addVis_listI_row2:{flexDirection:'row',width:'100%'}, + addVis_listIcol1:{width:'60%'}, + addVis_listIcol2:{width:'40%',paddingLeft:10,alignItems:'center'}, + addVis_btnRemove:{padding:8,alignItems:'center',justifyContent:'center',paddingHorizontal:10,borderRadius:40,position:'absolute',right:0,top:-30,backgroundColor:PageTheme.$accent_color,elevation:2,shadowOpacity:0.2,shadowOffset:{width:0,height:2}}, + addVis_listPcon:{width:'48%',marginTop:10,flexDirection:'row',backgroundColor:PageTheme.$bg_color,paddingVertical:3,paddingHorizontal:5,borderRadius:4,}, + addVis_listPcon1:{marginRight:5}, + addVis_listPcon2:{marginLeft:5}, + addVis_listR:{flexDirection:"row",marginTop:10,flexWrap:'wrap'}, + addVis_listRlbl:{fontSize:15,fontWeight:'500',color:PageTheme.$secondary_color_dark,marginRight:5,width:'60%',flexWrap:'wrap'}, + + contactConvWrap:{paddingHorizontal:10,paddingTop:10,width:'100%',height:'100%'}, + contactConvCard:{backgroundColor:PageTheme.$bg_color,elevation:2,shadowColor:'#000',shadowOpacity:0.15,borderRadius:5,shadowOffset:{width:0,height:2},padding:10}, + contactConvCardRow:{flexDirection:'row',flexWrap:'wrap'}, + contactConvCardCol:{width:'100%',marginBottom:10,}, + ccCard_FormGrp:{flexDirection:'row',alignItems:'center'}, + ccCard_lbl:{fontSize:15,fontWeight:'500',color:PageTheme.$secondary_color_dark,width:'45%',paddingRight:10,flexWrap:'wrap'}, + ccCard_input:{width:'55%',backgroundColor:PageTheme.$secondary_color_light,borderRadius:5,overflow:'hidden',textAlign:'left',fontSize:14,color:PageTheme.$text_color,paddingVertical:12,paddingHorizontal:12}, + + // survey list + surveyPageWrapper:{marginTop:10,paddingTop:10,backgroundColor:PageTheme.$secondary_color_light,borderTopLeftRadius:40,borderTopRightRadius:40,}, + surveyList:{width:'100%',}, + surveyListInner:{justifyContent:'center',padding:10,paddingHorizontal:15,width:'100%'}, + surveyItem:{elevation:1,shadowOpacity:1,shadowOffset:{width:0,height:2},shadowColor:'#efefef',backgroundColor:'#0000',marginBottom:10,}, + surveyItem_tile:{flexDirection:'row',alignItems:'center',width:'100%',padding:10,borderRadius:10}, + surveyItem_name:{fontSize:16,fontWeight:'500',color:PageTheme.$text_color,}, + surveyItemCircle:{backgroundColor:'#fff',width:40,height:40,borderRadius:20,alignItems:'center',justifyContent:'center',marginRight:10,}, + surveyItemCircle_Text:{fontSize:16,fontWeight:'500',color:PageTheme.$primary_color,}, + surveyItem_Check:{position:'absolute',width:24,height:24,right:10,borderRadius:15,elevation:3,paddingLeft:0.2,shadowColor:'#000'}, + + // survey cat + surveyCatList:{width:'100%',marginTop:20}, + surveyCatItem:{elevation:1,shadowOpacity:1,shadowOffset:{width:0,height:2},shadowColor:'#000',backgroundColor:PageTheme.$bg_color,marginBottom:10,flexDirection:'row',alignItems:'center',borderRadius:5,paddingHorizontal:10,paddingVertical:5}, + surveyCatItem_name:{fontSize:14,fontWeight:'500',color:PageTheme.$text_color,paddingRight:10,width:wp('100%')-125}, + surveyCatItem_Circle:{backgroundColor:PageTheme.$secondary_color_light,width:40,height:40,borderRadius:20,alignItems:'center',justifyContent:'center',marginRight:10,}, + surveyCatItem_CircleText:{fontSize:16,fontWeight:'500',color:PageTheme.$primary_color,}, + surveyCatItem_Check:{position:'absolute',width:24,height:24,right:10,borderRadius:15,elevation:3,shadowColor:'#000'}, + + + // survey toggle view + SurveyView:{position:'absolute',padding:10,paddingTop:30,paddingBottom:20,top:20,left:0,right:0,width:'100%',height:hp('100%')-(STATUSBAR_HEIGHT+50),shadowOpacity:1,shadowColor:'#8d8d8d',shadowRadius:5,alignItems:'center',borderTopLeftRadius:40,borderTopRightRadius:40,}, + SurveyViewCloseBtn:{position:'absolute',top:-17,right:30,paddingHorizontal:6,paddingVertical:5,borderRadius:20,backgroundColor:PageTheme.$primary_color,shadowColor:'#8d8d8d',shadowOpacity:1,elevation:2,shadowOffset:{width:0,height:2}}, + SurveyViewContent:{width:'100%'}, + SurveyViewContentInner:{padding:10,height:hp('100%')-200}, + SV_activeSurvey:{position:'absolute',top:-17,left:30,shadowColor:'#8d8d8d',shadowOpacity:1,elevation:2,shadowOffset:{width:0,height:2},backgroundColor:'#0000',marginBottom:10,width:wp('100%')-115}, + SV_activeSurvey_tile:{padding:10,borderRadius:30,paddingHorizontal:20,backgroundColor:PageTheme.$primary_color}, + SV_activeSurvey_name:{fontSize:16,fontWeight:'500',color:PageTheme.$accent_color,}, + + // survey questions + surveyQtnScroll:{width:'100%'}, + surveyQtnScrollInner:{width:'100%',paddingBottom:10,paddingHorizontal:5,}, + surveyQtn_InputStyle:{backgroundColor:PageTheme.$secondary_color_light,borderRadius:5,overflow:'hidden',textAlign:'left',fontSize:14,color:PageTheme.$text_color,paddingVertical:12,paddingHorizontal:12,height:40}, + + surveyQtn_datePicker_text: { + textAlign:'left', + width:'100%', + backgroundColor:PageTheme.$secondary_color_light, + paddingVertical:10, + paddingHorizontal:10, + color:PageTheme.$accent_color2, + height:'100%', + justifyContent:'center', + alignItems:'center', + borderRadius:5 + }, + surveyQtn_datePicker:{position:'absolute',width:40,height:40,right:0,top:0,backgroundColor:PageTheme.$primary_color,alignItems:'center',justifyContent:'center',borderTopRightRadius:5,borderBottomRightRadius:5}, + surveyQtn_datePicker_con:{position:'relative',justifyContent:'center',height:40,}, + surveyQtnRatingIcon:{position:'absolute',width:40,height:40,right:0,top:0,backgroundColor:PageTheme.$primary_color,alignItems:'center',justifyContent:'center',borderTopRightRadius:5,borderBottomRightRadius:5}, + + // survey Screen View + SVn_ContentCon:{paddingHorizontal:10,}, + SVn_ContentOuter:{width:'100%',height:hp('100%')-180}, + SVn_ContentInner:{padding:10}, + SVn_activeSurvey:{zIndex:1,position:'absolute',top:-15,left:0,right:0,width:wp('100%'),alignItems:'center',marginBottom:10}, + SVn_activeSurvey_tile:{shadowColor:'#8d8d8d',shadowOpacity:1,elevation:2,shadowOffset:{width:0,height:2},backgroundColor:'#0000',borderRadius:30,paddingHorizontal:15,alignItems:'center',paddingVertical:7,width:wp('100%')-50}, + SVn_SubmitBtn:{position:'absolute',bottom:Platform.OS=='ios'?30:10,left:0,right:0,width:'100%',alignItems:'center'}, + SVn_PageWrapper:{marginTop:10,paddingTop:10,backgroundColor:PageTheme.$bg_color,borderTopLeftRadius:40,borderTopRightRadius:40,}, + SVn_QtnScroll:{width:'100%',paddingTop:20}, + SVn_QtnScrollInner:{width:'100%',paddingBottom:40,paddingHorizontal:5,}, + SVn_GroupView:{paddingTop:20,paddingBottom:30}, + SVn_GroupView_hdr:{paddingHorizontal:10,paddingVertical:5,alignItems:'center'}, + SVn_GroupView_hdrText:{fontSize:13,color:PageTheme.$accent_color}, + SVn_GroupViewList:{paddingTop:10,}, + + // Feedback + FeedbVn_GroupView:{paddingBottom:20}, + + // RatingModal + RatingModal:{position:'absolute',zIndex:99,backgroundColor:'#00000055',alignItems:'center',justifyContent:'center',top:0,left:0,right:0,bottom:0,width:'100%',height:'100%'}, + RatingModalCon:{zIndex:9999,backgroundColor:PageTheme.$bg_color,borderRadius:10,padding:10,width:'80%',elevation:3,shadowColor:'#000',shadowOffset:{width:0,height:2},shadowOpacity:0.3,}, + RatingModalHeding:{textAlign:'center',fontSize:14,color:PageTheme.$text_color,fontWeight:'500',marginBottom:20,marginTop:10,}, + RModal_list:{padding:10,}, + RModal_listInner:{}, + RModal_Btns:{flexDirection:'row',width:'100%',marginTop:20,marginBottom:20,justifyContent:'space-evenly'}, + RModal_BtnCancel:{minWidth:100,paddingHorizontal:15,paddingVertical:7,borderColor:PageTheme.$primary_color,borderWidth:1,borderRadius:30,}, + RModal_BtnTextCancel:{textAlign:'center',fontSize:14,color:PageTheme.$primary_color,fontWeight:'500'}, + RModal_Btnsave:{minWidth:100,paddingHorizontal:15,paddingVertical:7,backgroundColor:PageTheme.$primary_color,borderRadius:30,}, + RModal_BtnTextsave:{textAlign:'center',fontSize:14,color:PageTheme.$accent_color,fontWeight:'500'}, + RModal_listItem:{paddingHorizontal:10,paddingVertical:7,borderRadius:4,marginBottom:10,}, + RModal_listItemText:{textAlign:'center',fontSize:14,color:PageTheme.$text_color,fontWeight:'500'}, + + // Voice Rcorder + VRModalHeding:{textAlign:'center',fontSize:14,color:PageTheme.$text_color,fontWeight:'500',marginTop:10,}, + VRSubHeding:{textAlign:'center',fontSize:12,color:PageTheme.$red,fontWeight:'400',marginBottom:20,marginTop:10,}, + VRSubHeding2:{textAlign:'center',fontSize:12,color:PageTheme.$primary_color,fontWeight:'400',marginTop:10,}, + VRMicBgRipple1:{width:80,height:80,borderWidth:5,borderColor:'#f5acb4c2',borderRadius:40,position:'absolute',top:0,left:0}, + VRMicBgRipple2:{width:80,height:80,borderWidth:5,borderColor:'#fce6e9e3',borderRadius:70,position:'absolute',top:0,left:0}, + + + VoiceRecorder:{width:'100%',alignItems:'center'}, + VoiceRecorderMic:{padding:10,}, + VoiceRecorderMicBtn:{width:60,height:60,backgroundColor:PageTheme.$red,alignItems:'center',justifyContent:'center',borderRadius:40,elevation:3,shadowOpacity:0.2,shadowOffset:{width:0,height:2},shadowColor:'#bdbdbd'}, + VoiceRecorderStopBtn:{width:60,height:60,backgroundColor:PageTheme.$red,position:'absolute',top:10,left:10,alignItems:'center',justifyContent:'center',borderRadius:40,elevation:3,shadowOpacity:0.2,shadowOffset:{width:0,height:2},shadowColor:'#bdbdbd'}, + VoiceRecordedView:{marginTop:30,alignItems:'center',width:'100%'}, + VoiceRecorderTimer:{textAlign:'center',fontSize:13,color:PageTheme.$text_color,fontWeight:'400'}, + + VRPlayBack:{alignItems:'center',flexDirection:'row',marginTop:10,paddingTop:10,borderTopColor:PageTheme.$secondary_color_light,borderTopWidth:2,width:'100%',paddingHorizontal:10,}, + VRPlayBackBarView:{width:'70%',alignItems:'center',}, + VRPlayBackBar:{position:'relative',width:'100%'}, + VRPlayBackBarBg:{width:'100%',height:10,borderRadius:20,backgroundColor:'#efefef'}, + VRPlayBackBarFilled:{width:'10%',position:'absolute',top:0,left:0,height:10,borderRadius:20,backgroundColor:PageTheme.$primary_color}, + VRPlayBackTimer:{}, + VRPlayBackControls:{width:'30%',alignItems:'flex-end'}, + VRPB_Play:{width:40,height:40,backgroundColor:PageTheme.$primary_color,alignItems:'center',justifyContent:'center',borderRadius:40,elevation:3,shadowOpacity:0.2,shadowOffset:{width:0,height:2},shadowColor:'#bdbdbd'}, + VRPB_Pause:{width:40,height:40,backgroundColor:PageTheme.$primary_color,position:'absolute',top:0,right:0,alignItems:'center',justifyContent:'center',borderRadius:40,elevation:3,shadowOpacity:0.2,shadowOffset:{width:0,height:2},shadowColor:'#bdbdbd'}, + + SurveyL_SubmitBtn:{position:'absolute',bottom:Platform.OS=='ios'?30:10,left:10,right:0,width:'100%',paddingBottom:20,alignItems:'center'}, + + // Visitor Login + vl_scrollView:{width:wp('100%')}, + vl_scrollViewInner:{width:'100%',paddingHorizontal:10,}, + vlPageWrapper:{paddingTop:10,backgroundColor:PageTheme.$secondary_color_light}, + + vlUinfo_Card:{marginBottom:10,backgroundColor:PageTheme.$bg_color, borderRadius:10,padding:10,elevation:3,shadowColor:'#000',shadowOffset: { width: 0, height: 2 } , shadowOpacity:0.15}, + vlUinfo_CardRow:{flexDirection:'row',paddingHorizontal:5,paddingVertical:5}, + vlUinfo_CardBorder:{borderBottomColor:PageTheme.$secondary_color_light,borderBottomWidth:2}, + vlUinfo_lbl:{fontSize:14,color:PageTheme.$secondary_color_dark,marginRight:5}, + vlUinfo_text:{fontSize:14,color:PageTheme.$text_color,textTransform:'capitalize'}, + vlEmplForm:{marginTop:10,marginBottom:10,}, + vlEmplFormRow:{flexDirection:'row',alignItems:'center',}, + vlEmplForm_field:{width:'80%'}, + vlEmplForm_InputStyle:{marginRight:10,backgroundColor:PageTheme.$bg_color,borderRadius:7,elevation:3,shadowOffset:{width:0,height:2},shadowColor:'#afafaf',shadowOpacity:1.15,paddingVertical:10,paddingHorizontal:10,color:PageTheme.$text_color}, + vlEmplSearchBtn:{width:'20%',paddingVertical:10,paddingHorizontal:10,alignItems:'center',justifyContent:'center',backgroundColor:PageTheme.$primary_color,borderRadius:7,elevation:3,shadowOffset:{width:0,height:2},shadowColor:'#747474',shadowOpacity:1.15}, + vlEmplSearchBtnText:{fontSize:14,fontWeight:'500',color:'#fff'}, + + vlEmplList:{marginTop:10,}, + vlEmplLDtl:{marginBottom:10,backgroundColor:PageTheme.$primary_color, borderRadius:10,padding:10,elevation:3,shadowColor:'#747474',shadowOffset: { width: 0, height: 2 } , shadowOpacity:1.0}, + vlEmplLDtlRow:{flexDirection:'row',paddingHorizontal:5,paddingVertical:5}, + vlEmplLDtlRow_Lbl:{fontSize:14,color:PageTheme.$accent_color,marginRight:5,fontWeight:'700'}, + vlEmplLDtlRow_Text:{fontSize:14,color:PageTheme.$text_color_light2,marginRight:5,textTransform:'capitalize'}, + vlEmplLDtlRow_Border:{borderBottomColor:PageTheme.$secondary_color_light,borderBottomWidth:1}, + vlEmplLDtlAct:{paddingTop:10,flexDirection:'row',}, + vlED_Act_Cameras:{width:'80%'}, + vlED_Act_CameraCon:{marginRight:10,marginTop:5,}, + vlED_Act_openCam:{}, + vlED_Act_ImageView:{position:'relative',backgroundColor:PageTheme.$secondary_color_light,padding:5,borderRadius:10,width:60,height:60}, + vlED_Act_Image:{width:50,height:50,borderRadius:10,backgroundColor:'#232323'}, + vlED_Act_reCap:{position:'absolute',top:-10,right:-10,padding:8,backgroundColor:PageTheme.$bg_color,borderRadius:30,elevation:2,shadowColor:'#8d8d8d',shadowOffset: { width: 0, height: 2 } , shadowOpacity:0.5}, + vlED_Act_addEmplCon:{width:'20%',justifyContent:'flex-end'}, + vlED_Act_addEmpl:{height:40,paddingHorizontal:10,marginBottom:5,alignItems:'center',justifyContent:'center',backgroundColor:PageTheme.$accent_color,borderRadius:7,elevation:3,shadowOffset:{width:0,height:2},shadowColor:'#efefef',shadowOpacity:1}, + vlED_Act_addEmplText:{fontSize:14,color:PageTheme.$primary_color,textTransform:'capitalize',fontWeight:'600'}, + + + vl_visitorsList:{marginTop:10,borderTopColor:PageTheme.$accent_color,borderTopWidth:2,paddingTop:10,}, + vl_visitorsListText:{fontSize:14,color:PageTheme.$secondary_color_dark,marginRight:5,fontWeight:'500'}, + vl_TblHeader:{marginBottom:10,marginTop:10,backgroundColor:PageTheme.$primary_color, borderRadius:10,padding:5,elevation:3,shadowColor:'#747474',shadowOffset: { width: 0, height: 2 } , shadowOpacity:1.0,flexDirection:'row',alignItems:'center'}, + vl_TblHeaderBox:{alignItems:'center',backgroundColor:PageTheme.$secondary_color_light,paddingVertical:5,borderRadius:5,}, + vl_TblHeaderBox1:{width:wp('30%')-15,marginRight:5}, + vl_TblHeaderBox2:{width:wp('30%')-15,marginRight:5}, + vl_TblHeaderBox3:{width:'40%'}, + vl_TblHeaderTxt:{fontSize:13,color:PageTheme.$text_color,marginRight:5,textTransform:'capitalize',fontWeight:'700'}, + + vl_TblBody:{backgroundColor:PageTheme.$bg_color, borderRadius:10,padding:5,elevation:3,shadowColor:'#afafaf',shadowOffset: { width: 0, height: 2 } , shadowOpacity:1.0}, + vl_visitorsLItem:{flexDirection:'row',alignItems:'center',paddingVertical:10}, + vl_visitorsLItemB:{borderBottomColor:PageTheme.$secondary_color_light,borderBottomWidth:1}, + vl_visitorsLI_Box:{alignItems:'center',}, + vl_visitorsLI_Box1:{width:wp('30%')-15,marginRight:5,alignItems:'flex-start',paddingLeft:5,}, + vl_visitorsLI_Box2:{width:wp('30%')-15,marginRight:5}, + vl_visitorsLI_Box3:{width:'40%',flexDirection:'row',alignItems:'center',position:'relative'}, + vl_visitorsLI_Txt:{fontSize:13,color:PageTheme.$text_color,marginRight:5,textTransform:'capitalize',fontWeight:'400'}, + vl_CheckOutBtn:{backgroundColor:PageTheme.$primary_color,marginRight:5, borderRadius:10,padding:5,paddingHorizontal:10,elevation:3,shadowColor:'#afafaf',shadowOffset: { width: 0, height: 2 } , shadowOpacity:1.0}, + vl_CheckOutBtnText:{color:PageTheme.$accent_color,fontSize:14,fontWeight:'600'}, + vl_DeleteBtn:{position:'absolute',right:5,backgroundColor:PageTheme.$bg_color,borderRadius:20,width:35,height:35,alignItems:'center',justifyContent:'center',elevation:2,shadowColor:'#afafaf',shadowOffset: { width: 0, height: 2 } , shadowOpacity:1.0}, + + vl_checkoutModal:{alignItems:'center',}, + vl_checkoutModalTitle:{fontSize:14,fontWeight:'500',color:PageTheme.$primary_color,marginBottom:10,}, + vl_removeModalTitle:{fontSize:14,fontWeight:'500',color:PageTheme.$text_color,marginBottom:10,marginTop:10,}, + vl_removeModalSubTitle:{fontSize:14,fontWeight:'500',color:PageTheme.$primary_color,marginBottom:20,}, + vl_checkoutM_Con:{width:'100%'}, + vl_checkoutM_Camera:{alignItems:'center',}, + vl_checkoutM_CameraCon:{}, + vl_checkoutM_openCam:{}, + vl_checkoutM_ImageView:{position:'relative',backgroundColor:PageTheme.$secondary_color_light,padding:5,borderRadius:10,width:90,height:90}, + vl_checkoutM_Image:{width:80,height:80,borderRadius:10,backgroundColor:'#232323'}, + vl_checkoutM_recap:{position:'absolute',top:-10,right:-10,padding:8,backgroundColor:PageTheme.$primary_color,borderRadius:30,elevation:2,shadowColor:'#8d8d8d',shadowOffset: { width: 0, height: 2 } , shadowOpacity:0.5}, + vl_checkoutM_btng:{marginTop:20,}, + vlStatus:{flexDirection:'row',alignItems:'center',justifyContent:'center'}, + vlStatus2:{flexDirection:'row',alignItems:'center',justifyContent:'center'}, + + // REports + rp_scrollView:{width:wp('100%'),height:'100%'}, + rp_scrollViewInner:{width:'100%',paddingHorizontal:10,height:'100%'}, + reportCon:{}, + reportConHdr:{backgroundColor:PageTheme.$primary_color, borderRadius:7,paddingVertical:10,paddingHorizontal:10,elevation:3,shadowColor:'#747474',shadowOffset: { width: 0, height: 2 } , shadowOpacity:1.0,flexDirection:'row',justifyContent:'center',marginBottom:5,marginTop:5}, + reportConHdrText:{color:PageTheme.$accent_color,fontSize:14,fontWeight:'500',}, + report_TblHeader:{marginBottom:10,marginTop:10,backgroundColor:PageTheme.$primary_color, borderRadius:10,padding:5,elevation:3,shadowColor:'#747474',shadowOffset: { width: 0, height: 2 } , shadowOpacity:1.0,flexDirection:'row',alignItems:'center'}, + report_TblHeaderBox:{alignItems:'center',backgroundColor:PageTheme.$secondary_color_light,paddingVertical:5,borderRadius:5,}, + report_TblHeaderBox1:{width:wp('40%')-15,marginRight:5}, + report_TblHeaderBox2:{width:wp('30%')-15,marginRight:5}, + report_TblHeaderBox3:{width:'30%'}, + report_TblHeaderTxt:{fontSize:13,color:PageTheme.$text_color,marginRight:5,textTransform:'capitalize',fontWeight:'700'}, + + report_TblBody:{backgroundColor:PageTheme.$bg_color, borderRadius:10,padding:5,elevation:3,shadowColor:'#afafaf',shadowOffset: { width: 0, height: 2 } , shadowOpacity:1.0}, + reportItem:{flexDirection:'row',alignItems:'center',paddingVertical:10}, + reportItemB:{borderBottomColor:PageTheme.$secondary_color_light,borderBottomWidth:1}, + reportItemCol:{alignItems:'center',}, + reportItemCol1:{width:wp('40%')-15,marginRight:5,alignItems:'flex-start',paddingLeft:5,}, + reportItemCol2:{width:wp('30%')-15,marginRight:5}, + reportItemCol3:{width:'30%',alignItems:'center'}, + reportItemColText:{fontSize:13,color:PageTheme.$text_color,marginRight:5,textTransform:'capitalize',fontWeight:'400'}, + + settingsWrap:{padding:10,paddingHorizontal:10,}, + settingsBtn:{flexDirection:'row',alignItems:'center',position:'relative',backgroundColor:PageTheme.$secondary_color_light,paddingVertical:15,paddingHorizontal:10, borderRadius:2,elevation:1,shadowColor:'#afafaf',shadowOffset: { width: 0, height: 2 } , shadowOpacity:0.15,marginBottom:10,}, + settingsBtnText:{fontSize:15,fontWeight:'600',color:PageTheme.$text_color}, + settingsBtnIcon:{position:'absolute',right:10}, + + + // network status bar + netSBar:{position:'absolute',bottom:0,width:'100%',backgroundColor:'#000',alignItems:'center',justifyContent:'center',paddingHorizontal:10,paddingVertical:6}, + netSBarText:{fontSize:13,fontWeight:'500',color:'#fff'}, + netSBarGreen:{backgroundColor:'green'}, + netSBarGrey:{backgroundColor:'red'}, + netSBarGrey_Text:{color:'#fff'}, + netSBarGreen_Text:{color:'#fff'}, + + + // Window styles + Windows_Wrap:{}, + Win_scroll:{justifyContent:'center',padding:10,paddingBottom:10,}, + Win_scrollO:{marginBottom:80,}, + WItem_wrap:{width:'100%',marginBottom:20,}, + WItem_Hdr:{}, + WItem_Hdrbg:{width:'100%',paddingHorizontal:10,paddingVertical:7,backgroundColor:PageTheme.$primary_color,borderRadius:5,justifyContent:'center'}, + WItem_HdrText:{fontSize:14,fontWeight:'500',color:PageTheme.$accent_color}, + WItem_Hdrname2:{fontSize:14,color:PageTheme.$accent_color,fontWeight:'400',marginTop:4,}, + WForm:{marginTop:10,paddingHorizontal:10,position:'relative',marginTop:10,paddingVertical:10,backgroundColor:PageTheme.$secondary_color_light,borderRadius:5,elevation:1,shadowColor:'#484848',shadowOpacity:0.1,shadowOffset:{width:0,height:2}}, + WItem_RefImgBtn:{position:'absolute',right:10,width:40,height:40,borderRadius:20,alignItems:'center',justifyContent:'center'}, + WSCameraWrap:{justifyContent:'center'}, + WSCameraCon:{}, + WSCameraLabel:{fontSize:13,fontWeight:'400',color:'#000',textAlign:'center',marginTop:5}, + WQPicker_InputStyle:{backgroundColor:PageTheme.$bg_color,borderRadius:5,overflow:'hidden',textAlign:'center',fontSize:14,color:PageTheme.$text_color,paddingVertical:12,paddingHorizontal:12}, + WStkWrap:{backgroundColor:PageTheme.$bg_color,marginBottom:10,paddingHorizontal:10,paddingVertical:5,borderRadius:5,elevation:1,shadowColor:'#efefef',shadowOpacity:0.05,shadowOffset:{width:0,height:2}}, + WStkHdrText:{fontSize:13,fontWeight:'500',color:PageTheme.$text_color_dark,marginBottom:10,paddingBottom:5,borderBottomWidth:1,borderBottomColor:PageTheme.$secondary_color_light}, + WStkHdrText2:{fontSize:13,fontWeight:'500',color:PageTheme.$text_color_dark,paddingBottom:5,}, + WStkHdr_checkboxWrap:{flexDirection:'row',alignItems:'flex-start',justifyContent:'flex-start'}, + WStkHdr_checkbox:{alignSelf:'flex-start'}, + WStkHdr_checkboxCon:{position:'absolute',width:25,height:25,top:-5,left:-10,}, + WStkHdr_checkboxpName:{width:'85%',marginLeft:25}, + WStkHdr_PrdcontentWrap:{borderTopColor:PageTheme.$secondary_color_light,borderTopWidth:1,marginTop:5,paddingTop:5,}, + WStkCon:{}, + WStkInputStyle:{backgroundColor:PageTheme.$secondary_color_light,borderRadius:5,overflow:'hidden',textAlign:'center',fontSize:14,color:PageTheme.$text_color,paddingVertical:2,paddingHorizontal:12,height:35}, + windhdrTextCon:{position:'relative',backgroundColor:PageTheme.$fourth_color,paddingHorizontal:10,justifyContent:'center',alignItems:'center',paddingVertical:5,marginBottom:10,borderRadius:4,elevation:5,shadowOpacity:0.2,shadowOffset:{width:0,height:2},shadowColor:'#000'}, + windhdrText:{fontSize:13,fontWeight:'500',color:PageTheme.$text_color,}, + windhdr_checkAllBtnCon:{alignItems:'flex-start',marginBottom:10}, + windhdr_checkAllBtn:{flexDirection:'row',backgroundColor:PageTheme.$fourth_color,paddingRight:10,paddingVertical:3,alignItems:'center',justifyContent:'center',borderRadius:4,elevation:2,shadowOpacity:0.1,shadowOffset:{width:0,height:2},shadowColor:'#000'}, + windhdr_checkAllBtnText:{marginLeft:10,fontSize:13,fontWeight:'500',color:PageTheme.$text_color,}, + WQ_InputStyle:{backgroundColor:PageTheme.$bg_color,borderRadius:5,overflow:'hidden',textAlign:'left',fontSize:14,color:PageTheme.$text_color,paddingVertical:12,paddingHorizontal:12,height:40}, + WQ_datePicker_text: {textAlign:'left',width:'100%',backgroundColor:PageTheme.$bg_color,paddingVertical:10,paddingHorizontal:10,color:PageTheme.$accent_color2,height:'100%',justifyContent:'center',alignItems:'center',borderRadius:5 }, + // contact us + ContUs_Wrap:{padding:10,marginTop:10,}, + ContUs_Hdr:{backgroundColor:PageTheme.$secondary_color_dark,borderRadius:4,justifyContent:'center',alignItems:'center',paddingVertical:10,paddingHorizontal:12}, + ContUs_HdrText:{color:PageTheme.$accent_color,fontSize:14,fontWeight:'500'}, + ContUs_infoBox:{backgroundColor:PageTheme.$secondary_color_light,marginBottom:10,flexDirection:'row',alignItems:'center',borderRadius:5,paddingVertical:10,paddingHorizontal:10}, + ContUs_IB_desc:{marginLeft:10,flexWrap:'wrap',width:'85%',color:PageTheme.$text_color}, + + // Image Types + ImageTypesPageWrap:{paddingHorizontal:10,}, + ImageTypesLHd:{backgroundColor:PageTheme.$primary_color,marginBottom:10,alignItems:'center',borderRadius:5,paddingVertical:10,paddingHorizontal:10,elevation:0.5,shadowOpacity:0.1,shadowOffset:{width:0,height:2},shadowColor:'#000'}, + ImageTypesLHdText:{fontSize:14,fontWeight:'500',color:PageTheme.$accent_color,textAlign:'center'}, + ImageTypesLOuter:{marginTop:10,}, + ImageTypesL:{}, + ImageTypesLCon:{position:'relative',backgroundColor:PageTheme.$secondary_color_light,marginBottom:10,alignItems:'center',borderRadius:5,paddingVertical:10,paddingHorizontal:10,elevation:0.5,shadowOpacity:0.1,shadowOffset:{width:0,height:2},shadowColor:'#000'}, + ImageTypesLName:{fontSize:13,fontWeight:'500',color:PageTheme.$text_color,}, + ImageTypesLImageCountBox:{position:'absolute',top:7,right:10,backgroundColor:PageTheme.$primary_color,width:25,height:25,borderRadius:30,alignItems:'center',justifyContent:'center'}, + ImageTypesLImageCountText:{fontSize:13,fontWeight:'600',color:PageTheme.$accent_color,}, + + // Image Cap Screen + ImageCapCamWrap:{flexDirection:'row',flexWrap:'wrap',alignItems:'flex-start'}, + ImageCapViewWrap:{flexDirection:'row',flexWrap:'wrap',alignItems:'flex-start',marginTop:20,}, + ImageCapCamCon:{marginRight:10,}, + ImgCapWrap:{paddingHorizontal:10,}, + ImgCapCon:{}, + ImgCapBox:{}, + ImgCapBoxTDF:{}, + ImageCapImgViewOuter:{width:'33%'}, + ImageCapImgView:{position:'relative',width:90,backgroundColor:PageTheme.$secondary_color_light,padding:5,borderRadius:10,marginRight:20,marginBottom:20,}, + ImageCapImgView1:{alignItems:'flex-start'}, + ImageCapImgView2:{alignItems:'center'}, + ImageCapImgView3:{alignItems:'flex-end'}, + ImageCapImg:{width:80,height:80,borderRadius:10,backgroundColor:'#232323'}, + ImageCapImgRemove:{position:'absolute',top:-10,right:-10,padding:6,backgroundColor:PageTheme.$red,borderRadius:30,elevation:1,shadowColor:'#000',shadowOpacity:0.2,shadowOffset:{width:0,height:2}}, + + }); +} + +export const customeButtons=(isDarkTheme=defdt,routeName=defrn)=>{ + const PageTheme=GetPageTheme(isDarkTheme,routeName); + return StyleSheet.create({ + buttonStyle: { + backgroundColor: PageTheme.$primary_color, + elevation:5,shadowColor:PageTheme.$primary_color,shadowOffset:{width:0,height:5},shadowRadius:7,shadowOpacity:0.4, + borderRadius: 40,width: wp('85%'),height: 50,display: 'flex',marginTop: 25,alignItems: 'center',justifyContent: 'center' + }, + textStyle: {color: PageTheme.$text_color_100,textAlign: 'center',fontSize: 15,padding: 10,}, + g_buttonStyle:{ + marginTop: 25,height: 50,shadowColor:PageTheme.$primary_color,shadowRadius:7,shadowOffset:{width:0,height:5},shadowOpacity:0.4,borderRadius: 40,backgroundColor:'#0000' + }, + g_linearGradient:{ + backgroundColor: PageTheme.$primary_color, + elevation:5,shadowColor:PageTheme.$primary_color, + borderRadius: 40,width: wp('85%'),display: 'flex',height:'100%',alignItems: 'center',justifyContent: 'center' + }, + g_textStyle: {color: PageTheme.$text_color_100,textAlign: 'center',fontSize: 15,padding: 10,}, + + + }); +} + +export const customCamera_LS=(isDarkTheme=defdt,routeName=defrn)=>{ + const PageTheme=GetPageTheme(isDarkTheme,routeName); + const bottomBarHeight=100; + const topBarHeight=Platform.OS=='ios'?STATUSBAR_HEIGHT+40:40; + return StyleSheet.create({ + IOS_StatusBar:{height:wp('100%'),width:STATUSBAR_HEIGHT,backgroundColor:'#000',zIndex:100000,position:'absolute',left:0,top:0,bottom:0}, + scrollMain:{flex: 1,backgroundColor: 'black',width:'100%',height:'100%',position:'absolute',zIndex:99999,top:0,left:0,right:0}, + // scrollMainInner:{alignItems:'center',height:'100%'}, + btnStyle:{ backgroundColor:'#0096d7',paddingVertical:10,paddingHorizontal:30,borderRadius:20,marginTop:50,elevation:5,shadowColor:'#232323',shadowOffset:{width:0,height:2}}, + btnText:{color:'#fff'}, + imgView:{flex:1,height:300,width:'100%',marginTop:100,paddingHorizontal:20}, + image:{width:'100%',height:300,backgroundColor:'#efefef'}, + customCamera_Wrap:{position:'absolute',top:0,left:0,right:0,bottom:0,zIndex:9999}, + customCamera:{position:'absolute',top:0,left:topBarHeight,right:bottomBarHeight,bottom:0}, + customCameraTop:{top:Platform.OS=='ios'?STATUSBAR_HEIGHT:0,}, + customCamera_bottomBar:{padding:10,backgroundColor:'#000',height:bottomBarHeight,position:'absolute',bottom:0,width:'100%',alignItems:'center',justifyContent:'center'}, + customCamera_capbtn:{elevation:4,shadowColor:'#efefef',width:60,height:60,borderRadius:30,}, + customCamera_capbtn_Outer:{width:60,height:60,borderRadius:30,backgroundColor:'#e4e4e4',paddingLeft:5,paddingTop:5}, + customCamera_capbtn_Inner:{width:50,height:50,borderRadius:30,backgroundColor:'#fff'}, + + customCamera_bottomBar2:{padding:10,backgroundColor:'#000',height:bottomBarHeight,position:'absolute',bottom:0,width:'100%',justifyContent:'center'}, + imgControls_btnCon:{minWidth:100,paddingHorizontal:10,paddingVertical:10}, + imgControls_btn:{alignItems:'center'}, + imgControls_btnText:{fontSize:14,fontWeight:'400',color:'#fff',textAlign:'center'}, + imgControls:{flexDirection:'row',alignItems:'center',justifyContent:'space-between'}, + cameraImgCaptured:{position:'absolute',top:0,left:0,right:0,bottom:bottomBarHeight}, + icbtTop:{marginTop:2,}, + imgControls_centerBtn:{marginTop:-15,minWidth:100,paddingHorizontal:10,paddingVertical:10}, + // flashBtn:{width:35,height:35,borderRadius:30,backgroundColor:'#fff',alignItems:'center',justifyContent:'center',elevation:4,shadowColor:'#fff',shadowOpacity:0.3,shadowOffset:{width:0,height:2}}, + flashBtn:{paddingVertical:10,paddingHorizontal:5,}, + topControls:{position:'absolute',top:0,left:0,bottom:0,backgroundColor:'#000',width:topBarHeight,height:'100%'}, + topControlsInner:{paddingVertical:10,paddingHorizontal:5,alignItems:'center'}, + }); +} + +export const ModalStyles =(isDarkTheme=defdt,routeName=defrn)=>{ + const PageTheme=GetPageTheme(isDarkTheme,routeName); + return StyleSheet.create({ + centeredView: { + backgroundColor: 'rgba(0,0,0,0.5)', + flex: 1, + justifyContent: "center", + alignItems: "center", + }, + modalView: { + margin: 20, + backgroundColor: "white", + borderRadius: 10, + padding: 35, + alignItems: "center", + shadowColor: "#000", + shadowOffset: { + width: 0, + height: 2 + }, + shadowOpacity: 0.25, + shadowRadius: 4, + elevation: 5 + }, + button: { + paddingLeft: 40, + paddingRight: 40, + elevation: 2 + }, + buttonOpen: { + backgroundColor: "#F194FF", + }, + buttonClose: { + backgroundColor: "#2196F3", + }, + textStyle: { + color: "white", + fontWeight: "bold", + textAlign: "center" + }, + modalText: { + marginBottom: 15, + textAlign: "center", + color: "#000", + } + }); +} + diff --git a/src/styles/Themes.js b/src/styles/Themes.js new file mode 100644 index 0000000..e563b86 --- /dev/null +++ b/src/styles/Themes.js @@ -0,0 +1,86 @@ +export const PrimaryTheme = { + primary_theme:true, + $primary_color:'#00968e', + $secondary_color_light:'#e6ecec', + $secondary_color_dark:'#046661', + $gradient1:'#5fd3bb', + $gradient2:'#31ab92', + $tertiary_color:'#999999', + $fourth_color:'#71c4c0', + $bg_color:'#fff', + $accent_color:'#fff', + $accent_color2:'#131313', + $status_bar_color:'#c6e7e6', + $placeholder_color:'#232323', + $icon_color:'#6B84F6', + $text_color:'#454545', + $text_color_light2:'#efefef', + $text_color_light:'#9e9e9e', + $text_color_dark:'#161616', + $text_color_900:'#000000', + $text_color_500:'#999999', + $text_color_300:'#666666', + $text_color_700:'#333333', + $text_color_100:'#ffffff', + $red:'#e3051f', + $red_light100:'#faeaea', + $sidemenuColor:'#00968e', +} + +export const MainThemeLight = { + project_theme:true, + $primary_color:'#00968e', + $secondary_color_light:'#e6ecec', + $secondary_color_dark:'#68a0f3', + $gradient1:'#5fd3bb', + $gradient2:'#31ab92', + $tertiary_color:'#999999', + $fourth_color:'#71c4c0', + $bg_color:'#fff', + $accent_color:'#fff', + $accent_color2:'#131313', + $status_bar_color:'#c6e7e6', + $placeholder_color:'#232323', + $icon_color:'#6B84F6', + $text_color:'#454545', + $text_color_light2:'#efefef', + $text_color_light:'#9e9e9e', + $text_color_dark:'#161616', + $text_color_900:'#000000', + $text_color_500:'#999999', + $text_color_300:'#666666', + $text_color_700:'#333333', + $text_color_100:'#ffffff', + $red:'#e3051f', + $red_light100:'#faeaea', + $sidemenuColor:'#00968e', +} + +export const DarkTheme = { + dark_theme:true, + $primary_color:'#00968e', + $secondary_color_light:'#e6ecec', + $secondary_color_dark:'#68a0f3', + $gradient1:'#5fd3bb', + $gradient2:'#31ab92', + $tertiary_color:'#999999', + $fourth_color:'#71c4c0', + $bg_color:'#fff', + $accent_color:'#fff', + $accent_color2:'#131313', + $status_bar_color:'#c6e7e6', + $placeholder_color:'#232323', + $icon_color:'#6B84F6', + $text_color:'#454545', + $text_color_light2:'#efefef', + $text_color_light:'#9e9e9e', + $text_color_dark:'#161616', + $text_color_900:'#000000', + $text_color_500:'#999999', + $text_color_300:'#666666', + $text_color_700:'#333333', + $text_color_100:'#ffffff', + $red:'#e3051f', + $red_light100:'#faeaea', + $sidemenuColor:'#00968e', +} \ No newline at end of file diff --git a/src/test.js b/src/test.js new file mode 100644 index 0000000..d736dde --- /dev/null +++ b/src/test.js @@ -0,0 +1,176 @@ +function _renderSurveyQtns(image) { + const SurveyQuestions = image.Questions; + + const renderItem = ({ item: qtn, index }) => { + let selansid = '', + selanswer = '', + selimg = '', + selimg2 = '', + showImageTag = false, + showImageTag2 = false; + let id_key = qtn.AIQuestionId + '_AnswerId' + image.QuestionImageId; + let ans_key = qtn.AIQuestionId + '_Answer' + image.QuestionImageId; + let multi_key = qtn.AIQuestionId + '_MultiOption' + image.QuestionImageId; + let date_key = qtn.AIQuestionId + '_Date' + image.QuestionImageId; + let img_key = qtn.AIQuestionId + '_ImagePath1' + image.QuestionImageId; + let imgname_key = qtn.AIQuestionId + '_ImageName1' + image.QuestionImageId; + let img_key2 = qtn.AIQuestionId + '_ImagePath2' + image.QuestionImageId; + let imgname_key2 = qtn.AIQuestionId + '_ImageName2' + image.QuestionImageId; + let rating_key = qtn.AIQuestionId + '_Rating' + image.QuestionImageId; + let voiceClip_key = qtn.AIQuestionId + '_VoiceClip' + image.QuestionImageId; + let list_mcdata = []; + + if (qtn.QuestionType == 'Single choice list') { + selansid = QuestionsData[id_key] != null ? QuestionsData[id_key] : ''; + selanswer = QuestionsData[ans_key] != null ? QuestionsData[ans_key] : ''; + } else if (qtn.QuestionType == 'Multi choice list') { + if (qtn.Answers != null) { + for (var i = 0; i < qtn.Answers.length; i++) { + let obj = { + AIAnswerId: parseInt(qtn.Answers[i].AIAnswerId), + AIAnswerName: qtn.Answers[i].AIAnswerName, + }; + list_mcdata.push(obj); + } + } + selansid = QuestionsData[multi_key] != null && QuestionsData[multi_key] != '' ? QuestionsData[multi_key].split(',') : []; + if (selansid != null && selansid.length > 0) { + let arr = []; + for (var i = 0; i < selansid.length; i++) { + arr.push(parseInt(selansid[i])); + } + selansid = arr; + } + } else if (qtn.QuestionType == 'Number' || qtn.QuestionType == 'Text' || qtn.QuestionType == 'Decimal' || qtn.QuestionType == 'Date') { + selansid = QuestionsData[ans_key]; + selanswer = (qtn.QuestionType == 'Date') ? QuestionsData[date_key] || moment().format('MM/DD/YYYY') : ''; + showImageTag = (qtn.QuestionImageAllow == true || qtn.QuestionImageAllow == 'true' || qtn.QuestionImageAllow == 1); + showImageTag2 = false; + } else if (qtn.QuestionType == 'Rating') { + selanswer = QuestionsData[ans_key] ? QuestionsData[ans_key] : ''; + } else if (qtn.QuestionType == 'Audio') { + selansid = QuestionsData[ans_key] ? QuestionsData[ans_key] : ''; + selanswer = QuestionsData[voiceClip_key] ? QuestionsData[voiceClip_key].filename ||'' : ''; + } + + if (qtn.QuestionType == 'Single choice list' || qtn.QuestionType == 'Multi choice list') { + if (qtn.Answers && qtn.Answers.length > 0) { + for (var i = 0; i < qtn.Answers.length; i++) { + let ansss = qtn.Answers[i]; + let isandImgAl = ansss.ImageAllow1 == true || ansss.ImageAllow1 == 'true' || ansss.ImageAllow1 == 1; + let isandImgAl2 = ansss.ImageAllow2 == true || ansss.ImageAllow2 == 'true' || ansss.ImageAllow2 == 1; + + if (qtn.QuestionType == 'Single choice list' && isandImgAl && ansss.AIAnswerId == selansid) { + showImageTag = true; + } else if (qtn.QuestionType == 'Multi choice list' && isandImgAl && selansid.indexOf(ansss.AIAnswerId) >= 0) { + showImageTag = true; + } + + if (qtn.QuestionType == 'Single choice list' && isandImgAl2 && ansss.AIAnswerId == selansid) { + showImageTag2 = true; + } else if (qtn.QuestionType == 'Multi choice list' && isandImgAl2 && selansid.indexOf(ansss.AIAnswerId) >= 0) { + showImageTag2 = true; + } + } + } + } + +let isDisabled = qtn.isDisabled != null ? qtn.isDisabled : false; + +if (isDisabled == true) { + return ; + } else { + return ( + + {qtn.AIQuestionName} + {qtn.QuestionType == 'Single choice list' && qtn.Answers && render_Picker('AIAnswerName', 'AIAnswerId', onselectionChange, { value: selanswer, qtn, image })} + {qtn.QuestionType == 'Multi choice list' && qtn.Answers && ( + { + console.log('onSelectedItemsChange'); + setMultiSelectValue(selectedItems, qtn, image); + }} + selectedItems={selansid} + selectText="Pick Items" + searchInputPlaceholderText="Search Items..." + tagRemoveIconColor={PrimaryTheme.$primary_color} + tagBorderColor={PrimaryTheme.$primary_color} + tagTextColor={PrimaryTheme.$primary_color} + selectedItemTextColor={PrimaryTheme.$primary_color} + selectedItemIconColor={PrimaryTheme.$primary_color} + tagContainerStyle={{ height: 30, width: '100%', paddingVertical: 5 }} + styleTextTag={{ fontSize: 14 }} + itemTextColor={PrimaryTheme.$text_color} + displayKey="AIAnswerName" + searchInputStyle={{ color: '#CCC' }} + submitButtonColor={PrimaryTheme.$primary_color} + submitButtonText="Submit" + /> + )} + {(qtn.QuestionType == 'Number' || qtn.QuestionType == 'Decimal' || qtn.QuestionType == 'Text') && ( + { + setTextValue(val, qtn, image); + }} + autoComplete="off" + /> + )} + {qtn.QuestionType == 'Date' && ( + + {selansid != '' ? selansid : 'MM/YYYY'} + { + setDateValue(selanswer); + showQtnDatePicker(qtn, true); + }}> + + + + )} + {qtn.QuestionType == 'Rating' && ( + + {selanswer} + { + setRatingQtn(qtn); + setShowRating(true); + }}> + + + + )} + {qtn.QuestionType == 'Audio' && ( + + {selanswer} + { + show_recorder(qtn); + }}> + + + + )} + + ); + } + }; + +return ( + index.toString()} + contentContainerStyle={customStyle.SVn_GroupViewList} + /> + ); +} \ No newline at end of file diff --git a/src/utils/navigations/Navigator.js b/src/utils/navigations/Navigator.js new file mode 100644 index 0000000..26a0fd8 --- /dev/null +++ b/src/utils/navigations/Navigator.js @@ -0,0 +1,58 @@ +import React,{useState,useEffect} from 'react'; +import {StatusBar} from 'react-native'; +import {NavigationContainer} from '@react-navigation/native'; +// import {PrimaryTheme} from '../../styles/Themes'; +import { GetPageTheme } from "../../styles/Global"; +import { AuthStack } from './Routes'; +import { connect } from 'react-redux'; +import { mapStateToProps,mapDispatchToProps } from '../../reducers/contextProvider'; +import {get_item,set_item,clear_item} from '../../components/localStorage'; +import { LogBox } from 'react-native'; +import NetInfo from "@react-native-community/netinfo"; + +LogBox.ignoreLogs(['new NativeEventEmitter']); // Ignore log notification by message +LogBox.ignoreAllLogs(); //Ignore all log notifications +LogBox.ignoreLogs([ + "[react-native-gesture-handler] Seems like you\'re using an old API with gesture components, check out new Gestures system!", +]); +const Navigator = (props)=>{ + const PageTheme=GetPageTheme(false,''); + const {DarkMode}=props; + const [state, setState] = useState({}); + + useEffect(() => { + + const unsubscribe = NetInfo.addEventListener(state => { + + // console.log("Is connected?", state.isConnected); + + var isAlreadyConnected=props.isInternetAvailable==true + // console.log("check if already connected ",isAlreadyConnected); + if(isAlreadyConnected==false || (isAlreadyConnected!=state.isConnected)){ + props.show_ConnChange({showConnChange:true}) + } + props.set_networkStatus({isInternetAvailable:state.isConnected}); + + + }); + + return ()=>{ + unsubscribe(); + } + }, []); + + + + return ( + + + + + ) + + +}; + + + +export default connect(mapStateToProps, mapDispatchToProps)(Navigator) \ No newline at end of file diff --git a/src/utils/navigations/Routes.js b/src/utils/navigations/Routes.js new file mode 100644 index 0000000..e8b2152 --- /dev/null +++ b/src/utils/navigations/Routes.js @@ -0,0 +1,198 @@ +import * as React from 'react'; +import { useRoute } from '@react-navigation/native'; +import { createStackNavigator } from '@react-navigation/stack'; +import { createDrawerNavigator } from '@react-navigation/drawer'; +import {Text,ImageBackground} from 'react-native'; +import { PrimaryTheme } from '../../styles/Themes'; +import { DrawerContent } from './drawerContent'; +import { globalStyles,customStyles,GetPageTheme } from "../../styles/Global"; + +// screens +import Project from '../../screens/Project'; +import Login from '../../screens/Login'; +import Mpin from '../../screens/Mpin'; +import MpinLogin from '../../screens/MpinLogin'; +import NoticeBoard from '../../screens/NoticeBoard'; +import One_QAD from '../../screens/One_QAD'; +import ReportsMenu from '../../screens/ReportsMenu'; +import UploadDataScreen from '../../screens/UploadData'; +import Splash from '../../screens/SplashScreen'; +import VisitorLogin from '../../screens/VisitorLogin'; +import PersonalDocument from '../../screens/PersonalDocument'; +import Training from '../../screens/Training'; +import StoreList from '../../screens/StoreList'; +import StoreDailyMenu from '../../screens/StoreDailyMenu'; +import StoreCheckin from '../../screens/CheckInStore'; +import GeoTag from '../../screens/GeoTag'; +import ShowMap from '../../screens/ShowMap'; +import StoreNonWorkingReasons from '../../screens/StoreNonWorkingReasons'; +import Settings from '../../screens/Settings'; +import CompetitionVisibility from '../../screens/CompetitionVisibility'; +import CompetitionPromotion from '../../screens/CompetitionPromotion'; +import SurveyList from '../../screens/SurveyList'; +import SurveyView from '../../screens/SurveyView'; +import SurveyCat from '../../screens/SurveyCat'; +import ContactUs from '../../screens/ContactUs'; +import StoreImages from '../../screens/StoreImages'; +import StoreImagesCap from '../../screens/StoreImagesCap'; +import CameraScreen from '../../screens/CameraScreen'; +import StoreDailyMenuCat from '../../screens/StoreDailyMenuCat'; + +import TeamList from '../../screensSup/TeamList'; +import Attendance from '../../screensSup/Attendance'; +import Album from '../../screensSup/Album'; +import ReportDetail from '../../screensSup/ReportDetail'; +import BannerDetail from '../../screens/Bannerdetail'; +import HR from '../../screens/HR'; +import ViewListData from '../../screens/ViewListData'; +import VideoScreen from '../../screens/VideoScreen'; +import GetDb from '../../screens/GetDb'; +import GateMeeting from '../../screens/GateMeeting'; +import AddGateMeeting from '../../screens/AddGateMeeting'; +import AttendanceSup from '../../screens/AttendanceSup'; +import VisibilityAudit from '../../screens/VisibilityAudit'; +import VisibilityAuditList from '../../screens/VisibilityAuditList'; +import SearchStoreList from '../../screens/SearchStoreList'; +import DistributorList from '../../screens/DistributorList'; +import DBNonWorkingReasons from '../../screens/DBNonWorkingReasons'; +import DB_POSM from '../../screens/DB_POSM'; +import DB_StoreDailyMenu from '../../screens/DB_StoreDailyMenu'; +import CheckInDistributor from '../../screens/CheckInDistributor'; +import DBVisiCooler from '../../screens/DBVisiCooler'; +import TrainingMenu from '../../screens/TrainingMenu'; + +// new +import ImageAuditStoreList from '../../screens/ImageAuditStoreList'; +import ImageAudit from '../../screens/ImageAudit'; +import NPNDStoreList from '../../screens/NPNDStoreList'; +import POSSale from '../../screens/POSSale'; +import PeopleDetail from '../../screens/PeopleDetail'; +import DashboardReportDetail from '../../screens/DashboardReportDetail'; +import DashboardDrilldown from '../../screens/DashboardDrilldown'; +import PeopleDrilldown from '../../screens/PeopleDrilldown'; +import GroomingPictures from '../../screens/GroomingPictures'; + + +const Stack = createStackNavigator(); +const Drawer = createDrawerNavigator(); + + +function DrawerRoutes(props) { + const route = useRoute(); + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const globalStyle=globalStyles(props.DarkMode,route.name); + let props1=props + + let params=props.route.params? props.route.params:{}; + let UserData=params.UserData || {}; + let username=UserData.UserId || ''; + let set_startDownload=params.set_startDownload || function (){}; + let useremail=''; + let pageprops=props.pageprops; + + return ( + } + screenOptions={{ + headerTintColor:PrimaryTheme.$primary_color, + drawerType:'front', + }}> + {} + + }} /> + + ) +} + + +export const AuthStack = (props) => { + let props1=props; + return( + + + + + + {props =>} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; + diff --git a/src/utils/navigations/RoutesOld.js b/src/utils/navigations/RoutesOld.js new file mode 100644 index 0000000..a7a6606 --- /dev/null +++ b/src/utils/navigations/RoutesOld.js @@ -0,0 +1,192 @@ +import { createStackNavigator } from '@react-navigation/stack'; +import { createDrawerNavigator } from '@react-navigation/drawer'; +import { useRoute } from '@react-navigation/native'; +import Project from '../../screens/Project'; +import Login from '../../screens/Login'; +import Mpin from '../../screens/Mpin'; +import MpinLogin from '../../screens/MpinLogin'; +import NoticeBoard from '../../screens/NoticeBoard'; +import One_QAD from '../../screens/One_QAD'; +import { PrimaryTheme } from '../../styles/Themes'; +// import Icon from 'react-native-vector-icons/Ionicons'; +import DownloadDataScreen from '../../screens/DownloadDataScreen'; +import ReportsMenu from '../../screens/ReportsMenu'; +// import VideoPlayerScreen from '../../screens/VideoPlayer'; +import UploadDataScreen from '../../screens/UploadData'; +import Splash from '../../screens/SplashScreen'; +import VisitorLogin from '../../screens/VisitorLogin'; +import PersonalDocument from '../../screens/PersonalDocument'; +import Training from '../../screens/Training'; +import StoreList from '../../screens/StoreList'; +import StoreDailyMenu from '../../screens/StoreDailyMenu'; +import StoreCheckin from '../../screens/CheckInStore'; +import GeoTag from '../../screens/GeoTag'; +import ShowMap from '../../screens/ShowMap'; +import StoreNonWorkingReasons from '../../screens/StoreNonWorkingReasons'; +import Settings from '../../screens/Settings'; + +import OpeningStock from '../../screens/OpeningStock'; +import BackroomStock from '../../screens/BackroomStock'; +import MiddayStock from '../../screens/MiddayStock'; +import ClosingStock from '../../screens/ClosingStock'; +import ShareOfShelf from '../../screens/ShareOfShelf'; +import PaidVisibility from '../../screens/PaidVisibility'; +import AdditionalVisibility from '../../screens/AdditionalVisibility'; +import CompetitionVisibility from '../../screens/CompetitionVisibility'; +import Promotion from '../../screens/Promotion'; +import CompetitionPromotion from '../../screens/CompetitionPromotion'; +import ContactConversion from '../../screens/ContactConversion'; +import Sale from '../../screens/Sale'; +import SurveyList from '../../screens/SurveyList'; + +import { DrawerContent } from './drawerContent'; +import { globalStyles,customStyles,GetPageTheme } from "../../styles/Global"; +import {Text,ImageBackground} from 'react-native'; +import LinearGradient from 'react-native-linear-gradient'; + +import * as React from 'react'; +import { FontAwesome } from '../../components/icons'; +import { TouchableOpacity } from 'react-native'; +// import { globalStyle } from '../../styles/Global'; + +import DynamicStoreList from '../../screens/DynamicStoreList'; +import DynamicSurveys from '../../screens/DynamicSurveys'; +import DynamicSurveyCat from '../../screens/DynamicSurveyCat'; +import SurveyView from '../../screens/SurveyView'; +import SurveyCat from '../../screens/SurveyCat'; +import SurveyNew from '../../screens/SurveyNew'; +import QuestionsScreen from '../../screens/QuestionsScreen'; +import Window from '../../screens/Window'; +import Stock from '../../screens/Stock'; +import ContactUs from '../../screens/ContactUs'; +import POSM from '../../screens/POSM'; +import Feedback from '../../screens/Feedback'; +import SimplePromotion from '../../screens/SimplePromotion'; +import StoreImages from '../../screens/StoreImages'; +import StoreImagesCap from '../../screens/StoreImagesCap'; +import CameraScreen from '../../screens/CameraScreen'; +import ShelfTalker from '../../screens/ShelfTalker'; +import StockCat from '../../screens/StockCat'; +import StockWithCat from '../../screens/StockWithCat'; +import StoreDailyMenuCat from '../../screens/StoreDailyMenuCat'; +import PromotionOneApp from '../../screens/PromotionOneApp'; +import PaidVisibilityOneApp from '../../screens/PaidVisibilityOneApp'; +import ShareOfShelfOneApp from '../../screens/ShareOfShelfOneApp'; + +const Stack = createStackNavigator(); +const Drawer = createDrawerNavigator(); + + +function DrawerRoutes(props) { + const route = useRoute(); + const PageTheme=GetPageTheme(props.DarkMode,route.name); + const customStyle=customStyles(props.DarkMode,route.name); + const globalStyle=globalStyles(props.DarkMode,route.name); + + let params=props.route.params? props.route.params:{}; + let UserData=params.UserData || {}; + let username=UserData.UserId || ''; + let set_startDownload=params.set_startDownload || function (){}; + let useremail=''; + let pageprops=props.pageprops; + + return ( + } + screenOptions={{ + headerTintColor:PrimaryTheme.$primary_color, + drawerType:'front', + }}> + {} + + }} /> + + ) +} + + +export const AuthStack = (props) => { + let props1=props; + return( + + + + + + {props =>} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; + diff --git a/src/utils/navigations/drawerContent.js b/src/utils/navigations/drawerContent.js new file mode 100644 index 0000000..bce780c --- /dev/null +++ b/src/utils/navigations/drawerContent.js @@ -0,0 +1,361 @@ +import React, { useState, useEffect } from 'react'; +import { useRoute } from '@react-navigation/native'; +import { View, Image, Alert, Platform, Linking } from 'react-native'; +import { DrawerContentScrollView, DrawerItem } from '@react-navigation/drawer'; +import { Title, Caption, Drawer, Text, TouchableRipple, Switch, Modal } from 'react-native-paper'; +import { TouchableOpacity } from 'react-native-gesture-handler'; +import { globalStyles, customStyles, GetPageTheme } from "../../styles/Global"; +import { logout } from '../../components/logout'; +import { version, db } from '../../constants/constants'; +import { get_item, clear_item, set_item } from '../../components/localStorage'; +import { AntDesign, Entypo, EvilIcons, FontAwesome, Ionicons, MaterialIcons } from '../../components/icons'; +import LinearGradient from 'react-native-linear-gradient'; +import { SvgUri, SvgXml } from 'react-native-svg'; +import CustomLoader from '../../components/CustomLoader'; +// import RNExitApp from 'react-native-exit-app'; +import SQLite from 'react-native-sqlite-2'; +import * as RNFS from 'react-native-fs'; + + +// import images +import download_data_image from '../../assets/performics/sidemenu_icons/download_data_icon.svg'; +import dailyrouteplan_image from '../../assets/performics/sidemenu_icons/adhoc_route_plan_icon.svg'; +import leave_management_icon from '../../assets/performics/sidemenu_icons/leave_management_icon.svg'; +import training_icon from '../../assets/performics/sidemenu_icons/training_section_icon.svg'; +import resume_icon from '../../assets/performics/sidemenu_icons/leave_management_icon.svg'; +import visitor_login_icon from '../../assets/performics/sidemenu_icons/visitor_login_icon.svg'; +import upload_data_icon from '../../assets/performics/sidemenu_icons/upload_data_icon.svg'; +import reports_icon from '../../assets/performics/sidemenu_icons/reports_icon.svg'; +import exit_icon from '../../assets/performics/sidemenu_icons/exit_icon.svg'; +import settings_icon from '../../assets/performics/sidemenu_icons/exit_icon.svg'; +import { notify } from '../../components/notify'; +import { getIf_UserIsManager } from '../../controller/functions'; + +export function DrawerContent(props) { + const route = useRoute(); + const propsData = props?.propsData + + + + // get all theme styles acc to current theme set + const PageTheme = GetPageTheme(props.DarkMode, route.name); + const customStyle = customStyles(props.DarkMode, route.name); + const globalStyle = globalStyles(props.DarkMode, route.name); + + + const [isDarkTheme, setIsDarkTheme] = useState(false) + const toggleTheme = () => { + setIsDarkTheme(!isDarkTheme); + } + + + let pageprops = props.pageprops || {}; + let userData = pageprops.sessionData || {}; + const ST = pageprops.StaticText || {}; + let un = userData.UserId || ''; + const activeOpacityC = 0.6; + + function startDownload() { + props.navigation.closeDrawer(); + + if (props.pageprops) { + if (props.pageprops.set_startDownload) { + props.pageprops.set_startDownload({ startDownload: true }); + } + else { + notify(ST.Couldnotstartdownload) + } + } + else { + notify(ST.Couldnotstartdownload) + } + } + + function AskForDownload() { + Alert.alert( + "Performics", + ST.Doyouwanttodownloaddata, + [ + { + text: ST.Cancel, + onPress: () => { }, + style: "cancel" + }, + { text: ST.OK, onPress: () => { startDownload(); } } + ], + ); + } + + function startUpload() { + props.navigation.closeDrawer(); + if (props.pageprops) { + if (props.pageprops.set_startUpload) { + props.pageprops.set_startUpload({ startUpload: true }); + } + else { + notify(ST.Couldnotstartupload) + } + } + else { + notify(ST.Couldnotstartupload) + } + } + + function AskForUpload() { + Alert.alert( + "Performics", + ST.Doyouwanttouploaddata, + [ + { + text: ST.Cancel, + onPress: () => { }, + style: "cancel" + }, + { text: ST.OK, onPress: () => { startUpload(); } } + ], + ); + } + + async function exitApp() { + console.log('exit app'); + clear_item('islogin'); + clear_item('mpin'); + clear_item('loginToken'); + clear_item('loginInfo'); + clear_item('login_credentials'); + clear_item('firsttime'); + clear_item('projectCode'); + clear_item('projectInfo'); + clear_item('loginOfDays'); + const pdata = { islogin: false, SecurityToken: '' }; + props.pageprops ? props.pageprops.set_session(pdata) : ''; + setTimeout(() => { + console.log("exit now"); + props.navigation.reset({index: 0,routes: [{name: "Mpin"}],}); + // RNExitApp.exitApp(); + }, 1000); + } + + async function clearStorage() { + await set_item('DataStorageCleared', '1'); + try { + db.transaction(async function (txn) { + await txn.executeSql(`SELECT name FROM sqlite_schema WHERE type='table' ORDER BY name`, [], async function (txnd, txnres1) { + console.log('q exec:', txnres1.rows.length); + if (txnres1.rows.length > 0) { + for (var i = 0; i < txnres1.rows.length; i++) { + let data = txnres1.rows.item(i); + let index = i; + if (data.name !== 'sqlite_sequence' && data.name != 'android_metadata') { + const q = `drop table ${data.name} `; + console.log(q); + txn.executeSql(q, [], async function (txnd, txnres3) { + console.log(data.name + ' dropped'); + if (index == txnres1.rows.length - 1) { + await exitApp(); + } + }, async function (txn1, txnerr) { + console.log(txnerr); + if (index == txnres1.rows.length - 1) { + await exitApp(); + } + }); + } else { + if (index == txnres1.rows.length - 1) { + await exitApp(); + } + } + } + } + else { + await exitApp(); + } + }, async function (txn1, txnerr) { console.log(txnerr); await exitApp(); }); + }); + + } catch (err) { + console.log(err); + await exitApp(); + } + + } + + function AskForClearStorage() { + Alert.alert( + "Performics", + ST.DoyoureallywanttoclearalldataThiswillremoveallcacheandstorage, + [ + { + text: ST.Cancel, + onPress: () => { }, + style: "cancel" + }, + { text: ST.OK, onPress: () => { clearStorage() } } + ], + ); + } + + async function gotoStore() { + // let loginInfo = await get_item('loginInfo'); + // let loginDetails = JSON.parse(loginInfo); + // let designation=loginDetails.Designation!=null?loginDetails.Designation:''; + + // let ManagersList=pageprops.SUP_ManagerDesigList!=null && pageprops.SUP_ManagerDesigList!="" && typeof pageprops.SUP_ManagerDesigList=="string"?pageprops.SUP_ManagerDesigList.split(","):[]; + // console.log("user designation & ManagersList:",designation,ManagersList); + let userIsManager = await getIf_UserIsManager(pageprops); + + if (userIsManager) { + // if current user is in manager list - then show search wise storelist + console.log("user is manager"); + props.navigation.navigate('StoreList', { showSearchWiseStore: true }); + } + else { + pageprops.SUP_StorewisePJP == true ? props.navigation.navigate('StoreList') : props.navigation.navigate('TeamList'); + } + } + + + // console.log(pageprops.ShowImageAudit, "props.ShowImageAudit") + + return ( + + + + {un} + {/* {uemail} */} + + + + + { AskForDownload() }}> + + {ST.DownloadData} + + + { props.navigation.navigate('Attendance') }}> + + {'Attendance'} + + + {/* + {props.navigation.navigate('AttendanceSup')}}> + + {'Employee Attendance'} + */} + + { gotoStore(); }}> + + {ST.DailyRoutePlan} + + + { props.navigation.navigate('DistributorList') }}> + + {'CD Point'} + + + { props.navigation.navigate('GateMeeting') }}> + + {'Gate Meeting'} + + + {pageprops.ShowImageAudit == true && + { props.navigation.navigate('ImageAuditStoreList') }}> + + {'Image Audit'} + + } + + { AskForUpload() }}> + + {ST.UplaodData} + + + { props.navigation.navigate('GroomingPictures') }}> + + + + {'Grooming Images'} + + + { props.navigation.navigate('ReportsMenu') }}> + + {ST.Report} + + + { props.navigation.navigate('HR') }}> + + {'Add Resume/CV'} + + {/* + {props.navigation.navigate('Training')}}> + + {ST.Training} + */} + + { props.navigation.navigate('TrainingMenu', { 'Contentid': 1 }) }}> + + {"Misc. Documents"} + + + { logout(props) }}> + + {ST.Exit} + + {/* {props.navigation.navigate('DynamicStoreList')}}> + + {'Dynamic Store List'} + */} + {/* {props.navigation.navigate('DynamicSurveys')}}> + + {'Dynamic Surveys'} + */} + {/* + {props.navigation.navigate('GetDb')}}> + + {'GetDb'} + */} + + { props.navigation.navigate('Settings') }}> + + {ST.Settings} + + + { Linking.openURL('https://www.cpm-int.com/legal-stuff/privacy-notice') }}> + + {ST.PrivacyPolicy} + + + { props.navigation.navigate('ContactUs') }}> + + {ST.ContactUs} + + + + + + + {/* + Preference + + + + Dark Theme + + + + */} + + + + + + {version} + + + + + ) +} + diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..c41b7e2 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "@react-native/typescript-config", + "include": ["**/*.ts", "**/*.tsx"], + "exclude": ["**/node_modules", "**/Pods"] +}