[
  {
    "path": ".eslintrc.json",
    "content": "{\n  \"extends\": \"next/core-web-vitals\",\n  \"rules\": {\n    \"@typescript-eslint/no-explicit-any\": \"off\",\n    \"@typescript-eslint/no-var-requires\": \"off\",\n    \"@typescript-eslint/no-namespace\": \"off\",\n    \"@next/next/no-img-element\": \"off\",\n    \"react-hooks/exhaustive-deps\": \"off\",\n    \"no-console\": \"warn\",\n    \"prefer-const\": \"warn\"\n  }\n}\n"
  },
  {
    "path": ".firebaserc",
    "content": "{\n  \"projects\": {\n    \"default\": \"writedown-4a984\"\n  }\n}\n"
  },
  {
    "path": ".gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# next.js\n/.next/\n/out/\n\n# production\n/build\n\n# misc\n.DS_Store\n*.pem\n\n# debug\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n.pnpm-debug.log*\n\n# local env files\n.env*.local\n\n# vercel\n.vercel\n\n# typescript\n*.tsbuildinfo\nnext-env.d.ts\nfirebase-debug.log\nfirestore-debug.log\n*.log\n\n#PWA Files\n/public/precache.*.*.js\n/public/sw.js\n/public/workbox-*.js\n/public/worker-*.js\n/public/fallback-*.js\n/public/precache.*.*.js.map\n/public/sw.js.map\n/public/workbox-*.js.map\n/public/worker-*.js.map\n/public/fallback-*.js\n\n/firebase/\n/firebase/**/*\n\nfunctions/\n.npmrc"
  },
  {
    "path": ".husky/pre-commit",
    "content": "#!/usr/bin/env sh\n. \"$(dirname -- \"$0\")/_/husky.sh\"\n\nnpx pretty-quick --staged\nnpm run lint"
  },
  {
    "path": ".prettierrc",
    "content": "{\n  \"plugins\": [\"prettier-plugin-tailwindcss\"],\n  \"arrowParens\": \"always\",\n  \"bracketSpacing\": true,\n  \"endOfLine\": \"lf\",\n  \"htmlWhitespaceSensitivity\": \"css\",\n  \"jsxSingleQuote\": false,\n  \"printWidth\": 80,\n  \"proseWrap\": \"preserve\",\n  \"quoteProps\": \"as-needed\",\n  \"semi\": true,\n  \"tabWidth\": 2,\n  \"trailingComma\": \"es5\"\n}\n"
  },
  {
    "path": ".vscode/extensions.json",
    "content": "{\n  \"recommendations\": [\n    \"formulahendry.auto-close-tag\",\n    \"steoates.autoimport\",\n    \"formulahendry.auto-rename-tag\",\n    \"dsznajder.es7-react-js-snippets\",\n    \"beatzoid.http-status-codes\",\n    \"shd101wyy.markdown-preview-enhanced\",\n    \"esbenp.prettier-vscode\",\n    \"afzalsayed96.reacticons\",\n    \"jeffersonlicet.snipped\",\n    \"simonsiefke.svg-preview\",\n    \"bradlc.vscode-tailwindcss\",\n    \"chakrounanas.turbo-console-log\",\n    \"mgmcdermott.vscode-language-babel\",\n    \"naumovs.color-highlight\",\n    \"mrmlnc.vscode-duplicate\",\n    \"irongeek.vscode-env\",\n    \"eamodio.gitlens\",\n    \"pkief.material-icon-theme\",\n    \"pkief.material-product-icons\",\n    \"csstools.postcss\",\n    \"usernamehw.errorlens\"\n  ]\n}\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published\n    by the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<https://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "README.md",
    "content": "<div align=\"center\">\n\n# ✏ [writedown (beta)](https://writedown.app)\n\n#### Free and Open Source Markdown Diary\n\n#### Public Blogs and Private Notes\n\nWrite. Share. Inspire.\n\n**writedown** is the new way of writing markdown notes fast and easily.  \nWith a beautiful interface and polished user experience, writedown is simple but powerful.\n\n![806shots_so (1)](https://user-images.githubusercontent.com/25067102/232125868-062e2438-c387-4c30-86e2-2766ff300cd0.png)\n\n</div>\n\n## 🤔 Why writedown?\n\nLove simplicity? **Good.**  \nHate complexity? **Even Better!**\n\n**writedown**'s focus is on providing a polished experience. A simple markdown editor you can use for writing notes quickly to publish and share them with the world.\n\n### Here's what writedown provides that most other editors don't:\n\n📴 **Offline support**  \n☁️ **Cloud Sync**  \n🤝 **Free and Open Source**  \n🪟 **Real-time Markdown Preview**  \n📨 **Publishing and Sharing**  \n🌹 **Simple and beautiful interface**\n\n[**GET STARTED IN JUST 5 SECONDS!**](https://writedown.app/login)\n\n## ✨ Features\n\n### Here are the markdown features that writedown supports:\n\n- Headings (1 to 4)\n- Bold\n- Italics\n- Underline\n- Quotes\n- Strikethrough\n- Ordered List\n- Unordered List\n- Task List\n- Code Block\n- Image\n- Horizontal Rule (Line)\n\n### Along with that, writedown lets you:\n\n- Share posts with people\n- Create your personalized landing page\n- Add your social media links\n\nand many more being added as you read this!\n\n## 🧑‍💻️ Development\n\nwritedown is self-hostable with Firebase and Node.js.  \nTo run a local instance, follow these steps:\n\n0. First install [Volta](https://volta.sh/). Then open your terminal and enter: `volta install node`.\n1. Enter the following commands in your terminal.\n\n```bash\ngit clone https://github.com/NayamAmarshe/writedown\ncd writedown\n```\n\n2. [Setup Firebase Emulator](https://github.com/NayamAmarshe/writedown/blob/main/docs/firebase.md)\n3. [Setup TipTap Editor](docs/tiptap.md)\n4. Install dependencies with: `npm install`\n5. Run local dev server with: `npm run dev`\n   OR local production server with `npm run build && npm run start`.\n\n#\n\n<div align=\"center\">\n\n© 2023 **writedown**. All rights reserved.\n\n</div>\n"
  },
  {
    "path": "animations/pencil-write-dark.json",
    "content": "{\n  \"nm\": \"Pencil\",\n  \"ddd\": 0,\n  \"h\": 800,\n  \"w\": 800,\n  \"meta\": { \"g\": \"@lottiefiles/toolkit-js 0.26.1\" },\n  \"layers\": [\n    {\n      \"ty\": 4,\n      \"nm\": \"line\",\n      \"sr\": 1,\n      \"st\": 0,\n      \"op\": 49,\n      \"ip\": 0,\n      \"hd\": false,\n      \"ddd\": 0,\n      \"bm\": 0,\n      \"hasMask\": false,\n      \"ao\": 0,\n      \"ks\": {\n        \"a\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n        \"s\": { \"a\": 0, \"k\": [100, 100, 100] },\n        \"sk\": { \"a\": 0, \"k\": 0 },\n        \"p\": { \"a\": 0, \"k\": [400, 400, 0] },\n        \"r\": { \"a\": 0, \"k\": 0 },\n        \"sa\": { \"a\": 0, \"k\": 0 },\n        \"o\": { \"a\": 0, \"k\": 100 }\n      },\n      \"ef\": [],\n      \"shapes\": [\n        {\n          \"ty\": \"gr\",\n          \"bm\": 0,\n          \"hd\": false,\n          \"mn\": \"ADBE Vector Group\",\n          \"nm\": \"Shape 1\",\n          \"ix\": 1,\n          \"cix\": 2,\n          \"np\": 4,\n          \"it\": [\n            {\n              \"ty\": \"sh\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Shape - Group\",\n              \"nm\": \"Path 1\",\n              \"ix\": 1,\n              \"d\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"c\": false,\n                  \"i\": [\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"o\": [\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [-198.875, 197.5],\n                    [197.938, 197.5]\n                  ]\n                }\n              }\n            },\n            {\n              \"ty\": \"tm\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Filter - Trim\",\n              \"nm\": \"Trim Paths 1\",\n              \"ix\": 2,\n              \"e\": {\n                \"a\": 1,\n                \"k\": [\n                  {\n                    \"o\": { \"x\": 0.522, \"y\": 0 },\n                    \"i\": { \"x\": 0.442, \"y\": 1 },\n                    \"s\": [0],\n                    \"t\": 0\n                  },\n                  { \"s\": [100], \"t\": 20 }\n                ],\n                \"ix\": 2\n              },\n              \"o\": { \"a\": 0, \"k\": 0, \"ix\": 3 },\n              \"s\": {\n                \"a\": 1,\n                \"k\": [\n                  {\n                    \"o\": { \"x\": 0.333, \"y\": 0 },\n                    \"i\": { \"x\": 0.667, \"y\": 1 },\n                    \"s\": [0],\n                    \"t\": 9\n                  },\n                  { \"s\": [100], \"t\": 27 }\n                ],\n                \"ix\": 1\n              },\n              \"m\": 1\n            },\n            {\n              \"ty\": \"st\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Graphic - Stroke\",\n              \"nm\": \"Stroke 1\",\n              \"lc\": 1,\n              \"lj\": 1,\n              \"ml\": 4,\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 14 },\n              \"c\": { \"a\": 0, \"k\": [0.9451, 0.9608, 0.9765] }\n            },\n            {\n              \"ty\": \"tr\",\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"p\": { \"a\": 0, \"k\": [0, 0], \"ix\": 2 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 }\n            }\n          ]\n        }\n      ],\n      \"ind\": 1\n    },\n    {\n      \"ty\": 3,\n      \"nm\": \"pencilRot\",\n      \"sr\": 1,\n      \"st\": 0,\n      \"op\": 49,\n      \"ip\": 0,\n      \"hd\": false,\n      \"ddd\": 0,\n      \"bm\": 0,\n      \"hasMask\": false,\n      \"ao\": 0,\n      \"ks\": {\n        \"a\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n        \"s\": { \"a\": 0, \"k\": [100, 100, 100] },\n        \"sk\": { \"a\": 0, \"k\": 0 },\n        \"p\": {\n          \"a\": 1,\n          \"k\": [\n            {\n              \"o\": { \"x\": 0.522, \"y\": 0 },\n              \"i\": { \"x\": 0.442, \"y\": 1 },\n              \"s\": [200, 422, 0],\n              \"t\": 0,\n              \"ti\": [0, 0, 0],\n              \"to\": [0, 0, 0]\n            },\n            {\n              \"o\": { \"x\": 0.333, \"y\": 0 },\n              \"i\": { \"x\": 1, \"y\": 1 },\n              \"s\": [600, 422, 0],\n              \"t\": 20,\n              \"ti\": [194, 0, 0],\n              \"to\": [0, 0, 0]\n            },\n            {\n              \"o\": { \"x\": 0, \"y\": 0 },\n              \"i\": { \"x\": 0.667, \"y\": 1 },\n              \"s\": [400, 217, 0],\n              \"t\": 36,\n              \"ti\": [0, 0, 0],\n              \"to\": [-179, 0, 0]\n            },\n            { \"s\": [200, 422, 0], \"t\": 48 }\n          ]\n        },\n        \"r\": {\n          \"a\": 1,\n          \"k\": [\n            {\n              \"o\": { \"x\": 0.7, \"y\": 0 },\n              \"i\": { \"x\": 0.256, \"y\": 1 },\n              \"s\": [0],\n              \"t\": 20\n            },\n            { \"s\": [-360], \"t\": 48 }\n          ]\n        },\n        \"sa\": { \"a\": 0, \"k\": 0 },\n        \"o\": { \"a\": 0, \"k\": 0 }\n      },\n      \"ef\": [],\n      \"ind\": 2\n    },\n    {\n      \"ty\": 4,\n      \"nm\": \"pencil\",\n      \"sr\": 1,\n      \"st\": 0,\n      \"op\": 49,\n      \"ip\": 0,\n      \"hd\": false,\n      \"ddd\": 0,\n      \"bm\": 0,\n      \"hasMask\": false,\n      \"ao\": 0,\n      \"ks\": {\n        \"a\": { \"a\": 0, \"k\": [524.082, 810.037, 0] },\n        \"s\": { \"a\": 0, \"k\": [60, 60, 100] },\n        \"sk\": { \"a\": 0, \"k\": 0 },\n        \"p\": { \"a\": 0, \"k\": [0, 162.022, 0] },\n        \"r\": {\n          \"a\": 1,\n          \"k\": [\n            {\n              \"o\": { \"x\": 0.469, \"y\": 0 },\n              \"i\": { \"x\": 0.212, \"y\": 1 },\n              \"s\": [-6],\n              \"t\": 0\n            },\n            {\n              \"o\": { \"x\": 0.441, \"y\": 0 },\n              \"i\": { \"x\": 1, \"y\": 1 },\n              \"s\": [11],\n              \"t\": 20\n            },\n            {\n              \"o\": { \"x\": 0, \"y\": 0 },\n              \"i\": { \"x\": 0.415, \"y\": 1 },\n              \"s\": [0],\n              \"t\": 36\n            },\n            { \"s\": [-6], \"t\": 48 }\n          ]\n        },\n        \"sa\": { \"a\": 0, \"k\": 0 },\n        \"o\": { \"a\": 0, \"k\": 100 }\n      },\n      \"ef\": [],\n      \"shapes\": [\n        {\n          \"ty\": \"gr\",\n          \"bm\": 0,\n          \"hd\": false,\n          \"mn\": \"ADBE Vector Group\",\n          \"nm\": \"Group 1\",\n          \"ix\": 1,\n          \"cix\": 2,\n          \"np\": 2,\n          \"it\": [\n            {\n              \"ty\": \"sh\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Shape - Group\",\n              \"nm\": \"Path 1\",\n              \"ix\": 1,\n              \"d\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"c\": false,\n                  \"i\": [\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"o\": [\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [548, 341],\n                    [548, 657]\n                  ]\n                }\n              }\n            },\n            {\n              \"ty\": \"st\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Graphic - Stroke\",\n              \"nm\": \"Stroke 1\",\n              \"lc\": 1,\n              \"lj\": 1,\n              \"ml\": 10,\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 10 },\n              \"c\": { \"a\": 0, \"k\": [0.9451, 0.9608, 0.9765] }\n            },\n            {\n              \"ty\": \"tr\",\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"p\": { \"a\": 0, \"k\": [0, 0], \"ix\": 2 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 }\n            }\n          ]\n        },\n        {\n          \"ty\": \"gr\",\n          \"bm\": 0,\n          \"hd\": false,\n          \"mn\": \"ADBE Vector Group\",\n          \"nm\": \"Group 2\",\n          \"ix\": 2,\n          \"cix\": 2,\n          \"np\": 2,\n          \"it\": [\n            {\n              \"ty\": \"sh\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Shape - Group\",\n              \"nm\": \"Path 1\",\n              \"ix\": 1,\n              \"d\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"c\": false,\n                  \"i\": [\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"o\": [\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [-0.063, -159.25],\n                    [0.063, 159.25]\n                  ]\n                }\n              }\n            },\n            {\n              \"ty\": \"st\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Graphic - Stroke\",\n              \"nm\": \"Stroke 1\",\n              \"lc\": 1,\n              \"lj\": 1,\n              \"ml\": 10,\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 10 },\n              \"c\": { \"a\": 0, \"k\": [0.9451, 0.9608, 0.9765] }\n            },\n            {\n              \"ty\": \"tr\",\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"p\": { \"a\": 0, \"k\": [500.063, 497.25], \"ix\": 2 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 }\n            }\n          ]\n        },\n        {\n          \"ty\": \"gr\",\n          \"bm\": 0,\n          \"hd\": false,\n          \"mn\": \"ADBE Vector Group\",\n          \"nm\": \"Group 3\",\n          \"ix\": 3,\n          \"cix\": 2,\n          \"np\": 2,\n          \"it\": [\n            {\n              \"ty\": \"sh\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Shape - Group\",\n              \"nm\": \"Path 1\",\n              \"ix\": 1,\n              \"d\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"c\": false,\n                  \"i\": [\n                    [0, 0],\n                    [13.222, 0],\n                    [0, 13.222]\n                  ],\n                  \"o\": [\n                    [0, 13.222],\n                    [-13.221, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [23.94, -11.97],\n                    [0, 11.97],\n                    [-23.94, -11.97]\n                  ]\n                }\n              }\n            },\n            {\n              \"ty\": \"st\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Graphic - Stroke\",\n              \"nm\": \"Stroke 1\",\n              \"lc\": 1,\n              \"lj\": 1,\n              \"ml\": 10,\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 10 },\n              \"c\": { \"a\": 0, \"k\": [0.9451, 0.9608, 0.9765] }\n            },\n            {\n              \"ty\": \"tr\",\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"p\": { \"a\": 0, \"k\": [524.06, 668.47], \"ix\": 2 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 }\n            }\n          ]\n        },\n        {\n          \"ty\": \"gr\",\n          \"bm\": 0,\n          \"hd\": false,\n          \"mn\": \"ADBE Vector Group\",\n          \"nm\": \"Group 4\",\n          \"ix\": 4,\n          \"cix\": 2,\n          \"np\": 2,\n          \"it\": [\n            {\n              \"ty\": \"sh\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Shape - Group\",\n              \"nm\": \"Path 1\",\n              \"ix\": 1,\n              \"d\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"c\": true,\n                  \"i\": [\n                    [0, 0],\n                    [-13.222, 0],\n                    [0, -13.221],\n                    [0, 0]\n                  ],\n                  \"o\": [\n                    [0, -13.222],\n                    [13.221, 0],\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [-23.939, -6.583],\n                    [0, -30.523],\n                    [23.94, -6.583],\n                    [0, 30.523]\n                  ]\n                }\n              }\n            },\n            {\n              \"ty\": \"fl\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Graphic - Fill\",\n              \"nm\": \"Fill 1\",\n              \"c\": { \"a\": 0, \"k\": [0.9451, 0.9608, 0.9765] },\n              \"r\": 1,\n              \"o\": { \"a\": 0, \"k\": 100 }\n            },\n            {\n              \"ty\": \"tr\",\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"p\": { \"a\": 0, \"k\": [524.06, 773.81], \"ix\": 2 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 }\n            }\n          ]\n        },\n        {\n          \"ty\": \"gr\",\n          \"bm\": 0,\n          \"hd\": false,\n          \"mn\": \"ADBE Vector Group\",\n          \"nm\": \"Group 5\",\n          \"ix\": 5,\n          \"cix\": 2,\n          \"np\": 2,\n          \"it\": [\n            {\n              \"ty\": \"sh\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Shape - Group\",\n              \"nm\": \"Path 1\",\n              \"ix\": 1,\n              \"d\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"c\": false,\n                  \"i\": [\n                    [0, 0],\n                    [6.412, 0],\n                    [0, 13.222]\n                  ],\n                  \"o\": [\n                    [-4.297, 4.104],\n                    [-13.222, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [20.236, 5.345],\n                    [3.704, 11.97],\n                    [-20.236, -11.97]\n                  ]\n                }\n              }\n            },\n            {\n              \"ty\": \"st\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Graphic - Stroke\",\n              \"nm\": \"Stroke 1\",\n              \"lc\": 1,\n              \"lj\": 1,\n              \"ml\": 10,\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 10 },\n              \"c\": { \"a\": 0, \"k\": [0.9451, 0.9608, 0.9765] }\n            },\n            {\n              \"ty\": \"tr\",\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"p\": { \"a\": 0, \"k\": [568.231, 668.47], \"ix\": 2 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 }\n            }\n          ]\n        },\n        {\n          \"ty\": \"gr\",\n          \"bm\": 0,\n          \"hd\": false,\n          \"mn\": \"ADBE Vector Group\",\n          \"nm\": \"Group 6\",\n          \"ix\": 6,\n          \"cix\": 2,\n          \"np\": 2,\n          \"it\": [\n            {\n              \"ty\": \"sh\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Shape - Group\",\n              \"nm\": \"Path 1\",\n              \"ix\": 1,\n              \"d\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"c\": false,\n                  \"i\": [\n                    [0, 0],\n                    [13.222, 0],\n                    [3.802, 2.543]\n                  ],\n                  \"o\": [\n                    [0, 13.222],\n                    [-4.917, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [18.616, -11.97],\n                    [-5.324, 11.97],\n                    [-18.616, 7.944]\n                  ]\n                }\n              }\n            },\n            {\n              \"ty\": \"st\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Graphic - Stroke\",\n              \"nm\": \"Stroke 1\",\n              \"lc\": 1,\n              \"lj\": 1,\n              \"ml\": 10,\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 10 },\n              \"c\": { \"a\": 0, \"k\": [0.9451, 0.9608, 0.9765] }\n            },\n            {\n              \"ty\": \"tr\",\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"p\": { \"a\": 0, \"k\": [481.509, 668.47], \"ix\": 2 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 }\n            }\n          ]\n        },\n        {\n          \"ty\": \"gr\",\n          \"bm\": 0,\n          \"hd\": false,\n          \"mn\": \"ADBE Vector Group\",\n          \"nm\": \"Group 7\",\n          \"ix\": 7,\n          \"cix\": 2,\n          \"np\": 2,\n          \"it\": [\n            {\n              \"ty\": \"sh\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Shape - Group\",\n              \"nm\": \"Path 1\",\n              \"ix\": 1,\n              \"d\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"c\": false,\n                  \"i\": [\n                    [0, 0],\n                    [-33.936, 0],\n                    [0, -34]\n                  ],\n                  \"o\": [\n                    [0, -34],\n                    [33.935, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [-61.446, 30.723],\n                    [0, -30.723],\n                    [61.446, 30.723]\n                  ]\n                }\n              }\n            },\n            {\n              \"ty\": \"st\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Graphic - Stroke\",\n              \"nm\": \"Stroke 1\",\n              \"lc\": 3,\n              \"lj\": 1,\n              \"ml\": 10,\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 20 },\n              \"c\": { \"a\": 0, \"k\": [0.9451, 0.9608, 0.9765] }\n            },\n            {\n              \"ty\": \"tr\",\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"p\": { \"a\": 0, \"k\": [524.06, 245.277], \"ix\": 2 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 }\n            }\n          ]\n        },\n        {\n          \"ty\": \"gr\",\n          \"bm\": 0,\n          \"hd\": false,\n          \"mn\": \"ADBE Vector Group\",\n          \"nm\": \"Group 8\",\n          \"ix\": 8,\n          \"cix\": 2,\n          \"np\": 2,\n          \"it\": [\n            {\n              \"ty\": \"sh\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Shape - Group\",\n              \"nm\": \"Path 1\",\n              \"ix\": 1,\n              \"d\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"c\": true,\n                  \"i\": [\n                    [0, 0],\n                    [0, 0],\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"o\": [\n                    [0, 0],\n                    [0, 0],\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [61.446, 10.827],\n                    [-61.446, 10.827],\n                    [-61.446, -10.827],\n                    [61.446, -10.827]\n                  ]\n                }\n              }\n            },\n            {\n              \"ty\": \"fl\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Graphic - Fill\",\n              \"nm\": \"Fill 1\",\n              \"c\": { \"a\": 0, \"k\": [0.9451, 0.9608, 0.9765] },\n              \"r\": 1,\n              \"o\": { \"a\": 0, \"k\": 100 }\n            },\n            {\n              \"ty\": \"tr\",\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"p\": { \"a\": 0, \"k\": [524.06, 336.333], \"ix\": 2 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 }\n            }\n          ]\n        },\n        {\n          \"ty\": \"gr\",\n          \"bm\": 0,\n          \"hd\": false,\n          \"mn\": \"ADBE Vector Group\",\n          \"nm\": \"Group 9\",\n          \"ix\": 9,\n          \"cix\": 2,\n          \"np\": 2,\n          \"it\": [\n            {\n              \"ty\": \"sh\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Shape - Group\",\n              \"nm\": \"Path 1\",\n              \"ix\": 1,\n              \"d\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"c\": true,\n                  \"i\": [\n                    [0, 0],\n                    [0, 0],\n                    [0, 0],\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"o\": [\n                    [0, 0],\n                    [0, 0],\n                    [0, 0],\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [61.446, 130.452],\n                    [0, 258.452],\n                    [-61.446, 130.452],\n                    [-61.446, -258.452],\n                    [61.446, -258.452]\n                  ]\n                }\n              }\n            },\n            {\n              \"ty\": \"st\",\n              \"bm\": 0,\n              \"hd\": false,\n              \"mn\": \"ADBE Vector Graphic - Stroke\",\n              \"nm\": \"Stroke 1\",\n              \"lc\": 1,\n              \"lj\": 1,\n              \"ml\": 10,\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 20 },\n              \"c\": { \"a\": 0, \"k\": [0.9451, 0.9608, 0.9765] }\n            },\n            {\n              \"ty\": \"tr\",\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"p\": { \"a\": 0, \"k\": [524.06, 551.548], \"ix\": 2 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 }\n            }\n          ]\n        }\n      ],\n      \"ind\": 3,\n      \"parent\": 2\n    },\n    {\n      \"ty\": 4,\n      \"nm\": \"Shape Layer 1\",\n      \"sr\": 1,\n      \"st\": 0,\n      \"op\": 49,\n      \"ip\": 0,\n      \"hd\": false,\n      \"ddd\": 0,\n      \"bm\": 0,\n      \"hasMask\": false,\n      \"ao\": 0,\n      \"ks\": {\n        \"a\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n        \"s\": { \"a\": 0, \"k\": [100, 100, 100] },\n        \"sk\": { \"a\": 0, \"k\": 0 },\n        \"p\": { \"a\": 0, \"k\": [400, 400, 0] },\n        \"r\": { \"a\": 0, \"k\": 0 },\n        \"sa\": { \"a\": 0, \"k\": 0 },\n        \"o\": { \"a\": 0, \"k\": 100 }\n      },\n      \"ef\": [],\n      \"shapes\": [],\n      \"ind\": 4\n    }\n  ],\n  \"v\": \"4.6.6\",\n  \"fr\": 24,\n  \"op\": 48,\n  \"ip\": 0,\n  \"assets\": []\n}\n"
  },
  {
    "path": "animations/pencil-write.json",
    "content": "{\n  \"v\": \"4.6.6\",\n  \"fr\": 24,\n  \"ip\": 0,\n  \"op\": 48,\n  \"w\": 800,\n  \"h\": 800,\n  \"nm\": \"Pencil\",\n  \"ddd\": 0,\n  \"assets\": [],\n  \"layers\": [\n    {\n      \"ddd\": 0,\n      \"ind\": 1,\n      \"ty\": 4,\n      \"nm\": \"line\",\n      \"ks\": {\n        \"o\": { \"a\": 0, \"k\": 100 },\n        \"r\": { \"a\": 0, \"k\": 0 },\n        \"p\": { \"a\": 0, \"k\": [400, 400, 0] },\n        \"a\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n        \"s\": { \"a\": 0, \"k\": [100, 100, 100] }\n      },\n      \"ao\": 0,\n      \"shapes\": [\n        {\n          \"ty\": \"gr\",\n          \"it\": [\n            {\n              \"ind\": 0,\n              \"ty\": \"sh\",\n              \"ix\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"i\": [\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"o\": [\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [-198.875, 197.5],\n                    [197.938, 197.5]\n                  ],\n                  \"c\": false\n                }\n              },\n              \"nm\": \"Path 1\",\n              \"mn\": \"ADBE Vector Shape - Group\"\n            },\n            {\n              \"ty\": \"tm\",\n              \"s\": {\n                \"a\": 1,\n                \"k\": [\n                  {\n                    \"i\": { \"x\": [0.667], \"y\": [1] },\n                    \"o\": { \"x\": [0.333], \"y\": [0] },\n                    \"n\": [\"0p667_1_0p333_0\"],\n                    \"t\": 9,\n                    \"s\": [0],\n                    \"e\": [100]\n                  },\n                  { \"t\": 27 }\n                ],\n                \"ix\": 1\n              },\n              \"e\": {\n                \"a\": 1,\n                \"k\": [\n                  {\n                    \"i\": { \"x\": [0.442], \"y\": [1] },\n                    \"o\": { \"x\": [0.522], \"y\": [0] },\n                    \"n\": [\"0p442_1_0p522_0\"],\n                    \"t\": 0,\n                    \"s\": [0],\n                    \"e\": [100]\n                  },\n                  { \"t\": 20 }\n                ],\n                \"ix\": 2\n              },\n              \"o\": { \"a\": 0, \"k\": 0, \"ix\": 3 },\n              \"m\": 1,\n              \"ix\": 2,\n              \"nm\": \"Trim Paths 1\",\n              \"mn\": \"ADBE Vector Filter - Trim\"\n            },\n            {\n              \"ty\": \"st\",\n              \"c\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 14 },\n              \"lc\": 1,\n              \"lj\": 1,\n              \"ml\": 4,\n              \"nm\": \"Stroke 1\",\n              \"mn\": \"ADBE Vector Graphic - Stroke\"\n            },\n            {\n              \"ty\": \"tr\",\n              \"p\": { \"a\": 0, \"k\": [0, 0], \"ix\": 2 },\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"nm\": \"Transform\"\n            }\n          ],\n          \"nm\": \"Shape 1\",\n          \"np\": 4,\n          \"cix\": 2,\n          \"ix\": 1,\n          \"mn\": \"ADBE Vector Group\"\n        }\n      ],\n      \"ip\": 0,\n      \"op\": 49,\n      \"st\": 0,\n      \"bm\": 0,\n      \"sr\": 1\n    },\n    {\n      \"ddd\": 0,\n      \"ind\": 2,\n      \"ty\": 3,\n      \"nm\": \"pencilRot\",\n      \"ks\": {\n        \"o\": { \"a\": 0, \"k\": 0 },\n        \"r\": {\n          \"a\": 1,\n          \"k\": [\n            {\n              \"i\": { \"x\": [0.256], \"y\": [1] },\n              \"o\": { \"x\": [0.7], \"y\": [0] },\n              \"n\": [\"0p256_1_0p7_0\"],\n              \"t\": 20,\n              \"s\": [0],\n              \"e\": [-360]\n            },\n            { \"t\": 48 }\n          ]\n        },\n        \"p\": {\n          \"a\": 1,\n          \"k\": [\n            {\n              \"i\": { \"x\": 0.442, \"y\": 1 },\n              \"o\": { \"x\": 0.522, \"y\": 0 },\n              \"n\": \"0p442_1_0p522_0\",\n              \"t\": 0,\n              \"s\": [200, 422, 0],\n              \"e\": [600, 422, 0],\n              \"to\": [0, 0, 0],\n              \"ti\": [0, 0, 0]\n            },\n            {\n              \"i\": { \"x\": 1, \"y\": 1 },\n              \"o\": { \"x\": 0.333, \"y\": 0 },\n              \"n\": \"1_1_0p333_0\",\n              \"t\": 20,\n              \"s\": [600, 422, 0],\n              \"e\": [400, 217, 0],\n              \"to\": [0, 0, 0],\n              \"ti\": [194, 0, 0]\n            },\n            {\n              \"i\": { \"x\": 0.667, \"y\": 1 },\n              \"o\": { \"x\": 0, \"y\": 0 },\n              \"n\": \"0p667_1_0_0\",\n              \"t\": 36,\n              \"s\": [400, 217, 0],\n              \"e\": [200, 422, 0],\n              \"to\": [-179, 0, 0],\n              \"ti\": [0, 0, 0]\n            },\n            { \"t\": 48 }\n          ]\n        },\n        \"a\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n        \"s\": { \"a\": 0, \"k\": [100, 100, 100] }\n      },\n      \"ao\": 0,\n      \"ip\": 0,\n      \"op\": 49,\n      \"st\": 0,\n      \"bm\": 0,\n      \"sr\": 1\n    },\n    {\n      \"ddd\": 0,\n      \"ind\": 3,\n      \"ty\": 4,\n      \"nm\": \"pencil\",\n      \"parent\": 2,\n      \"ks\": {\n        \"o\": { \"a\": 0, \"k\": 100 },\n        \"r\": {\n          \"a\": 1,\n          \"k\": [\n            {\n              \"i\": { \"x\": [0.212], \"y\": [1] },\n              \"o\": { \"x\": [0.469], \"y\": [0] },\n              \"n\": [\"0p212_1_0p469_0\"],\n              \"t\": 0,\n              \"s\": [-6],\n              \"e\": [11]\n            },\n            {\n              \"i\": { \"x\": [1], \"y\": [1] },\n              \"o\": { \"x\": [0.441], \"y\": [0] },\n              \"n\": [\"1_1_0p441_0\"],\n              \"t\": 20,\n              \"s\": [11],\n              \"e\": [0]\n            },\n            {\n              \"i\": { \"x\": [0.415], \"y\": [1] },\n              \"o\": { \"x\": [0], \"y\": [0] },\n              \"n\": [\"0p415_1_0_0\"],\n              \"t\": 36,\n              \"s\": [0],\n              \"e\": [-6]\n            },\n            { \"t\": 48 }\n          ]\n        },\n        \"p\": { \"a\": 0, \"k\": [0, 162.022, 0] },\n        \"a\": { \"a\": 0, \"k\": [524.082, 810.037, 0] },\n        \"s\": { \"a\": 0, \"k\": [60, 60, 100] }\n      },\n      \"ao\": 0,\n      \"shapes\": [\n        {\n          \"ty\": \"gr\",\n          \"it\": [\n            {\n              \"ind\": 0,\n              \"ty\": \"sh\",\n              \"ix\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"i\": [\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"o\": [\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [548, 341],\n                    [548, 657]\n                  ],\n                  \"c\": false\n                }\n              },\n              \"nm\": \"Path 1\",\n              \"mn\": \"ADBE Vector Shape - Group\"\n            },\n            {\n              \"ty\": \"st\",\n              \"c\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 10 },\n              \"lc\": 1,\n              \"lj\": 1,\n              \"ml\": 10,\n              \"nm\": \"Stroke 1\",\n              \"mn\": \"ADBE Vector Graphic - Stroke\"\n            },\n            {\n              \"ty\": \"tr\",\n              \"p\": { \"a\": 0, \"k\": [0, 0], \"ix\": 2 },\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"nm\": \"Transform\"\n            }\n          ],\n          \"nm\": \"Group 1\",\n          \"np\": 2,\n          \"cix\": 2,\n          \"ix\": 1,\n          \"mn\": \"ADBE Vector Group\"\n        },\n        {\n          \"ty\": \"gr\",\n          \"it\": [\n            {\n              \"ind\": 0,\n              \"ty\": \"sh\",\n              \"ix\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"i\": [\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"o\": [\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [-0.063, -159.25],\n                    [0.063, 159.25]\n                  ],\n                  \"c\": false\n                }\n              },\n              \"nm\": \"Path 1\",\n              \"mn\": \"ADBE Vector Shape - Group\"\n            },\n            {\n              \"ty\": \"st\",\n              \"c\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 10 },\n              \"lc\": 1,\n              \"lj\": 1,\n              \"ml\": 10,\n              \"nm\": \"Stroke 1\",\n              \"mn\": \"ADBE Vector Graphic - Stroke\"\n            },\n            {\n              \"ty\": \"tr\",\n              \"p\": { \"a\": 0, \"k\": [500.063, 497.25], \"ix\": 2 },\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"nm\": \"Transform\"\n            }\n          ],\n          \"nm\": \"Group 2\",\n          \"np\": 2,\n          \"cix\": 2,\n          \"ix\": 2,\n          \"mn\": \"ADBE Vector Group\"\n        },\n        {\n          \"ty\": \"gr\",\n          \"it\": [\n            {\n              \"ind\": 0,\n              \"ty\": \"sh\",\n              \"ix\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"i\": [\n                    [0, 0],\n                    [13.222, 0],\n                    [0, 13.222]\n                  ],\n                  \"o\": [\n                    [0, 13.222],\n                    [-13.221, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [23.94, -11.97],\n                    [0, 11.97],\n                    [-23.94, -11.97]\n                  ],\n                  \"c\": false\n                }\n              },\n              \"nm\": \"Path 1\",\n              \"mn\": \"ADBE Vector Shape - Group\"\n            },\n            {\n              \"ty\": \"st\",\n              \"c\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 10 },\n              \"lc\": 1,\n              \"lj\": 1,\n              \"ml\": 10,\n              \"nm\": \"Stroke 1\",\n              \"mn\": \"ADBE Vector Graphic - Stroke\"\n            },\n            {\n              \"ty\": \"tr\",\n              \"p\": { \"a\": 0, \"k\": [524.06, 668.47], \"ix\": 2 },\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"nm\": \"Transform\"\n            }\n          ],\n          \"nm\": \"Group 3\",\n          \"np\": 2,\n          \"cix\": 2,\n          \"ix\": 3,\n          \"mn\": \"ADBE Vector Group\"\n        },\n        {\n          \"ty\": \"gr\",\n          \"it\": [\n            {\n              \"ind\": 0,\n              \"ty\": \"sh\",\n              \"ix\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"i\": [\n                    [0, 0],\n                    [-13.222, 0],\n                    [0, -13.221],\n                    [0, 0]\n                  ],\n                  \"o\": [\n                    [0, -13.222],\n                    [13.221, 0],\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [-23.939, -6.583],\n                    [0, -30.523],\n                    [23.94, -6.583],\n                    [0, 30.523]\n                  ],\n                  \"c\": true\n                }\n              },\n              \"nm\": \"Path 1\",\n              \"mn\": \"ADBE Vector Shape - Group\"\n            },\n            {\n              \"ty\": \"fl\",\n              \"c\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"r\": 1,\n              \"nm\": \"Fill 1\",\n              \"mn\": \"ADBE Vector Graphic - Fill\"\n            },\n            {\n              \"ty\": \"tr\",\n              \"p\": { \"a\": 0, \"k\": [524.06, 773.81], \"ix\": 2 },\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"nm\": \"Transform\"\n            }\n          ],\n          \"nm\": \"Group 4\",\n          \"np\": 2,\n          \"cix\": 2,\n          \"ix\": 4,\n          \"mn\": \"ADBE Vector Group\"\n        },\n        {\n          \"ty\": \"gr\",\n          \"it\": [\n            {\n              \"ind\": 0,\n              \"ty\": \"sh\",\n              \"ix\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"i\": [\n                    [0, 0],\n                    [6.412, 0],\n                    [0, 13.222]\n                  ],\n                  \"o\": [\n                    [-4.297, 4.104],\n                    [-13.222, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [20.236, 5.345],\n                    [3.704, 11.97],\n                    [-20.236, -11.97]\n                  ],\n                  \"c\": false\n                }\n              },\n              \"nm\": \"Path 1\",\n              \"mn\": \"ADBE Vector Shape - Group\"\n            },\n            {\n              \"ty\": \"st\",\n              \"c\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 10 },\n              \"lc\": 1,\n              \"lj\": 1,\n              \"ml\": 10,\n              \"nm\": \"Stroke 1\",\n              \"mn\": \"ADBE Vector Graphic - Stroke\"\n            },\n            {\n              \"ty\": \"tr\",\n              \"p\": { \"a\": 0, \"k\": [568.231, 668.47], \"ix\": 2 },\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"nm\": \"Transform\"\n            }\n          ],\n          \"nm\": \"Group 5\",\n          \"np\": 2,\n          \"cix\": 2,\n          \"ix\": 5,\n          \"mn\": \"ADBE Vector Group\"\n        },\n        {\n          \"ty\": \"gr\",\n          \"it\": [\n            {\n              \"ind\": 0,\n              \"ty\": \"sh\",\n              \"ix\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"i\": [\n                    [0, 0],\n                    [13.222, 0],\n                    [3.802, 2.543]\n                  ],\n                  \"o\": [\n                    [0, 13.222],\n                    [-4.917, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [18.616, -11.97],\n                    [-5.324, 11.97],\n                    [-18.616, 7.944]\n                  ],\n                  \"c\": false\n                }\n              },\n              \"nm\": \"Path 1\",\n              \"mn\": \"ADBE Vector Shape - Group\"\n            },\n            {\n              \"ty\": \"st\",\n              \"c\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 10 },\n              \"lc\": 1,\n              \"lj\": 1,\n              \"ml\": 10,\n              \"nm\": \"Stroke 1\",\n              \"mn\": \"ADBE Vector Graphic - Stroke\"\n            },\n            {\n              \"ty\": \"tr\",\n              \"p\": { \"a\": 0, \"k\": [481.509, 668.47], \"ix\": 2 },\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"nm\": \"Transform\"\n            }\n          ],\n          \"nm\": \"Group 6\",\n          \"np\": 2,\n          \"cix\": 2,\n          \"ix\": 6,\n          \"mn\": \"ADBE Vector Group\"\n        },\n        {\n          \"ty\": \"gr\",\n          \"it\": [\n            {\n              \"ind\": 0,\n              \"ty\": \"sh\",\n              \"ix\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"i\": [\n                    [0, 0],\n                    [-33.936, 0],\n                    [0, -34]\n                  ],\n                  \"o\": [\n                    [0, -34],\n                    [33.935, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [-61.446, 30.723],\n                    [0, -30.723],\n                    [61.446, 30.723]\n                  ],\n                  \"c\": false\n                }\n              },\n              \"nm\": \"Path 1\",\n              \"mn\": \"ADBE Vector Shape - Group\"\n            },\n            {\n              \"ty\": \"st\",\n              \"c\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 20 },\n              \"lc\": 3,\n              \"lj\": 1,\n              \"ml\": 10,\n              \"nm\": \"Stroke 1\",\n              \"mn\": \"ADBE Vector Graphic - Stroke\"\n            },\n            {\n              \"ty\": \"tr\",\n              \"p\": { \"a\": 0, \"k\": [524.06, 245.277], \"ix\": 2 },\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"nm\": \"Transform\"\n            }\n          ],\n          \"nm\": \"Group 7\",\n          \"np\": 2,\n          \"cix\": 2,\n          \"ix\": 7,\n          \"mn\": \"ADBE Vector Group\"\n        },\n        {\n          \"ty\": \"gr\",\n          \"it\": [\n            {\n              \"ind\": 0,\n              \"ty\": \"sh\",\n              \"ix\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"i\": [\n                    [0, 0],\n                    [0, 0],\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"o\": [\n                    [0, 0],\n                    [0, 0],\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [61.446, 10.827],\n                    [-61.446, 10.827],\n                    [-61.446, -10.827],\n                    [61.446, -10.827]\n                  ],\n                  \"c\": true\n                }\n              },\n              \"nm\": \"Path 1\",\n              \"mn\": \"ADBE Vector Shape - Group\"\n            },\n            {\n              \"ty\": \"fl\",\n              \"c\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"r\": 1,\n              \"nm\": \"Fill 1\",\n              \"mn\": \"ADBE Vector Graphic - Fill\"\n            },\n            {\n              \"ty\": \"tr\",\n              \"p\": { \"a\": 0, \"k\": [524.06, 336.333], \"ix\": 2 },\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"nm\": \"Transform\"\n            }\n          ],\n          \"nm\": \"Group 8\",\n          \"np\": 2,\n          \"cix\": 2,\n          \"ix\": 8,\n          \"mn\": \"ADBE Vector Group\"\n        },\n        {\n          \"ty\": \"gr\",\n          \"it\": [\n            {\n              \"ind\": 0,\n              \"ty\": \"sh\",\n              \"ix\": 1,\n              \"ks\": {\n                \"a\": 0,\n                \"k\": {\n                  \"i\": [\n                    [0, 0],\n                    [0, 0],\n                    [0, 0],\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"o\": [\n                    [0, 0],\n                    [0, 0],\n                    [0, 0],\n                    [0, 0],\n                    [0, 0]\n                  ],\n                  \"v\": [\n                    [61.446, 130.452],\n                    [0, 258.452],\n                    [-61.446, 130.452],\n                    [-61.446, -258.452],\n                    [61.446, -258.452]\n                  ],\n                  \"c\": true\n                }\n              },\n              \"nm\": \"Path 1\",\n              \"mn\": \"ADBE Vector Shape - Group\"\n            },\n            {\n              \"ty\": \"st\",\n              \"c\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n              \"o\": { \"a\": 0, \"k\": 100 },\n              \"w\": { \"a\": 0, \"k\": 20 },\n              \"lc\": 1,\n              \"lj\": 1,\n              \"ml\": 10,\n              \"nm\": \"Stroke 1\",\n              \"mn\": \"ADBE Vector Graphic - Stroke\"\n            },\n            {\n              \"ty\": \"tr\",\n              \"p\": { \"a\": 0, \"k\": [524.06, 551.548], \"ix\": 2 },\n              \"a\": { \"a\": 0, \"k\": [0, 0], \"ix\": 1 },\n              \"s\": { \"a\": 0, \"k\": [100, 100], \"ix\": 3 },\n              \"r\": { \"a\": 0, \"k\": 0, \"ix\": 6 },\n              \"o\": { \"a\": 0, \"k\": 100, \"ix\": 7 },\n              \"sk\": { \"a\": 0, \"k\": 0, \"ix\": 4 },\n              \"sa\": { \"a\": 0, \"k\": 0, \"ix\": 5 },\n              \"nm\": \"Transform\"\n            }\n          ],\n          \"nm\": \"Group 9\",\n          \"np\": 2,\n          \"cix\": 2,\n          \"ix\": 9,\n          \"mn\": \"ADBE Vector Group\"\n        }\n      ],\n      \"ip\": 0,\n      \"op\": 49,\n      \"st\": 0,\n      \"bm\": 0,\n      \"sr\": 1\n    },\n    {\n      \"ddd\": 0,\n      \"ind\": 4,\n      \"ty\": 4,\n      \"nm\": \"Shape Layer 1\",\n      \"ks\": {\n        \"o\": { \"a\": 0, \"k\": 100 },\n        \"r\": { \"a\": 0, \"k\": 0 },\n        \"p\": { \"a\": 0, \"k\": [400, 400, 0] },\n        \"a\": { \"a\": 0, \"k\": [0.05859375, 0.08984375, 0.1640625] },\n        \"s\": { \"a\": 0, \"k\": [100, 100, 100] }\n      },\n      \"ao\": 0,\n      \"shapes\": [],\n      \"ip\": 0,\n      \"op\": 49,\n      \"st\": 0,\n      \"bm\": 0,\n      \"sr\": 1\n    }\n  ]\n}\n"
  },
  {
    "path": "components/Navbar.tsx",
    "content": "import Link from \"next/link\";\nimport React from \"react\";\nimport UserMenu from \"./common/UserMenu\";\nimport { RiMenu5Fill } from \"react-icons/ri\";\nimport useUser from \"./hooks/useUser\";\n\ntype Props = {};\n\nconst Navbar = (props: Props) => {\n  const { user } = useUser();\n\n  return (\n    <nav className=\"fixed top-0 z-20 flex w-full flex-row items-center justify-between border-b border-gray-300 bg-transparent p-4 backdrop-blur dark:border-gray-700\">\n      {/* LOGO */}\n      <Link href=\"/\">\n        <h4 className=\"flex items-center text-2xl font-semibold\">writedown</h4>\n      </Link>\n      {/* USER MENU */}\n      <div className=\"flex flex-row items-center gap-4\">\n        <UserMenu dashboard home logout themeOption reverse>\n          {user ? (\n            <img\n              src={\n                user?.photoURL ||\n                `https://ui-avatars.com/api/?name=${user?.displayName}&rounded=true&format=svg&background=random`\n              }\n              alt=\"User Photo\"\n              className=\"h-10 w-10 rounded-full object-cover\"\n            />\n          ) : (\n            <RiMenu5Fill className=\"h-7 w-7\" />\n          )}\n        </UserMenu>\n      </div>\n    </nav>\n  );\n};\n\nexport default Navbar;\n"
  },
  {
    "path": "components/common/HeadTags.tsx",
    "content": "import Head from \"next/head\";\nimport React from \"react\";\n\ntype HeadTagsProps = {\n  title: string;\n  ogImage: string;\n  description: string;\n  ogUrl: string;\n};\n\nconst HeadTags = ({ title, ogImage, description, ogUrl }: HeadTagsProps) => {\n  return (\n    <Head>\n      <link rel=\"manifest\" href=\"/manifest.json\" />\n      <link rel=\"apple-touch-icon\" href=\"/icons/icon-180x180.png\" />\n      <meta name=\"theme-color\" content=\"#e2e8f0\" />\n      <link rel=\"icon\" type=\"image/png\" href=\"/icons/favicon-32x32.png\" />\n      <link\n        href=\"/icons/favicon-16x16.png\"\n        rel=\"icon\"\n        type=\"image/png\"\n        sizes=\"16x16\"\n      />\n      <link\n        href=\"/icons/favicon-32x32.png\"\n        rel=\"icon\"\n        type=\"image/png\"\n        sizes=\"32x32\"\n      />\n      <meta name=\"application-name\" content=\"writedown\" />\n      <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n      <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"default\" />\n      {/* META TAGS */}\n      <title>{title}</title>\n      <meta\n        name=\"apple-mobile-web-app-title\"\n        content=\"writedown - Notes made simple\"\n      />\n      <meta name=\"description\" content={description} key=\"description\" />\n      {/* TWITTER */}\n      <meta name=\"twitter:card\" content=\"summary_large_image\" />\n      <meta name=\"twitter:url\" content={ogUrl} />\n      <meta name=\"twitter:title\" content={title} />\n      <meta\n        name=\"twitter:description\"\n        content={description}\n        key=\"twitter-description\"\n      />\n      <meta name=\"twitter:image\" content={ogImage} key=\"twitter-image\" />\n      {/* OG */}\n      <meta property=\"og:type\" content=\"website\" />\n      <meta property=\"og:title\" content={title} key=\"og-title\" />\n      <meta\n        property=\"og:description\"\n        content={description}\n        key=\"og-description\"\n      />\n      <meta property=\"og:site_name\" content=\"writedown\" />\n      <meta property=\"og:url\" content={ogUrl} />\n      <meta property=\"og:image\" content={ogImage} key=\"og-image\" />\n    </Head>\n  );\n};\n\nexport default HeadTags;\n"
  },
  {
    "path": "components/common/UserMenu.tsx",
    "content": "import {\n  BiHomeAlt,\n  BiLogInCircle,\n  BiLogOutCircle,\n  BiMoon,\n  BiPencil,\n  BiSun,\n} from \"react-icons/bi\";\nimport { selectedNoteAtom } from \"@/stores/postDataAtom\";\nimport { useTheme } from \"next-themes\";\nimport Popover from \"../ui/Popover\";\nimport { auth } from \"@/lib/firebase\";\nimport { useAtom, useSetAtom } from \"jotai\";\nimport Link from \"next/link\";\nimport React from \"react\";\n\ntype UserMenuProps = {\n  reverse?: boolean;\n  dashboard?: boolean;\n  home?: boolean;\n  themeOption?: boolean;\n  logout?: boolean;\n  showImageAsButton?: boolean;\n  children?: React.ReactNode;\n};\n\nconst UserMenu = ({\n  reverse,\n  dashboard,\n  home,\n  themeOption,\n  logout,\n  showImageAsButton,\n  children,\n}: UserMenuProps) => {\n  const { theme, setTheme } = useTheme();\n  const [selectedNote, setSelectedNote] = useAtom(selectedNoteAtom);\n\n  return (\n    <Popover\n      data-testid=\"logout\"\n      buttonStyle=\"outline-none\"\n      button={<>{children}</>}\n      reverse={reverse}\n    >\n      {dashboard && auth.currentUser && (\n        <Link\n          href=\"/dashboard\"\n          className=\"flex items-center gap-2 rounded-md p-2 text-left text-sm font-medium hover:bg-slate-200 dark:text-slate-300 dark:hover:bg-slate-700\"\n        >\n          <BiPencil /> writedown\n        </Link>\n      )}\n      {dashboard && !auth.currentUser && (\n        <Link\n          href=\"/login\"\n          className=\"flex items-center gap-2 rounded-md p-2 text-left text-sm font-medium hover:bg-slate-200 dark:text-slate-300 dark:hover:bg-slate-700\"\n        >\n          <BiLogInCircle className=\"\" /> Login\n        </Link>\n      )}\n      {home && (\n        <Link\n          href=\"/\"\n          className=\"flex items-center gap-2 rounded-md p-2 text-left text-sm font-medium hover:bg-slate-200 dark:text-slate-300 dark:hover:bg-slate-700\"\n        >\n          <BiHomeAlt className=\"\" />\n          Home\n        </Link>\n      )}\n      {themeOption && (\n        <button\n          onClick={() => {\n            theme === \"light\" ? setTheme(\"dark\") : setTheme(\"light\");\n          }}\n          className=\"flex items-center gap-2 rounded-md p-2 text-left text-sm font-medium hover:bg-slate-200 dark:text-slate-300 dark:hover:bg-slate-700\"\n        >\n          {theme === \"light\" ? <BiMoon className=\"\" /> : <BiSun className=\"\" />}\n          {theme === \"light\" ? \"Dark\" : \"Light\"} Mode\n        </button>\n      )}\n      {logout && auth.currentUser && (\n        <button\n          onClick={() => {\n            auth.signOut();\n            setSelectedNote((prev) => ({\n              ...prev,\n              id: \"\",\n              isPublic: false,\n              title: \"\",\n              content: \"\",\n            }));\n          }}\n          className=\"flex items-center gap-2 rounded-md p-2 text-left text-sm font-medium hover:bg-slate-200 dark:text-slate-300 dark:hover:bg-slate-700\"\n        >\n          <BiLogOutCircle className=\"\" /> Logout\n        </button>\n      )}\n    </Popover>\n  );\n};\n\nexport default UserMenu;\n"
  },
  {
    "path": "components/dashboard/CheckUsername.tsx",
    "content": "import React, { useEffect, useState } from \"react\";\nimport { toast } from \"react-hot-toast\";\nimport useUser from \"../hooks/useUser\";\nimport { auth } from \"@/lib/firebase\";\nimport Modal from \"../ui/Modal\";\nimport Input from \"../ui/Input\";\n\nconst CheckUsername = ({\n  show,\n  onSetShow,\n}: {\n  show: boolean;\n  onSetShow: (state: boolean) => void;\n}) => {\n  const { user, setUsername, checkUsernameValidity } = useUser();\n  const [input, setInput] = useState(\"\");\n  const [invalidUsername, setInvalidUsername] = useState(false);\n\n  const onUsernameSet = async (username: string) => {\n    if (!user) return;\n    try {\n      await setUsername(user.uid, username);\n      onSetShow(false);\n    } catch (error) {\n      toast.error(\"Error setting username\");\n      setInvalidUsername(true);\n    }\n  };\n\n  const handleSaveUsername = async () => {\n    try {\n      const isValid = await checkUsernameValidity(input);\n      if (!isValid) {\n        toast.error(\"Username is not valid\");\n        setInvalidUsername(true);\n        return;\n      }\n      await onUsernameSet(input);\n    } catch (error) {\n      toast.error(\"Error checking username\");\n    }\n  };\n\n  return (\n    <Modal\n      isOpen={show}\n      setIsOpen={onSetShow}\n      saveText=\"Save\"\n      title=\"Set Username\"\n      description=\"Set a username to create your personal writedown space.\"\n      saveHandler={handleSaveUsername}\n      undismissable\n    >\n      {invalidUsername && (\n        <p className=\"mb-2 text-sm text-red-400\">\n          Username is not valid or already taken\n        </p>\n      )}\n      <Input\n        id=\"username\"\n        placeholder=\"Username\"\n        value={input}\n        small\n        onChange={(e) => setInput(e.target.value)}\n      />\n      <div className=\"flex flex-col\">\n        <p className=\"mt-4 text-sm text-slate-600 dark:text-slate-300\">\n          Username must:\n        </p>\n        <ul className=\"ml-4 list-disc text-xs leading-relaxed text-slate-500 dark:text-slate-400\">\n          <li>Begin with a lowercase letter (a-z).</li>\n          <li>Combine lowercase letters (a-z) and digits (0-9).</li>\n          <li className=\"leading-normal\">\n            Optionally contain periods (.), underscores (_), or hyphens (-).\n          </li>\n        </ul>\n      </div>\n    </Modal>\n  );\n};\nexport default CheckUsername;\n"
  },
  {
    "path": "components/dashboard/Sidebar/PostRow.tsx",
    "content": "import React from \"react\";\nimport Skeleton from \"react-loading-skeleton\";\nimport { useAtom, useAtomValue } from \"jotai\";\nimport RemoveMarkdown from \"remove-markdown\";\nimport { BiGlobe } from \"react-icons/bi\";\nimport { isSyncedAtom } from \"@/stores/syncedAtom\";\nimport { selectedNoteAtom } from \"@/stores/postDataAtom\";\n\ntype PostRowProps = {\n  title: string;\n  content: string;\n  noteId: string;\n  userId: string | undefined;\n  isPublic: boolean;\n  setShowSidebar: React.Dispatch<React.SetStateAction<boolean>>;\n};\n\nconst PostRow = ({\n  title,\n  content,\n  noteId,\n  isPublic,\n  setShowSidebar,\n}: PostRowProps) => {\n  const [selectedNote, setSelectedNote] = useAtom(selectedNoteAtom);\n  const synced = useAtomValue(isSyncedAtom);\n\n  const switchNotesHandler = async (noteId: string) => {\n    if (!synced) {\n      const confirm = window.confirm(\n        \"You have unsaved changes. Are you sure you want to switch notes?\"\n      );\n      if (!confirm) return;\n    }\n    setSelectedNote((prev) => ({ ...prev, id: noteId }));\n    window.innerWidth <= 768 && setShowSidebar(false);\n  };\n\n  return (\n    <div\n      className={`flex items-center justify-between rounded-xl p-4 ${\n        selectedNote.id === noteId\n          ? \"bg-slate-200 dark:bg-slate-700\"\n          : \"bg-slate-50 hover:bg-slate-100 dark:bg-slate-800 dark:hover:bg-slate-700\"\n      }`}\n      onClick={() => switchNotesHandler(noteId)}\n    >\n      <div\n        className=\"flex w-full cursor-pointer flex-col gap-2 truncate\"\n        onClick={() => switchNotesHandler(noteId)}\n      >\n        <div className=\"w-full truncate font-medium dark:text-slate-200\">\n          {title === \"\" ? \"Untitled\" : title || <Skeleton className=\"w-1/2\" />}\n        </div>\n        <button className=\"flex flex-col gap-2\">\n          <p className=\"w-full truncate text-left text-sm text-slate-600 dark:text-slate-400\">\n            {content === null || content === undefined ? (\n              <Skeleton />\n            ) : (\n              RemoveMarkdown(content.slice(0, 50)) || \"Empty Post\"\n            )}\n          </p>\n\n          {/* TODO: Add tags  */}\n          {/* <div className=\"flex flex-row flex-wrap gap-1\">\n          <Badge color=\"yellow\">UI</Badge>\n          <Badge color=\"green\">Development</Badge>\n          <Badge color=\"red\">UX</Badge>\n        </div> */}\n        </button>\n      </div>\n      {isPublic && <BiGlobe title=\"Public\" size={25} />}\n    </div>\n  );\n};\n\nexport default PostRow;\n"
  },
  {
    "path": "components/dashboard/Sidebar/ThemeChanger.tsx",
    "content": "import { useTheme } from \"next-themes\";\nimport Button from \"../../ui/Button\";\n\nexport default function ThemeChanger() {\n  const { theme, setTheme } = useTheme();\n\n  return (\n    <Button\n      onClick={() => {\n        setTheme(theme === \"dark\" ? \"light\" : \"dark\");\n      }}\n    >\n      {theme === \"dark\" ? \"Light\" : \"Dark\"}\n    </Button>\n  );\n}\n"
  },
  {
    "path": "components/dashboard/Sidebar/index.tsx",
    "content": "import React, { useEffect, useState } from \"react\";\nimport Link from \"next/link\";\nimport { useRouter } from \"next/router\";\nimport { useAtom, useAtomValue } from \"jotai\";\nimport Skeleton from \"react-loading-skeleton\";\nimport { toast } from \"react-hot-toast\";\nimport { IoMdAddCircle, IoMdRefreshCircle } from \"react-icons/io\";\nimport { BsChevronBarLeft } from \"react-icons/bs\";\nimport { IFirebaseAuth } from \"@/types/components/firebase-hooks\";\nimport { FEATURE_FLAGS } from \"@/constants/feature-flags\";\nimport { selectedNoteAtom } from \"@/stores/postDataAtom\";\nimport UserMenu from \"@/components/common/UserMenu\";\nimport IconButton from \"@/components/ui/IconButton\";\nimport useNotes from \"@/components/hooks/useNotes\";\nimport { isSyncedAtom } from \"@/stores/syncedAtom\";\nimport BetaBadge from \"@/components/ui/BetaBadge\";\nimport useUser from \"@/components/hooks/useUser\";\nimport Button from \"@/components/ui/Button\";\nimport PostRow from \"./PostRow\";\n\ninterface SidebarProps {\n  showSidebar: boolean;\n  setShowSidebar: React.Dispatch<React.SetStateAction<boolean>>;\n}\n\nconst Sidebar = ({\n  showSidebar,\n  setShowSidebar,\n}: SidebarProps & IFirebaseAuth) => {\n  const router = useRouter();\n  const { user, publicUserDetails } = useUser();\n  const [mounted, setMounted] = useState(false);\n  const [createPostLoading, setCreatePostLoading] = useState(false);\n\n  const [selectedNote, setSelectedNote] = useAtom(selectedNoteAtom);\n\n  const synced = useAtomValue(isSyncedAtom);\n\n  const { notes, createNote, refreshNotes } = useNotes({ userId: user?.uid });\n\n  useEffect(() => {\n    if (!selectedNote.id) return;\n    router.push(`/dashboard/?post=${selectedNote.id}`, undefined, {\n      shallow: true,\n    });\n  }, [selectedNote.id]);\n\n  useEffect(() => {\n    if (!router.query.post) return;\n    setSelectedNote((prev) => ({ ...prev, id: router.query.post as string }));\n  }, [router.query.post]);\n\n  useEffect(() => {\n    refreshNotes();\n  }, [synced, selectedNote.id]);\n\n  const newPostClickHandler = async () => {\n    setCreatePostLoading(true);\n    const newId = await createNote();\n    await refreshNotes();\n    if (!newId) {\n      toast.error(\"Failed to create new post\");\n      return;\n    }\n    setSelectedNote((prev) => ({ ...prev, id: newId }));\n    setCreatePostLoading(false);\n    window.innerWidth <= 768 && setShowSidebar(false);\n  };\n\n  useEffect(() => {\n    setMounted(true);\n  }, []);\n\n  return (\n    <aside\n      className={`dark:slate-950 absolute bottom-0 left-0 right-0 top-0 z-50 flex h-full flex-col gap-y-5 bg-white p-2 shadow-2xl shadow-slate-400 transition-transform duration-300 dark:bg-slate-900 dark:text-slate-50 dark:shadow-slate-950 md:bottom-auto md:left-auto md:right-auto md:top-auto md:m-4 md:h-[calc(96%)] md:w-96 md:rounded-xl md:p-5 ${\n        showSidebar ? \"translate-x-0\" : \"-translate-x-full\"\n      }`}\n    >\n      {/* MOBILE - SIDEBAR TOGGLE BUTTON */}\n      <IconButton\n        id=\"new\"\n        onClick={() => setShowSidebar(!showSidebar)}\n        extraClasses={`fixed z-10 ml-auto top-[10px] right-[15px] md:hidden dark:!bg-slate-800 !bg-slate-100`}\n      >\n        <BsChevronBarLeft\n          className={`duration-400 h-4 w-4 text-black transition-transform dark:text-slate-100 ${\n            showSidebar ? \"rotate-0\" : \"rotate-180\"\n          }`}\n        />\n      </IconButton>\n\n      {/* DESKTOP - SIDEBAR TOGGLE BUTTON */}\n      <IconButton\n        data-testid=\"sidebarToggle\"\n        onClick={() => setShowSidebar(!showSidebar)}\n        extraClasses=\"absolute top-1/2 -right-5 z-10 hidden md:block\"\n      >\n        <BsChevronBarLeft\n          className={`duration-400 h-5 w-5 translate-x-1 text-black transition-transform dark:text-slate-100 ${\n            showSidebar ? \"\" : \"rotate-180\"\n          }`}\n        />\n      </IconButton>\n\n      {/* USER  GREETING SECTION */}\n      <div className=\"relative min-w-fit\">\n        <UserMenu home logout themeOption showImageAsButton>\n          <div className=\"flex flex-row items-center gap-2\">\n            {user ? (\n              <img\n                src={\n                  user?.photoURL ||\n                  `https://ui-avatars.com/api/?name=${user?.displayName}&rounded=true&format=svg&background=random`\n                }\n                alt=\"User Photo\"\n                className=\"h-10 w-10 rounded-full object-cover\"\n              />\n            ) : (\n              <Skeleton className=\"h-10 w-10\" circle={true} />\n            )}\n            {user ? (\n              <h4 className=\"truncate text-xl font-semibold text-slate-500 dark:text-slate-300\">\n                Hi there,{\" \"}\n                <span className=\"text-slate-900 dark:text-slate-100\">\n                  {user?.displayName}{\" \"}\n                </span>\n              </h4>\n            ) : (\n              <Skeleton className=\"w-32\" />\n            )}\n          </div>\n        </UserMenu>\n      </div>\n\n      {/* CREATE NEW POST BUTTON */}\n      {notes ? (\n        <Button\n          data-testid=\"new-note\"\n          onClick={newPostClickHandler}\n          disabled={createPostLoading}\n          className=\"disabled:cursor-not-allowed\"\n        >\n          <span className=\"flex items-center justify-center gap-1\">\n            {createPostLoading ? (\n              <IoMdRefreshCircle className=\"h-5 w-5 animate-spin\" />\n            ) : (\n              <IoMdAddCircle className=\"h-5 w-5\" />\n            )}\n            Create New Post\n          </span>\n        </Button>\n      ) : (\n        <Skeleton className=\"h-9 w-full\" borderRadius={50} />\n      )}\n\n      {/* POSTS SECTION */}\n      {/* POSTS HEADING */}\n      <h6 className=\"font-semibold\">Posts</h6>\n      <div className=\"scrollbar flex h-full flex-col  gap-3 overflow-y-auto\">\n        {/* POSTS LIST */}\n        <div className=\"mb-64 flex flex-col gap-2 p-1\">\n          {notes ? (\n            notes.map((note) => (\n              <Link\n                href={`/dashboard/?post=${note.slug}`}\n                key={note.id}\n                as={\n                  note.public\n                    ? `/${publicUserDetails?.username}/posts/${note.slug}`\n                    : `/dashboard/?post=${note.slug}`\n                }\n              >\n                <PostRow\n                  userId={user?.uid}\n                  title={note.title}\n                  content={note.content}\n                  noteId={note.id}\n                  isPublic={\n                    note.id === selectedNote.id\n                      ? selectedNote.isPublic\n                      : note.public\n                  }\n                  setShowSidebar={setShowSidebar}\n                />\n              </Link>\n            ))\n          ) : (\n            <Skeleton className=\"mb-2 h-20 p-4\" count={4} />\n          )}\n          <div className=\"pointer-events-none absolute inset-x-0 bottom-10 flex justify-center bg-gradient-to-t from-white pb-32 pt-32 dark:from-slate-900\"></div>\n        </div>\n      </div>\n\n      <div className=\"mt-auto\">\n        <p className=\"text-center text-xs text-slate-400\">\n          © {new Date().getFullYear()} <b>writedown</b>. All rights reserved.\n          {FEATURE_FLAGS.beta && <BetaBadge pulse />}\n        </p>\n      </div>\n    </aside>\n  );\n};\n\nexport default Sidebar;\n"
  },
  {
    "path": "components/dashboard/TextArea/EditorButtons.tsx",
    "content": "import React, { useState } from \"react\";\nimport {\n  LuBold,\n  LuLink,\n  LuCheckSquare,\n  LuCode,\n  LuHeading1,\n  LuHeading2,\n  LuHeading3,\n  LuHeading4,\n  LuImage,\n  LuItalic,\n  LuList,\n  LuListOrdered,\n  LuMinus,\n  LuQuote,\n  LuStrikethrough,\n} from \"react-icons/lu\";\nimport Toggle from \"@/components/ui/Toggle\";\nimport { Editor } from \"@tiptap/react\";\nimport Modal from \"../../ui/Modal\";\nimport Input from \"../../ui/Input\";\n\ntype EditorButtonsProps = {\n  shiftRight?: boolean;\n  editor: Editor | null;\n};\n\nconst EditorButtons = ({ shiftRight, editor }: EditorButtonsProps) => {\n  const [isOpen, setIsOpen] = useState(false);\n  const [title, setTitle] = useState(\"\");\n  const [url, setUrl] = useState(\"\");\n\n  // Image preview states\n  const [isUrlPromptOpen, setIsUrlPromptOpen] = useState(false);\n  const [isLinkPreview, setIsLinkPreview] = useState(false);\n\n  if (!editor) return <></>;\n\n  return (\n    <div\n      className={`m-4 flex w-full max-w-3xl items-center justify-center rounded-xl bg-white p-1 transition-transform duration-300 dark:bg-slate-900 sm:justify-start ${\n        shiftRight ? \"translate-x-52\" : \"translate-x-0\"\n      }`}\n    >\n      <div className=\"flex flex-row items-center gap-2 overflow-x-auto sm:w-full sm:justify-evenly\">\n        <button\n          className=\"rounded-xl p-2 hover:bg-slate-200 dark:hover:bg-slate-700\"\n          onClick={() =>\n            editor\n              .chain()\n              .focus()\n              .toggleHeading({\n                level: 1,\n              })\n              .run()\n          }\n        >\n          <LuHeading1 className=\"dark:text-slate-200\" />\n        </button>\n        <button\n          className=\"rounded-xl p-2 hover:bg-slate-200 dark:hover:bg-slate-700\"\n          onClick={() =>\n            editor\n              .chain()\n              .focus()\n              .toggleHeading({\n                level: 2,\n              })\n              .run()\n          }\n        >\n          <LuHeading2 className=\"dark:text-slate-200\" />\n        </button>\n        <button\n          className=\"rounded-xl p-2 hover:bg-slate-200 dark:hover:bg-slate-700\"\n          onClick={() =>\n            editor.chain().focus().toggleHeading({ level: 3 }).run()\n          }\n        >\n          <LuHeading3 className=\"dark:text-slate-200\" />\n        </button>\n        <button\n          className=\"rounded-xl p-2 hover:bg-slate-200 dark:hover:bg-slate-700\"\n          onClick={() =>\n            editor\n              .chain()\n              .focus()\n              .toggleHeading({\n                level: 4,\n              })\n              .run()\n          }\n        >\n          <LuHeading4 className=\"dark:text-slate-200\" />\n        </button>\n        <button\n          className=\"rounded-xl p-2 hover:bg-slate-200 dark:hover:bg-slate-700\"\n          onClick={() => editor.chain().focus().toggleBold().run()}\n        >\n          <LuBold className=\"dark:text-slate-200\" />\n        </button>\n        <button\n          className=\"rounded-xl p-2 hover:bg-slate-200 dark:hover:bg-slate-700\"\n          onClick={() => editor.chain().focus().toggleItalic().run()}\n        >\n          <LuItalic className=\"dark:text-slate-200\" />\n        </button>\n        <button\n          className=\"rounded-xl p-2 hover:bg-slate-200 dark:hover:bg-slate-700\"\n          onClick={() => editor.chain().focus().toggleBlockquote().run()}\n        >\n          <LuQuote className=\"dark:text-slate-200\" />\n        </button>\n        <button\n          className=\"rounded-xl p-2 hover:bg-slate-200 dark:hover:bg-slate-700\"\n          onClick={() => editor.chain().focus().toggleStrike().run()}\n        >\n          <LuStrikethrough className=\"dark:text-slate-200\" />\n        </button>\n        <button\n          className=\"rounded-xl p-2 hover:bg-slate-200 dark:hover:bg-slate-700\"\n          onClick={() => editor.chain().focus().toggleOrderedList().run()}\n        >\n          <LuListOrdered className=\"dark:text-slate-200\" />\n        </button>\n        <button\n          className=\"rounded-xl p-2 hover:bg-slate-200 dark:hover:bg-slate-700\"\n          onClick={() => editor.chain().focus().toggleBulletList().run()}\n        >\n          <LuList className=\"dark:text-slate-200\" />\n        </button>\n        <button\n          className=\"rounded-xl p-2 hover:bg-slate-200 dark:hover:bg-slate-700\"\n          onClick={() => editor.chain().focus().toggleTaskList().run()}\n        >\n          <LuCheckSquare className=\"dark:text-slate-200\" />\n        </button>\n        <button\n          className=\"rounded-xl p-2 hover:bg-slate-200 dark:hover:bg-slate-700\"\n          onClick={() => editor.chain().focus().setCodeBlock().run()}\n        >\n          <LuCode className=\"dark:text-slate-200\" />\n        </button>\n        {/* <button className=\"rounded-xl p-2 hover:bg-slate-200 dark:hover:bg-slate-700\">\n          <MaterialLink />\n        </button> */}\n        <button\n          className=\"rounded-xl p-3 hover:bg-slate-200 dark:hover:bg-slate-700\"\n          onClick={() => setIsUrlPromptOpen(true)}\n        >\n          <LuLink className=\"dark:text-slate-200\" />\n        </button>\n        <Modal\n          isOpen={isUrlPromptOpen}\n          setIsOpen={setIsUrlPromptOpen}\n          title=\"Insert Link\"\n          saveText=\"Insert\"\n          closeText=\"Cancel\"\n          saveHandler={() => {\n            isLinkPreview\n              ? editor.chain().setLinkPreview({ url: url }).run()\n              : editor.chain().insertContent(`[${url}](${url})`).run();\n            setIsUrlPromptOpen(false);\n          }}\n        >\n          <div className=\"flex flex-col items-center gap-2\">\n            <div className=\"mb-2 inline-flex w-full items-center justify-end gap-4\">\n              <span>Link Preview: </span>\n              <Toggle\n                enabled={isLinkPreview}\n                onChange={() => setIsLinkPreview((prev) => !prev)}\n              />\n            </div>\n\n            <Input\n              id=\"url\"\n              placeholder=\"Enter URL\"\n              onChange={(e) => setUrl(e.target.value)}\n            />\n          </div>\n        </Modal>\n\n        <button\n          className=\"rounded-xl p-3 hover:bg-slate-200 dark:hover:bg-slate-700\"\n          onClick={() => setIsOpen(true)}\n        >\n          <LuImage className=\"dark:text-slate-200\" />\n        </button>\n        <button\n          className=\"rounded-xl p-2 hover:bg-slate-200 dark:hover:bg-slate-700\"\n          onClick={() => editor.chain().focus().setHorizontalRule().run()}\n        >\n          <LuMinus className=\"dark:text-slate-200\" />\n        </button>\n\n        <Modal\n          isOpen={isOpen}\n          setIsOpen={setIsOpen}\n          title=\"Insert Image\"\n          description=\"Enter a title and the link to an image.\"\n          saveText=\"Insert\"\n          closeText=\"Cancel\"\n          saveHandler={() => {\n            editor.chain().focus().setImage({ src: url, title }).run();\n            setIsOpen(false);\n          }}\n        >\n          <div className=\"flex flex-col items-center gap-2\">\n            <Input\n              id=\"title\"\n              placeholder=\"Enter Title\"\n              onChange={(e) => setTitle(e.target.value)}\n            />\n            <Input\n              id=\"url\"\n              placeholder=\"Enter URL\"\n              onChange={(e) => setUrl(e.target.value)}\n            />\n          </div>\n        </Modal>\n      </div>\n    </div>\n  );\n};\nexport default EditorButtons;\n"
  },
  {
    "path": "components/dashboard/TextArea/LinkPreview.tsx",
    "content": "import { LuLink } from \"react-icons/lu\";\nimport {\n  NodeViewWrapper,\n  ReactNodeViewRenderer,\n  Node,\n  mergeAttributes,\n} from \"@tiptap/react\";\nimport React, { useEffect, useState } from \"react\";\n\nconst LinkPreviewCard = ({ node }: { node: any }) => {\n  const { url } = node.attrs;\n  const [title, setTitle] = useState(\"\");\n  const [description, setDescription] = useState(\"\");\n  const [image, setImage] = useState(\n    \"https://placehold.co/900x600/000000/FFF?text=writedown&font=raleway/jpeg\"\n  );\n  const sanitizedUrl = url.split(\"/\").slice(0, 3).join(\"/\");\n\n  useEffect(() => {\n    (async () => {\n      const { title, description, image } = await fetch(\n        `/api/link-preview?url=${url}`\n      ).then((res) => res.json());\n\n      setTitle(title);\n      setDescription(description);\n      setImage(image);\n    })();\n  }, []);\n\n  return (\n    <NodeViewWrapper contenteditable=\"false\" id=\"link-preview\">\n      <a\n        href={url}\n        target=\"_blank\"\n        rel=\"noreferrer\"\n        className=\"not-prose mb-4 flex w-full cursor-pointer items-center gap-4 rounded-lg bg-slate-100 p-3 transition-colors hover:bg-slate-200 dark:bg-slate-800 dark:hover:bg-slate-700 \"\n      >\n        {image && (\n          <div className=\"w-1/3 overflow-hidden\">\n            <img\n              src={image}\n              alt={`${title}-preview`}\n              className=\"not-prose rounded-lg\"\n            />\n          </div>\n        )}\n        <div className=\"w-2/3 space-y-2 text-xs md:text-sm\">\n          <div className=\"truncate\">{title} </div>\n\n          <div className=\"line-clamp-2 text-slate-400 md:line-clamp-3\">\n            {description}\n          </div>\n          <p className=\"hidden cursor-pointer  items-center gap-2 font-medium text-sky-500 md:inline-flex\">\n            <LuLink />\n            {sanitizedUrl}\n          </p>\n        </div>\n      </a>\n    </NodeViewWrapper>\n  );\n};\n\ndeclare module \"@tiptap/core\" {\n  interface Commands<ReturnType> {\n    linkPreview: {\n      /**\n       * @example editor.commands.setLinkPreview({ url: 'https://example.com' })\n       */\n      setLinkPreview: ({ url }: { url: string }) => ReturnType;\n    };\n  }\n}\n\nexport const LinkPreview = Node.create({\n  name: \"linkPreview\",\n  priority: 1000,\n  group: \"block\",\n  content: \"inline*\",\n\n  addAttributes() {\n    return {\n      url: {\n        default: null,\n      },\n    };\n  },\n\n  parseHTML() {\n    return [{ tag: \"div\" }];\n  },\n\n  renderHTML({ HTMLAttributes }) {\n    return [\n      \"div\",\n      mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n    ];\n  },\n\n  addNodeView() {\n    return ReactNodeViewRenderer(LinkPreviewCard);\n  },\n\n  addCommands() {\n    return {\n      setLinkPreview:\n        ({ url }) =>\n        ({ commands }) => {\n          return commands.setNode(this.name, { url });\n        },\n    };\n  },\n});\n"
  },
  {
    "path": "components/dashboard/TextArea/PostButtons.tsx",
    "content": "import React, { useEffect, useState } from \"react\";\nimport { useTheme } from \"next-themes\";\nimport { useAtom } from \"jotai\";\nimport Skeleton from \"react-loading-skeleton\";\nimport { toast } from \"react-hot-toast\";\nimport {\n  IoMdCheckmarkCircle,\n  IoMdCopy,\n  IoMdRefresh,\n  IoMdRefreshCircle,\n  IoMdSend,\n  IoMdTrash,\n} from \"react-icons/io\";\nimport { selectedNoteAtom } from \"@/stores/postDataAtom\";\nimport useNotes from \"@/components/hooks/useNotes\";\nimport { isSyncedAtom } from \"@/stores/syncedAtom\";\nimport useUser from \"@/components/hooks/useUser\";\nimport Button from \"@/components/ui/Button\";\nimport Toggle from \"@/components/ui/Toggle\";\nimport Modal from \"@/components/ui/Modal\";\nimport { Editor } from \"@tiptap/react\";\n\ntype PostButtonsProps = {\n  shiftRight?: boolean;\n  editor: Editor | null;\n};\n\nexport const formatTimeStamp = (time: number | undefined) => {\n  if (!time) return \"never\";\n  const formattingOptions: Intl.DateTimeFormatOptions = {\n    year: \"numeric\",\n    month: \"long\",\n    day: \"numeric\",\n    hour: \"numeric\",\n    minute: \"numeric\",\n    hour12: true,\n  };\n  const formattedDate = new Date(time).toLocaleString(\n    \"en-US\",\n    formattingOptions\n  );\n  return formattedDate;\n};\n\nconst PostButtons = ({ shiftRight, editor }: PostButtonsProps) => {\n  // HOOKS\n  const { theme } = useTheme();\n\n  // LOCAL STATE\n  const [lastUpdated, setLastUpdated] = useState<string | null>(null);\n  const [showPublishModal, setShowPublishModal] = useState(false);\n  const [downloadLoading, setDownloadLoading] = useState(false);\n\n  // ATOMIC STATE\n  const [synced, setSynced] = useAtom(isSyncedAtom);\n  const [selectedNote, setSelectedNote] = useAtom(selectedNoteAtom);\n\n  const { user, publicUserDetails } = useUser();\n\n  // CUSTOM HOOKS\n  const { notes, updateNote, deleteNote, refreshNotes } = useNotes({\n    userId: user?.uid,\n  });\n\n  // EFFECTS\n  useEffect(() => {\n    if (!selectedNote.lastUpdated) return;\n    const formattedDate = formatTimeStamp(selectedNote.lastUpdated);\n    setLastUpdated(formattedDate);\n  }, [selectedNote.lastUpdated, selectedNote.id]);\n\n  /**\n   * Saves the note if not already synced\n   */\n  const saveNoteHandler = async () => {\n    setSelectedNote((prev) => ({\n      ...prev,\n      isPublic: !prev.isPublic,\n    }));\n    if (!selectedNote.id || !notes?.find((note) => note.id === selectedNote.id))\n      return;\n    setSynced(false);\n    await updateNote({\n      id: selectedNote.id,\n      title: selectedNote.title,\n      content: selectedNote.content,\n      public: selectedNote.isPublic,\n    });\n    refreshNotes();\n    setSynced(true);\n  };\n\n  /**\n   * Deletes the note and selects the next note in the list\n   */\n  const deleteNoteHandler = async () => {\n    if (!notes || !selectedNote.id) return;\n    // Confirm deletion\n    const confirm = window.confirm(\n      \"Are you sure you want to delete this post?\"\n    );\n    if (!confirm) return;\n    await deleteNote(selectedNote.id);\n    await refreshNotes();\n    toast.success(\"Deleted Post!\", {\n      iconTheme: {\n        primary: \"#f00\",\n        secondary: \"#ffffff\",\n      },\n    });\n    const noteIndex = notes.findIndex((note) => note.id === selectedNote.id);\n    const newIndex = noteIndex > 0 ? noteIndex - 1 : noteIndex + 1;\n    setSelectedNote((prev) => ({ ...prev, id: notes[0]?.id || \"\" }));\n  };\n\n  const downloadPDFHandler = async () => {\n    if (!editor) return;\n    setDownloadLoading(true);\n    const content = document.querySelector(\"#writedown-editor\") as HTMLElement;\n    if (!content) return;\n    // const originalColor = content.style.color;\n    const originalBgColor = content.style.backgroundColor;\n    import(\"html2pdf.js\").then((html2pdf) => {\n      // content.style.color = \"#000 !important\";\n      content.style.backgroundColor = theme === \"dark\" ? \"#000\" : \"#fff\";\n      html2pdf\n        .default()\n        .set({\n          margin: 1,\n          filename: `${selectedNote.title}-${lastUpdated}.pdf`,\n          image: { type: \"jpeg\", quality: 0.98 },\n          jsPDF: { compress: true, backgroundColor: \"#000\" },\n          enableLinks: true,\n        })\n        .from(content)\n        .save()\n        .then(() => {\n          // content.style.color = originalColor;\n          content.style.backgroundColor = originalBgColor;\n        })\n        .finally(() => {\n          setDownloadLoading(false);\n        });\n    });\n  };\n\n  const downloadMarkdownHandler = () => {\n    if (!editor) return;\n    setDownloadLoading(true);\n    const markdown = selectedNote.content;\n    if (!markdown) return;\n    const blob = new Blob([markdown], { type: \"text/plain\" });\n    const url = URL.createObjectURL(blob);\n    const a = document.createElement(\"a\");\n    a.href = url;\n    a.download = `${selectedNote.title}-${lastUpdated}.md`;\n    a.click();\n    setDownloadLoading(false);\n  };\n\n  const downloadHTMLHandler = () => {\n    if (!editor) return;\n    setDownloadLoading(true);\n    const html = editor.getHTML();\n    if (!html) return;\n    const blob = new Blob([html], { type: \"text/plain\" });\n    const url = URL.createObjectURL(blob);\n    const a = document.createElement(\"a\");\n    a.href = url;\n    a.download = `${selectedNote.title}-${lastUpdated}.html`;\n    a.click();\n    setDownloadLoading(false);\n  };\n\n  return (\n    <div\n      className={`mt-14 flex w-full max-w-3xl select-none flex-col gap-4 transition-transform duration-300 md:mt-52 md:flex-row md:items-center md:justify-between md:px-4 ${\n        shiftRight ? \"translate-x-52\" : \"translate-x-0\"\n      }`}\n    >\n      {/* LAST UPDATED */}\n      {lastUpdated ? (\n        <p className=\"flex items-center justify-center text-xs font-medium text-slate-500 dark:text-slate-400 md:text-sm\">\n          Last Updated {lastUpdated}\n        </p>\n      ) : (\n        <Skeleton className=\"w-44\" />\n      )}\n\n      {/* ACTION BUTTONS */}\n      <div className=\"flex flex-wrap items-center justify-center gap-4 md:items-start\">\n        {/* SAVE BUTTON */}\n        <Button\n          data-testid=\"save\"\n          type=\"button\"\n          size=\"sm\"\n          variant=\"green\"\n          className=\"w-28\"\n        >\n          {!synced && (\n            <span className=\"flex items-center justify-center gap-1\">\n              <IoMdRefreshCircle className=\"h-5 w-5 animate-spin\" />\n              <p>Saving</p>\n            </span>\n          )}\n          {synced && (\n            <span className=\"flex items-center justify-center gap-1\">\n              <IoMdCheckmarkCircle className=\"h-5 w-5\" />\n              <p>Saved</p>\n            </span>\n          )}\n        </Button>\n\n        <Button\n          data-testid=\"del\"\n          type=\"button\"\n          onClick={deleteNoteHandler}\n          variant=\"red\"\n          size=\"sm\"\n        >\n          <span className=\"flex items-center justify-center gap-1\">\n            <IoMdTrash className=\"h-5 w-5\" />\n            <p>Delete Post</p>\n          </span>\n        </Button>\n\n        {/* SAVE BUTTON */}\n        <Button\n          data-testid=\"download\"\n          type=\"button\"\n          onClick={() => {\n            setShowPublishModal(true);\n          }}\n          size=\"sm\"\n          variant=\"blue\"\n        >\n          <span className=\"flex items-center justify-center gap-1\">\n            <IoMdSend className=\"h-5 w-5\" />\n            <p>Publish</p>\n          </span>\n        </Button>\n\n        <Modal\n          isOpen={showPublishModal}\n          setIsOpen={setShowPublishModal}\n          title=\"Publish and Share\"\n        >\n          <div className=\"p-2\">\n            <div className=\"mb-4 flex flex-row items-center gap-2\">\n              <label\n                htmlFor=\"toggle\"\n                className=\"cursor-pointer select-none font-medium dark:text-slate-300\"\n                onClick={saveNoteHandler}\n              >\n                Enable Public Viewing\n              </label>\n              <Toggle\n                enabled={selectedNote.isPublic}\n                onChange={saveNoteHandler}\n                screenReaderPrompt=\"Toggle Public Sharing\"\n              />\n            </div>\n            <p\n              className={`relative rounded-lg p-2 text-sm transition-all duration-500 ${\n                selectedNote.isPublic\n                  ? \"cursor-pointer bg-emerald-50 text-slate-900 ring-2 ring-emerald-300 hover:scale-95 dark:bg-emerald-950 dark:text-emerald-100 dark:ring-emerald-400\"\n                  : \"select-none bg-slate-200 text-slate-400 ring-2 ring-slate-300 dark:bg-slate-800 dark:text-slate-500 dark:ring-slate-500\"\n              }`}\n              onClick={() => {\n                if (!selectedNote.isPublic) return;\n                toast.success(\"Copied link to clipboard!\");\n                const isDev = process.env.NODE_ENV === \"development\";\n                navigator.clipboard.writeText(\n                  isDev\n                    ? `http://localhost:3000/${\n                        publicUserDetails?.username || publicUserDetails?.uid\n                      }/posts/${selectedNote.id}`\n                    : `https://writedown.app/${\n                        publicUserDetails?.username || publicUserDetails?.uid\n                      }/posts/${selectedNote.id}`\n                );\n              }}\n            >\n              <div className=\"w-11/12 truncate\">\n                {/* PROD */}\n                {process.env.NODE_ENV !== \"development\" &&\n                  selectedNote.isPublic &&\n                  `https://writedown.app/${\n                    publicUserDetails?.username || publicUserDetails?.uid\n                  }/posts/${selectedNote.id}`}\n                {process.env.NODE_ENV !== \"development\" &&\n                  !selectedNote.isPublic &&\n                  `https://writedown.app/...`}\n                {/* DEV */}\n                {process.env.NODE_ENV === \"development\" &&\n                  selectedNote.isPublic &&\n                  `http://localhost:3000/${\n                    publicUserDetails?.username || publicUserDetails?.uid\n                  }/posts/${selectedNote.id}`}\n                {process.env.NODE_ENV === \"development\" &&\n                  !selectedNote.isPublic &&\n                  `http://localhost:3000/...`}\n              </div>\n              {selectedNote.isPublic && (\n                <IoMdCopy className=\"absolute right-2 top-1/2 h-5 w-5 -translate-y-1/2\" />\n              )}\n            </p>\n\n            <div className=\"mt-5\">\n              <label className=\"font-medium dark:text-slate-300\">\n                {!downloadLoading ? (\n                  \"Download Post\"\n                ) : (\n                  <div className=\"flex items-center gap-1\">\n                    Downloading\n                    <IoMdRefresh className=\"h-5 w-5 animate-spin\" />\n                  </div>\n                )}\n              </label>\n              <div className=\"mt-4 flex flex-row flex-wrap items-center justify-center gap-4\">\n                <Button variant=\"red\" size=\"sm\" onClick={downloadPDFHandler}>\n                  Download PDF\n                </Button>\n                <Button\n                  variant=\"green\"\n                  size=\"sm\"\n                  onClick={downloadMarkdownHandler}\n                >\n                  Download Markdown\n                </Button>\n                <Button variant=\"blue\" size=\"sm\" onClick={downloadHTMLHandler}>\n                  Download HTML\n                </Button>\n              </div>\n            </div>\n          </div>\n        </Modal>\n      </div>\n    </div>\n  );\n};\n\nexport default PostButtons;\n"
  },
  {
    "path": "components/dashboard/TextArea/index.tsx",
    "content": "import { selectedNoteAtom } from \"@/stores/postDataAtom\";\nimport CodeBlockLowlight from \"@tiptap/extension-code-block-lowlight\";\nimport DetailsContent from \"@tiptap-pro/extension-details-content\";\nimport DetailsSummary from \"@tiptap-pro/extension-details-summary\";\nimport WritedownEditor from \"@/components/ui/WritedownEditor\";\nimport Mathematics from \"@tiptap-pro/extension-mathematics\";\nimport { useAuthState } from \"react-firebase-hooks/auth\";\nimport { LinkPreview } from \"./LinkPreview\";\nimport UniqueId from \"@tiptap-pro/extension-unique-id\";\nimport Details from \"@tiptap-pro/extension-details\";\nimport IconButton from \"@/components/ui/IconButton\";\nimport useNotes from \"@/components/hooks/useNotes\";\nimport TaskList from \"@tiptap/extension-task-list\";\nimport TaskItem from \"@tiptap/extension-task-item\";\nimport { isSyncedAtom } from \"@/stores/syncedAtom\";\nimport { BsChevronBarLeft } from \"react-icons/bs\";\nimport Emoji from \"@tiptap-pro/extension-emoji\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport { createLowlight } from \"lowlight\";\nimport Image from \"@tiptap/extension-image\";\nimport EditorButtons from \"./EditorButtons\";\nimport { Markdown } from \"tiptap-markdown\";\nimport Code from \"@tiptap/extension-code\";\nimport Link from \"@tiptap/extension-link\";\nimport { useEditor } from \"@tiptap/react\";\nimport React, { useEffect } from \"react\";\nimport PostButtons from \"./PostButtons\";\nimport { auth } from \"@/lib/firebase\";\nimport { useAtom } from \"jotai\";\n\nconst lowlight = createLowlight();\n\ntype TextAreaProps = {\n  shiftRight: boolean;\n  setShiftRight: React.Dispatch<React.SetStateAction<boolean>>;\n};\n\nconst TextArea = ({ shiftRight, setShiftRight }: TextAreaProps) => {\n  const [user] = useAuthState(auth);\n  const [selectedNote, setSelectedNote] = useAtom(selectedNoteAtom);\n  const [synced, setSynced] = useAtom(isSyncedAtom);\n\n  const { notes, updateNote, createNote, refreshNotes } = useNotes({\n    userId: user?.uid,\n  });\n\n  // EDITOR OPTIONS\n  const editor = useEditor({\n    editorProps: {\n      attributes: {\n        class:\n          \"prose !max-h-none min-h-screen !max-w-none p-2 dark:prose-invert focus:outline-none\",\n        id: \"writedown-editor\",\n      },\n    },\n    extensions: [\n      StarterKit.configure({\n        heading: {\n          levels: [1, 2, 3, 4, 5, 6],\n          HTMLAttributes: {\n            class: \"font-semibold\",\n          },\n        },\n        paragraph: {\n          HTMLAttributes: {},\n        },\n      }),\n      TaskList.configure({}),\n      TaskItem.configure({\n        nested: true,\n      }),\n      Link.configure({\n        protocols: [\"ftp\", \"mailto\"],\n        autolink: true,\n        linkOnPaste: true,\n        HTMLAttributes: {\n          class: \"text-sky-500 underline cursor-pointer\",\n          target: \"_blank\",\n          rel: \"noopener noreferrer\",\n        },\n      }),\n      Image.configure({\n        inline: true,\n        allowBase64: false,\n      }),\n      Code.configure({\n        HTMLAttributes: {},\n      }),\n      CodeBlockLowlight.configure({\n        lowlight,\n        HTMLAttributes: {\n          languageClassPrefix: \"language-\",\n        },\n      }),\n      Mathematics,\n      Details,\n      DetailsSummary,\n      DetailsContent,\n      Emoji,\n      UniqueId,\n      Markdown.configure({\n        html: true,\n        tightLists: true,\n        tightListClass: \"tight\",\n        bulletListMarker: \"-\",\n        linkify: true,\n        breaks: true,\n        transformPastedText: true,\n        transformCopiedText: true,\n      }),\n      LinkPreview,\n    ],\n    content: selectedNote.content,\n    onUpdate: ({ editor }) => {\n      if (editor) {\n        setSelectedNote((prev) => ({\n          ...prev,\n          content: editor.storage.markdown.getMarkdown(),\n        }));\n      }\n    },\n  });\n\n  // EFFECTS\n  useEffect(() => {\n    const alertUser = (e: BeforeUnloadEvent) => {\n      e.preventDefault();\n    };\n    if (!synced) {\n      window.addEventListener(\"beforeunload\", alertUser);\n    } else {\n      window.removeEventListener(\"beforeunload\", alertUser);\n    }\n    return () => {\n      window.removeEventListener(\"beforeunload\", alertUser);\n    };\n  }, [synced]);\n\n  useEffect(() => {\n    if (!notes) return;\n    notes.length === 0 &&\n      createNote().then((id) => {\n        if (!id) {\n          return;\n        }\n        setSelectedNote((prev) => ({ ...prev, id }));\n      });\n  }, [notes]);\n\n  useEffect(() => {\n    if (!notes) return;\n    if (notes.length > 0 && !selectedNote.id) {\n      setSelectedNote((prev) => ({\n        ...prev,\n        id: notes[0].id,\n        content: notes[0].content,\n        title: notes[0].title,\n        lastUpdated: notes[0].updatedAt,\n        isPublic: notes[0].public,\n      }));\n\n      return;\n    }\n    if (!selectedNote.id) return;\n    const foundExistingNote = notes.find((note) => note.id === selectedNote.id);\n    if (!foundExistingNote) return;\n\n    setSelectedNote((prev) => ({\n      ...prev,\n      content: foundExistingNote.content,\n      title: foundExistingNote.title,\n      lastUpdated: foundExistingNote.updatedAt,\n      isPublic: foundExistingNote.public,\n    }));\n  }, [notes, selectedNote.id]);\n\n  useEffect(() => {\n    if (!selectedNote.id || !user) return;\n    const currentNote = notes?.find(\n      (note) =>\n        selectedNote.content === note.content &&\n        selectedNote.title === note.title &&\n        selectedNote.lastUpdated === note.updatedAt &&\n        selectedNote.isPublic === note.public\n    );\n    let debounceSave: NodeJS.Timeout;\n    const isNoteUnchanged = currentNote?.id === selectedNote.id;\n    if (isNoteUnchanged) {\n      setSynced(true);\n      return;\n    } else {\n      debounceSave = setTimeout(() => {\n        setSynced(false);\n        updateNote({\n          id: selectedNote.id,\n          title: selectedNote.title,\n          content: selectedNote.content,\n          public: selectedNote.isPublic,\n        });\n        setSynced(true);\n      }, 3000);\n      setSynced(false);\n    }\n    return () => {\n      clearTimeout(debounceSave);\n    };\n  }, [notes, selectedNote.title, selectedNote.content, selectedNote.isPublic]);\n\n  useEffect(() => {\n    refreshNotes();\n  }, [selectedNote.id]);\n\n  return (\n    <div\n      className={`scrollbar flex w-full flex-col items-center justify-start overflow-x-hidden overflow-y-scroll p-2 md:p-5`}\n    >\n      <IconButton\n        extraClasses={`fixed z-10 ml-auto top-[10px] right-[15px] md:hidden transition-transform duration-400 rotate-180 ${\n          shiftRight ? \"translate-x-52\" : \"translate-x-0\"\n        }`}\n        onClick={() => setShiftRight(true)}\n      >\n        <BsChevronBarLeft\n          className={`duration-400 h-4 w-4 text-black transition-transform dark:text-slate-100`}\n        />\n      </IconButton>\n\n      {/*BUTTONS AND OTHER STATUS ELEMENTS*/}\n      <PostButtons shiftRight={shiftRight} editor={editor} />\n\n      {/*EDITOR BUTTONS AND THE EDITOR*/}\n      <EditorButtons shiftRight={shiftRight} editor={editor} />\n\n      <div\n        tabIndex={0}\n        id=\"editor\"\n        className={`mb-64 w-full max-w-3xl flex-col rounded-xl bg-white p-5 transition-transform duration-300 dark:bg-slate-900 ${\n          shiftRight ? \"translate-x-52\" : \"translate-x-0\"\n        }`}\n      >\n        {/* TITLE OF THE POST */}\n        <input\n          data-testid=\"noteTitle\"\n          type=\"text\"\n          className=\"w-full appearance-none border-none p-0 text-5xl font-bold leading-relaxed focus:outline-none focus:ring-0 dark:bg-slate-900 dark:text-slate-200\"\n          onChange={(e) => {\n            setSelectedNote((prev) => ({\n              ...prev,\n              title: e.target.value,\n            }));\n          }}\n          placeholder=\"Untitled\"\n          value={selectedNote.title}\n        />\n\n        {/* SEPARATOR */}\n        <div className=\"mb-5 mt-2 h-0.5 w-full rounded-full bg-slate-200 dark:bg-slate-800\" />\n\n        <WritedownEditor notes={notes} editor={editor} />\n      </div>\n    </div>\n  );\n};\n\nexport default TextArea;\n"
  },
  {
    "path": "components/home/FeatureCard.tsx",
    "content": "import React from \"react\";\n\ntype FeatureCardProps = {\n  icon: React.ReactNode;\n  title: string;\n  description: string;\n};\n\nconst FeatureCard = ({ icon, title, description }: FeatureCardProps) => {\n  return (\n    <div className=\"flex w-full cursor-default flex-col gap-4 rounded-xl bg-slate-200 p-5 text-sm transition-all duration-300 hover:scale-105 hover:bg-slate-100 dark:bg-slate-700 sm:hover:scale-110\">\n      <h6 className=\"tex-base flex flex-col items-center gap-1 font-medium text-slate-900 dark:text-slate-100 sm:text-lg\">\n        {icon} {title}\n      </h6>\n      <p className=\"text-slate-600 dark:text-slate-300\">{description}</p>\n    </div>\n  );\n};\n\nexport default FeatureCard;\n"
  },
  {
    "path": "components/home/Features.tsx",
    "content": "import {\n  FiBox,\n  FiCloudLightning,\n  FiEye,\n  FiGithub,\n  FiGlobe,\n  FiPackage,\n  FiRefreshCcw,\n  FiSmile,\n  FiSun,\n  FiUserCheck,\n  FiWifiOff,\n} from \"react-icons/fi\";\nimport FeatureCard from \"./FeatureCard\";\nimport React from \"react\";\n\nconst Features = () => {\n  return (\n    <div className=\"mb-10 grid grid-cols-1 content-center gap-4 px-4 sm:grid-cols-2 sm:gap-8 sm:px-5 md:px-20 lg:grid-cols-2 lg:px-36 xl:grid-cols-5\">\n      <FeatureCard\n        icon={<FiGlobe className=\"h-6 w-6\" />}\n        title=\"Free and Open Source\"\n        description=\"Sharing is caring, writedown is completely free and open source and licensed under AGPLv3.\"\n      />\n\n      <FeatureCard\n        icon={<FiCloudLightning className=\"h-6 w-6\" />}\n        title=\"Synced on all your devices\"\n        description=\"All your notes are synced on all your devices. You can access them from anywhere.\"\n      />\n\n      <FeatureCard\n        icon={<FiWifiOff className=\"h-6 w-6\" />}\n        title=\"Offline Support\"\n        description=\"Write and save notes even when you are away from the internet!\"\n      />\n\n      <FeatureCard\n        icon={<FiEye className=\"h-6 w-6\" />}\n        title=\"Live Markdown\"\n        description=\"Writedown supports Markdown. You can write markdown and preview it in real-time.\"\n      />\n\n      <FeatureCard\n        icon={<FiSmile className=\"h-6 w-6\" />}\n        title=\"Easy to Use\"\n        description=\"Writedown is easy to use with a beautiful interface. Get started in just 5 seconds!\"\n      />\n    </div>\n  );\n};\n\nexport default Features;\n"
  },
  {
    "path": "components/home/Footer.tsx",
    "content": "import { FEATURE_FLAGS } from \"@/constants/feature-flags\";\nimport BetaBadge from \"../ui/BetaBadge\";\nimport { auth } from \"@/lib/firebase\";\nimport Link from \"next/link\";\nimport React from \"react\";\n\nconst Footer = ({ className }: { className?: string }) => {\n  return (\n    <footer\n      className={\n        \"flex flex-col items-center justify-between gap-2 bg-slate-200 px-4 text-slate-900 dark:bg-slate-700 dark:text-slate-50 sm:flex-row sm:py-4 md:px-10 lg:px-36\" +\n        \" \" +\n        className\n      }\n    >\n      <div className=\"pt-4 sm:pt-0\">\n        <Link href=\"/\" className=\"text-xl font-semibold\">\n          writedown {FEATURE_FLAGS.beta && <BetaBadge />}\n        </Link>\n      </div>\n      <div className=\"text-sm\">\n        <ul className=\"flex flex-row gap-5\">\n          <li>\n            <Link href=\"/login\">\n              {auth.currentUser ? \"Write Down\" : \"Login\"}\n            </Link>\n          </li>\n          <li>\n            <a href=\"https://github.com/NayamAmarshe/writedown\">GitHub</a>\n          </li>\n        </ul>\n      </div>\n      <div className=\"pb-5 text-slate-500 dark:text-slate-400 sm:pb-0\">\n        <p className=\"text-sm\">\n          © {new Date().getFullYear()}{\" \"}\n          <Link href=\"/\" className=\"font-semibold\">\n            writedown\n          </Link>\n          . All rights reserved.\n        </p>\n      </div>\n    </footer>\n  );\n};\n\nexport default Footer;\n"
  },
  {
    "path": "components/home/HeroSection.tsx",
    "content": "import { Parallax } from \"react-scroll-parallax\";\nimport { auth } from \"@/lib/firebase\";\nimport Button from \"../ui/Button\";\nimport Link from \"next/link\";\nimport React from \"react\";\n\nconst HeroSection = () => {\n  return (\n    <div className=\"my-32 h-full w-full\">\n      <div className=\"flex h-full w-full flex-col items-center justify-center gap-20 px-4\">\n        <div className=\"flex flex-col items-center justify-center gap-5\">\n          <h1 className=\"flex flex-col gap-5 text-center text-4xl font-semibold leading-tight text-slate-900 dark:text-slate-50 xs:text-5xl sm:text-7xl\">\n            <span className=\"whitespace-nowrap\">Upgrade Your</span>\n            <span className=\"text-pacifico whitespace-nowrap font-light\">\n              Dear Diary\n            </span>\n          </h1>\n\n          <p className=\"mt-4 max-w-lg text-center text-base font-medium text-slate-800 dark:text-slate-200 xs:text-xl\">\n            All your notes, synced on all your devices. <br />\n            Free, easy and fast.\n          </p>\n\n          <div>\n            <Link href=\"/login\">\n              <Button>{auth.currentUser ? \"Write Down\" : \"Try Now\"}</Button>\n            </Link>\n          </div>\n        </div>\n\n        <Parallax speed={10}>\n          <img\n            src=\"/screenshot.png\"\n            alt=\"Writedown Screenshot\"\n            className=\"dark:hidden\"\n          />\n          <img\n            src=\"/dark-screenshot.png\"\n            alt=\"Writedown Screenshot\"\n            className=\"hidden dark:block\"\n          />\n        </Parallax>\n      </div>\n    </div>\n  );\n};\n\nexport default HeroSection;\n"
  },
  {
    "path": "components/home/Navbar.tsx",
    "content": "import { FEATURE_FLAGS } from \"@/constants/feature-flags\";\nimport { FiMoon, FiSun } from \"react-icons/fi\";\nimport BetaBadge from \"../ui/BetaBadge\";\nimport { useTheme } from \"next-themes\";\nimport { auth } from \"@/lib/firebase\";\nimport Button from \"../ui/Button\";\nimport Link from \"next/link\";\nimport React from \"react\";\nimport useMounted from \"../hooks/useMounted\";\n\nconst Navbar = () => {\n  const { theme, setTheme } = useTheme();\n  const isMounted = useMounted();\n\n  return (\n    <nav className=\"fixed z-10 flex w-full flex-row justify-between bg-slate-50/50 px-4 py-4 backdrop-blur-md dark:bg-slate-900/50 md:px-10 lg:px-36\">\n      <div className=\"flex w-full flex-row items-center justify-start gap-2\">\n        <Link href=\"/\">\n          <h4 className=\"flex items-center text-2xl font-semibold\">\n            writedown {FEATURE_FLAGS.beta && <BetaBadge />}\n          </h4>\n        </Link>\n      </div>\n      <div className=\"flex w-full flex-row items-center justify-end gap-4\">\n        <button\n          onClick={() => {\n            setTheme(theme === \"light\" ? \"dark\" : \"light\");\n          }}\n        >\n          {isMounted && theme === \"light\" ? (\n            <FiMoon className=\"h-6 w-6 duration-300 hover:scale-110\" />\n          ) : (\n            <FiSun className=\"h-6 w-6 duration-300 hover:scale-110\" />\n          )}\n        </button>\n\n        <Link href=\"/login\" className=\"hidden sm:block\">\n          <Button>{auth.currentUser ? \"Write Down\" : \"Try Now\"}</Button>\n        </Link>\n      </div>\n    </nav>\n  );\n};\n\nexport default Navbar;\n"
  },
  {
    "path": "components/hooks/UsePaginateQuery.ts",
    "content": "import {\n  startAfter,\n  query,\n  getDocs,\n  DocumentData,\n  QueryDocumentSnapshot,\n} from \"firebase/firestore\";\nimport { useState, useEffect, useCallback, useRef, useMemo } from \"react\";\nimport { Query } from \"firebase/firestore\";\n\nconst usePaginateQuery = (queryFn: () => Query, pageLoaded: boolean) => {\n  const [data, setData] = useState<QueryDocumentSnapshot<DocumentData>[]>([]);\n  const isMountedRef = useRef(false);\n  const lastItemRef = useRef<any>(null);\n  const [isLoading, setisLoading] = useState<boolean>();\n  const [errorMsg, setErrorMsg] = useState();\n\n  const resetStates = () => {\n    setData([]);\n    setisLoading(false);\n  };\n\n  useEffect(() => {\n    if (isMountedRef.current === true) return;\n\n    async function fetchQuery() {\n      try {\n        isMountedRef.current = true;\n        setisLoading(true);\n        const q = query(queryFn());\n        const querySnapshot = await getDocs(q);\n        setData([...querySnapshot.docs]);\n        lastItemRef.current = querySnapshot.docs[querySnapshot.docs.length - 1];\n        setisLoading(false);\n      } catch (error: any) {\n        resetStates();\n        setErrorMsg(error.code);\n      }\n    }\n    fetchQuery();\n  }, [queryFn]);\n\n  const more = useCallback(async () => {\n    try {\n      setisLoading(true);\n      const next = query(queryFn(), startAfter(lastItemRef.current));\n      const querySnapshot = await getDocs(next);\n      setData([...data, ...querySnapshot.docs]);\n      lastItemRef.current = querySnapshot.docs[querySnapshot.docs.length - 1];\n      setisLoading(false);\n    } catch (error: any) {\n      resetStates();\n      setErrorMsg(error.code);\n    }\n  }, [data, queryFn]);\n\n  return useMemo(() => {\n    return {\n      more,\n      isLoading,\n      data: data ? data : [],\n      errorMsg,\n    };\n  }, [more, isLoading, data, errorMsg]);\n};\n\nexport default usePaginateQuery;\n"
  },
  {
    "path": "components/hooks/useMounted.ts",
    "content": "import { useEffect, useState } from \"react\";\n\nconst useMounted = () => {\n  const [isMounted, setIsMounted] = useState(false);\n\n  useEffect(() => {\n    setIsMounted(true);\n  }, []);\n\n  return isMounted;\n};\n\nexport default useMounted;\n"
  },
  {
    "path": "components/hooks/useNotes.ts",
    "content": "import {\n  collection,\n  deleteDoc,\n  doc,\n  getDoc,\n  orderBy,\n  query,\n  setDoc,\n  updateDoc,\n} from \"firebase/firestore\";\nimport { useCollectionDataOnce } from \"react-firebase-hooks/firestore\";\nimport { NoteDocument } from \"@/types/utils/firebaseOperations\";\nimport { notesConverter } from \"@/utils/firestoreDataConverter\";\nimport { selectedNoteAtom } from \"@/stores/postDataAtom\";\n\nimport { toast } from \"react-hot-toast\";\nimport { db } from \"@/lib/firebase\";\nimport { useCallback } from \"react\";\nimport { useAtom, useSetAtom } from \"jotai\";\n\ntype UseNotesProps = {\n  userId: string | undefined;\n};\n\nexport const useNotes = ({ userId }: UseNotesProps) => {\n  const [selectedNote, setSelectedNote] = useAtom(selectedNoteAtom);\n\n  const [notes, loading, error, snapshot, refreshNotes] = useCollectionDataOnce(\n    userId\n      ? query(\n          collection(db, \"users\", userId, \"notes\"),\n          orderBy(\"updatedAt\", \"desc\")\n        ).withConverter(notesConverter)\n      : null\n  );\n\n  const createNote = useCallback(async () => {\n    if (!userId) return;\n\n    const id = crypto.randomUUID();\n    const currentTime = new Date().getTime();\n\n    const noteData: NoteDocument = {\n      id,\n      content: \"\",\n      public: false,\n      slug: id,\n      title: \"\",\n      userId,\n      createdAt: currentTime,\n      updatedAt: currentTime,\n    };\n\n    const notesRef = doc(db, \"users\", userId, \"notes\", id);\n\n    try {\n      // Create a document inside channelsRef array\n      await setDoc(notesRef, noteData, { merge: true });\n      refreshNotes();\n      return id;\n    } catch (error) {\n      toast.error(\"Failed to create post, please try again later.\");\n    }\n  }, [userId]);\n\n  const updateNote = useCallback(\n    async (note: {\n      id: string;\n      title: string;\n      content: string;\n      public?: boolean;\n    }) => {\n      if (!userId || !note) return;\n\n      const notesRef = doc(db, \"users\", userId, \"notes\", note.id);\n      const currentTime = new Date().getTime();\n      const updatedContent = note.public\n        ? { ...note, updatedAt: currentTime, publishedAt: currentTime }\n        : { ...note, updatedAt: currentTime };\n\n      try {\n        // Create a document inside channelsRef array\n        await updateDoc(notesRef, updatedContent);\n        setSelectedNote((prev) => ({\n          ...prev,\n          lastUpdated: currentTime,\n        }));\n      } catch (error) {\n        toast.error(\"Failed to update post, please try again later.\");\n      }\n    },\n    [userId]\n  );\n\n  const deleteNote = useCallback(\n    async (noteId: string) => {\n      if (!userId || !noteId) return;\n\n      const notesRef = doc(db, \"users\", userId, \"notes\", noteId);\n\n      try {\n        // Create a document inside channelsRef array\n        await deleteDoc(notesRef);\n        refreshNotes();\n      } catch (error) {\n        toast.error(\"Failed to delete post, please try again later.\");\n      }\n    },\n    [userId]\n  );\n\n  return {\n    notes,\n    refreshNotes,\n    notesLoading: loading,\n    notesError: error,\n    notesSnapshot: snapshot,\n    createNote,\n    updateNote,\n    deleteNote,\n  };\n};\n\nexport default useNotes;\n"
  },
  {
    "path": "components/hooks/usePublicNotes.ts",
    "content": "import { useDocumentData } from \"react-firebase-hooks/firestore\";\nimport { doc } from \"firebase/firestore\";\nimport { db } from \"@/lib/firebase\";\n\ntype UseNotesProps = {\n  noteId: string;\n};\n\nexport const usePublicNotes = ({ noteId }: UseNotesProps) => {\n  const [publicNotes, loading, error, snapshot] = useDocumentData(\n    noteId ? doc(db, \"public_notes\", noteId) : null\n  );\n\n  const [note, note_loading, note_error, note_snapshot] = useDocumentData(\n    publicNotes ? doc(db, \"users\", publicNotes.userId, \"notes\", noteId) : null\n  );\n\n  return {\n    publicNotes,\n    note,\n    publicNotesLoading: loading,\n    publicNotesError: error,\n    publicNotesSnapshot: snapshot,\n    notesLoading: note_loading,\n    notesError: note_error,\n    notesSnapshot: note_snapshot,\n  };\n};\n\nexport default usePublicNotes;\n"
  },
  {
    "path": "components/hooks/useUser.ts",
    "content": "import { deleteDoc, doc, getDoc, writeBatch } from \"firebase/firestore\";\nimport { userDocConverter } from \"@/utils/firestoreDataConverter\";\nimport { useDocumentData } from \"react-firebase-hooks/firestore\";\nimport { UserDocument } from \"@/types/utils/firebaseOperations\";\nimport { useAuthState } from \"react-firebase-hooks/auth\";\nimport { User } from \"firebase/auth\";\nimport { db } from \"@/lib/firebase\";\nimport { auth } from \"@/lib/firebase\";\n\nexport const useUser = () => {\n  const [user] = useAuthState(auth);\n\n  const [publicUserDetails] = useDocumentData(\n    user ? doc(db, \"users\", user?.uid).withConverter(userDocConverter) : null\n  );\n\n  /**\n   * Create a new user document in firestore with\n   * default values\n   * @param user\n   */\n  const checkUserExists = async (user: User) => {\n    const userRef = doc(db, \"users\", user.uid);\n    try {\n      const userSnap = await getDoc(userRef);\n      return userSnap.exists();\n    } catch (error) {\n      throw error;\n    }\n  };\n\n  const createUser = async (user: User) => {\n    if (!user) {\n      throw new Error(\"User not found\");\n    }\n    try {\n      const batch = writeBatch(db);\n      batch.set(doc(db, \"users\", user.uid), {\n        uid: user.uid,\n        photoURL: user.photoURL,\n        displayName: user.displayName,\n      });\n      // TODO: Create a {username: uid} doc in usernames collection\n      batch.set(doc(db, \"users\", user.uid, \"extras\", \"private\"), {\n        email: user.email,\n        createdAt: new Date().toISOString(),\n      });\n      await batch.commit();\n    } catch (error) {\n      throw error;\n    }\n  };\n\n  /**\n   * Set username for a user\n   * @param userId\n   * @param userName\n   */\n  const setUsername = async (userId: string, userName: string) => {\n    if (!userId) {\n      throw new Error(\"User not found\");\n    }\n    const batch = writeBatch(db);\n    // Store username->uid mapping\n    const usernameRef = doc(db, \"usernames\", userName);\n    batch.set(usernameRef, {\n      uid: userId,\n    });\n    // Store username in user document\n    const userRef = doc(db, \"users\", userId);\n    batch.update(userRef, {\n      username: userName,\n    });\n    // Commit batch write\n    try {\n      await batch.commit();\n    } catch (error) {\n      // Rollback username->uid mapping\n      deleteDoc(usernameRef);\n      throw error;\n    }\n  };\n\n  /**\n   * Check if a username is available\n   * @param userName\n   */\n  const checkUsernameValidity = async (userName: string) => {\n    if (!userName) return false;\n    const usernameDoc = doc(db, \"usernames\", userName);\n    const usernameSnap = await getDoc(usernameDoc);\n    return usernameSnap.exists() ? false : true;\n  };\n\n  /**\n   * Check if a user has a username\n   * @param user\n   */\n  const hasUsername = async (user: User) => {\n    if (!user) {\n      throw new Error(\"User not found\");\n    }\n    const userRef = doc(db, \"users\", user.uid);\n    try {\n      const userSnap = await getDoc(userRef);\n      const userData = userSnap.data() as UserDocument;\n      return userData && userData.username ? true : false;\n    } catch (error) {\n      throw error;\n    }\n  };\n\n  return {\n    user,\n    /** The user document with public details */\n    publicUserDetails,\n    createUser,\n    setUsername,\n    checkUsernameValidity,\n    hasUsername,\n    checkUserExists,\n  };\n};\n\nexport default useUser;\n"
  },
  {
    "path": "components/login/InfoSidebar.tsx",
    "content": "import React from \"react\";\nconst InfoSidebar = () => {\n  return (\n    <div className=\"relative h-1/2 w-full flex-col gap-2 overflow-hidden bg-slate-300 dark:bg-slate-600 md:h-full md:w-2/3\">\n      <h1 className=\"ml-10 mt-20 text-lg font-semibold dark:text-slate-50 md:ml-20 md:mt-52 md:text-2xl\">\n        Simplicity starts here\n      </h1>\n      <p className=\"ml-10 w-9/12 text-slate-700 dark:text-slate-200 sm:w-6/12 md:ml-20 md:w-1/2\">\n        A fast, easy and free way to write notes with offline support, cloud\n        sync and real-time markdown preview.\n      </p>\n\n      <img\n        src=\"/writedown.png\"\n        alt=\"Writedown Screenshot\"\n        className=\"ml-10 mt-5 h-96 origin-top-left rounded-l-xl object-cover object-left-top shadow-lg shadow-slate-900/50 dark:hidden dark:shadow-black/30 md:ml-20 md:mt-10 md:h-[70vh]\"\n      />\n      <img\n        src=\"/writedown-dark.png\"\n        alt=\"Writedown Screenshot\"\n        className=\"ml-10 mt-5 hidden h-96 origin-top-left rounded-l-xl object-cover object-left-top shadow-lg shadow-slate-900/50 dark:block dark:shadow-black/30 md:ml-20 md:mt-10 md:h-[70vh]\"\n      />\n    </div>\n  );\n};\n\nexport default InfoSidebar;\n"
  },
  {
    "path": "components/login/SignInArea.tsx",
    "content": "import {\n  useSignInWithGithub,\n  useSignInWithGoogle,\n} from \"react-firebase-hooks/auth\";\nimport { authErrorCodes } from \"@/constants/firebase-auth-error-codes\";\nimport { AiFillGithub } from \"react-icons/ai\";\nimport { FcGoogle } from \"react-icons/fc\";\nimport React, { useEffect } from \"react\";\nimport BetaBadge from \"../ui/BetaBadge\";\nimport toast from \"react-hot-toast\";\nimport { auth } from \"@/lib/firebase\";\nimport Button from \"../ui/Button\";\nimport Link from \"next/link\";\n\nconst SignInArea = () => {\n  // GOOGLE SIGN IN HOOK\n  const [signInWithGoogle, googleUser, googleLoading, googleError] =\n    useSignInWithGoogle(auth);\n  // GITHUB SIGN IN HOOK\n  const [signInWithGithub, githubUser, githubLoading, githubError] =\n    useSignInWithGithub(auth);\n\n  const login = (type: \"google\" | \"github\") => {\n    if (type === \"google\") {\n      signInWithGoogle();\n    } else if (type === \"github\") {\n      signInWithGithub();\n    }\n  };\n\n  useEffect(() => {\n    const error = githubError || googleError;\n\n    if (!error) return;\n    toast.error(\n      authErrorCodes[error.code as keyof typeof authErrorCodes] || error.message\n    );\n  }, [githubError, googleError]);\n\n  return (\n    <div className=\"flex h-1/2 w-full flex-col items-center justify-end gap-4 bg-slate-300 dark:bg-slate-600 dark:text-slate-50 md:h-full md:w-1/2\">\n      <div className=\"absolute left-5 top-0 px-4 pb-4 text-2xl font-semibold\">\n        <Link href=\"/\" className=\"fixed top-4 z-10 flex items-center\">\n          writedown\n        </Link>\n      </div>\n      <div className=\"bottom-0 flex h-full w-full flex-col items-center gap-4 bg-slate-50 px-10 py-16 pb-20 dark:bg-slate-900 md:justify-center md:rounded-r-xl\">\n        <p className=\"mb-5 text-center text-sm font-medium\">\n          Login with your familiar services:\n        </p>\n        <Button\n          className=\"hover:!border-slate- flex gap-2 border-2 !px-10 !text-slate-900 dark:!text-slate-50\"\n          data-testid=\"google-login\"\n          onClick={() => login(\"google\")}\n        >\n          <FcGoogle className=\"h-6 w-6\" /> Sign in with Google\n        </Button>\n        <Button\n          className=\"flex gap-2 border-2 !bg-slate-900 !px-10 !text-slate-50 hover:!border-slate-600 hover:!bg-slate-600 hover:!text-slate-50 dark:!text-slate-50 dark:hover:!border-slate-300 dark:hover:!bg-slate-300 dark:hover:!text-slate-900\"\n          data-testid=\"github-login\"\n          onClick={() => login(\"github\")}\n        >\n          <AiFillGithub className=\"h-6 w-6\" /> Sign in with GitHub\n        </Button>\n      </div>\n    </div>\n  );\n};\n\nexport default SignInArea;\n"
  },
  {
    "path": "components/ui/Badge.tsx",
    "content": "import React, { HTMLAttributes } from \"react\";\n\ntype BadgeProps = {\n  children: React.ReactNode;\n  color: \"yellow\" | \"green\" | \"red\" | \"blue\" | \"purple\" | \"pink\";\n};\n\nconst Badge = ({ children, color }: BadgeProps) => {\n  const getColorClasses = () => {\n    switch (color) {\n      case \"yellow\":\n        return \"bg-yellow-100 text-yellow-800\";\n      case \"green\":\n        return \"bg-green-100 text-green-800\";\n      case \"red\":\n        return \"bg-red-100 text-red-800\";\n      case \"blue\":\n        return \"bg-blue-100 text-blue-800\";\n      case \"purple\":\n        return \"bg-purple-100 text-purple-800\";\n      case \"pink\":\n        return \"bg-pink-100 text-pink-800\";\n      default:\n        return \"bg-gray-100 text-gray-800\";\n    }\n  };\n\n  return (\n    <div\n      className={`${getColorClasses()} cursor-pointer select-none rounded-full px-2 text-xs`}\n    >\n      {children}\n    </div>\n  );\n};\n\nexport default Badge;\n"
  },
  {
    "path": "components/ui/BetaBadge.tsx",
    "content": "import React from \"react\";\n\ntype BetaBadgeProps = {\n  pulse?: boolean;\n};\n\nconst BetaBadge = ({ pulse }: BetaBadgeProps) => {\n  return (\n    <span\n      className={`ml-2 ${\n        pulse && \"animate-pulse\"\n      } rounded-full bg-violet-500 px-3 text-xs text-violet-100`}\n    >\n      BETA\n    </span>\n  );\n};\n\nexport default BetaBadge;\n"
  },
  {
    "path": "components/ui/Button.tsx",
    "content": "import React, { ButtonHTMLAttributes } from \"react\";\n\ninterface ButtonProps {\n  variant?: \"red\" | \"green\" | \"slate\" | \"blue\";\n  size?: \"sm\";\n  children: React.ReactNode;\n  className?: string;\n}\n\nconst Button = ({\n  variant,\n  size,\n  children,\n  className,\n  ...rest\n}: ButtonProps & ButtonHTMLAttributes<HTMLButtonElement>) => {\n  const getButtonClass = () => {\n    if (size === \"sm\") {\n      switch (variant) {\n        case \"red\":\n          return \"rounded-full py-1 px-3 text-sm font-medium text-red-500 ring-2 ring-red-500 transition-colors duration-300 hover:bg-red-100 bg-red-50 dark:bg-red-900/20 dark:text-red-400 dark:ring-red-400 dark:hover:bg-red-800/50\";\n        case \"green\":\n          return \"rounded-full py-1 px-3 text-sm font-medium text-green-500 ring-2 ring-green-500 transition-colors duration-300 hover:bg-green-100 bg-green-50 dark:bg-green-900/20 dark:text-green-400 dark:ring-green-400 dark:hover:bg-green-800/50\";\n        case \"blue\":\n          return \"rounded-full py-1 px-3 text-sm font-medium text-blue-500 ring-2 ring-blue-500 transition-colors duration-300 hover:bg-blue-100 bg-blue-50 dark:bg-blue-900/20 dark:text-blue-400 dark:ring-blue-400 dark:hover:bg-blue-800/50\";\n        case \"slate\":\n          return \"rounded-full py-1 px-3 text-sm font-medium text-slate-500 ring-2 ring-slate-500 transition-colors duration-300 hover:bg-slate-100 bg-slate-50 dark:bg-slate-900/20 dark:text-slate-400 dark:ring-slate-400 dark:hover:bg-slate-800/50\";\n        default:\n          return \"rounded-full py-1 px-3 text-sm font-medium text-slate-900 ring-2 ring-slate-900 transition-colors duration-300 hover:bg-slate-300\";\n      }\n    }\n\n    switch (variant) {\n      case \"red\":\n        return \"inline-flex items-center justify-center px-5 py-2.5 bg-white border rounded-full border-red-900 text-sm font-medium text-red-900 hover:bg-red-200 transition-all duration-300\";\n      default:\n        return \"inline-flex items-center justify-center px-5 py-2.5 bg-slate-50 border rounded-full border-2 border-slate-900 text-sm font-medium text-slate-900 hover:bg-slate-200 transition-all duration-300 dark:bg-slate-900 dark:border-slate-50 dark:text-slate-100 dark:hover:bg-slate-800\";\n    }\n  };\n\n  return (\n    <button\n      type=\"button\"\n      className={getButtonClass() + \" \" + className}\n      {...rest}\n    >\n      {children}\n    </button>\n  );\n};\n\nexport default Button;\n"
  },
  {
    "path": "components/ui/IconButton.tsx",
    "content": "import React from \"react\";\n\ntype IconButtonProps = {\n  children: React.ReactNode;\n  extraClasses?: HTMLButtonElement[\"className\"];\n};\n\nconst IconButton = ({\n  children,\n  extraClasses,\n  ...rest\n}: IconButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>) => {\n  return (\n    <button\n      className={\"rounded-full bg-white p-3 dark:bg-slate-900 \" + extraClasses}\n      {...rest}\n    >\n      {children}\n    </button>\n  );\n};\n\nexport default IconButton;\n"
  },
  {
    "path": "components/ui/Input.tsx",
    "content": "import { InputHTMLAttributes } from \"react\";\nimport React from \"react\";\n\nconst Input = ({\n  label,\n  id,\n  small,\n  ...rest\n}: InputHTMLAttributes<HTMLInputElement> & {\n  id: string;\n  label?: string;\n  small?: boolean;\n}) => {\n  return (\n    <>\n      {label && (\n        <label className=\"mb-2 block text-sm font-medium dark:text-white\">\n          {label}\n        </label>\n      )}\n      <input\n        id={id}\n        className={`w-full rounded-xl bg-slate-200 p-2 outline-none dark:bg-slate-900 dark:text-slate-200 ${\n          small && \"text-sm\"\n        }`}\n        {...rest}\n      />\n    </>\n  );\n};\n\nexport default Input;\n"
  },
  {
    "path": "components/ui/Loading.tsx",
    "content": "import darkLoadingAnimation from \"@/animations/pencil-write-dark.json\";\nimport loadingAnimation from \"@/animations/pencil-write.json\";\nimport { FEATURE_FLAGS } from \"@/constants/feature-flags\";\nimport BetaBadge from \"./BetaBadge\";\nimport Lottie from \"lottie-react\";\nimport React from \"react\";\n\nconst Loading = () => {\n  return (\n    <div className=\"fixed left-0 top-0 z-[99] flex h-screen w-screen flex-col overflow-y-auto bg-slate-50 text-slate-900 dark:bg-slate-900 dark:text-slate-50\">\n      <div className=\"flex h-screen w-full flex-col items-center justify-center\">\n        <Lottie\n          className=\"max-h-96 dark:hidden\"\n          animationData={loadingAnimation}\n          loop={true}\n        />\n        <Lottie\n          className=\"hidden max-h-96 dark:block\"\n          animationData={darkLoadingAnimation}\n          loop={true}\n        />\n        <p className=\"flex items-center text-2xl font-semibold text-slate-900 dark:text-slate-100 sm:text-4xl\">\n          writedown {FEATURE_FLAGS.beta && <BetaBadge />}\n        </p>\n      </div>\n    </div>\n  );\n};\n\nexport default Loading;\n"
  },
  {
    "path": "components/ui/Modal.tsx",
    "content": "import { Dialog, Transition } from \"@headlessui/react\";\nimport Button from \"./Button\";\nimport React from \"react\";\n\ninterface ModalProps {\n  title?: string;\n  description?: string;\n  saveHandler?: () => void;\n  saveText?: string;\n  closeText?: string;\n  isOpen: boolean;\n  setIsOpen: (isOpen: boolean) => void;\n  undismissable?: boolean;\n  children?: React.ReactNode;\n}\n\nconst Modal = ({\n  title,\n  description,\n  saveText,\n  saveHandler,\n  closeText,\n  isOpen,\n  setIsOpen,\n  undismissable,\n  children,\n}: ModalProps) => {\n  return (\n    <Transition appear show={isOpen} as={React.Fragment}>\n      <Dialog\n        as=\"div\"\n        className=\"relative z-50\"\n        onClose={() => {\n          if (undismissable) {\n            return;\n          }\n          setIsOpen(false);\n        }}\n      >\n        <Transition.Child\n          as={React.Fragment}\n          enter=\"ease-out duration-300\"\n          enterFrom=\"opacity-0\"\n          enterTo=\"opacity-100\"\n          leave=\"ease-in duration-200\"\n          leaveFrom=\"opacity-100\"\n          leaveTo=\"opacity-0\"\n        >\n          <div className=\"fixed inset-0 bg-black bg-opacity-25 backdrop-blur-sm\" />\n        </Transition.Child>\n\n        <div className=\"fixed inset-0 overflow-y-auto\">\n          <div className=\"flex min-h-full items-center justify-center p-4 text-center\">\n            <Transition.Child\n              as={React.Fragment}\n              enter=\"ease-out duration-300\"\n              enterFrom=\"opacity-0 scale-95\"\n              enterTo=\"opacity-100 scale-100\"\n              leave=\"ease-in duration-200\"\n              leaveFrom=\"opacity-100 scale-100\"\n              leaveTo=\"opacity-0 scale-95\"\n            >\n              <Dialog.Panel className=\"w-full max-w-md transform overflow-hidden rounded-2xl bg-slate-50 p-6 text-left align-middle shadow-xl transition-all dark:bg-slate-800\">\n                {title && (\n                  <Dialog.Title\n                    as=\"h3\"\n                    className=\"text-xl font-semibold leading-6 text-slate-900 dark:text-slate-100\"\n                  >\n                    {title}\n                  </Dialog.Title>\n                )}\n\n                <Dialog.Description className=\"mb-4 mt-2\">\n                  <p className=\"text-sm text-slate-500 dark:text-slate-400\">\n                    {description}\n                  </p>\n                </Dialog.Description>\n\n                {children}\n\n                <div className=\"mt-4 flex justify-end gap-2\">\n                  {saveText && (\n                    <Button onClick={saveHandler}>{saveText}</Button>\n                  )}\n\n                  {closeText && (\n                    <Button\n                      variant=\"red\"\n                      onClick={() => {\n                        setIsOpen(false);\n                      }}\n                    >\n                      {closeText}\n                    </Button>\n                  )}\n                </div>\n              </Dialog.Panel>\n            </Transition.Child>\n          </div>\n        </div>\n      </Dialog>\n    </Transition>\n  );\n};\n\nexport default Modal;\n"
  },
  {
    "path": "components/ui/Popover.tsx",
    "content": "import { Popover as HeadlessPopover, Transition } from \"@headlessui/react\";\nimport { Fragment } from \"react\";\n\ntype PopoverProps = {\n  button?: React.ReactNode;\n  buttonStyle?: string;\n  openStyle?: string;\n  reverse?: boolean;\n  children: React.ReactNode;\n};\n\nexport default function Popover({\n  button,\n  buttonStyle,\n  openStyle,\n  reverse = false,\n  children,\n  ...rest\n}: PopoverProps) {\n  return (\n    <HeadlessPopover {...rest} className=\"relative\">\n      {({ open }) => (\n        <>\n          <HeadlessPopover.Button\n            className={`block\n                ${open ? \"\" : openStyle} ${buttonStyle}`}\n          >\n            {button}\n          </HeadlessPopover.Button>\n\n          <Transition\n            as={Fragment}\n            enter=\"transition ease-out duration-200\"\n            enterFrom=\"opacity-0 translate-y-1\"\n            enterTo=\"opacity-100 translate-y-0\"\n            leave=\"transition ease-in duration-150\"\n            leaveFrom=\"opacity-100 translate-y-0\"\n            leaveTo=\"opacity-0 translate-y-1\"\n          >\n            <HeadlessPopover.Panel\n              className={`absolute ${\n                reverse ? \"right-0\" : \"left-0\"\n              } z-10 mt-2 w-52`}\n            >\n              <div className=\"ring-opacity-15 overflow-hidden rounded-lg shadow-lg shadow-black/10 ring-1 ring-slate-200 dark:shadow-slate-900 dark:ring-slate-700\">\n                <div className=\"relative flex flex-col gap-1 bg-white p-2 dark:bg-slate-800 lg:grid-cols-2\">\n                  {children}\n                </div>\n              </div>\n            </HeadlessPopover.Panel>\n          </Transition>\n        </>\n      )}\n    </HeadlessPopover>\n  );\n}\n"
  },
  {
    "path": "components/ui/Toggle.tsx",
    "content": "import { Switch } from \"@headlessui/react\";\nimport { useState } from \"react\";\n\ntype ToggleProps = {\n  enabled: boolean;\n  onChange: (arg: boolean) => void;\n  screenReaderPrompt?: string;\n};\n\nexport default function Toggle({\n  enabled,\n  onChange,\n  screenReaderPrompt,\n}: ToggleProps) {\n  return (\n    <Switch\n      name=\"toggle\"\n      checked={enabled}\n      onChange={onChange}\n      className={`${!enabled ? \"bg-rose-500\" : \"bg-emerald-400\"}\n          relative inline-flex h-7 w-12 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-500 ease-in-out focus:outline-none focus-visible:ring-2  focus-visible:ring-white focus-visible:ring-opacity-75`}\n    >\n      <span className=\"sr-only\">{screenReaderPrompt}</span>\n      <span\n        aria-hidden=\"true\"\n        className={`${enabled ? \"translate-x-5\" : \"translate-x-0\"}\n            pointer-events-none inline-block h-6 w-6 transform rounded-full bg-white shadow-lg ring-0 transition duration-500 ease-in-out`}\n      />\n    </Switch>\n  );\n}\n"
  },
  {
    "path": "components/ui/WritedownEditor.tsx",
    "content": "import { selectedNoteAtom } from \"@/stores/postDataAtom\";\nimport { NoteDocument } from \"@/types/utils/firebaseOperations\";\nimport { EditorContent, Editor } from \"@tiptap/react\";\nimport { useAtomValue } from \"jotai\";\nimport { useEffect } from \"react\";\n\ninterface editorProps {\n  notes?: NoteDocument[] | undefined;\n  editor: Editor | null;\n}\n\nconst WritedownEditor = ({ notes, editor }: editorProps) => {\n  const selectedNote = useAtomValue(selectedNoteAtom);\n\n  useEffect(() => {\n    if (!editor) return;\n    // If there are no notes or no selected note, clear the editor\n    if (!notes || !selectedNote.id) {\n      editor.commands.clearContent();\n\n      return;\n    }\n    // Replace the editor content with the current note content\n    const currentNote = notes.find((note) => note.id === selectedNote.id);\n    if (!currentNote) return;\n    editor.commands.setContent(currentNote.content);\n  }, [selectedNote.id, notes]);\n\n  return <EditorContent selected editor={editor} />;\n};\n\nexport default WritedownEditor;\n"
  },
  {
    "path": "constants/channel-background-colors.ts",
    "content": "export const channelBackgroundColors = [\n  \"from-teal-400 to-blue-500\",\n  \"from-sky-500 to-indigo-600\",\n  \"from-violet-500 to-fuchsia-500\",\n  \"from-purple-500 to-pink-500\",\n  \"from-green-700 to-green-400\",\n  \"from-orange-400 to-yellow-200\",\n];\n"
  },
  {
    "path": "constants/feature-flags.ts",
    "content": "export const FEATURE_FLAGS = {\n  beta: process.env.NEXT_PUBLIC_FEATURE_FLAG_BETA === \"true\",\n};\n"
  },
  {
    "path": "constants/firebase-auth-error-codes.ts",
    "content": "export const authErrorCodes = {\n  \"auth/claims-too-large\":\n    \"The claims payload provided to setCustomUserClaims() exceeds the maximum allowed size of 1000 bytes.\",\n  \"auth/email-already-exists\":\n    \"The provided email is already in use by an existing user. Each user must have a unique email.\",\n  \"auth/id-token-expired\": \"The provided Firebase ID token is expired.\",\n  \"auth/id-token-revoked\": \"The Firebase ID token has been revoked.\",\n  \"auth/account-exists-with-different-credential\":\n    \"An account with this email address already exists, but it was registered using a different login method. Please log in using the appropriate method associated with this email address.\",\n  \"auth/insufficient-permission\":\n    \"The credential used to initialize the Admin SDK has insufficient permission to access the requested Authentication resource. Refer to Set up a Firebase project for documentation on how to generate a credential with appropriate permissions and use it to authenticate the Admin SDKs.\",\n  \"auth/internal-error\":\n    \"The Authentication server encountered an unexpected error while trying to process the request. The error message should contain the response from the Authentication server containing additional information. If the error persists, please report the problem to our Bug Report support channel.\",\n  \"auth/invalid-argument\":\n    \"An invalid argument was provided to an Authentication method. The error message should contain additional information.\",\n  \"auth/invalid-claims\":\n    \"The custom claim attributes provided to setCustomUserClaims() are invalid.\",\n  \"auth/invalid-continue-uri\": \"The continue URL must be a valid URL string.\",\n  \"auth/invalid-creation-time\":\n    \"The creation time must be a valid UTC date string.\",\n  \"auth/invalid-credential\":\n    \"The credential used to authenticate the Admin SDKs cannot be used to perform the desired action. Certain Authentication methods such as createCustomToken() and verifyIdToken() require the SDK to be initialized with a certificate credential as opposed to a refresh token or Application Default credential. See Initialize the SDK for documentation on how to authenticate the Admin SDKs with a certificate credential.\",\n  \"auth/invalid-disabled-field\":\n    \"The provided value for the disabled user property is invalid. It must be a boolean.\",\n  \"auth/invalid-display-name\":\n    \"The provided value for the displayName user property is invalid. It must be a non-empty string.\",\n  \"auth/invalid-dynamic-link-domain\":\n    \"The provided dynamic link domain is not configured or authorized for the current project.\",\n  \"auth/invalid-email\":\n    \"The provided value for the email user property is invalid. It must be a string email address.\",\n  \"auth/invalid-email-verified\":\n    \"The provided value for the emailVerified user property is invalid. It must be a boolean.\",\n  \"auth/invalid-hash-algorithm\":\n    \"The hash algorithm must match one of the strings in the list of supported algorithms.\",\n  \"auth/invalid-hash-block-size\": \"The hash block size must be a valid number.\",\n  \"auth/invalid-hash-derived-key-length\":\n    \"The hash derived key length must be a valid number.\",\n  \"auth/invalid-hash-key\": \"The hash key must a valid byte buffer.\",\n  \"auth/invalid-hash-memory-cost\":\n    \"The hash memory cost must be a valid number.\",\n  \"auth/invalid-hash-parallelization\":\n    \"The hash parallelization must be a valid number.\",\n  \"auth/invalid-hash-rounds\": \"The hash rounds must be a valid number.\",\n  \"auth/invalid-hash-salt-separator\":\n    \"The hashing algorithm salt separator field must be a valid byte buffer.\",\n  \"auth/invalid-id-token\":\n    \"The provided ID token is not a valid Firebase ID token.\",\n  \"auth/invalid-last-sign-in-time\":\n    \"The last sign-in time must be a valid UTC date string.\",\n  \"auth/invalid-page-token\":\n    \"The provided next page token in listUsers() is invalid. It must be a valid non-empty string.\",\n  \"auth/invalid-password\":\n    \"The provided value for the password user property is invalid.It must be a string with at least six characters.\",\n  \"auth/invalid-password-hash\":\n    \"The password hash must be a valid byte buffer.\",\n  \"auth/invalid-password-salt\": \"The password salt must be a valid byte buffer\",\n  \"auth/invalid-phone-number\":\n    \"The provided value for the phoneNumber is invalid. It must be a non-empty E.164 standard compliant identifier string.\",\n  \"auth/invalid-photo-url\":\n    \"The provided value for the photoURL user property is invalid. It must be a string URL.\",\n  \"auth/invalid-provider-data\":\n    \"The providerData must be a valid array of UserInfo objects.\",\n  \"auth/invalid-provider-id\":\n    \"The providerId must be a valid supported provider identifier string.\",\n  \"auth/invalid-oauth-responsetype\":\n    \"Only exactly one OAuth responseType should be set to true.\",\n  \"auth/invalid-session-cookie-duration\":\n    \"The session cookie duration must be a valid number in milliseconds between 5 minutes and 2 weeks.\",\n  \"auth/invalid-uid\":\n    \"The provided uid must be a non-empty string with at most 128 characters.\",\n  \"auth/invalid-user-import\": \"The user record to import is invalid.\",\n  \"auth/maximum-user-count-exceeded\":\n    \"The maximum allowed number of users to import has been exceeded.\",\n  \"auth/missing-android-pkg-name\":\n    \"An Android Package Name must be provided if the Android App is required to be installed.\",\n  \"auth/missing-continue-uri\":\n    \"A valid continue URL must be provided in the request.\",\n  \"auth/missing-hash-algorithm\":\n    \"Importing users with password hashes requires that the hashing algorithm and its parameters be provided.\",\n  \"auth/missing-ios-bundle-id\": \"The request is missing a Bundle ID.\",\n  \"auth/missing-uid\": \"A uid identifier is required for the current operation.\",\n  \"auth/missing-oauth-client-secret\":\n    \"The OAuth configuration client secret is required to enable OIDC code flow.\",\n  \"auth/operation-not-allowed\":\n    \"The provided sign-in provider is disabled for your Firebase project. Enable it from the Sign-in Method section of the Firebase console.\",\n  \"auth/phone-number-already-exists\":\n    \"The provided phoneNumber is already in use by an existing user. Each user must have a unique phoneNumber.\",\n  \"auth/project-not-found\":\n    \"No Firebase project was found for the credential used to initialize the Admin SDKs. Refer to Set up a Firebase project for documentation on how to generate a credential for your project and use it to authenticate the Admin SDKs.\",\n  \"auth/reserved-claims\":\n    \"One or more custom user claims provided to setCustomUserClaims() are reserved. For example, OIDC specific claims such as (sub, iat, iss, exp, aud, auth_time, etc) should not be used as keys for custom claims.\",\n  \"auth/session-cookie-expired\":\n    \"The provided Firebase session cookie is expired.\",\n  \"auth/session-cookie-revoked\":\n    \"The Firebase session cookie has been revoked.\",\n  \"auth/uid-already-exists\":\n    \"The provided uid is already in use by an existing user. Each user must have a unique uid.\",\n  \"auth/unauthorized-continue-uri\":\n    \"The domain of the continue URL is not whitelisted. Whitelist the domain in the Firebase Console.\",\n  \"auth/user-not-found\":\n    \"There is no existing user record corresponding to the provided identifier.\",\n};\n"
  },
  {
    "path": "declaration.d.ts",
    "content": "declare module \"preline\";\n"
  },
  {
    "path": "docs/colors.md",
    "content": "# Mapping Colors from Light to Dark\n\n50 - 900\n\n100 - 800\n\n200 - 700\n\n300 - 600\n\n400 - 500\n\n500 - 400\n\n600 - 300\n\n700 - 200\n\n800 - 100\n\n900 - 50\n\n950 -\n"
  },
  {
    "path": "docs/firebase.md",
    "content": "# Firebase Emulator Setup\n\n## Setup\n\n0. Don't use Windows and install Java 12+.\n\n1. Install the Firebase CLI\n\n```bash\ncurl -sL firebase.tools | bash\n```\n\n2. Login to Firebase\n\n```bash\nfirebase login\n```\n\nIt'll ask you:\n`? Allow Firebase to collect CLI and Emulator Suite usage and error reporting information?`\n\n**Just say, \"NO!\"**\n\n3. Initialize the Firebase project\n\n```bash\nfirebase init\n```\n\nSelect Firestore and Emulators. Press enter to select default options.\nThen select authentication and firestore with spacebar and press enter.\n\n4. Select the following options\n\n```bash\n? Which Firebase CLI features do you want to set up for this folder? Press Space to select features, then Enter to confirm your choices. Functions: Configure and deploy Cloud Functions\n? What language would you like to use to write Cloud Functions? JavaScript\n? Do you want to use ESLint to catch probable bugs and enforce style? No\n? Do you want to install dependencies with npm now? Yes\n```\n\n5. Install the Firebase Emulator\n\n```bash\nfirebase setup:emulators:firestore\n```\n\n6. Start the Firebase Emulator\n\n```bash\nnpm run firebase\n```\n"
  },
  {
    "path": "docs/tiptap.md",
    "content": "# TipTap Setup\n\n## Setup\n\n1. Create a TipTap account at [cloud.tiptap.dev](https://cloud.tiptap.dev/pro-extensions).\n2. Create a new app and go to Pro Extensions.\n3. Copy the token.\n4. Open `~/.zshrc` or `~/.bashrc` and add the following line at the end:\n\n```bash\nexport TIPTAP_PRO_TOKEN=\"YOUR_TOKEN\"\n```\n\n5. Run the following command:\n\n```bash\nsource ~/.zshrc\n# OR\nsource ~/.bashrc\n```\n\n6. You're all set! Now you can use TipTap in your app.\n"
  },
  {
    "path": "firebase.json",
    "content": "{\n  \"firestore\": {\n    \"rules\": \"firestore.rules\",\n    \"indexes\": \"firestore.indexes.json\"\n  },\n  \"emulators\": {\n    \"auth\": {\n      \"port\": 9099,\n      \"host\": \"127.0.0.1\"\n    },\n    \"firestore\": {\n      \"port\": 8080,\n      \"host\": \"127.0.0.1\"\n    },\n    \"ui\": {\n      \"enabled\": true\n    },\n    \"singleProjectMode\": true\n  }\n}\n"
  },
  {
    "path": "firestore.indexes.json",
    "content": "{\n  \"indexes\": [\n    {\n      \"collectionGroup\": \"messages\",\n      \"queryScope\": \"COLLECTION_GROUP\",\n      \"fields\": [\n        {\n          \"fieldPath\": \"channelId\",\n          \"order\": \"ASCENDING\"\n        },\n        {\n          \"fieldPath\": \"createdAt\",\n          \"order\": \"DESCENDING\"\n        }\n      ]\n    }\n  ],\n  \"fieldOverrides\": [\n    {\n      \"collectionGroup\": \"messages\",\n      \"fieldPath\": \"createdAt\",\n      \"ttl\": false,\n      \"indexes\": [\n        {\n          \"order\": \"ASCENDING\",\n          \"queryScope\": \"COLLECTION\"\n        },\n        {\n          \"order\": \"DESCENDING\",\n          \"queryScope\": \"COLLECTION\"\n        },\n        {\n          \"arrayConfig\": \"CONTAINS\",\n          \"queryScope\": \"COLLECTION\"\n        },\n        {\n          \"order\": \"DESCENDING\",\n          \"queryScope\": \"COLLECTION_GROUP\"\n        }\n      ]\n    }\n  ]\n}\n"
  },
  {
    "path": "firestore.rules",
    "content": "rules_version = '2';\nservice cloud.firestore {\n  match /databases/{database}/documents {\n\n    match /users/{userId} {\n      allow update: if request.auth.uid == userId;\n      allow create: if request.auth != null;\n      allow read;\n    }\n\n    match /users/{userId}/{document=**} {\n      allow read, write: if request.auth.uid == userId;\n    }\n\n    function isValidUsername(username) {\n      let isOwner = request.auth.uid == request.resource.data.uid;\n      let isValidLength = username.size() >= 3 && username.size() <= 15;\n      let isValidRegex = username.matches(\"^[a-z][a-z0-9]*([._-][a-z0-9]+)*$\");\n      let isValidUserDoc = exists(/databases/$(database)/documents/users/$(request.auth.uid));\n\n      return isOwner && isValidLength && isValidRegex && isValidUserDoc;\n    }\n\n    match /usernames/{username} {\n      allow read;\n      allow create: if isValidUsername(username);\n    }\n\n    match /users/{userId}/notes/{noteId} {\n      allow write: if request.auth.uid == userId;\n      allow read: if isPublicNote() || request.auth.uid == userId;\n    }\n\n    function isPublicNote() {\n      return resource.data.public == true;\n    }\n\n  }\n}"
  },
  {
    "path": "html2pdf.js.d.ts",
    "content": "declare module \"html2pdf.js\";\n"
  },
  {
    "path": "lib/firebase.ts",
    "content": "import { Firestore, getFirestore } from \"firebase/firestore\";\nimport { FirebaseApp, getApps, initializeApp } from \"firebase/app\";\nimport \"firebase/firestore\";\nimport { Auth, getAuth } from \"firebase/auth\";\n\nconst firebaseConfig = {\n  apiKey: \"AIzaSyBbfVs3Q1NlARdE5wXZb4DLXonfcwMu2CI\",\n  authDomain: \"writedown-4a984.firebaseapp.com\",\n  databaseURL: \"https://writedown-4a984-default-rtdb.firebaseio.com\",\n  projectId: \"writedown-4a984\",\n  storageBucket: \"writedown-4a984.appspot.com\",\n  messagingSenderId: \"991441150383\",\n  appId: \"1:991441150383:web:73ab73141aee5c3bafcf5a\",\n};\nlet firebaseApp: FirebaseApp;\nlet db: Firestore;\nlet auth: Auth;\nconst currentApps = getApps();\nif (currentApps.length <= 0) {\n  firebaseApp = initializeApp(firebaseConfig);\n  db = getFirestore(firebaseApp);\n  auth = getAuth(firebaseApp);\n} else {\n  firebaseApp = currentApps[0];\n  db = getFirestore(firebaseApp);\n  auth = getAuth(firebaseApp);\n}\n\nexport { db, auth, firebaseApp };\n"
  },
  {
    "path": "next.config.js",
    "content": "/** @type {import('next').NextConfig} */\nconst runtimeCaching = require(\"next-pwa/cache\");\nconst withPWA = require(\"next-pwa\")({\n  dest: \"public\",\n  runtimeCaching,\n  register: true,\n  disable: process.env.NODE_ENV === \"development\",\n});\n\nmodule.exports = withPWA({\n  swcMinify: true,\n});\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"private\": true,\n  \"scripts\": {\n    \"dev\": \"next dev\",\n    \"build\": \"next build\",\n    \"start\": \"next start\",\n    \"lint\": \"next lint\",\n    \"firebase\": \"firebase emulators:start\",\n    \"stop\": \"for port in 3000 3001 3002 4000 4001 4002 9150; do lsof -t -i:$port | xargs -r kill; done\",\n    \"prepare\": \"husky install\",\n    \"cypress\": \"cypress open\"\n  },\n  \"dependencies\": {\n    \"@tiptap-pro/extension-details\": \"^2.8.1\",\n    \"@tiptap-pro/extension-details-content\": \"^2.18.0-beta.6\",\n    \"@tiptap-pro/extension-details-summary\": \"^2.8.1\",\n    \"@tiptap-pro/extension-emoji\": \"^2.18.0-beta.6\",\n    \"@tiptap-pro/extension-mathematics\": \"^2.18.0-beta.6\",\n    \"@tiptap-pro/extension-unique-id\": \"^2.18.0-beta.6\",\n    \"@tiptap/extension-code-block-lowlight\": \"^2.11.7\",\n    \"@tiptap/extension-image\": \"^2.11.7\",\n    \"@tiptap/extension-link\": \"^2.3.1\",\n    \"@tiptap/extension-task-item\": \"^2.11.7\",\n    \"@tiptap/extension-task-list\": \"^2.11.7\",\n    \"@tiptap/react\": \"^2.11.7\",\n    \"@tiptap/starter-kit\": \"^2.11.7\",\n    \"@vercel/og\": \"^0.6.8\",\n    \"cheerio\": \"^1.0.0\",\n    \"firebase\": \"^11.6.0\",\n    \"html2pdf.js\": \"^0.10.3\",\n    \"jotai\": \"^2.12.2\",\n    \"katex\": \"^0.16.21\",\n    \"lottie-react\": \"^2.4.1\",\n    \"lowlight\": \"^3.3.0\",\n    \"next\": \"^14.2.26\",\n    \"next-pwa\": \"^5.6.0\",\n    \"next-themes\": \"^0.4.6\",\n    \"react\": \"^18.3.1\",\n    \"react-dom\": \"^18.3.1\",\n    \"react-firebase-hooks\": \"^5.1.1\",\n    \"react-icons\": \"^5.5.0\",\n    \"react-markdown\": \"^10.1.0\",\n    \"react-scroll-parallax\": \"^3.4.5\",\n    \"remark-gfm\": \"^4.0.1\",\n    \"remove-markdown\": \"^0.6.0\",\n    \"tiptap-markdown\": \"^0.8.10\"\n  },\n  \"devDependencies\": {\n    \"@tailwindcss/forms\": \"^0.5.7\",\n    \"@tailwindcss/typography\": \"^0.5.13\",\n    \"@types/node\": \"20.12.8\",\n    \"@types/react\": \"18.3.1\",\n    \"@types/react-dom\": \"18.3.0\",\n    \"@types/remove-markdown\": \"^0.3.4\",\n    \"autoprefixer\": \"^10.4.19\",\n    \"eslint\": \"8.57.0\",\n    \"eslint-config-next\": \"14.2.3\",\n    \"husky\": \"^9.0.11\",\n    \"postcss\": \"^8.4.38\",\n    \"prettier\": \"^3.2.5\",\n    \"prettier-plugin-tailwindcss\": \"^0.5.14\",\n    \"pretty-quick\": \"^4.0.0\",\n    \"tailwindcss\": \"^3.4.3\",\n    \"typescript\": \"5.4.5\"\n  },\n  \"volta\": {\n    \"node\": \"20.12.2\"\n  }\n}\n"
  },
  {
    "path": "pages/[username]/posts/[postId].tsx",
    "content": "import { useEffect, useState } from \"react\";\nimport { useRouter } from \"next/router\";\nimport Markdown from \"react-markdown\";\nimport { doc, getDoc } from \"firebase/firestore\";\nimport Link from \"next/link\";\nimport toast from \"react-hot-toast\";\nimport remarkGfm from \"remark-gfm\";\nimport { formatTimeStamp } from \"@/components/dashboard/TextArea/PostButtons\";\nimport { NoteDocument, UserDocument } from \"@/types/utils/firebaseOperations\";\nimport HeadTags from \"@/components/common/HeadTags\";\nimport useUser from \"@/components/hooks/useUser\";\nimport Footer from \"@/components/home/Footer\";\nimport Button from \"@/components/ui/Button\";\nimport { db } from \"@/lib/firebase\";\nimport Loading from \"@/components/ui/Loading\";\nimport Navbar from \"@/components/Navbar\";\n\ninterface Props {}\n\nexport const PostPage = ({}: Props) => {\n  const router = useRouter();\n\n  const [note, setNote] = useState<NoteDocument | null>(null);\n  const [name, setName] = useState<string>(\"\");\n  const [profilePicture, setProfilePicture] = useState<string>(\"\");\n  const [loading, setLoading] = useState(true);\n  const { username, postId } = router.query;\n\n  const fetchData = async () => {\n    let user: UserDocument | null = null;\n    let note: NoteDocument | null = null;\n\n    try {\n      const usernameDoc = doc(db, \"usernames\", username as string);\n      const usernameSnapshot = await getDoc(usernameDoc);\n      const usernameData = usernameSnapshot.data();\n      if (usernameData) {\n        const userDoc = doc(db, \"users\", usernameData.uid as string);\n        const userSnapshot = await getDoc(userDoc);\n        user = userSnapshot.data() as UserDocument;\n      } else {\n        const uid = username as string;\n        const userDoc = doc(db, \"users\", uid);\n        const userSnapshot = await getDoc(userDoc);\n        user = userSnapshot.data() as UserDocument;\n      }\n    } catch (error) {\n      toast.error(\"User not found\");\n      setLoading(false);\n      return;\n    }\n\n    if (!user) return;\n\n    try {\n      const noteDoc = doc(db, \"users\", user.uid, \"notes\", postId as string);\n      const noteSnapshot = await getDoc(noteDoc);\n      note = noteSnapshot.data() as NoteDocument;\n    } catch (error) {\n      toast.error(\"User not found\");\n      setLoading(false);\n      return;\n    }\n\n    if (!note || !user) {\n      toast.error(\"Post not found\");\n      setLoading(false);\n      return;\n    }\n\n    if (note && !note.public) {\n      toast.error(\"Post not found\");\n      setLoading(false);\n      return;\n    }\n\n    setNote(note);\n    setName(user.displayName);\n    setProfilePicture(user.photoURL);\n    setLoading(false);\n  };\n\n  useEffect(() => {\n    if (username && postId) {\n      fetchData();\n    }\n  }, [username, postId]);\n\n  const { user } = useUser();\n\n  if (loading) return <Loading />;\n\n  return (\n    <>\n      <HeadTags\n        title={`${note?.title} by ${name} - writedown`}\n        description={`Read this post by ${name} on writedown - A simple and beautiful notes app with cloud sync, markdown and offline support. Write, share, inspire.`}\n        ogImage={`https://dynamic-og-image-generator.vercel.app/api/generate?title=${note?.title}&author=${name}&avatar=${profilePicture}&websiteUrl=https://writedown.app&theme=nightOwl`}\n        // ogImage={`https://writedown.app/api/og?title=${\n        //   note.title\n        // }&content=${RemoveMarkdown(\n        //   note.content.slice(0, 200)\n        // )}&author=${name}&profilePicture=${profilePicture}`}\n        ogUrl={`https://writedown.app/${note?.userId}/posts/${note?.id}`}\n      />\n\n      <Navbar />\n\n      {!note && (\n        <main className=\"max-w-screen relative flex min-h-screen flex-row items-center justify-center bg-slate-100 text-slate-900 dark:bg-slate-800 dark:text-slate-50\">\n          <div className=\"flex h-full w-full flex-col items-center justify-center gap-2\">\n            <h1 className=\"text-2xl font-medium\">\n              Oops, couldn&apos;t find that post!\n            </h1>\n            <p className=\"max-w-96 text-center text-slate-500 dark:text-slate-400\">\n              The post you are looking for might have been removed or the link\n              is broken.\n            </p>\n          </div>\n        </main>\n      )}\n\n      {note && (\n        <main className=\"max-w-screen relative flex min-h-screen flex-row bg-slate-100 text-slate-900 dark:bg-slate-800 dark:text-slate-50\">\n          <div className=\"flex h-full w-full flex-col items-center justify-center\">\n            <div className=\"mt-52 flex flex-col items-center justify-center gap-20\">\n              <div className=\"flex flex-col items-center justify-center gap-4 px-2\">\n                <img\n                  src={profilePicture}\n                  alt=\"User Profile Picture\"\n                  className=\"w-24 rounded-full\"\n                />\n                <h1 className=\"max-w-4xl text-center text-5xl font-bold leading-tight\">\n                  {note?.title}\n                </h1>\n                <p className=\"text-xl dark:text-slate-200\">\n                  <span className=\"font-light\">By</span>{\" \"}\n                  <span className=\"font-medium\">{name}</span>\n                </p>\n                <p className=\"text-sm dark:text-slate-400\">\n                  Published {formatTimeStamp(note?.publishedAt)}\n                </p>\n\n                {user?.uid === note?.userId && (\n                  <Link href={`/dashboard?post=${note?.id}`}>\n                    <Button variant=\"slate\" size=\"sm\">\n                      Edit Post\n                    </Button>\n                  </Link>\n                )}\n              </div>\n\n              <div className=\"mb-40 flex items-center justify-center px-4\">\n                <Markdown\n                  remarkPlugins={[remarkGfm]}\n                  className=\"prose dark:prose-invert\"\n                >\n                  {note?.content}\n                </Markdown>\n              </div>\n            </div>\n          </div>\n\n          <Footer className=\"absolute bottom-0 w-full\" />\n        </main>\n      )}\n    </>\n  );\n};\n\nexport default PostPage;\n"
  },
  {
    "path": "pages/_app.tsx",
    "content": "import { ParallaxProvider } from \"react-scroll-parallax\";\nimport { SkeletonTheme } from \"react-loading-skeleton\";\nimport { ThemeProvider } from \"next-themes\";\nimport \"react-loading-skeleton/dist/skeleton.css\";\nimport { useEffect, useState } from \"react\";\nimport { Toaster } from \"react-hot-toast\";\nimport type { AppProps } from \"next/app\";\nimport \"katex/dist/katex.min.css\";\nimport { Provider } from \"jotai\";\nimport \"@/styles/globals.css\";\n\n// const env = process.env.NODE_ENV;\n// if (env === \"development\") {\n//   connectFirestoreEmulator(db, \"localhost\", 8080);\n//   connectAuthEmulator(auth, \"http://localhost:9099\");\n// }\n\nfunction MyApp({ Component, pageProps }: AppProps) {\n  const [theme, setTheme] = useState(\"light\");\n\n  useEffect(() => {\n    const currentTheme = localStorage.getItem(\"theme\");\n    if (currentTheme) {\n      setTheme(currentTheme);\n    } else {\n      setTheme(\"light\");\n    }\n  }, []);\n\n  return (\n    <Provider>\n      <ThemeProvider attribute=\"class\">\n        {/* EXTRA DIV IS BECAUSE OF TOAST */}\n        <Toaster position=\"top-center\" />\n        <SkeletonTheme\n          baseColor={theme === \"light\" ? \"#e2e8f0\" : \"#0f172a\"}\n          highlightColor={theme === \"light\" ? \"#f8fafc\" : \"#1e293b\"}\n          borderRadius={10}\n        >\n          <ParallaxProvider>\n            <Component {...pageProps} />\n          </ParallaxProvider>\n        </SkeletonTheme>\n      </ThemeProvider>\n    </Provider>\n  );\n}\n\nexport default MyApp;\n"
  },
  {
    "path": "pages/api/link-preview.ts",
    "content": "import { NextApiRequest, NextApiResponse } from \"next\";\nimport * as cheerio from \"cheerio\";\n\nexport default async function handler(\n  req: NextApiRequest,\n  res: NextApiResponse\n) {\n  try {\n    const { url } = req.query;\n    const response = await fetch(url as string);\n    const data = await response.text();\n    const $ = cheerio.load(data);\n\n    // Site name\n    const name = $('meta[property=\"og:site_name\"]').attr(\"content\");\n\n    // Extract title\n    const title =\n      $(\"head > title\").text() ||\n      $('meta[property=\"og:title\"]').attr(\"content\");\n\n    // Extract the description\n    const description =\n      $('meta[name=\"description\"]').attr(\"content\") ||\n      $('meta[property=\"og:description\"]').attr(\"content\");\n\n    // Extract the image\n    const image =\n      $('meta[property=\"og:image\"]').attr(\"content\") ||\n      $('meta[name=\"twitter:image\"]').attr(\"content\") ||\n      $('link[rel=\"image_src\"]').attr(\"href\");\n\n    res.status(200).json({ name, title, description, image });\n  } catch (error) {\n    res.status(500).json({\n      error: JSON.stringify(error),\n    });\n  }\n}\n"
  },
  {
    "path": "pages/api/og.tsx",
    "content": "import { NextRequest, NextResponse } from \"next/server\";\nimport { ImageResponse } from \"@vercel/og\";\n\nexport const config = {\n  runtime: \"edge\",\n};\n\nexport default function handler(request: NextRequest, res: NextResponse) {\n  try {\n    const { searchParams } = new URL(request.url);\n\n    const hasTitle = searchParams.has(\"title\");\n    const hasContent = searchParams.has(\"content\");\n    const hasAuthor = searchParams.has(\"author\");\n    const hasProfilePicture = searchParams.has(\"profilePicture\");\n    const title = hasTitle\n      ? searchParams.get(\"title\")?.slice(0, 100)\n      : \"writedown\";\n    const content = hasContent\n      ? searchParams.get(\"content\")?.slice(0, 200) + \"..\"\n      : \"A free markdown notes app that is simple and beautiful.\";\n    const author = hasAuthor\n      ? searchParams.get(\"author\")?.slice(0, 100)\n      : \"writedown\";\n    const profilePicture = hasProfilePicture\n      ? searchParams.get(\"profilePicture\")?.slice()\n      : \"https://writedown.app/og-image.png\";\n\n    return new ImageResponse(\n      (\n        <div tw=\"flex flex-col w-full h-full items-center justify-center bg-slate-100\">\n          <div tw=\"flex flex-col items-center justify-center mt-auto\">\n            <img\n              src={profilePicture}\n              tw=\"w-12 mx-auto mb-2 rounded-full\"\n              alt=\"Author profile picture\"\n            />\n            <div tw=\"flex flex-col font-semibold mb-5 text-slate-700 items-center w-11/12 justify-center text-6xl text-center\">\n              {title}\n              <p tw=\"text-slate-400 mx-auto text-center font-medium text-base mt-2\">\n                By {author}\n              </p>\n            </div>\n\n            <div tw=\"text-slate-600 mx-auto w-7/12 text-center text-lg\">\n              {content}\n            </div>\n          </div>\n\n          <div tw=\"font-semibold text-slate-500 text-lg mt-auto mb-2\">\n            writedown.app\n          </div>\n        </div>\n      ),\n      {\n        width: 1200,\n        height: 600,\n      }\n    );\n  } catch (e: any) {\n    console.log(`${e.message}`);\n    return new Response(`Failed to generate the image`, {\n      status: 500,\n    });\n  }\n}\n"
  },
  {
    "path": "pages/dashboard.tsx",
    "content": "import CheckUsername from \"@/components/dashboard/CheckUsername\";\nimport { useAuthState } from \"react-firebase-hooks/auth\";\nimport TextArea from \"@/components/dashboard/TextArea\";\nimport Sidebar from \"@/components/dashboard/Sidebar\";\nimport HeadTags from \"@/components/common/HeadTags\";\nimport React, { useEffect, useState } from \"react\";\nimport useUser from \"@/components/hooks/useUser\";\nimport { useRouter } from \"next/router\";\nimport { auth } from \"@/lib/firebase\";\n\nconst Dashboard = () => {\n  // NEXT ROUTER\n  const router = useRouter();\n\n  const { user, hasUsername } = useUser();\n\n  const [showUsernameModal, setShowUsernameModal] = useState(false);\n  const [showSidebar, setShowSidebar] = useState(true);\n\n  useEffect(() => {\n    (async () => {\n      const user = auth.currentUser;\n      if (!user) return;\n      try {\n        const userHasUsername = await hasUsername(user);\n        if (!userHasUsername) {\n          setShowUsernameModal(true);\n        }\n      } catch (error) {\n        console.log(\"Error checking username: \", error);\n      }\n    })();\n  }, [user]);\n\n  // AUTH STATE HOOK\n  useAuthState(auth, {\n    onUserChanged: async (user) => {\n      console.log(\"🚀 => user:\", user);\n\n      if (!user) {\n        router.push(\"/login\");\n        return;\n      }\n    },\n  });\n\n  return (\n    <>\n      <div className=\"relative flex h-screen w-screen flex-row bg-slate-200 text-gray-900 dark:bg-slate-800\">\n        <HeadTags\n          title=\"Dashboard - writedown\"\n          description=\"A simple and beautiful notes app with cloud sync, markdown and offline support. Write, share, inspire.\"\n          ogImage=\"https://writedown.app/og-image.png\"\n          ogUrl=\"https://writedown.app\"\n        />\n        <Sidebar showSidebar={showSidebar} setShowSidebar={setShowSidebar} />\n        <TextArea shiftRight={showSidebar} setShiftRight={setShowSidebar} />\n        <CheckUsername\n          show={showUsernameModal}\n          onSetShow={(state) => {\n            setShowUsernameModal(state);\n          }}\n        />\n      </div>\n    </>\n  );\n};\n\nexport default Dashboard;\n"
  },
  {
    "path": "pages/index.tsx",
    "content": "import HeroSection from \"@/components/home/HeroSection\";\nimport HeadTags from \"@/components/common/HeadTags\";\nimport Features from \"@/components/home/Features\";\nimport Navbar from \"@/components/home/Navbar\";\nimport Footer from \"@/components/home/Footer\";\nimport type { NextPage } from \"next\";\n\nconst Home: NextPage = () => {\n  return (\n    <div className=\"flex min-h-screen flex-col overflow-y-auto bg-slate-50 text-slate-900 dark:bg-slate-900 dark:text-slate-50\">\n      <HeadTags\n        title=\"writedown - Your public and private diary\"\n        description=\"A simple and beautiful notes app with cloud sync, markdown and offline support. Write, share, inspire.\"\n        ogImage=\"https://writedown.app/og-image.png\"\n        ogUrl=\"https://writedown.app\"\n      />\n      <Navbar />\n      <HeroSection />\n      <Features />\n      <Footer />\n    </div>\n  );\n};\n\nexport default Home;\n"
  },
  {
    "path": "pages/login.tsx",
    "content": "import InfoSidebar from \"@/components/login/InfoSidebar\";\nimport { useAuthState } from \"react-firebase-hooks/auth\";\nimport SignInArea from \"@/components/login/SignInArea\";\nimport HeadTags from \"@/components/common/HeadTags\";\nimport useUser from \"@/components/hooks/useUser\";\nimport Loading from \"@/components/ui/Loading\";\nimport { useRouter } from \"next/router\";\nimport React from \"react\";\nimport { auth } from \"@/lib/firebase\";\n\nconst LoginPage = () => {\n  // NEXT ROUTER\n  const router = useRouter();\n  const { createUser, checkUserExists } = useUser();\n\n  // AUTH STATE HOOK\n  const [authUser, authLoading, authError] = useAuthState(auth, {\n    onUserChanged: async (user) => {\n      if (!user) return;\n      const existingUser = await checkUserExists(user);\n      !existingUser && createUser(user);\n    },\n  });\n\n  if (authError) {\n    return (\n      <div>\n        <p>Error: {authError.message}</p>\n      </div>\n    );\n  }\n\n  if (authLoading || authUser) {\n    authUser && router.push(\"/dashboard\");\n    return <Loading />;\n  }\n\n  return (\n    <div className=\"flex min-h-screen flex-col overflow-y-auto bg-slate-200 text-slate-900 sm:bg-slate-50\">\n      <HeadTags\n        title=\"Login - writedown\"\n        description=\"A simple and beautiful notes app with cloud sync, markdown and offline support. Write, share, inspire.\"\n        ogImage=\"https://writedown.app/og-image.png\"\n        ogUrl=\"https://writedown.app\"\n      />\n      <div className=\"flex h-screen w-full flex-col-reverse items-center justify-center md:flex-row\">\n        <SignInArea />\n        <InfoSidebar />\n      </div>\n    </div>\n  );\n};\n\nexport default LoginPage;\n"
  },
  {
    "path": "pages/not-found.tsx",
    "content": "import React from \"react\";\n\ntype Props = {};\n\nconst NotFoundPapge = (props: Props) => {\n  return <div>NotFoundPapge</div>;\n};\n\nexport default NotFoundPapge;\n"
  },
  {
    "path": "postcss.config.js",
    "content": "module.exports = {\n  plugins: {\n    tailwindcss: {},\n    autoprefixer: {},\n  },\n};\n"
  },
  {
    "path": "public/manifest.json",
    "content": "{\n  \"theme_color\": \"#e2e8f0\",\n  \"background_color\": \"#e2e8f0\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/dashboard\",\n  \"description\": \"A Free and Open Source Markdown Notes App with Cloud Sync, Offline Support and a Beautiful Interface.\",\n  \"name\": \"writedown\",\n  \"short_name\": \"writedown\",\n  \"icons\": [\n    {\n      \"src\": \"/icons/icon-192x192.png\",\n      \"sizes\": \"192x192\",\n      \"type\": \"image/png\"\n    },\n    {\n      \"src\": \"/icons/icon-256x256.png\",\n      \"sizes\": \"256x256\",\n      \"type\": \"image/png\"\n    },\n    {\n      \"src\": \"/icons/icon-384x384.png\",\n      \"sizes\": \"384x384\",\n      \"type\": \"image/png\"\n    },\n    {\n      \"src\": \"/icons/icon-512x512.png\",\n      \"sizes\": \"512x512\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n"
  },
  {
    "path": "stores/postDataAtom.ts",
    "content": "import { atom } from \"jotai\";\n\ntype SelectedNote = {\n  id: string;\n  title: string;\n  isPublic: boolean;\n  content: string;\n  lastUpdated: number | null;\n};\n\nexport const selectedNoteAtom = atom<SelectedNote>({\n  id: \"\",\n  title: \"\",\n  isPublic: false,\n  content: \"\",\n  lastUpdated: null,\n});\n"
  },
  {
    "path": "stores/syncLoadingAtom.ts",
    "content": "import { atom } from \"jotai\";\n\nexport const syncLoadingAtom = atom(false);\n"
  },
  {
    "path": "stores/syncedAtom.ts",
    "content": "import { atom } from \"jotai\";\n\nexport const isSyncedAtom = atom(true);\n"
  },
  {
    "path": "styles/code-block.css",
    "content": "/**\n * Dracula Theme originally by Zeno Rocha [@zenorocha]\n * https://draculatheme.com/\n *\n * Ported for PrismJS by Albert Vallverdu [@byverdu]\n */\n\ncode[class*=\"language-\"],\npre[class*=\"language-\"] {\n  color: #f8f8f2;\n  background: none;\n  text-shadow: 0 1px rgba(0, 0, 0, 0.3);\n  font-family: Consolas, Monaco, \"Andale Mono\", \"Ubuntu Mono\", monospace;\n  text-align: left;\n  white-space: pre;\n  word-spacing: normal;\n  word-break: normal;\n  word-wrap: normal;\n  line-height: 1.5;\n  -moz-tab-size: 4;\n  -o-tab-size: 4;\n  tab-size: 4;\n  -webkit-hyphens: none;\n  -moz-hyphens: none;\n  -ms-hyphens: none;\n  hyphens: none;\n}\n\n/* Code blocks */\npre[class*=\"language-\"] {\n  padding: 1em;\n  margin: 0.5em 0;\n  overflow: auto;\n  border-radius: 0.3em;\n}\n\n:not(pre) > code[class*=\"language-\"],\npre[class*=\"language-\"] {\n  background: #282a36;\n}\n\n/* Inline code */\n:not(pre) > code[class*=\"language-\"] {\n  padding: 0.1em;\n  border-radius: 0.3em;\n  white-space: normal;\n}\n\n.token.comment,\n.token.prolog,\n.token.doctype,\n.token.cdata {\n  color: #6272a4;\n}\n\n.token.punctuation {\n  color: #f8f8f2;\n}\n\n.namespace {\n  opacity: 0.7;\n}\n\n.token.property,\n.token.tag,\n.token.constant,\n.token.symbol,\n.token.deleted {\n  color: #ff79c6;\n}\n\n.token.boolean,\n.token.number {\n  color: #bd93f9;\n}\n\n.token.selector,\n.token.attr-name,\n.token.string,\n.token.char,\n.token.builtin,\n.token.inserted {\n  color: #50fa7b;\n}\n\n.token.operator,\n.token.entity,\n.token.url,\n.language-css .token.string,\n.style .token.string,\n.token.variable {\n  color: #f8f8f2;\n}\n\n.token.atrule,\n.token.attr-value,\n.token.function,\n.token.class-name {\n  color: #f1fa8c;\n}\n\n.token.keyword {\n  color: #8be9fd;\n}\n\n.token.regex,\n.token.important {\n  color: #ffb86c;\n}\n\n.token.important,\n.token.bold {\n  font-weight: bold;\n}\n\n.token.italic {\n  font-style: italic;\n}\n\n.token.entity {\n  cursor: help;\n}\n"
  },
  {
    "path": "styles/globals.css",
    "content": "@import url(\"https://api.fonts.coollabs.io/css2?family=Poppins:wght@300;400;500;600;700&display=swap\");\n@import url(\"https://fonts.googleapis.com/css2?family=Pacifico&display=swap\");\n@import url(\"https://fonts.googleapis.com/css2?family=Leckerli One&display=swap\");\n\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\n* {\n  font-family: \"Poppins\", sans-serif;\n}\n\n.text-pacifico {\n  font-family: \"Leckerli One\", sans-serif;\n}\n\n.scrollbar::-webkit-scrollbar {\n  width: 12px;\n  height: 10px;\n}\n\n.scrollbar::-webkit-scrollbar-track {\n  border-radius: 100vh;\n  background: #f1f5f9;\n}\n\n.dark .scrollbar::-webkit-scrollbar-track {\n  border-radius: 100vh;\n  background: #0f172a;\n}\n\n.scrollbar::-webkit-scrollbar-thumb {\n  background: #a0abb8;\n  border-radius: 100vh;\n  border: 3px solid #f1f5f9;\n}\n\n.dark .scrollbar::-webkit-scrollbar-thumb {\n  background: #596579;\n  border-radius: 100vh;\n  border: 3px solid #334155;\n}\n\n.scrollbar::-webkit-scrollbar-thumb:hover {\n  background: #8993a0;\n  border: 3px solid #f1f5f9;\n}\n\n.firebase-emulator-warning {\n  display: none;\n}\n\n.font-outline-2 {\n  -webkit-text-stroke: 2px black;\n}\n.font-outline-4 {\n  -webkit-text-stroke: 4px black;\n}\n\nul[data-type=\"taskList\"] {\n  list-style: none;\n  padding: 0;\n}\n\nul[data-type=\"taskList\"] p {\n  margin: 0;\n}\n\nul[data-type=\"taskList\"] li {\n  display: flex;\n}\n\nul[data-type=\"taskList\"] li > label {\n  flex: 0 0 auto;\n  margin-right: 0.5rem;\n  margin-top: 0;\n  user-select: none;\n}\n\nul[data-type=\"taskList\"] li > div {\n  flex: 1 1 auto;\n  margin-bottom: 0;\n}\n\nlabel > input[type=\"checkbox\"] {\n  border-radius: 0.25rem;\n}\n\n/* .milkdown {\n  width: 100%;\n  height: 100%;\n}\n\n[data-milkdown-root=\"true\"] {\n  width: 100%;\n  height: 100%;\n}\n\n.ProseMirror {\n  @apply max-h-none max-w-none;\n}\n\n.milkdown .editor {\n  height: 100% !important;\n} */\n"
  },
  {
    "path": "tailwind.config.js",
    "content": "/** @type {import('tailwindcss').Config} */\nmodule.exports = {\n  content: [\n    \"node_modules/preline/dist/*.js\",\n    \"./pages/**/*.{js,ts,jsx,tsx}\",\n    \"./components/**/*.{js,ts,jsx,tsx}\",\n    \"./app/**/*.{js,ts,jsx,tsx}\",\n  ],\n  theme: {\n    extend: {\n      screens: {\n        xs: \"320px\",\n      },\n      typography: {\n        DEFAULT: {\n          css: {\n            \"code::before\": { content: \"\" },\n            \"code::after\": { content: \"\" },\n          },\n        },\n      },\n    },\n  },\n  plugins: [require(\"@tailwindcss/typography\"), require(\"@tailwindcss/forms\")],\n  darkMode: \"class\",\n};\n"
  },
  {
    "path": "todo.md",
    "content": "- [ ] Remove headless UI\n- [ ] Add ShadCN UI\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es5\",\n    \"lib\": [\"dom\", \"dom.iterable\", \"esnext\"],\n    \"allowJs\": true,\n    \"skipLibCheck\": true,\n    \"strict\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"noEmit\": true,\n    \"esModuleInterop\": true,\n    \"module\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"resolveJsonModule\": true,\n    \"isolatedModules\": true,\n    \"jsx\": \"preserve\",\n    \"incremental\": true,\n    \"baseUrl\": \"./\",\n    \"noImplicitThis\": false,\n    \"paths\": {\n      \"@/*\": [\"*\"]\n    }\n  },\n  \"include\": [\"next-env.d.ts\", \"**/*.ts\", \"**/*.tsx\"],\n  \"exclude\": [\"node_modules\", \"**/*.cy.tsx\"]\n}\n"
  },
  {
    "path": "types/components/firebase-hooks.d.ts",
    "content": "import { User } from \"firebase/auth\";\n\nexport interface IFirebaseAuth {\n  user?: User | null;\n  userLoading?: boolean;\n  userError?: Error;\n}\n"
  },
  {
    "path": "types/utils/firebaseOperations.d.ts",
    "content": "export type NoteDocument = {\n  id: string;\n  createdAt?: number;\n  updatedAt: number;\n  publishedAt?: number;\n  title: string;\n  content: string;\n  userId: string;\n  slug: string;\n  public: boolean;\n};\n\nexport type PublicNoteDocument = {\n  userId: string;\n};\n\nexport type UserDocument = {\n  displayName: string;\n  photoURL: string;\n  uid: string;\n  username?: string;\n};\n\nexport type UserPrivateDocument = {\n  createdAt: number;\n  email: string;\n};\n"
  },
  {
    "path": "utils/debounce.ts",
    "content": "export const debounce = (fn: any, time: number) => {\n  let timeout: any = null;\n  return (...args: any) => {\n    if (timeout) {\n      clearTimeout(timeout);\n    }\n    timeout = setTimeout(() => {\n      fn(...args);\n    }, time);\n  };\n};\n"
  },
  {
    "path": "utils/firestoreDataConverter.ts",
    "content": "import {\n  NoteDocument,\n  PublicNoteDocument,\n  UserDocument,\n} from \"@/types/utils/firebaseOperations\";\nimport { QueryDocumentSnapshot } from \"firebase/firestore\";\n\nexport const converter = <T>() => ({\n  toFirestore: (data: T) => data,\n  fromFirestore: (snap: QueryDocumentSnapshot) => snap.data() as T,\n});\n\nexport const userDocConverter = converter<UserDocument>();\nexport const notesConverter = converter<NoteDocument>();\nexport const publicNotesConverter = converter<PublicNoteDocument>();\n"
  },
  {
    "path": "utils/markdownStyles.ts",
    "content": "export const markdownStyles = {\n  github:\n    '@media (prefers-color-scheme: dark) {\\n  .markdown-body {\\n    color-scheme: dark;\\n    --color-prettylights-syntax-comment: #8b949e;\\n    --color-prettylights-syntax-constant: #79c0ff;\\n    --color-prettylights-syntax-entity: #d2a8ff;\\n    --color-prettylights-syntax-storage-modifier-import: #c9d1d9;\\n    --color-prettylights-syntax-entity-tag: #7ee787;\\n    --color-prettylights-syntax-keyword: #ff7b72;\\n    --color-prettylights-syntax-string: #a5d6ff;\\n    --color-prettylights-syntax-variable: #ffa657;\\n    --color-prettylights-syntax-brackethighlighter-unmatched: #f85149;\\n    --color-prettylights-syntax-invalid-illegal-text: #f0f6fc;\\n    --color-prettylights-syntax-invalid-illegal-bg: #8e1519;\\n    --color-prettylights-syntax-carriage-return-text: #f0f6fc;\\n    --color-prettylights-syntax-carriage-return-bg: #b62324;\\n    --color-prettylights-syntax-string-regexp: #7ee787;\\n    --color-prettylights-syntax-markup-list: #f2cc60;\\n    --color-prettylights-syntax-markup-heading: #1f6feb;\\n    --color-prettylights-syntax-markup-italic: #c9d1d9;\\n    --color-prettylights-syntax-markup-bold: #c9d1d9;\\n    --color-prettylights-syntax-markup-deleted-text: #ffdcd7;\\n    --color-prettylights-syntax-markup-deleted-bg: #67060c;\\n    --color-prettylights-syntax-markup-inserted-text: #aff5b4;\\n    --color-prettylights-syntax-markup-inserted-bg: #033a16;\\n    --color-prettylights-syntax-markup-changed-text: #ffdfb6;\\n    --color-prettylights-syntax-markup-changed-bg: #5a1e02;\\n    --color-prettylights-syntax-markup-ignored-text: #c9d1d9;\\n    --color-prettylights-syntax-markup-ignored-bg: #1158c7;\\n    --color-prettylights-syntax-meta-diff-range: #d2a8ff;\\n    --color-prettylights-syntax-brackethighlighter-angle: #8b949e;\\n    --color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;\\n    --color-prettylights-syntax-constant-other-reference-link: #a5d6ff;\\n    --color-fg-default: #c9d1d9;\\n    --color-fg-muted: #8b949e;\\n    --color-fg-subtle: #6e7681;\\n    --color-canvas-default: #0d1117;\\n    --color-canvas-subtle: #161b22;\\n    --color-border-default: #30363d;\\n    --color-border-muted: #21262d;\\n    --color-neutral-muted: rgba(110,118,129,0.4);\\n    --color-accent-fg: #58a6ff;\\n    --color-accent-emphasis: #1f6feb;\\n    --color-attention-subtle: rgba(187,128,9,0.15);\\n    --color-danger-fg: #f85149;\\n  }\\n}\\n\\n@media (prefers-color-scheme: light) {\\n  .markdown-body {\\n    color-scheme: light;\\n    --color-prettylights-syntax-comment: #6e7781;\\n    --color-prettylights-syntax-constant: #0550ae;\\n    --color-prettylights-syntax-entity: #8250df;\\n    --color-prettylights-syntax-storage-modifier-import: #24292f;\\n    --color-prettylights-syntax-entity-tag: #116329;\\n    --color-prettylights-syntax-keyword: #cf222e;\\n    --color-prettylights-syntax-string: #0a3069;\\n    --color-prettylights-syntax-variable: #953800;\\n    --color-prettylights-syntax-brackethighlighter-unmatched: #82071e;\\n    --color-prettylights-syntax-invalid-illegal-text: #f6f8fa;\\n    --color-prettylights-syntax-invalid-illegal-bg: #82071e;\\n    --color-prettylights-syntax-carriage-return-text: #f6f8fa;\\n    --color-prettylights-syntax-carriage-return-bg: #cf222e;\\n    --color-prettylights-syntax-string-regexp: #116329;\\n    --color-prettylights-syntax-markup-list: #3b2300;\\n    --color-prettylights-syntax-markup-heading: #0550ae;\\n    --color-prettylights-syntax-markup-italic: #24292f;\\n    --color-prettylights-syntax-markup-bold: #24292f;\\n    --color-prettylights-syntax-markup-deleted-text: #82071e;\\n    --color-prettylights-syntax-markup-deleted-bg: #ffebe9;\\n    --color-prettylights-syntax-markup-inserted-text: #116329;\\n    --color-prettylights-syntax-markup-inserted-bg: #dafbe1;\\n    --color-prettylights-syntax-markup-changed-text: #953800;\\n    --color-prettylights-syntax-markup-changed-bg: #ffd8b5;\\n    --color-prettylights-syntax-markup-ignored-text: #eaeef2;\\n    --color-prettylights-syntax-markup-ignored-bg: #0550ae;\\n    --color-prettylights-syntax-meta-diff-range: #8250df;\\n    --color-prettylights-syntax-brackethighlighter-angle: #57606a;\\n    --color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;\\n    --color-prettylights-syntax-constant-other-reference-link: #0a3069;\\n    --color-fg-default: #24292f;\\n    --color-fg-muted: #57606a;\\n    --color-fg-subtle: #6e7781;\\n    --color-canvas-default: #ffffff;\\n    --color-canvas-subtle: #f6f8fa;\\n    --color-border-default: #d0d7de;\\n    --color-border-muted: hsla(210,18%,87%,1);\\n    --color-neutral-muted: rgba(175,184,193,0.2);\\n    --color-accent-fg: #0969da;\\n    --color-accent-emphasis: #0969da;\\n    --color-attention-subtle: #fff8c5;\\n    --color-danger-fg: #cf222e;\\n  }\\n}\\n\\n.markdown-body {\\n  -ms-text-size-adjust: 100%;\\n  -webkit-text-size-adjust: 100%;\\n  margin: 0;\\n  color: var(--color-fg-default);\\n  background-color: var(--color-canvas-default);\\n  font-family: -apple-system,BlinkMacSystemFont,\"Segoe UI\",\"Noto Sans\",Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\";\\n  font-size: 16px;\\n  line-height: 1.5;\\n  word-wrap: break-word;\\n}\\n\\n.markdown-body .octicon {\\n  display: inline-block;\\n  fill: currentColor;\\n  vertical-align: text-bottom;\\n}\\n\\n.markdown-body h1:hover .anchor .octicon-link:before,\\n.markdown-body h2:hover .anchor .octicon-link:before,\\n.markdown-body h3:hover .anchor .octicon-link:before,\\n.markdown-body h4:hover .anchor .octicon-link:before,\\n.markdown-body h5:hover .anchor .octicon-link:before,\\n.markdown-body h6:hover .anchor .octicon-link:before {\\n  width: 16px;\\n  height: 16px;\\n  content: \\' \\';\\n  display: inline-block;\\n  background-color: currentColor;\\n  -webkit-mask-image: url(\"data:image/svg+xml,<svg xmlns=\\'http://www.w3.org/2000/svg\\' viewBox=\\'0 0 16 16\\' version=\\'1.1\\' aria-hidden=\\'true\\'><path fill-rule=\\'evenodd\\' d=\\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\\'></path></svg>\");\\n  mask-image: url(\"data:image/svg+xml,<svg xmlns=\\'http://www.w3.org/2000/svg\\' viewBox=\\'0 0 16 16\\' version=\\'1.1\\' aria-hidden=\\'true\\'><path fill-rule=\\'evenodd\\' d=\\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\\'></path></svg>\");\\n}\\n\\n.markdown-body details,\\n.markdown-body figcaption,\\n.markdown-body figure {\\n  display: block;\\n}\\n\\n.markdown-body summary {\\n  display: list-item;\\n}\\n\\n.markdown-body [hidden] {\\n  display: none !important;\\n}\\n\\n.markdown-body a {\\n  background-color: transparent;\\n  color: var(--color-accent-fg);\\n  text-decoration: none;\\n}\\n\\n.markdown-body abbr[title] {\\n  border-bottom: none;\\n  text-decoration: underline dotted;\\n}\\n\\n.markdown-body b,\\n.markdown-body strong {\\n  font-weight: var(--base-text-weight-semibold, 600);\\n}\\n\\n.markdown-body dfn {\\n  font-style: italic;\\n}\\n\\n.markdown-body h1 {\\n  margin: .67em 0;\\n  font-weight: var(--base-text-weight-semibold, 600);\\n  padding-bottom: .3em;\\n  font-size: 2em;\\n  border-bottom: 1px solid var(--color-border-muted);\\n}\\n\\n.markdown-body mark {\\n  background-color: var(--color-attention-subtle);\\n  color: var(--color-fg-default);\\n}\\n\\n.markdown-body small {\\n  font-size: 90%;\\n}\\n\\n.markdown-body sub,\\n.markdown-body sup {\\n  font-size: 75%;\\n  line-height: 0;\\n  position: relative;\\n  vertical-align: baseline;\\n}\\n\\n.markdown-body sub {\\n  bottom: -0.25em;\\n}\\n\\n.markdown-body sup {\\n  top: -0.5em;\\n}\\n\\n.markdown-body img {\\n  border-style: none;\\n  max-width: 100%;\\n  box-sizing: content-box;\\n  background-color: var(--color-canvas-default);\\n}\\n\\n.markdown-body code,\\n.markdown-body kbd,\\n.markdown-body pre,\\n.markdown-body samp {\\n  font-family: monospace;\\n  font-size: 1em;\\n}\\n\\n.markdown-body figure {\\n  margin: 1em 40px;\\n}\\n\\n.markdown-body hr {\\n  box-sizing: content-box;\\n  overflow: hidden;\\n  background: transparent;\\n  border-bottom: 1px solid var(--color-border-muted);\\n  height: .25em;\\n  padding: 0;\\n  margin: 24px 0;\\n  background-color: var(--color-border-default);\\n  border: 0;\\n}\\n\\n.markdown-body input {\\n  font: inherit;\\n  margin: 0;\\n  overflow: visible;\\n  font-family: inherit;\\n  font-size: inherit;\\n  line-height: inherit;\\n}\\n\\n.markdown-body [type=button],\\n.markdown-body [type=reset],\\n.markdown-body [type=submit] {\\n  -webkit-appearance: button;\\n}\\n\\n.markdown-body [type=checkbox],\\n.markdown-body [type=radio] {\\n  box-sizing: border-box;\\n  padding: 0;\\n}\\n\\n.markdown-body [type=number]::-webkit-inner-spin-button,\\n.markdown-body [type=number]::-webkit-outer-spin-button {\\n  height: auto;\\n}\\n\\n.markdown-body [type=search]::-webkit-search-cancel-button,\\n.markdown-body [type=search]::-webkit-search-decoration {\\n  -webkit-appearance: none;\\n}\\n\\n.markdown-body ::-webkit-input-placeholder {\\n  color: inherit;\\n  opacity: .54;\\n}\\n\\n.markdown-body ::-webkit-file-upload-button {\\n  -webkit-appearance: button;\\n  font: inherit;\\n}\\n\\n.markdown-body a:hover {\\n  text-decoration: underline;\\n}\\n\\n.markdown-body ::placeholder {\\n  color: var(--color-fg-subtle);\\n  opacity: 1;\\n}\\n\\n.markdown-body hr::before {\\n  display: table;\\n  content: \"\";\\n}\\n\\n.markdown-body hr::after {\\n  display: table;\\n  clear: both;\\n  content: \"\";\\n}\\n\\n.markdown-body table {\\n  border-spacing: 0;\\n  border-collapse: collapse;\\n  display: block;\\n  width: max-content;\\n  max-width: 100%;\\n  overflow: auto;\\n}\\n\\n.markdown-body td,\\n.markdown-body th {\\n  padding: 0;\\n}\\n\\n.markdown-body details summary {\\n  cursor: pointer;\\n}\\n\\n.markdown-body details:not([open])>*:not(summary) {\\n  display: none !important;\\n}\\n\\n.markdown-body a:focus,\\n.markdown-body [role=button]:focus,\\n.markdown-body input[type=radio]:focus,\\n.markdown-body input[type=checkbox]:focus {\\n  outline: 2px solid var(--color-accent-fg);\\n  outline-offset: -2px;\\n  box-shadow: none;\\n}\\n\\n.markdown-body a:focus:not(:focus-visible),\\n.markdown-body [role=button]:focus:not(:focus-visible),\\n.markdown-body input[type=radio]:focus:not(:focus-visible),\\n.markdown-body input[type=checkbox]:focus:not(:focus-visible) {\\n  outline: solid 1px transparent;\\n}\\n\\n.markdown-body a:focus-visible,\\n.markdown-body [role=button]:focus-visible,\\n.markdown-body input[type=radio]:focus-visible,\\n.markdown-body input[type=checkbox]:focus-visible {\\n  outline: 2px solid var(--color-accent-fg);\\n  outline-offset: -2px;\\n  box-shadow: none;\\n}\\n\\n.markdown-body a:not([class]):focus,\\n.markdown-body a:not([class]):focus-visible,\\n.markdown-body input[type=radio]:focus,\\n.markdown-body input[type=radio]:focus-visible,\\n.markdown-body input[type=checkbox]:focus,\\n.markdown-body input[type=checkbox]:focus-visible {\\n  outline-offset: 0;\\n}\\n\\n.markdown-body kbd {\\n  display: inline-block;\\n  padding: 3px 5px;\\n  font: 11px ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;\\n  line-height: 10px;\\n  color: var(--color-fg-default);\\n  vertical-align: middle;\\n  background-color: var(--color-canvas-subtle);\\n  border: solid 1px var(--color-neutral-muted);\\n  border-bottom-color: var(--color-neutral-muted);\\n  border-radius: 6px;\\n  box-shadow: inset 0 -1px 0 var(--color-neutral-muted);\\n}\\n\\n.markdown-body h1,\\n.markdown-body h2,\\n.markdown-body h3,\\n.markdown-body h4,\\n.markdown-body h5,\\n.markdown-body h6 {\\n  margin-top: 24px;\\n  margin-bottom: 16px;\\n  font-weight: var(--base-text-weight-semibold, 600);\\n  line-height: 1.25;\\n}\\n\\n.markdown-body h2 {\\n  font-weight: var(--base-text-weight-semibold, 600);\\n  padding-bottom: .3em;\\n  font-size: 1.5em;\\n  border-bottom: 1px solid var(--color-border-muted);\\n}\\n\\n.markdown-body h3 {\\n  font-weight: var(--base-text-weight-semibold, 600);\\n  font-size: 1.25em;\\n}\\n\\n.markdown-body h4 {\\n  font-weight: var(--base-text-weight-semibold, 600);\\n  font-size: 1em;\\n}\\n\\n.markdown-body h5 {\\n  font-weight: var(--base-text-weight-semibold, 600);\\n  font-size: .875em;\\n}\\n\\n.markdown-body h6 {\\n  font-weight: var(--base-text-weight-semibold, 600);\\n  font-size: .85em;\\n  color: var(--color-fg-muted);\\n}\\n\\n.markdown-body p {\\n  margin-top: 0;\\n  margin-bottom: 10px;\\n}\\n\\n.markdown-body blockquote {\\n  margin: 0;\\n  padding: 0 1em;\\n  color: var(--color-fg-muted);\\n  border-left: .25em solid var(--color-border-default);\\n}\\n\\n.markdown-body ul,\\n.markdown-body ol {\\n  margin-top: 0;\\n  margin-bottom: 0;\\n  padding-left: 2em;\\n}\\n\\n.markdown-body ol ol,\\n.markdown-body ul ol {\\n  list-style-type: lower-roman;\\n}\\n\\n.markdown-body ul ul ol,\\n.markdown-body ul ol ol,\\n.markdown-body ol ul ol,\\n.markdown-body ol ol ol {\\n  list-style-type: lower-alpha;\\n}\\n\\n.markdown-body dd {\\n  margin-left: 0;\\n}\\n\\n.markdown-body tt,\\n.markdown-body code,\\n.markdown-body samp {\\n  font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;\\n  font-size: 12px;\\n}\\n\\n.markdown-body pre {\\n  margin-top: 0;\\n  margin-bottom: 0;\\n  font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;\\n  font-size: 12px;\\n  word-wrap: normal;\\n}\\n\\n.markdown-body .octicon {\\n  display: inline-block;\\n  overflow: visible !important;\\n  vertical-align: text-bottom;\\n  fill: currentColor;\\n}\\n\\n.markdown-body input::-webkit-outer-spin-button,\\n.markdown-body input::-webkit-inner-spin-button {\\n  margin: 0;\\n  -webkit-appearance: none;\\n  appearance: none;\\n}\\n\\n.markdown-body::before {\\n  display: table;\\n  content: \"\";\\n}\\n\\n.markdown-body::after {\\n  display: table;\\n  clear: both;\\n  content: \"\";\\n}\\n\\n.markdown-body>*:first-child {\\n  margin-top: 0 !important;\\n}\\n\\n.markdown-body>*:last-child {\\n  margin-bottom: 0 !important;\\n}\\n\\n.markdown-body a:not([href]) {\\n  color: inherit;\\n  text-decoration: none;\\n}\\n\\n.markdown-body .absent {\\n  color: var(--color-danger-fg);\\n}\\n\\n.markdown-body .anchor {\\n  float: left;\\n  padding-right: 4px;\\n  margin-left: -20px;\\n  line-height: 1;\\n}\\n\\n.markdown-body .anchor:focus {\\n  outline: none;\\n}\\n\\n.markdown-body p,\\n.markdown-body blockquote,\\n.markdown-body ul,\\n.markdown-body ol,\\n.markdown-body dl,\\n.markdown-body table,\\n.markdown-body pre,\\n.markdown-body details {\\n  margin-top: 0;\\n  margin-bottom: 16px;\\n}\\n\\n.markdown-body blockquote>:first-child {\\n  margin-top: 0;\\n}\\n\\n.markdown-body blockquote>:last-child {\\n  margin-bottom: 0;\\n}\\n\\n.markdown-body h1 .octicon-link,\\n.markdown-body h2 .octicon-link,\\n.markdown-body h3 .octicon-link,\\n.markdown-body h4 .octicon-link,\\n.markdown-body h5 .octicon-link,\\n.markdown-body h6 .octicon-link {\\n  color: var(--color-fg-default);\\n  vertical-align: middle;\\n  visibility: hidden;\\n}\\n\\n.markdown-body h1:hover .anchor,\\n.markdown-body h2:hover .anchor,\\n.markdown-body h3:hover .anchor,\\n.markdown-body h4:hover .anchor,\\n.markdown-body h5:hover .anchor,\\n.markdown-body h6:hover .anchor {\\n  text-decoration: none;\\n}\\n\\n.markdown-body h1:hover .anchor .octicon-link,\\n.markdown-body h2:hover .anchor .octicon-link,\\n.markdown-body h3:hover .anchor .octicon-link,\\n.markdown-body h4:hover .anchor .octicon-link,\\n.markdown-body h5:hover .anchor .octicon-link,\\n.markdown-body h6:hover .anchor .octicon-link {\\n  visibility: visible;\\n}\\n\\n.markdown-body h1 tt,\\n.markdown-body h1 code,\\n.markdown-body h2 tt,\\n.markdown-body h2 code,\\n.markdown-body h3 tt,\\n.markdown-body h3 code,\\n.markdown-body h4 tt,\\n.markdown-body h4 code,\\n.markdown-body h5 tt,\\n.markdown-body h5 code,\\n.markdown-body h6 tt,\\n.markdown-body h6 code {\\n  padding: 0 .2em;\\n  font-size: inherit;\\n}\\n\\n.markdown-body summary h1,\\n.markdown-body summary h2,\\n.markdown-body summary h3,\\n.markdown-body summary h4,\\n.markdown-body summary h5,\\n.markdown-body summary h6 {\\n  display: inline-block;\\n}\\n\\n.markdown-body summary h1 .anchor,\\n.markdown-body summary h2 .anchor,\\n.markdown-body summary h3 .anchor,\\n.markdown-body summary h4 .anchor,\\n.markdown-body summary h5 .anchor,\\n.markdown-body summary h6 .anchor {\\n  margin-left: -40px;\\n}\\n\\n.markdown-body summary h1,\\n.markdown-body summary h2 {\\n  padding-bottom: 0;\\n  border-bottom: 0;\\n}\\n\\n.markdown-body ul.no-list,\\n.markdown-body ol.no-list {\\n  padding: 0;\\n  list-style-type: none;\\n}\\n\\n.markdown-body ol[type=a] {\\n  list-style-type: lower-alpha;\\n}\\n\\n.markdown-body ol[type=A] {\\n  list-style-type: upper-alpha;\\n}\\n\\n.markdown-body ol[type=i] {\\n  list-style-type: lower-roman;\\n}\\n\\n.markdown-body ol[type=I] {\\n  list-style-type: upper-roman;\\n}\\n\\n.markdown-body ol[type=\"1\"] {\\n  list-style-type: decimal;\\n}\\n\\n.markdown-body div>ol:not([type]) {\\n  list-style-type: decimal;\\n}\\n\\n.markdown-body ul ul,\\n.markdown-body ul ol,\\n.markdown-body ol ol,\\n.markdown-body ol ul {\\n  margin-top: 0;\\n  margin-bottom: 0;\\n}\\n\\n.markdown-body li>p {\\n  margin-top: 16px;\\n}\\n\\n.markdown-body li+li {\\n  margin-top: .25em;\\n}\\n\\n.markdown-body dl {\\n  padding: 0;\\n}\\n\\n.markdown-body dl dt {\\n  padding: 0;\\n  margin-top: 16px;\\n  font-size: 1em;\\n  font-style: italic;\\n  font-weight: var(--base-text-weight-semibold, 600);\\n}\\n\\n.markdown-body dl dd {\\n  padding: 0 16px;\\n  margin-bottom: 16px;\\n}\\n\\n.markdown-body table th {\\n  font-weight: var(--base-text-weight-semibold, 600);\\n}\\n\\n.markdown-body table th,\\n.markdown-body table td {\\n  padding: 6px 13px;\\n  border: 1px solid var(--color-border-default);\\n}\\n\\n.markdown-body table tr {\\n  background-color: var(--color-canvas-default);\\n  border-top: 1px solid var(--color-border-muted);\\n}\\n\\n.markdown-body table tr:nth-child(2n) {\\n  background-color: var(--color-canvas-subtle);\\n}\\n\\n.markdown-body table img {\\n  background-color: transparent;\\n}\\n\\n.markdown-body img[align=right] {\\n  padding-left: 20px;\\n}\\n\\n.markdown-body img[align=left] {\\n  padding-right: 20px;\\n}\\n\\n.markdown-body .emoji {\\n  max-width: none;\\n  vertical-align: text-top;\\n  background-color: transparent;\\n}\\n\\n.markdown-body span.frame {\\n  display: block;\\n  overflow: hidden;\\n}\\n\\n.markdown-body span.frame>span {\\n  display: block;\\n  float: left;\\n  width: auto;\\n  padding: 7px;\\n  margin: 13px 0 0;\\n  overflow: hidden;\\n  border: 1px solid var(--color-border-default);\\n}\\n\\n.markdown-body span.frame span img {\\n  display: block;\\n  float: left;\\n}\\n\\n.markdown-body span.frame span span {\\n  display: block;\\n  padding: 5px 0 0;\\n  clear: both;\\n  color: var(--color-fg-default);\\n}\\n\\n.markdown-body span.align-center {\\n  display: block;\\n  overflow: hidden;\\n  clear: both;\\n}\\n\\n.markdown-body span.align-center>span {\\n  display: block;\\n  margin: 13px auto 0;\\n  overflow: hidden;\\n  text-align: center;\\n}\\n\\n.markdown-body span.align-center span img {\\n  margin: 0 auto;\\n  text-align: center;\\n}\\n\\n.markdown-body span.align-right {\\n  display: block;\\n  overflow: hidden;\\n  clear: both;\\n}\\n\\n.markdown-body span.align-right>span {\\n  display: block;\\n  margin: 13px 0 0;\\n  overflow: hidden;\\n  text-align: right;\\n}\\n\\n.markdown-body span.align-right span img {\\n  margin: 0;\\n  text-align: right;\\n}\\n\\n.markdown-body span.float-left {\\n  display: block;\\n  float: left;\\n  margin-right: 13px;\\n  overflow: hidden;\\n}\\n\\n.markdown-body span.float-left span {\\n  margin: 13px 0 0;\\n}\\n\\n.markdown-body span.float-right {\\n  display: block;\\n  float: right;\\n  margin-left: 13px;\\n  overflow: hidden;\\n}\\n\\n.markdown-body span.float-right>span {\\n  display: block;\\n  margin: 13px auto 0;\\n  overflow: hidden;\\n  text-align: right;\\n}\\n\\n.markdown-body code,\\n.markdown-body tt {\\n  padding: .2em .4em;\\n  margin: 0;\\n  font-size: 85%;\\n  white-space: break-spaces;\\n  background-color: var(--color-neutral-muted);\\n  border-radius: 6px;\\n}\\n\\n.markdown-body code br,\\n.markdown-body tt br {\\n  display: none;\\n}\\n\\n.markdown-body del code {\\n  text-decoration: inherit;\\n}\\n\\n.markdown-body samp {\\n  font-size: 85%;\\n}\\n\\n.markdown-body pre code {\\n  font-size: 100%;\\n}\\n\\n.markdown-body pre>code {\\n  padding: 0;\\n  margin: 0;\\n  word-break: normal;\\n  white-space: pre;\\n  background: transparent;\\n  border: 0;\\n}\\n\\n.markdown-body .highlight {\\n  margin-bottom: 16px;\\n}\\n\\n.markdown-body .highlight pre {\\n  margin-bottom: 0;\\n  word-break: normal;\\n}\\n\\n.markdown-body .highlight pre,\\n.markdown-body pre {\\n  padding: 16px;\\n  overflow: auto;\\n  font-size: 85%;\\n  line-height: 1.45;\\n  background-color: var(--color-canvas-subtle);\\n  border-radius: 6px;\\n}\\n\\n.markdown-body pre code,\\n.markdown-body pre tt {\\n  display: inline;\\n  max-width: auto;\\n  padding: 0;\\n  margin: 0;\\n  overflow: visible;\\n  line-height: inherit;\\n  word-wrap: normal;\\n  background-color: transparent;\\n  border: 0;\\n}\\n\\n.markdown-body .csv-data td,\\n.markdown-body .csv-data th {\\n  padding: 5px;\\n  overflow: hidden;\\n  font-size: 12px;\\n  line-height: 1;\\n  text-align: left;\\n  white-space: nowrap;\\n}\\n\\n.markdown-body .csv-data .blob-num {\\n  padding: 10px 8px 9px;\\n  text-align: right;\\n  background: var(--color-canvas-default);\\n  border: 0;\\n}\\n\\n.markdown-body .csv-data tr {\\n  border-top: 0;\\n}\\n\\n.markdown-body .csv-data th {\\n  font-weight: var(--base-text-weight-semibold, 600);\\n  background: var(--color-canvas-subtle);\\n  border-top: 0;\\n}\\n\\n.markdown-body [data-footnote-ref]::before {\\n  content: \"[\";\\n}\\n\\n.markdown-body [data-footnote-ref]::after {\\n  content: \"]\";\\n}\\n\\n.markdown-body .footnotes {\\n  font-size: 12px;\\n  color: var(--color-fg-muted);\\n  border-top: 1px solid var(--color-border-default);\\n}\\n\\n.markdown-body .footnotes ol {\\n  padding-left: 16px;\\n}\\n\\n.markdown-body .footnotes ol ul {\\n  display: inline-block;\\n  padding-left: 16px;\\n  margin-top: 16px;\\n}\\n\\n.markdown-body .footnotes li {\\n  position: relative;\\n}\\n\\n.markdown-body .footnotes li:target::before {\\n  position: absolute;\\n  top: -8px;\\n  right: -8px;\\n  bottom: -8px;\\n  left: -24px;\\n  pointer-events: none;\\n  content: \"\";\\n  border: 2px solid var(--color-accent-emphasis);\\n  border-radius: 6px;\\n}\\n\\n.markdown-body .footnotes li:target {\\n  color: var(--color-fg-default);\\n}\\n\\n.markdown-body .footnotes .data-footnote-backref g-emoji {\\n  font-family: monospace;\\n}\\n\\n.markdown-body .pl-c {\\n  color: var(--color-prettylights-syntax-comment);\\n}\\n\\n.markdown-body .pl-c1,\\n.markdown-body .pl-s .pl-v {\\n  color: var(--color-prettylights-syntax-constant);\\n}\\n\\n.markdown-body .pl-e,\\n.markdown-body .pl-en {\\n  color: var(--color-prettylights-syntax-entity);\\n}\\n\\n.markdown-body .pl-smi,\\n.markdown-body .pl-s .pl-s1 {\\n  color: var(--color-prettylights-syntax-storage-modifier-import);\\n}\\n\\n.markdown-body .pl-ent {\\n  color: var(--color-prettylights-syntax-entity-tag);\\n}\\n\\n.markdown-body .pl-k {\\n  color: var(--color-prettylights-syntax-keyword);\\n}\\n\\n.markdown-body .pl-s,\\n.markdown-body .pl-pds,\\n.markdown-body .pl-s .pl-pse .pl-s1,\\n.markdown-body .pl-sr,\\n.markdown-body .pl-sr .pl-cce,\\n.markdown-body .pl-sr .pl-sre,\\n.markdown-body .pl-sr .pl-sra {\\n  color: var(--color-prettylights-syntax-string);\\n}\\n\\n.markdown-body .pl-v,\\n.markdown-body .pl-smw {\\n  color: var(--color-prettylights-syntax-variable);\\n}\\n\\n.markdown-body .pl-bu {\\n  color: var(--color-prettylights-syntax-brackethighlighter-unmatched);\\n}\\n\\n.markdown-body .pl-ii {\\n  color: var(--color-prettylights-syntax-invalid-illegal-text);\\n  background-color: var(--color-prettylights-syntax-invalid-illegal-bg);\\n}\\n\\n.markdown-body .pl-c2 {\\n  color: var(--color-prettylights-syntax-carriage-return-text);\\n  background-color: var(--color-prettylights-syntax-carriage-return-bg);\\n}\\n\\n.markdown-body .pl-sr .pl-cce {\\n  font-weight: bold;\\n  color: var(--color-prettylights-syntax-string-regexp);\\n}\\n\\n.markdown-body .pl-ml {\\n  color: var(--color-prettylights-syntax-markup-list);\\n}\\n\\n.markdown-body .pl-mh,\\n.markdown-body .pl-mh .pl-en,\\n.markdown-body .pl-ms {\\n  font-weight: bold;\\n  color: var(--color-prettylights-syntax-markup-heading);\\n}\\n\\n.markdown-body .pl-mi {\\n  font-style: italic;\\n  color: var(--color-prettylights-syntax-markup-italic);\\n}\\n\\n.markdown-body .pl-mb {\\n  font-weight: bold;\\n  color: var(--color-prettylights-syntax-markup-bold);\\n}\\n\\n.markdown-body .pl-md {\\n  color: var(--color-prettylights-syntax-markup-deleted-text);\\n  background-color: var(--color-prettylights-syntax-markup-deleted-bg);\\n}\\n\\n.markdown-body .pl-mi1 {\\n  color: var(--color-prettylights-syntax-markup-inserted-text);\\n  background-color: var(--color-prettylights-syntax-markup-inserted-bg);\\n}\\n\\n.markdown-body .pl-mc {\\n  color: var(--color-prettylights-syntax-markup-changed-text);\\n  background-color: var(--color-prettylights-syntax-markup-changed-bg);\\n}\\n\\n.markdown-body .pl-mi2 {\\n  color: var(--color-prettylights-syntax-markup-ignored-text);\\n  background-color: var(--color-prettylights-syntax-markup-ignored-bg);\\n}\\n\\n.markdown-body .pl-mdr {\\n  font-weight: bold;\\n  color: var(--color-prettylights-syntax-meta-diff-range);\\n}\\n\\n.markdown-body .pl-ba {\\n  color: var(--color-prettylights-syntax-brackethighlighter-angle);\\n}\\n\\n.markdown-body .pl-sg {\\n  color: var(--color-prettylights-syntax-sublimelinter-gutter-mark);\\n}\\n\\n.markdown-body .pl-corl {\\n  text-decoration: underline;\\n  color: var(--color-prettylights-syntax-constant-other-reference-link);\\n}\\n\\n.markdown-body g-emoji {\\n  display: inline-block;\\n  min-width: 1ch;\\n  font-family: \"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\";\\n  font-size: 1em;\\n  font-style: normal !important;\\n  font-weight: var(--base-text-weight-normal, 400);\\n  line-height: 1;\\n  vertical-align: -0.075em;\\n}\\n\\n.markdown-body g-emoji img {\\n  width: 1em;\\n  height: 1em;\\n}\\n\\n.markdown-body .task-list-item {\\n  list-style-type: none;\\n}\\n\\n.markdown-body .task-list-item label {\\n  font-weight: var(--base-text-weight-normal, 400);\\n}\\n\\n.markdown-body .task-list-item.enabled label {\\n  cursor: pointer;\\n}\\n\\n.markdown-body .task-list-item+.task-list-item {\\n  margin-top: 4px;\\n}\\n\\n.markdown-body .task-list-item .handle {\\n  display: none;\\n}\\n\\n.markdown-body .task-list-item-checkbox {\\n  margin: 0 .2em .25em -1.4em;\\n  vertical-align: middle;\\n}\\n\\n.markdown-body .contains-task-list:dir(rtl) .task-list-item-checkbox {\\n  margin: 0 -1.6em .25em .2em;\\n}\\n\\n.markdown-body .contains-task-list {\\n  position: relative;\\n}\\n\\n.markdown-body .contains-task-list:hover .task-list-item-convert-container,\\n.markdown-body .contains-task-list:focus-within .task-list-item-convert-container {\\n  display: block;\\n  width: auto;\\n  height: 24px;\\n  overflow: visible;\\n  clip: auto;\\n}\\n\\n.markdown-body ::-webkit-calendar-picker-indicator {\\n  filter: invert(50%);\\n}\\n',\n};\n"
  }
]