This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import { defineStore } from 'pinia' | |
| export const useAuthStore = defineStore({ | |
| id: 'auth', | |
| state: () => ({ | |
| isAuthenticated: false, | |
| user: null | |
| }), | |
| actions: { | |
| async nuxtServerInit() { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import { observable, observe, AnnotationsMap } from "mobx" | |
| import { getCurrentInstance, shallowRef, Ref, triggerRef, readonly, onUnmounted } from "vue" | |
| // Composable | |
| export function useLocalObservable<TStore extends Record<string, any>>( | |
| initializer: () => TStore, | |
| annotations?: AnnotationsMap<TStore, never> | |
| ): Readonly<Ref<TStore>> { | |
| const localObservable = shallowRef(observable(initializer(), annotations, { autoBind: true })) | |
| const dispose = observe(localObservable.value, () => { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | type Suggestions = google.maps.places.AutocompletePrediction[] | null; | |
| describe('Your Test', () => { | |
| const getMaps = (type = 'success', data: Suggestions): any => ({ | |
| maps: { | |
| places: { | |
| AutocompleteService: jest.fn(() => ({ | |
| getPlacePredictions: (_: any, cb: (dataArg: Suggestions) => void) => { | |
| setTimeout(() => { | |
| cb(type === "success" ? data : null); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // https://github.com/vueuse/vue-demi/issues/65 | |
| import { h as hDemi, isVue2 } from 'vue-demi' | |
| interface Options { | |
| props?: Record<any, any>, | |
| domProps?: Record<any, any> | |
| on?: Record<any, any> | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | export default async function svgToCanvas(svgElement: SVGElement): Promise<HTMLCanvasElement> { | |
| return new Promise((resolve, reject) => { | |
| const { width, height } = svgElement.getBoundingClientRect(); | |
| const blob = new Blob([svgElement.outerHTML], { type:'image/svg+xml' }) | |
| const blobURL = window.URL.createObjectURL(blob) | |
| const image = new Image() | |
| image.onload = () => { | |
| window.URL.revokeObjectURL(blobURL) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <template> | |
| <emoji-picker ref="picker"></emoji-picker> | |
| </template> | |
| <script> | |
| import { defineComponent, ref, onMounted, onUnmounted } from 'vue'; | |
| // https://github.com/nolanlawson/emoji-picker-element | |
| import 'emoji-picker-element/picker'; | |
| export default defineComponent({ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <script setup lang="ts"> | |
| import { ref } from 'vue'; | |
| import InfiniteScroll from '~/components/InfiniteScroll.vue'; | |
| import SkeletonPostItem from '~/components/SkeletonPostItem.vue'; | |
| interface State { | |
| loaded: () => void; | |
| complete: () => void; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <template> | |
| <div v-frag> | |
| <slot /> | |
| <v-snackbar v-model="show" :timeout="options.timeout" bottom right> | |
| {{ text }} | |
| <template v-if="options.showCloseButton" #action="{ attrs }"> | |
| <v-btn | |
| :color="options.closeButtonColor" | |
| text | |
| v-bind="attrs" | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <template> | |
| <div v-frag> | |
| <slot /> | |
| <v-dialog | |
| v-model="isOpen" | |
| :max-width="options.width" | |
| :persistent="options.persistent" | |
| > | |
| <v-card> | |
| <v-card-title>{{ title }}</v-card-title> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | export default function openFileDialog( | |
| accept: string, | |
| multiple: boolean, | |
| callback: (arg: Event) => void | |
| ) { | |
| // this function must be called from a user | |
| // activation event (ie an onclick event) | |
| // Create an input element | |
| const inputElement = document.createElement('input'); |