[
  {
    "path": ".gitattributes",
    "content": ".gitattributes export-ignore\n.gitignore export-ignore\nREADME.md export-ignore"
  },
  {
    "path": ".gitignore",
    "content": "engine/log"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"mecha-cms/x.asset\"]\n  path = lot/x/asset\n  url = https://github.com/mecha-cms/x.asset.git\n[submodule \"mecha-cms/x.layout\"]\n  path = lot/x/layout\n  url = https://github.com/mecha-cms/x.layout.git\n[submodule \"mecha-cms/x.link\"]\n  path = lot/x/link\n  url = https://github.com/mecha-cms/x.link.git\n[submodule \"mecha-cms/x.markdown\"]\n  path = lot/x/markdown\n  url = https://github.com/mecha-cms/x.markdown.git\n[submodule \"mecha-cms/x.page\"]\n  path = lot/x/page\n  url = https://github.com/mecha-cms/x.page.git\n[submodule \"mecha-cms/x.test\"]\n  path = lot/x/test\n  url = https://github.com/mecha-cms/x.test.git\n[submodule \"mecha-cms/x.y-a-m-l\"]\n  path = lot/x/y-a-m-l\n  url = https://github.com/mecha-cms/x.y-a-m-l.git\n[submodule \"mecha-cms/y.log\"]\n  path = lot/y/log\n  url = https://github.com/mecha-cms/y.log.git"
  },
  {
    "path": ".htaccess",
    "content": "# Deny access to file(s) with `.` prefix\n<FilesMatch '^[.]'>\n  Deny from all\n</FilesMatch>\n\n# Deny access to folder(s)\n<IfModule mod_autoindex.c>\n  Options -Indexes\n</IfModule>\n\n# Set default character set to `UTF-8`\n<IfModule mod_mime.c>\n  AddDefaultCharset utf-8\n</IfModule>\n\n# Rewrite the path to `index.php` if it’s not a file/folder\n<IfModule mod_rewrite.c>\n  RewriteEngine on\n  RewriteCond %{REQUEST_FILENAME} !-d\n  RewriteCond %{REQUEST_FILENAME} !-f\n  RewriteRule . index.php [L,QSA]\n</IfModule>"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                      Version 3, 29 June 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 General Public License is a free, copyleft license for\nsoftware and other kinds of works.\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,\nthe GNU General Public License is 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.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\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  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\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 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. Use with the GNU Affero General Public License.\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 Affero 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 special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe 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 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 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 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 General Public License as published by\n    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 General Public License for more details.\n\n    You should have received a copy of the GNU 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 the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\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 GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>."
  },
  {
    "path": "README.md",
    "content": "Mecha CMS\n=========\n\nMecha is a flat-file content management system for minimalists.\n\n![Code Size](https://img.shields.io/github/languages/code-size/mecha-cms/mecha?color=%23444&style=for-the-badge) ![License](https://img.shields.io/github/license/mecha-cms/mecha?color=%23444&style=for-the-badge)\n\n[![Meme](https://user-images.githubusercontent.com/1669261/187597836-936abaa2-6898-4817-a968-346c4a678d93.png)](https://vincentdnl.com/drawings/developers-side-projects)\n\nFront-End\n---------\n\nThe [default layout][mecha-cms/y.log] uses only Serif and Mono fonts. Different operating systems may produce slightly\ndifferent results. This preview was taken from a computer running [Arch Linux][taufik-nurrohman/arch] operating system.\nThe Serif font shown in the preview should be [DejaVu Serif][dejavu-serif]:\n\n![Front-End](https://user-images.githubusercontent.com/1669261/190838629-860bfd9c-0444-4426-990f-71a604b95c32.png)\n\nBack-End ([Optional][mecha-cms/x.panel])\n-----------------------------------------------------------------------------\n\nTo be able to activate the back-end feature requires you to install our [Alert][mecha-cms/x.alert],\n[Panel][mecha-cms/x.panel], and [User][mecha-cms/x.user] extensions. This feature is forever optional. You can use this\nfeature on the local version only, and remove it on the public version to secure your website (only if you don’t trust\nthis extension).\n\n![Back-End](https://user-images.githubusercontent.com/1669261/193995098-3d4ff7c3-6d49-4d77-86e6-ca3ca0039d3f.png)\n\nColors and font types in the control panel preview above are generated from the\n[default skin][mecha-cms/x.panel.skin.default]. Without them, the display will look like the preview below:\n\n![Back-End](https://user-images.githubusercontent.com/1669261/193995030-9538357e-a5c4-4292-8ad2-a1e657f40acc.png)\n\nFeatures\n--------\n\n - Writing pages with ease using [Markdown][mecha-cms/x.markdown] extension.\n - Unlimited page children.\n - Unlimited page fields.\n - Extensible as hell.\n - Create unique design for each blog post by adding special CSS and JavaScript files using\n   [Art][mecha-cms/x.art] extension.\n - Built-in commenting system using [Comment][mecha-cms/x.comment] extension.\n - RSS and Sitemap using the [Feed][mecha-cms/x.feed] and [Sitemap][mecha-cms/x.sitemap] extension.\n - Easy to use and well documented API.\n - Almost everything are optional.\n - Control panel using [Panel][mecha-cms/x.panel] extension.\n\nRequirements\n------------\n\n - Apache 2.4 and above, with enabled [`mod_rewrite`][apache/mod_rewrite] module.\n - PHP 7.3 and above.\n\nPreparations\n------------\n\n 1. Make sure that you already have the required components.\n 2. Download the available package from the [home page][home].\n 3. Upload Mecha through your FTP/SFTP to the public folder/directory on your site, then extract it!\n 4. Take a look on the available extensions and layouts that you might be interested.\n 5. Upload your extension files to `.\\lot\\x` and your layout files to `.\\lot\\y`. They’re auto-loaded.\n 6. Read on how to add pages and tags. Learn on how to create pages from the author by looking at the\n    [source code][mecha-cms/site].\n 7. Install [Panel][mecha-cms/x.panel] extension if you are stuck by doing everything manually. You always have the full\n    control to remove this extension without having to worry that your site will stop running after doing so.\n\nAlternatives\n------------\n\n### Command Line\n\nThis assumes that your site’s public directory is in `/srv/http`. Make sure the folder is empty, or move the existing\nfiles to another place first. Don’t forget with that `.` at the end of the command as written in the example below, to\nclone the repository into the current root folder.\n\n#### Using Composer\n\n~~~ .sh\ncd /srv/http\ncomposer create-project mecha-cms/mecha .\n~~~\n\nYou may want to install our [Panel][mecha-cms/x.panel] extension as well:\n\n~~~ .sh\ncomposer require mecha-cms/x.panel\n~~~\n\n#### Using Git\n\n~~~ .sh\ncd /srv/http\ngit clone https://github.com/mecha-cms/mecha.git --depth 1 .\ngit submodule update --init --recursive\n~~~\n\nYou may want to install our [Panel][mecha-cms/x.panel] extension as well. Here, [Alert][mecha-cms/x.alert], and\n[User][mecha-cms/x.user] extension is required to be installed:\n\n~~~ .sh\ngit submodule add https://github.com/mecha-cms/x.alert.git --depth 1 lot/x/alert\ngit submodule add https://github.com/mecha-cms/x.user.git --depth 1 lot/x/user\ngit submodule add https://github.com/mecha-cms/x.panel.git --depth 1 lot/x/panel\n~~~\n\n### Web Browser\n\nDownload the installer file from <https://github.com/mecha-cms/start> and then follow the instructions.\n\n---\n\nContributors\n------------\n\nThis project exists and survives because of you. I would like to thank all those who have taken the time to contribute\nto this project.\n\n[![Contributors](https://opencollective.com/mecha-cms/contributors.svg?avatarHeight=24&button=false&width=890)](https://github.com/mecha-cms/mecha/graphs/contributors)\n\nContribute financially to keep the project domain and website accessible to everyone. The website provides complete\ndocumentation and latest information regarding the software and future development plans. Some parts of the website also\nserve to provide a clean and efficient project file download feature which is obtained by managing responses from the\n[GitHub API](https://docs.github.com/en/rest/reference/repos).\n\n### Backers\n\n[![Contribute](https://opencollective.com/mecha-cms/individuals.svg?width=890)](https://opencollective.com/mecha-cms)\n\n### Sponsors\n\n[![0](https://opencollective.com/mecha-cms/organization/0/avatar.svg)](https://opencollective.com/mecha-cms/organization/0/website)\n[![1](https://opencollective.com/mecha-cms/organization/1/avatar.svg)](https://opencollective.com/mecha-cms/organization/1/website)\n[![2](https://opencollective.com/mecha-cms/organization/2/avatar.svg)](https://opencollective.com/mecha-cms/organization/2/website)\n[![3](https://opencollective.com/mecha-cms/organization/3/avatar.svg)](https://opencollective.com/mecha-cms/organization/3/website)\n[![4](https://opencollective.com/mecha-cms/organization/4/avatar.svg)](https://opencollective.com/mecha-cms/organization/4/website)\n[![5](https://opencollective.com/mecha-cms/organization/5/avatar.svg)](https://opencollective.com/mecha-cms/organization/5/website)\n[![6](https://opencollective.com/mecha-cms/organization/6/avatar.svg)](https://opencollective.com/mecha-cms/organization/6/website)\n[![7](https://opencollective.com/mecha-cms/organization/7/avatar.svg)](https://opencollective.com/mecha-cms/organization/7/website)\n[![8](https://opencollective.com/mecha-cms/organization/8/avatar.svg)](https://opencollective.com/mecha-cms/organization/8/website)\n[![9](https://opencollective.com/mecha-cms/organization/9/avatar.svg)](https://opencollective.com/mecha-cms/organization/9/website)\n\n [apache/mod_rewrite]: http://httpd.apache.org/docs/current/mod/mod_rewrite.html 'Apache Module `mod_rewrite`'\n [dejavu-serif]: https://commons.wikimedia.org/wiki/File:DejaVuSerifSpecimen.svg 'DejaVu Serif · Wikimedia Commons'\n [home]: https://mecha-cms.com 'Mecha CMS'\n [mecha-cms/site]: https://github.com/mecha-cms/site 'GitHub'\n [mecha-cms/x.alert]: https://github.com/mecha-cms/x.alert 'Alert Extension'\n [mecha-cms/x.art]: https://github.com/mecha-cms/x.art 'Art Extension'\n [mecha-cms/x.comment]: https://github.com/mecha-cms/x.comment 'Comment Extension'\n [mecha-cms/x.feed]: https://github.com/mecha-cms/x.feed 'Feed Extension'\n [mecha-cms/x.markdown]: https://github.com/mecha-cms/x.markdown 'Markdown Extension'\n [mecha-cms/x.panel.skin.default]: https://github.com/mecha-cms/x.panel.skin.default 'Default Skin for Mecha’s Panel'\n [mecha-cms/x.panel]: https://github.com/mecha-cms/x.panel 'Panel Extension'\n [mecha-cms/x.sitemap]: https://github.com/mecha-cms/x.sitemap 'Sitemap Extension'\n [mecha-cms/x.user]: https://github.com/mecha-cms/x.user 'User Extension'\n [mecha-cms/y.log]: https://github.com/mecha-cms/y.log 'Log Layout'\n [php/dom]: http://php.net/manual/en/book.dom.php 'PHP Extension `dom`'\n [php/json]: http://php.net/manual/en/book.json.php 'PHP Extension `json`'\n [php/mbstring]: http://php.net/manual/en/book.mbstring.php 'PHP Extension `mbstring`'\n [taufik-nurrohman/arch]: https://github.com/taufik-nurrohman/arch 'My Minimalist Desk Setup'"
  },
  {
    "path": "composer.json",
    "content": "{\n  \"authors\": [\n    {\n      \"homepage\": \"https://github.com/taufik-nurrohman\",\n      \"name\": \"Taufik Nurrohman\",\n      \"role\": \"Developer\"\n    },\n    {\n      \"homepage\": \"https://github.com/igoynawamreh\",\n      \"name\": \"Igoy Nawamreh\",\n      \"role\": \"Developer\"\n    }\n  ],\n  \"config\": {\n    \"allow-plugins\": {\n      \"mecha-cms/composer\": true\n    },\n    \"lock\": false,\n    \"sort-packages\": true,\n    \"vendor-dir\": \"engine/vendor\"\n  },\n  \"description\": \"Minimalist content management system.\",\n  \"extra\": {\n    \"minify-on-install\": false,\n    \"remove-on-install\": {\n      \".factory/\": true,\n      \".git/\": true,\n      \".github/\": true,\n      \".node_modules/\": true,\n      \"test/\": true,\n      \".editorconfig\": true,\n      \".gitattributes\": true,\n      \".gitignore\": true,\n      \".gitmodules\": true,\n      \".keep\": true,\n      \"README.md\": true,\n      \"package-lock.json\": true,\n      \"package.json\": true,\n      \"test\": 1,\n      \"test.css\": true,\n      \"test.html\": true,\n      \"test.js\": true,\n      \"test.json\": true,\n      \"test.php\": true,\n      \"test.txt\": true\n    }\n  },\n  \"funding\": [\n    {\n      \"type\": \"github\",\n      \"url\": \"https://github.com/sponsors/mecha-cms\"\n    },\n    {\n      \"type\": \"opencollective\",\n      \"url\": \"https://opencollective.com/mecha-cms\"\n    },\n    {\n      \"type\": \"paypal\",\n      \"url\": \"https://paypal.me/tatautaufik\"\n    }\n  ],\n  \"homepage\": \"https://mecha-cms.com\",\n  \"license\": \"GPL-3.0-or-later\",\n  \"name\": \"mecha-cms/mecha\",\n  \"require\": {\n    \"ext-json\": \"*\",\n    \"mecha-cms/composer\": \"^1.0.0\",\n    \"mecha-cms/x.asset\": \"^2.0.0\",\n    \"mecha-cms/x.layout\": \"^2.0.0\",\n    \"mecha-cms/x.link\": \"^2.0.0\",\n    \"mecha-cms/x.markdown\": \"^3.0.0\",\n    \"mecha-cms/x.page\": \"^3.1.0\",\n    \"mecha-cms/x.test\": \"^1.0.0\",\n    \"mecha-cms/y.log\": \"^2.0.0\",\n    \"php\": \">=8.1\"\n  },\n  \"suggest\": {\n    \"ext-curl\": \"We will use `file_get_contents()` if `ext-curl` is not installed. It will be more efficient when `curl_*()` functions are available.\",\n    \"ext-gd\": \"Required if you are interested in installing the `mecha-cms/x.image` extension.\",\n    \"ext-mbstring\": \"It would be great if `ext-mbstring` is installed. We will use other ways if `ext-mbstring` is not available.\",\n    \"ext-zip\": \"Required if certain extensions (such as `mecha-cms/x.panel`) need to work with ZIP files.\"\n  },\n  \"support\": {\n    \"forum\": \"https://github.com/mecha-cms/mecha/discussions\",\n    \"issues\": \"https://github.com/mecha-cms/mecha/issues\",\n    \"source\": \"https://github.com/mecha-cms/mecha\",\n    \"wiki\": \"https://github.com/mecha-cms/mecha/wiki\"\n  },\n  \"type\": \"project\"\n}"
  },
  {
    "path": "engine/.htaccess",
    "content": "Deny from all"
  },
  {
    "path": "engine/f.php",
    "content": "<?php\n\n// <https://wiki.php.net/rfc/json_validate>\nif (!function_exists('json_validate')) {\n    // PHP < 8.3\n    function json_validate(string $json): bool {\n        $json = trim($json);\n        if (\n            'false' === $json ||\n            // `null` is a valid JSON <https://www.rfc-editor.org/rfc/rfc8259#section-3>\n            'null' === $json ||\n            'true' === $json ||\n            '\"\"' === $json ||\n            '[]' === $json ||\n            '{}' === $json ||\n            is_numeric($json)\n        ) {\n            return true;\n        }\n        return (\n            // Maybe string\n            '\"' === $json[0] && '\"' === substr($json, -1) ||\n            // Maybe array\n            '[' === $json[0] && ']' === substr($json, -1) ||\n            // Maybe object\n            '{' === $json[0] && '}' === substr($json, -1)\n        ) && null !== json_decode($json);\n    }\n}\n\n// To be used by `g()`\nfinal class IteratorG implements Countable, Iterator {\n    private $i = 0;\n    private $it;\n    private $lot = [];\n    private $valid = true;\n    public function __construct(Iterator $it) {\n        $this->it = $it;\n    }\n    public function count(): int {\n        if ($this->valid) {\n            foreach ($this as $v) {}\n            $this->i = 0;\n        }\n        return count($this->lot);\n    }\n    public function current(): mixed {\n        return $this->valid() ? $this->lot[$this->i][0] : null;\n    }\n    public function key(): mixed {\n        return $this->valid() ? $this->lot[$this->i][1] : null;\n    }\n    public function next(): void {\n        ++$this->i;\n    }\n    public function rewind(): void {\n        $this->i = 0;\n    }\n    public function valid(): bool {\n        if (isset($this->lot[$this->i])) {\n            return true;\n        }\n        if (!$this->valid) {\n            return false;\n        }\n        $it = $this->it;\n        if (!$it->valid()) {\n            $this->valid = false;\n            return false;\n        }\n        $this->lot[] = [$it->current(), $it->key()];\n        $it->next();\n        return true;\n    }\n}\n\nfunction all(array $value, $valid = null, $that = null, $scope = 'static') {\n    if (!$value) {\n        return true;\n    }\n    if (!is_callable($valid) && null !== $valid) {\n        $valid = function ($v) use ($valid) {\n            return $v === $valid;\n        };\n    }\n    $c = cue($valid, $that, $scope);\n    foreach ($value as $k => $v) {\n        if (!$c($v, $k)) {\n            return false;\n        }\n    }\n    return true;\n}\n\nfunction any(array $value, $valid = null, $that = null, $scope = 'static') {\n    if (!$value) {\n        return false;\n    }\n    if (!is_callable($valid) && null !== $valid) {\n        $valid = function ($v) use ($valid) {\n            return $v === $valid;\n        };\n    }\n    $c = cue($valid, $that, $scope);\n    foreach ($value as $k => $v) {\n        if ($c($v, $k)) {\n            return true;\n        }\n    }\n    return false;\n}\n\nfunction apart(string $value, array $raw = [], array $void = []) {\n    $r = [];\n    $s = \"\";\n    if (\"\" === $value) {\n        return $r;\n    }\n    $c1 = \" \\n\\r\\t\";\n    $c2 = '0123456789';\n    $c3 = 'abcdef';\n    $c4 = 'ABCDEF';\n    $c5 = $c3 . 'ghijklmnopqrstuvwxyz';\n    $c6 = $c4 . 'GHIJKLMNOPQRSTUVWXYZ';\n    $c7 = $c1 . '>';\n    $i = 0;\n    $max = strlen($value);\n    $raw = $raw ? array_flip($raw) : [];\n    $void = $void ? array_flip($void) : [];\n    while ($i < $max) {\n        $c = $value[$i];\n        $next = $i + 1 < $max ? $value[$i + 1] : \"\\0\";\n        // <https://www.w3.org/TR/xml#sec-references>\n        if ('&' === $c && false === strpos($c1, $next)) {\n            $n = $i + 1;\n            if ($n < $max && '#' === $value[$n]) {\n                ++$n;\n                if ($n < $max && ('X' === $value[$n] || 'x' === $value[$n])) {\n                    $m = strspn($value, $c2 . $c3 . $c4, $n += 1);\n                } else {\n                    $m = strspn($value, $c2, $n);\n                }\n                if ($m && $n + $m < $max && ';' === $value[$n + $m]) {\n                    \"\" !== $s && ($r[] = [$s, 0]) && ($s = \"\");\n                    $r[] = [substr($value, $i, $n + $m - $i + 1), -1];\n                    $i = $n + $m + 1;\n                    continue;\n                }\n            } else {\n                if ($m = strspn($value, $c5 . $c6, $n)) {\n                    $n += $m;\n                    $n += strspn($value, $c2 . $c5 . $c6, $n);\n                    if ($n < $max && ';' === $value[$n]) {\n                        \"\" !== $s && ($r[] = [$s, 0]) && ($s = \"\");\n                        $r[] = [substr($value, $i, $n - $i + 1), -1];\n                        $i = $n + 1;\n                        continue;\n                    }\n                }\n            }\n        }\n        if ('<' === $c && false === strpos($c7, $next)) {\n            if ('!' === $next) {\n                // <https://www.w3.org/TR/xml#sec-comments>\n                if (0 === substr_compare($value, '<!--', $i, 4)) {\n                    if (false !== ($z = strpos($value, '-->', $i + 4))) {\n                        \"\" !== $s && ($r[] = [$s, 0]) && ($s = \"\");\n                        $r[] = [substr($value, $i, $z - $i + 3), 1];\n                        $i = $z + 3;\n                        continue;\n                    }\n                }\n                // <https://www.w3.org/TR/xml#sec-cdata-sect>\n                if (0 === substr_compare($value, '<![CDATA[', $i, 9)) {\n                    if (false !== ($n = strpos($value, ']]>', $i + 9))) {\n                        \"\" !== $s && ($r[] = [$s, 0]) && ($s = \"\");\n                        $r[] = [substr($value, $i, $n - $i + 3), 1];\n                        $i = $n + 3;\n                        continue;\n                    }\n                }\n                // <https://www.w3.org/TR/xml#sec-entexpand>\n                // <https://www.w3.org/TR/xml#vc-roottype>\n                $n = $i + 2;\n                if ($n >= $max || false !== strpos($c7, $value[$n])) {\n                    $s .= '<';\n                    ++$i;\n                    continue;\n                }\n                $deep = $q = 0;\n                $n = $i + 2;\n                while ($n < $max) {\n                    $v = $value[$n];\n                    if ($q) {\n                        $q === $v && ($q = 0);\n                    } else {\n                        if (\"'\" === $v || '\"' === $v) {\n                            $q = $v;\n                        } else if ('[' === $v) {\n                            ++$deep;\n                        } else if (']' === $v && $deep > 0) {\n                            --$deep;\n                        } else if ('>' === $v && 0 === $deep) {\n                            break;\n                        }\n                    }\n                    ++$n;\n                }\n                if ($n < $max) {\n                    \"\" !== $s && ($r[] = [$s, 0]) && ($s = \"\");\n                    $r[] = [substr($value, $i, $n - $i + 1), 1];\n                    $i = $n + 1;\n                    continue;\n                }\n            }\n            // <https://www.w3.org/TR/xml#sec-pi>\n            if ('?' === $next) {\n                $n = $i + 2;\n                $q = 0;\n                while ($n < $max) {\n                    $v = $value[$n];\n                    if ($q) {\n                        $q === $v && ($q = 0);\n                    } else {\n                        if (\"'\" === $v || '\"' === $v) {\n                            $q = $v;\n                        } else if ('?' === $v && $n + 1 < $max && '>' === $value[$n + 1]) {\n                            break;\n                        }\n                    }\n                    ++$n;\n                }\n                if ($n < $max) {\n                    \"\" !== $s && ($r[] = [$s, 0]) && ($s = \"\");\n                    $r[] = [substr($value, $i, $n - $i + 2), 1];\n                    $i = $n + 2;\n                    continue;\n                }\n            }\n            // <https://www.w3.org/TR/xml#sec-starttags>\n            $n = $i + 1;\n            $q = 0;\n            while ($n < $max) {\n                $v = $value[$n];\n                if ($q) {\n                    $q === $v && ($q = 0);\n                } else {\n                    if (\"'\" === $v || '\"' === $v) {\n                        $q = $v;\n                    } else if ('>' === $v) {\n                        break;\n                    }\n                }\n                ++$n;\n            }\n            $start = $n - $i + 1;\n            if ($n < $max) {\n                $z = $i + 1;\n                $z += strspn($value, $c1, $z, $n - $z);\n                $m = strlen($name = substr($value, $z, min(strcspn($value, $c1 . '/>', $z), $n - $z)));\n                if (isset($raw[$name])) {\n                    $n += 1;\n                    while (1) {\n                        // Raw HTML is left open for some reason until the end of the stream\n                        if (\"\" !== $name && false === ($z = strpos($value, '</' . $name, $n))) {\n                            \"\" !== $s && ($r[] = [$s, 0]) && ($s = \"\");\n                            $r[] = [substr($value, $i), 1, $start, null];\n                            return $r;\n                        }\n                        $y = $z + 2 + $m;\n                        $y += strspn($value, $c1, $y);\n                        if ($y < $max && '>' === $value[$y]) {\n                            \"\" !== $s && ($r[] = [$s, 0]) && ($s = \"\");\n                            $r[] = [substr($value, $i, $y - $i + 1), 1, $start, -($y - $z + 1)];\n                            $i = $y + 1;\n                            continue 2;\n                        }\n                        $n = max($y, $z + 1);\n                    }\n                }\n                \"\" !== $s && ($r[] = [$s, 0]) && ($s = \"\");\n                $x = $n - 1;\n                while ($x > $i && false !== strpos($c1, $value[$x])) --$x;\n                $v = [substr($value, $i, $start), 2, $start];\n                // <https://www.w3.org/TR/2011/WD-html-markup-20110113/syntax.html#void-elements>\n                if (isset($void[$name])) {\n                    $v[1] = 1;\n                    $v[3] = false;\n                // <https://www.w3.org/TR/xml#d0e2480>\n                } else if ($x > $i && '/' === $value[$x]) {\n                    $v[1] = 1;\n                    $v[3] = true;\n                }\n                $r[] = $v;\n                $i = $n + 1;\n                continue;\n            }\n        }\n        $s .= $c;\n        ++$i;\n    }\n    \"\" !== $s && ($r[] = [$s, 0]) && ($s = \"\");\n    return $r;\n}\n\n// Convert class name to file name\nfunction c2f(?string $value, $accent = false) {\n    $value = implode(D, map(explode(P, strtr($value ?? \"\", \"\\\\/\", P . P)), static function ($v) use ($accent) {\n        return ltrim(strtr(h($v, '-', $accent, '_') ?? \"\", [\n            '_-' => '_',\n            '__-' => '.',\n            '__' => '.'\n        ]), '-');\n    }));\n    return \"\" !== $value ? $value : null;\n}\n\nfunction check(string $token, $key = 0) {\n    $past = $_SESSION['token'][$key ?? bin2hex(random_bytes(8))] ?? [0, \"\"];\n    return $past[1] && $token && $past[1] === $token ? $token : false;\n}\n\nfunction choke(int $for = 1, $key = 0) {\n    $current = $_SERVER['REQUEST_TIME'];\n    $key = md5((string) ($key ?? bin2hex(random_bytes(8))));\n    if (!is_file($file = ENGINE . D . 'log' . D . 'choke' . D . $key)) {\n        if (!is_dir($folder = dirname($file))) {\n            mkdir($folder, 0775, true);\n        }\n        touch($file, $current);\n        return $for;\n    }\n    $past = filemtime($file);\n    if ($for > $current - $past) {\n        return $for - ($current - $past);\n    }\n    touch($file, $current);\n    return false;\n}\n\nfunction concat(array $value, ...$lot) {\n    // `concat([…], […], […], false)`\n    if (count($lot) > 1 && false === last($lot)) {\n        array_pop($lot);\n        return array_merge($value, ...$lot);\n    }\n    // `concat([…], […], […])`\n    return array_merge_recursive($value, ...$lot);\n}\n\nfunction content(string $path, ?string $value = null, $seal = null) {\n    if (null !== $value) {\n        if (is_dir($path) || (is_file($path) && !is_writable($path))) {\n            return false;\n        }\n        if (!is_dir($folder = dirname($path))) {\n            mkdir($folder, 0775, true);\n        }\n        if (is_int(file_put_contents($path, $value))) {\n            $seal && seal($path, $seal);\n            return true;\n        }\n        return null;\n    }\n    return is_file($path) && is_readable($path) ? file_get_contents($path) : null;\n}\n\nfunction cookie(...$lot) {\n    if (0 === count($lot)) {\n        $cookie = [];\n        foreach ($_COOKIE as $k => $v) {\n            if (0 === strpos($k, '+')) {\n                $cookie[$k] = json_decode(base64_decode($v), true);\n            } else {\n                $cookie[$k] = $v;\n            }\n        }\n        return $cookie;\n    }\n    $key = array_shift($lot);\n    if (0 === count($lot)) {\n        if (isset($_COOKIE[$k = '+' . substr(md5($key), 0, 16)])) {\n            return json_decode(base64_decode($_COOKIE[$k]), true);\n        }\n        return $_COOKIE[$key] ?? null;\n    }\n    $value = array_shift($lot);\n    $with = array_shift($lot) ?? '+1 day';\n    if (!is_array($with)) {\n        $with = ['expires' => $with];\n    }\n    $with = array_replace([\n        'domain' => \"\",\n        'expires' => '+1 day',\n        'httponly' => true, // Safe by default\n        'path' => '/',\n        'samesite' => 'Strict', // Safe by default\n        'secure' => !empty($_SERVER['HTTPS']) && 'off' !== $_SERVER['HTTPS'] || 443 === (int) $_SERVER['SERVER_PORT']\n    ], $with);\n    if (is_string($with['expires'])) {\n        $with['expires'] = strtotime($with['expires']);\n    }\n    setcookie('+' . substr(md5($key), 0, 16), base64_encode(json_encode($value, JSON_PRESERVE_ZERO_FRACTION | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)), $with);\n}\n\nfunction delete(string $path, $purge = true) {\n    if (is_dir($path)) {\n        $r = [];\n        foreach (g($path, null, true) as $k => $v) {\n            $r[$k] = (0 === $v ? rmdir($k) : unlink($k)) ? $v : null;\n        }\n        $r[$path] = rmdir($path) ? 0 : null;\n        if ($purge && 0 === $r[$path]) {\n            $folder = dirname($path);\n            while ($folder && PATH !== $folder) {\n                if ((new FilesystemIterator($folder, FilesystemIterator::SKIP_DOTS))->valid()) {\n                    break;\n                }\n                if (!rmdir($folder)) {\n                    break;\n                }\n                $folder = dirname($folder);\n            }\n        }\n        return $r;\n    }\n    if (is_file($path) && unlink($path)) {\n        return $path;\n    }\n    return null;\n}\n\n// Remove empty array, empty string, and `null` value from array\nfunction drop(array $value, ?callable $valid = null, $that = null, $scope = 'static') {\n    if (!$value) {\n        return null;\n    }\n    $c = cue($valid ?? function ($v, $k) {\n        return \"\" === $v || null === $v || [] === $v;\n    }, $that, $scope);\n    foreach ($value as $k => $v) {\n        if (is_array($v)) {\n            if ($v = drop($v, $valid, $that, $scope)) {\n                $value[$k] = $v;\n            } else {\n                unset($value[$k]); // Drop!\n            }\n        } else {\n            if ($c($v, $k)) {\n                unset($value[$k]); // Drop!\n            }\n        }\n    }\n    return $value ?: null;\n}\n\n// [E]scape HTML [at]tribute’s value\nfunction eat(?string $value) {\n    return \"\" !== ($value = htmlspecialchars($value ?? \"\", ENT_HTML5 | ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8', false)) ? $value : null;\n}\n\nfunction eq($a, $b) {\n    return $b === q($a);\n}\n\nfunction exist($path, $type = null) {\n    static $c = [];\n    $test = match ($type) {\n        0 => 'is_dir',\n        1 => 'is_file',\n        default => null\n    };\n    foreach ((array) $path as $v) {\n        if (!$v) {\n            continue;\n        }\n        if (isset($c[$v])) {\n            return $c[$v];\n        }\n        if ($r = stream_resolve_include_path($v)) {\n            if ($test && !$test($r)) {\n                continue;\n            }\n            return ($c[$v] = $r);\n        }\n        if (strcspn($v, '*?[]{}') !== strlen($v)) {\n            if (!($r = glob($v, GLOB_BRACE | GLOB_NOSORT)) || !($r = $r[0] ?? 0) || $test && !$test($r)) {\n                $c[$v] = false;\n                continue;\n            }\n            return ($c[$v] = $r);\n        }\n    }\n    return false;\n}\n\nfunction extend(array $value, ...$lot) {\n    // `extend([…], […], […], false)`\n    if (count($lot) > 1 && false === last($lot)) {\n        array_pop($lot);\n        return array_replace($value, ...$lot);\n    }\n    // `extend([…], […], […])`\n    return array_replace_recursive($value, ...$lot);\n}\n\n// Convert file name to class name\nfunction f2c(?string $value, $accent = false) {\n    $value = implode(\"\\\\\", map(explode(P, strtr($value ?? \"\", \"\\\\/\", P . P)), static function ($v) use ($accent) {\n        return p(strtr($v, ['.' => '__']), $accent, '_');\n    }));\n    return \"\" !== $value ? $value : null;\n}\n\n// Convert file name to property name\nfunction f2p(?string $value, $accent = false) {\n    $value = implode(\"\\\\\", map(explode(P, strtr($value ?? \"\", \"\\\\/\", P . P)), static function ($v) use ($accent) {\n        return c(strtr($v, ['.' => '__']), $accent, '_');\n    }));\n    return \"\" !== $value ? $value : null;\n}\n\nfunction fetch(string $from, $lot = null, $data = \"\") {\n    $h = [];\n    if (is_array($lot)) {\n        foreach ($lot as $k => $v) {\n            if (false === $v || null === $v) {\n                continue;\n            }\n            $k = strtolower($k);\n            if (is_array($v)) {\n                foreach ($v as $kk => $vv) {\n                    $h[$k . P . $kk] = $k . ': ' . s($vv);\n                }\n                continue;\n            }\n            $h[$k] = $k . ': ' . s($v);\n        }\n    } else if (is_string($lot)) {\n        $h[$k = 'user-agent'] = $k . ': ' . $lot;\n    }\n    if (empty($h[$k = 'user-agent'])) {\n        // <https://www.rfc-editor.org/rfc/rfc7231#section-5.5.3>\n        $port = (int) ($_SERVER['SERVER_PORT'] ?? 0);\n        $s = !empty($_SERVER['HTTPS']) && 'off' !== $_SERVER['HTTPS'] || 443 === $port ? 's' : \"\";\n        $h[$k] = $k . ': Mecha/' . VERSION . ' (+http' . $s . '://' . ($_SERVER['HTTP_HOST'] ?? $_SERVER['SERVER_NAME'] ?? \"\") . ')';\n    }\n    // `fetch('POST http://127.0.0.1/asdf')`\n    if (strpos($from = trim($from), '/') > ($n = strcspn($from, \" \\n\\r\\t\"))) {\n        $link = trim(substr($from, $n + 1));\n        $type = strtoupper(substr($from, 0, $n));\n    // `fetch('http://127.0.0.1/asdf')`\n    } else {\n        $link = $from;\n        $type = 'GET';\n    }\n    if (function_exists('curl_init')) {\n        $c = curl_init($link);\n        if ('HEAD' === $type) {\n            curl_setopt($c, CURLOPT_HEADER, true);\n            curl_setopt($c, CURLOPT_NOBODY, true);\n        } else if (false !== strpos(',PATCH,POST,PUT,', ',' . $type . ',')) {\n            $data_with_blob = \"\";\n            $has_blob = false;\n            if (is_array($data)) {\n                $task = function ($data, $prefix = \"\") use (&$has_blob, &$task) {\n                    $r = [];\n                    foreach ($data as $k => $v) {\n                        $kk = $prefix ? $prefix . '[' . $k . ']' : $k;\n                        if (is_array($v)) {\n                            $r += $task($v, $kk);\n                            continue;\n                        }\n                        if (is_string($v) && is_file($v = 0 === strpos($v, \".\\\\\") ? PATH . strtr(substr($v, 1), \"\\\\\", D) : $v)) {\n                            $has_blob = true;\n                            $r[$kk] = new CURLFile($v, mime_content_type($v) ?: 'application/octet-stream', basename($v));\n                            continue;\n                        }\n                        $r[$kk] = $v;\n                    }\n                    return $r;\n                };\n                $data_with_blob = $task($data);\n            }\n            if ('application/json' === ($h['content-type'] ?? 0)) {\n                $data = json_encode($data);\n            } else if (!$has_blob && is_array($data)) {\n                $data = http_build_query($data);\n            }\n            curl_setopt($c, CURLOPT_POSTFIELDS, $has_blob ? $data_with_blob : $data);\n        }\n        $h[$k = 'x-requested-with'] = $h[$k] ?? ($k . ': PHP cURL');\n        curl_setopt_array($c, [\n            CURLOPT_CUSTOMREQUEST => $type,\n            CURLOPT_FAILONERROR => true,\n            CURLOPT_FOLLOWLOCATION => true,\n            CURLOPT_HTTPHEADER => array_values($h),\n            CURLOPT_MAXREDIRS => 2,\n            CURLOPT_RETURNTRANSFER => true,\n            CURLOPT_SSL_VERIFYPEER => false,\n            CURLOPT_TIMEOUT => 15\n        ]);\n        if (false !== ($r = curl_exec($c))) {\n            if ('HEAD' === $type) {\n                $h = explode(\"\\n\", n(trim($r)));\n                $r = array_shift($h) . \"\\n\";\n                foreach ($h as $v) {\n                    $r .= strtolower(strstr($v, ':', true)) . strstr($v, ':') . \"\\n\";\n                }\n                $r = substr($r, 0, -1);\n            }\n        }\n        if (defined('TEST') && 'curl' === TEST && false === $r) {\n            throw new UnexpectedValueException(curl_error($c));\n        }\n        curl_close($c);\n    } else {\n        if ('HEAD' === $type) {\n            $h = get_headers($link, true, stream_context_set_default(['http' => ['method' => $type]]));\n            $h = array_change_key_case((array) $h, CASE_LOWER);\n            // If `$link` is redirected and the new target is also redirected, we got the `Location` data as array.\n            // We also got the HTTP code header in a number indexed value.\n            //\n            // <https://www.php.net/manual/en/function.get-headers.php#120075>\n            //\n            // [\n            //     0 => 'HTTP/1.1 302 Moved Temporarily',\n            //     'Location' => [\n            //         0 => '/test.php?id=2',\n            //         1 => '/test.php?id=3',\n            //         2 => '/test.php?id=4'\n            //     ],\n            //     1 => 'HTTP/1.1 302 Moved Temporarily',\n            //     2 => 'HTTP/1.1 302 Moved Temporarily',\n            //     3 => 'HTTP/1.1 200 OK'\n            // ]\n            $r = [];\n            if (isset($h[0]) && isset($h[1])) {\n                foreach ($h as $k => $v) {\n                    $k = is_int($k) ? $k : strtolower($k);\n                    if (is_array($v)) {\n                        foreach ($v as $kk => $vv) {\n                            $r[$kk][] = $k . ': ' . $vv;\n                        }\n                        continue;\n                    }\n                    $r[0][] = (is_int($k) ? \"\\n\" : $k . ': ') . $v;\n                }\n                foreach ($r as &$v) {\n                    $v = implode(\"\\n\", $v);\n                }\n                unset($v);\n            } else {\n                foreach ($h as $k => $v) {\n                    $r[] = (is_int($k) ? \"\\n\" : strtolower($k) . ': ') . (is_array($v) ? last($v) : $v);\n                }\n            }\n            $r = trim(implode(\"\\n\", $r));\n        } else {\n            $h[$k = 'x-requested-with'] = $h[$k] ?? ($k . ': PHP');\n            $x = [];\n            if (false !== strpos(',PATCH,POST,PUT,', ',' . $type . ',')) {\n                if ('application/json' === ($h['content-type'] ?? 0)) {\n                    $data = json_encode($data);\n                } else if (is_array($data)) {\n                    $data = http_build_query($data);\n                }\n                $h[$k = 'content-type'] = $h[$k] ?? ($k . ': application/x-www-form-urlencoded');\n                $x['http']['content'] = $data;\n            }\n            $x['http']['header'] = implode(\"\\r\\n\", array_values($h));\n            $x['http']['ignore_errors'] = true;\n            $x['http']['method'] = $type;\n            $x['ssl']['verify_peer'] = false;\n            $x['ssl']['verify_peer_name'] = false;\n            $r = file_get_contents($link, false, stream_context_create($x));\n        }\n    }\n    return false !== $r ? $r : null;\n}\n\nfunction find(array $value, callable $valid, $that = null, $scope = 'static') {\n    if (!$value) {\n        return null;\n    }\n    $c = cue($valid, $that, $scope);\n    foreach ($value as $k => $v) {\n        if ($c($v, $k)) {\n            return $v;\n        }\n    }\n    return null;\n}\n\nfunction fire(callable $task, array $lot = [], $that = null, $scope = 'static') {\n    return cue($task, $that, $scope)(...$lot);\n}\n\nfunction first(array $value) {\n    if (!$value) {\n        return null;\n    }\n    return $value[array_key_first($value)] ?? null;\n}\n\nfunction ge($a, $b) {\n    return q($a) >= $b;\n}\n\nfunction get(array $from, string $key, string $join = '.') {\n    if (!$from) {\n        return null;\n    }\n    $keys = explode($join, strtr($key, [\"\\\\\" . $join => P]));\n    foreach ($keys as $key) {\n        $key = strtr($key, [P => $join]);\n        if (!is_array($from) || !array_key_exists($key, $from)) {\n            return null;\n        }\n        $from =& $from[$key];\n    }\n    return $from;\n}\n\nfunction gt($a, $b) {\n    return q($a) > $b;\n}\n\nfunction has(array $from, string $key, string $join = '.') {\n    if (!$from) {\n        return false;\n    }\n    $keys = explode($join, strtr($key, [\"\\\\\" . $join => P]));\n    foreach ($keys as $key) {\n        $key = strtr($key, [P => $join]);\n        if (!is_array($from) || !array_key_exists($key, $from)) {\n            return false;\n        }\n        $from =& $from[$key];\n    }\n    return true;\n}\n\nfunction ip() {\n    if ($for = $_SERVER['HTTP_X_FORWARDED_FOR'] ?? \"\") {\n        $ip = trim(strstr($for, ',', true) ?: $for);\n    } else {\n        $ip = $_SERVER['REMOTE_ADDR'];\n    }\n    return filter_var($ip, FILTER_VALIDATE_IP) ? $ip : null;\n}\n\nfunction is(array $value, $valid = null, $keys = false, $that = null, $scope = 'static') {\n    if (!$value) {\n        return $value;\n    }\n    if (!is_callable($valid) && null !== $valid) {\n        $valid = function ($v) use ($valid) {\n            return $v === $valid;\n        };\n    }\n    $c = cue($valid, $that, $scope);\n    $r = [];\n    foreach ($value as $k => $v) {\n        if (!$c($v, $k)) {\n            continue;\n        }\n        if ($keys) {\n            $r[$k] = $v;\n            continue;\n        }\n        $r[] = $v;\n    }\n    return $r;\n}\n\nfunction last(array $value) {\n    if (!$value) {\n        return null;\n    }\n    return $value[array_key_last($value)] ?? null;\n}\n\nfunction le($a, $b) {\n    return q($a) <= $b;\n}\n\nfunction let(array &$from, string $key, string $join = '.') {\n    if (!$from) {\n        return false;\n    }\n    $keys = explode($join, strtr($key, [\"\\\\\" . $join => P]));\n    $k = strtr(array_pop($keys), [P => $join]);\n    while ($keys) {\n        $key = strtr(array_shift($keys), [P => $join]);\n        if (is_array($from) && array_key_exists($key, $from)) {\n            $from =& $from[$key];\n        }\n    }\n    if (is_array($from) && array_key_exists($k, $from)) {\n        unset($from[$k]);\n        return true;\n    }\n    return false;\n}\n\nfunction &lot(...$lot) {\n    static $test;\n    $test ??= function (string $name) {\n        if (\"\" === $name) {\n            return false;\n        }\n        // <https://www.php.net/manual/en/language.variables.php>\n        static $a, $b;\n        if (!isset($a)) {\n            $a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_' . implode(\"\", range(\"\\x80\", \"\\xff\"));\n            $b = $a . '0123456789';\n        }\n        if (1 !== strspn($name[0], $a)) {\n            return false;\n        }\n        return strlen($name) - 1 === strspn($name, $b, 1);\n    };\n    if (0 === ($max = count($lot)) || 1 === $max && is_array($lot[0])) {\n        $r = [];\n        foreach (array_replace($GLOBALS, $lot[0] ?? []) as $k => $v) {\n            if ($test($k)) {\n                $r[$k] = $v;\n            }\n        }\n        return $r;\n    }\n    if (1 === $max && $test($lot[0])) {\n        if (!array_key_exists($lot[0], $GLOBALS)) {\n            $GLOBALS[$lot[0]] = null;\n        }\n        return $GLOBALS[$lot[0]];\n    }\n    $r =& $lot[1];\n    if ($test($lot[0])) {\n        $GLOBALS[$lot[0]] = $r;\n    }\n    return $r;\n}\n\nfunction lt($a, $b) {\n    return q($a) < $b;\n}\n\nfunction map(array $value, callable $at, $that = null, $scope = 'static') {\n    if (!$value) {\n        return $value;\n    }\n    $c = cue($at, $that, $scope);\n    foreach ($value as $k => $v) {\n        $value[$k] = $c($v, $k);\n    }\n    return $value;\n}\n\nfunction move(string $path, string $to, ?string $as = null) {\n    $r = [];\n    if (!is_dir($path) && !is_file($path)) {\n        return [null, null];\n    }\n    $path = path($path);\n    // Move a file to a folder\n    if (is_file($r[0] = $path)) {\n        if (is_file($file = $to . D . ($as ?? basename($path)))) {\n            // Return `false` if file exists\n            $r[1] = false;\n        } else {\n            if (!is_dir($folder = dirname($file))) {\n                mkdir($folder, 0775, true);\n            }\n            // Return `$file` on success, `null` on error\n            $r[1] = rename($path, $file) ? path($file) : null;\n        }\n        return $r;\n    }\n    // Move a folder with its contents to a folder\n    $r = [$path, null];\n    if (!is_dir($to)) {\n        return $r;\n    }\n    $r[1] = [];\n    if (!is_dir($to .= D . ($as ?? basename($path)))) {\n        mkdir($to, 0775, true);\n    }\n    if ($path === ($to = path($to))) {\n        return $r; // Nothing to move\n    }\n    foreach (g($path, 1, true) as $k => $v) {\n        $file = $to . D . substr($k, strlen($path) + 1);\n        if (!is_dir($folder = dirname($file))) {\n            $r[1][$folder] = mkdir($folder, 0775, true) ? 0 : null;\n        }\n        $r[1][$file] = rename($k, $file) ? 1 : null;\n    }\n    // Delete empty folder\n    foreach (g($path, 0, true) as $k => $v) {\n        if (0 === q(g($k))) {\n            rmdir($k);\n        }\n    }\n    // Delete folder\n    if (0 === q(g($path))) {\n        rmdir($path);\n    }\n    return $r;\n}\n\nfunction ne($a, $b) {\n    return q($a) !== $b;\n}\n\nfunction not(array $value, $valid = null, $keys = false, $that = null, $scope = 'static') {\n    if (!$value) {\n        return $value;\n    }\n    if (!is_callable($valid) && null !== $valid) {\n        $valid = function ($v) use ($valid) {\n            return $v === $valid;\n        };\n    }\n    $c = cue($valid, $that, $scope);\n    $r = [];\n    foreach ($value as $k => $v) {\n        if ($c($v, $k)) {\n            continue;\n        }\n        if ($keys) {\n            $r[$k] = $v;\n            continue;\n        }\n        $r[] = $v;\n    }\n    return $r;\n}\n\n// Convert property name to file name\nfunction p2f(?string $value, $accent = false) {\n    $value = implode(D, map(explode(P, strtr($value ?? \"\", \"\\\\/\", P . P)), static function ($v) use ($accent) {\n        return strtr(h($v, '-', $accent, '_') ?? \"\", ['__' => '.']);\n    }));\n    return \"\" !== $value ? $value : null;\n}\n\nfunction pair(string $value) {\n    $i = strspn($value, $c = \" \\n\\r\\t\");\n    $max = strlen($value);\n    $r = [];\n    if ($i >= $max) {\n        return $r;\n    }\n    while ($i < $max) {\n        if (0 === ($n = strcspn($value, $c . '=', $i))) {\n            break;\n        }\n        $k = substr($value, $i, $n);\n        $i += $n;\n        $i += strspn($value, $c, $i);\n        if ($i >= $max || '=' !== $value[$i]) {\n            $r[$k] = true;\n            continue;\n        }\n        ++$i;\n        if ($i >= $max || false !== strpos($c, $value[$i])) {\n            $r[$k] = \"\";\n            $i += strspn($value, $c, $i);\n            continue;\n        }\n        if ($i < $max) {\n            $q = $value[$i];\n            if (\"'\" === $q || '\"' === $q) {\n                ++$i;\n                // Attribute value is left open for some reason until the end of the stream\n                if (false === ($n = strpos($value, $q, $i))) {\n                    $r[$k] = substr($value, $i);\n                    return $r;\n                }\n                $r[$k] = substr($value, $i, $n - $i);\n                $i = $n + 1;\n                $i += strspn($value, $c, $i);\n                continue;\n            }\n        }\n        if ($n = strcspn($value, $c, $i)) {\n            $r[$k] = substr($value, $i, $n);\n            $i += $n;\n        } else {\n            $r[$k] = \"\";\n        }\n        $i += strspn($value, $c, $i);\n    }\n    return $r;\n}\n\nfunction path(?string $value) {\n    if (0 === strpos($value = strtr($value ?? \"\", '/', D), D) && 0 !== strpos($value, PATH . D)) {\n        $value = PATH . $value;\n    }\n    return stream_resolve_include_path(rtrim($value, D)) ?: null;\n}\n\nfunction pluck(array $from, string $key, $value = null, $that = null, $scope = 'static') {\n    if (!$from) {\n        return [];\n    }\n    $dot = false !== strpos(strtr($key, [\"\\\\.\" => P]), '.');\n    return map($from, function ($v, $k) use ($dot, $key, $value) {\n        if ($dot && is_array($v)) {\n            return get($v, $key) ?? $value;\n        }\n        return $v[$key] ?? $value;\n    }, $that, $scope);\n}\n\nfunction pop(array &$value, $keys = false) {\n    if ($keys) {\n        if (!$value) {\n            return null;\n        }\n        $r = $value[$key = array_key_last($value)];\n        unset($value[$key]);\n        return $r;\n    }\n    return array_pop($value);\n}\n\nfunction save(string $path, string $value, $seal = null) {\n    if (is_dir($path)) {\n        // Error\n        return null;\n    }\n    if (is_file($path)) {\n        // Skip\n        return false;\n    }\n    if (!is_dir($folder = dirname($path))) {\n        mkdir($folder, 0775, true);\n    }\n    if (is_int(file_put_contents($path, $value))) {\n        $seal && seal($path, $seal);\n        // Success\n        return path($path);\n    }\n    // Error\n    return null;\n}\n\nfunction seal(string $path, $seal = null) {\n    if (!is_dir($path) && !is_file($path)) {\n        // Skip\n        return false;\n    }\n    $seal = is_string($seal) ? octdec($seal) : ($seal ?? 0600);\n    // Success?\n    return chmod($path, $seal) ? $seal : null;\n}\n\nfunction set(array &$to, string $key, $value = null, string $join = '.') {\n    $keys = explode($join, strtr($key, [\"\\\\\" . $join => P]));\n    $k = strtr(array_pop($keys), [P => $join]);\n    while ($keys) {\n        $key = strtr(array_shift($keys), [P => $join]);\n        if (!array_key_exists($key, $to)) {\n            $to[$key] = [];\n        }\n        $to =& $to[$key];\n    }\n    return ($to[$k] = $value);\n}\n\nfunction shake(array $value, $keys = false) {\n    // <http://php.net/manual/en/function.shuffle.php#94697>\n    if ($keys) {\n        $keys = array_keys($value);\n        $values = [];\n        shuffle($keys);\n        foreach ($keys as $key) {\n            $values[$key] = $value[$key];\n        }\n        $value = $values;\n        unset($keys, $values);\n    } else {\n        shuffle($value);\n    }\n    return $value;\n}\n\nfunction shift(array &$value, $keys = false) {\n    if ($keys) {\n        if (!$value) {\n            return null;\n        }\n        $r = $value[$key = array_key_first($value)];\n        unset($value[$key]);\n        return $r;\n    }\n    return array_shift($value);\n}\n\n// Tidy file size <https://en.wikipedia.org/wiki/Byte#Multiple-byte_units>\nfunction size(float $size, ?string $unit = null, int $fix = 2, int $base = 1000) {\n    $bases = [\n        1000 => ['B', 'KB', 'MB', 'GB', 'TB'],\n        1024 => ['B', 'KiB', 'MiB', 'GiB', 'TiB']\n    ];\n    $x = $bases[$base] ?? [];\n    $u = $unit ? array_search($unit, $x) : ($size > 0 ? floor(log($size, $base)) : 0);\n    $v = round($size / pow($base, $u), $fix);\n    return $v < 0 ? null : trim($v . ' ' . ($x[$u] ?? \"\"));\n}\n\nfunction status(...$lot) {\n    if (0 === count($lot)) {\n        $r = [http_response_code(), [], []];\n        foreach ($_SERVER as $k => $v) {\n            if (0 === strpos($k, 'HTTP_')) {\n                $r[1][strtolower(strtr(substr($k, 5), '_', '-'))] = e($v);\n            }\n        }\n        if (function_exists('apache_request_headers')) {\n            $r[1] = e(array_change_key_case((array) apache_request_headers(), CASE_LOWER));\n        }\n        if (function_exists('apache_response_headers')) {\n            $r[2] = e(array_change_key_case((array) apache_response_headers(), CASE_LOWER));\n        }\n        foreach (headers_list() as $v) {\n            $v = explode(':', $v, 2);\n            if (isset($v[1])) {\n                $vv = e(trim($v[1]));\n                if (isset($r[2][$k = strtolower($v[0])]) && $vv !== $r[2][$k]) {\n                    $r[2][$k] = (array) $r[2][$k];\n                    $r[2][$k][] = $vv;\n                    continue;\n                }\n                $r[2][$k] = $vv;\n            }\n        }\n        return $r;\n    }\n    $code = array_shift($lot);\n    $values = (array) array_shift($lot);\n    // `status(['content-type' => 'text/plain'])`\n    if (is_array($code)) {\n        $values = $code;\n        $code = null;\n    }\n    // `status(200, ['content-type' => 'text/plain'])`\n    if (is_int($code)) {\n        http_response_code($code);\n    }\n    foreach ($values as $k => $v) {\n        if (false === $v || null === $v) {\n            header_remove($k);\n            continue;\n        }\n        if (is_array($v)) {\n            foreach ($v as $vv) {\n                header($k . ': ' . s($vv), false);\n            }\n            continue;\n        }\n        header($k . ': ' . s($v), true);\n    }\n}\n\n// Break dot-notation sequence into step(s)\nfunction step(string $value, string $join = '.', int $direction = 1) {\n    $value = strtr($value, [\"\\\\\" . $join => P]);\n    if (false !== strpos($value, $join)) {\n        $values = explode($join, $value);\n        $v = -1 === $direction ? array_pop($values) : array_shift($values);\n        $k = strtr(implode($join, $values), [P => $join]);\n        $c = [$k => strtr($v, [P => $join])];\n        if (-1 === $direction) {\n            while (null !== ($value = array_pop($values))) {\n                $v = strtr($value . $join . $v, [P => $join]);\n                $k = strtr(implode($join, $values), [P => $join]);\n                $c += [$k => $v];\n            }\n        } else {\n            while (null !== ($value = array_shift($values))) {\n                $v .= strtr($join . $value, [P => $join]);\n                $k = strtr(implode($join, $values), [P => $join]);\n                $c = [$k => $v] + $c;\n            }\n        }\n        return $c;\n    }\n    return [\"\" => $value];\n}\n\nfunction store(string $path, array $blob, ?string $as = null) {\n    if (!empty($blob['status'])) {\n        // Error\n        return $blob['status'];\n    }\n    if (\"\" !== trim($route = $blob['route'] ?? \"\", '/')) {\n        $path .= D . dirname($route);\n    }\n    if (is_file($file = $path . D . ($as ?? $blob['name']))) {\n        // Skip\n        return false;\n    }\n    if (!is_dir($path)) {\n        mkdir($path, 0775, true);\n    }\n    // Success?\n    return move_uploaded_file($blob['path'], $file) ? path($file) : null;\n}\n\n// Get file content line by line\nfunction stream(string $path, ?int $max = 1024) {\n    if (is_file($path) && $h = fopen($path, 'r')) {\n        $max = is_int($max) ? $max + 1 : $max;\n        while (false !== ($v = fgets($h, $max))) {\n            yield strtr($v, [\n                \"\\r\\n\" => \"\\n\",\n                \"\\r\" => \"\\n\"\n            ]);\n        }\n        fclose($h);\n    }\n    yield from [];\n}\n\nfunction cue(callable $task, $that = null, $scope = 'static') {\n    $task = $task instanceof Closure ? $task : Closure::fromCallable($task);\n    if (is_string($that)) {\n        $scope = $that;\n        $that = null;\n    }\n    return $that ? $task->bindTo($that, $scope) : $task;\n}\n\nfunction token($key = 0, $for = '+1 minute') {\n    $past = $_SESSION['token'][$key] ?? [0, \"\"];\n    if ($past[0] > time()) {\n        return $past[1];\n    }\n    $t = is_string($for) ? strtotime($for) : time() + $for;\n    $_SESSION['token'][$key] = $v = [$t, bin2hex(random_bytes(16) . $key)];\n    return $v[1];\n}\n\nfunction type(?string $type = null) {\n    if (!isset($type)) {\n        $t = status();\n        $type = $t[1]['content-type'] ?? $t[2]['content-type'] ?? null;\n        if (is_string($type)) {\n            return trim(strstr($type . ';', ';', true));\n        }\n        return null;\n    }\n    $type = trim(strstr($type . ';', ';', true));\n    status(['content-type' => $type . '; charset=utf-8']);\n}\n\nfunction ua() {\n    return $_SERVER['HTTP_USER_AGENT'] ?? null;\n}\n\nfunction zone(?string $zone = null) {\n    if (!isset($zone)) {\n        return 'UTC' !== ($zone = date_default_timezone_get()) ? $zone : null;\n    }\n    return date_default_timezone_set($zone);\n}\n\n\n// a: Convert object to array\n// b: Keep value between `$a` and `$b`\n// c: Convert text to camel case\n// d: Declare class(es) with task\n// e: Evaluate string to their data type\n// f: Filter/sanitize string\n// g: Advance PHP `glob()` function that returns iterator\n// h: Convert text to snake case with `-` (hyphen) as the default separator\n// i: Internationalization\n// j: Compare array(s) and return all item(s) that exist just once in any\n// k: Search file in a folder by query\n// l: Convert text to lower case\n// m: Normalize range margin\n// n: Normalize white-space in string\n// o: Convert array to object\n// p: Convert text to pascal case\n// q: Quantity (length of a string, number, array, and object)\n// r: Replace string\n// s: Convert data type to their string format\n// t: Trim string from prefix and suffix once\n// u: Convert text to upper case\n// v: Un-escape\n// w: Convert any data to plain word(s)\n// x: Escape\n// y: Convert iterator to plain array\n// z: Export array/object into a compact PHP data string\n\nfunction a($value, $safe = true) {\n    if ($safe && is_object($value) && 'stdClass' !== get_class($value)) {\n        return $value;\n    }\n    if (is_array($value) || is_object($value)) {\n        $value = (array) $value;\n        foreach ($value as &$v) {\n            $v = a($v, $safe);\n        }\n        unset($v);\n    }\n    return $value;\n}\n\nfunction b($value, array $range = [0, null]) {\n    if (isset($range[0]) && $value < $range[0]) {\n        return $range[0];\n    }\n    if (isset($range[1]) && $value > $range[1]) {\n        return $range[1];\n    }\n    return $value;\n}\n\nfunction c(?string $value, $accent = false, string $keep = \"\") {\n    $value = strtr(preg_replace_callback('/([ ' . ($keep = x($keep)) . ']+)([\\p{L}\\p{N}' . $keep . '])/u', static function ($m) {\n        if (' ' !== substr($m[1], -1)) {\n            return $m[1] . $m[2];\n        }\n        return $m[1] . u($m[2]);\n    }, f($value, $accent, $keep ?? \"\") ?? \"\"), [' ' => \"\"]);\n    return \"\" !== $value ? $value : null;\n}\n\nfunction d(string $folder, ?callable $task = null) {\n    spl_autoload_register(static function ($object) use ($folder, $task) {\n        $f = c2f($object);\n        if (is_file($file = $folder . D . $f . '.php')) {\n            extract(lot(), EXTR_SKIP);\n            require $file;\n            if (is_callable($task)) {\n                $task($object, $f, $file);\n            }\n        }\n    });\n}\n\nfunction e($value, array $lot = []) {\n    if (is_string($value)) {\n        if (\"\" === $value) {\n            return $value;\n        }\n        if (is_numeric($value)) {\n            if (strlen($value) > 1 && '0' === $value[0] && false === strpos($value, '.')) {\n                return $value; // Preserve as-is!\n            }\n            return false !== strpos($value, '.') ? (float) $value : (int) $value;\n        }\n        if (array_key_exists($value, $lot = array_replace([\n            'FALSE' => false,\n            'NULL' => null,\n            'TRUE' => true,\n            'false' => false,\n            'null' => null,\n            'true' => true\n        ], $lot))) {\n            return $lot[$value];\n        }\n        return $value;\n    }\n    if (is_array($value)) {\n        foreach ($value as &$v) {\n            $v = e($v, $lot);\n        }\n        unset($v);\n    }\n    return $value;\n}\n\nfunction f(?string $value, $accent = true, string $keep = \"\") {\n    // Remove HTML tag(s) and character(s) reference\n    $value = preg_replace('/<(\"[^\"]*\"|\\'[^\\']*\\'|[^>])+>|&(?>[a-z\\d]+|#\\d+|#x[a-f\\d]+);/i', ' ', $value ?? \"\");\n    if (!$accent || is_array($accent)) {\n        // If this condition is not checked, the translation below will incorrectly translate all `'0'` to `false`\n        // (which will be casted as an empty string), and so any string containing a `'0'` character will always drop\n        // that character in the output :(\n        if (false === $accent) {\n            $accent = []; // Because `(array) false` will turn into `[0 => false]` which we don’t want\n        }\n        $value = ($any = (array) lot('F')) ? strtr($value, array_replace($any, (array) $accent)) : $value;\n    }\n    $value = preg_replace([\n        // Remove anything except character(s) white-list\n        '/[^\\p{L}\\p{N}«»‘’“”\\s' . x($keep) . ']/u',\n        // Convert multiple white-space to single space\n        '/\\s+/'\n    ], ' ', $value);\n    // This function does not trim white-space at the start and end of the string\n    return \"\" !== $value ? $value : null;\n}\n\nfunction g(string $folder, $x = null, $deep = 0, $keys = true) {\n    if (!is_dir($folder)) {\n        return new IteratorG(new EmptyIterator);\n    }\n    $it = new RecursiveDirectoryIterator($folder, FilesystemIterator::SKIP_DOTS | FilesystemIterator::CURRENT_AS_PATHNAME);\n    $it = new RecursiveIteratorIterator($it, 0 === $x || null === $x ? RecursiveIteratorIterator::CHILD_FIRST : RecursiveIteratorIterator::LEAVES_ONLY);\n    $it->setMaxDepth(true === $deep ? -1 : (int) $deep);\n    return new IteratorG((function ($it, $keys, $x) {\n        $i = 0;\n        foreach ($it as $path) {\n            $f = !($d = is_dir($path));\n            if (0 === $x && !$d) {\n                continue;\n            }\n            if (1 === $x && !$f) {\n                continue;\n            }\n            if (is_string($x)) {\n                if ($d) {\n                    continue;\n                }\n                if (false === strpos(',' . strtolower($x) . ',', ',' . strtolower(pathinfo($path, PATHINFO_EXTENSION)) . ',')) {\n                    continue;\n                }\n            }\n            yield ($keys ? $path : $i) => ($keys ? ($d ? 0 : 1) : $path);\n            ++$i;\n        }\n    })($it, $keys, $x));\n}\n\nfunction h(?string $value, string $join = '-', $accent = false, string $keep = \"\") {\n    $value = strtr(preg_replace_callback('/\\p{Lu}/u', static function ($m) use ($join) {\n        return $join . l($m[0]);\n    }, f($value, $accent, $join . $keep) ?? \"\"), [\n        ' ' => $join,\n        ' ' . $join => $join,\n        $join . $join => $join\n    ]);\n    return \"\" !== $value ? $value : null;\n}\n\nfunction i(?string $value, $lot = [], ?string $or = null) {\n    if (null === $value) {\n        return;\n    }\n    $lot = (array) $lot;\n    if ($lot) {\n        // Also translate the argument(s)\n        foreach ($lot as &$v) {\n            $v = i($v);\n        }\n    }\n    $value = $raw = lot('I')[$value] ?? $or ?? $value;\n    try {\n        $value = $lot ? vsprintf($value, $lot) : $value;\n        // Also translate the result after the argument(s) are applied\n        if ($value !== $raw) { // This prevents recursive function call(s)\n            $value = i($value, [], $or);\n        }\n    } catch (Throwable $e) {}\n    return \"\" !== $value ? $value : null;\n}\n\nfunction j(array $a, array $b) {\n    $r = [];\n    foreach ($a as $k => $v) {\n        if (is_array($v)) {\n            if (!array_key_exists($k, $b) || !is_array($b[$k])) {\n                $r[$k] = $v;\n            } else {\n                if ($vv = j($v, $b[$k])) {\n                    $r[$k] = $vv;\n                }\n            }\n        } else if (!array_key_exists($k, $b) || $v !== $b[$k]) {\n            $r[$k] = $v;\n        }\n    }\n    return $r;\n}\n\nfunction k(string $folder, $x = null, $deep = 0, $keys = true, $query = [], $content = false) {\n    $strict = ($s = implode(' ', $query = (array) $query)) !== strtolower($s);\n    foreach (g($folder, $x, $deep, $keys) as $k => $v) {\n        $path = $keys ? $k : $v;\n        // Find by query in file name…\n        foreach ($query as $q) {\n            if (\"\" !== $q && false !== ($strict ? strpos($path, $q) : stripos($path, $q))) {\n                yield $k => $v;\n                continue 2;\n            }\n        }\n        // Find by query in file content…\n        if ($content && is_file($path)) {\n            foreach (stream($path, 4096) as $s) {\n                if (false !== strpbrk($s, \"\\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x0B\\x0C\\x0E\\x0F\")) {\n                    continue 2; // Maybe binary, skip!\n                }\n                foreach ($query as $q) {\n                    if (\"\" !== $q && false !== ($strict ? strpos($s, $q) : stripos($s, $q))) {\n                        yield $k => $v;\n                        continue 3;\n                    }\n                }\n            }\n        }\n    }\n}\n\nfunction l(?string $value) {\n    $value = (string) $value;\n    $value = function_exists('mb_strtolower') ? mb_strtolower($value) : strtolower($value);\n    return \"\" !== $value ? $value : null;\n}\n\nfunction m($value, array $a, array $b) {\n    // <https://stackoverflow.com/a/14224813/1163000>\n    return ($value - $a[0]) * ($b[1] - $b[0]) / ($a[1] - $a[0]) + $b[0];\n}\n\nfunction n(?string $value, $tab = '    ', string $c = ' ') {\n    $value = (string) $value;\n    // <https://stackoverflow.com/a/18870840/1163000>\n    $value = strtr($value, [\"\\xEF\\xBB\\xBF\" => \"\"]);\n    // Tab to 4 space(s), line-break to `\\n`\n    $value = strtr($value, [\n        \"\\r\\n\" => \"\\n\",\n        \"\\r\" => \"\\n\"\n    ]);\n    // Tab(s) to pad(s)\n    if (is_int($tab)) {\n        $value = explode(\"\\n\", $value);\n        foreach ($value as &$v) {\n            while (false !== ($pad = strstr($v, \"\\t\", true))) {\n                $v = $pad . str_repeat($c, $tab - ($n = strlen($pad)) % $tab) . substr($v, $n + 1);\n            }\n        }\n        unset($v);\n        $value = implode(\"\\n\", $value);\n    // Tab(s) to character(s)\n    } else if (is_string($tab)) {\n        $value = strtr($value, [\"\\t\" => $tab]);\n    }\n    return \"\" !== $value ? $value : null;\n}\n\nfunction o($value, $safe = true) {\n    if (is_array($value)) {\n        $value = $safe && array_is_list($value) ? $value : (object) $value;\n        foreach ($value as &$v) {\n            $v = o($v, $safe);\n        }\n        unset($v);\n    }\n    return $value;\n}\n\nfunction p(?string $value, $accent = false, string $keep = \"\") {\n    $value = strtr(preg_replace_callback('/([ ' . ($keep = x($keep)) . ']+)([\\p{L}\\p{N}' . $keep . '])/u', static function ($m) {\n        return $m[1] . u($m[2]);\n    }, f(' ' . $value, $accent, $keep ?? \"\") ?? \"\"), [' ' => \"\"]);\n    return \"\" !== $value ? $value : null;\n}\n\nfunction q($value) {\n    if (true === $value) {\n        return 1;\n    }\n    if (false === $value || null === $value) {\n        return 0;\n    }\n    if (is_countable($value)) {\n        return count($value);\n    }\n    if (is_float($value) || is_int($value)) {\n        return $value;\n    }\n    if (is_object($value)) {\n        if ($value instanceof EmptyIterator) {\n            return 0;\n        }\n        if ($value instanceof Traversable) {\n            if ($r = method_exists($value, 'rewind')) {\n                $value->rewind();\n            }\n            $v = iterator_count($value);\n            $r && $value->rewind();\n            return $v;\n        }\n        if ($value instanceof stdClass) {\n            return count(get_object_vars($value));\n        }\n        return 1;\n    }\n    if (is_string($value)) {\n        return function_exists('mb_strlen') ? mb_strlen($value) : strlen($value);\n    }\n    return empty($value) ? 0 : 1;\n}\n\nfunction r(?string $value, $from, $to = null, $strict = true) {\n    if (\"\" === ($value ?? \"\")) {\n        return null;\n    }\n    // `r('…', '…', '…')`\n    if (is_string($from) && is_string($to)) {\n        return \"\" !== ($value = strtr($value, [$from => $to])) ? $value : null;\n    }\n    // `r('…', ['…' => '…'])`\n    if (null === $to) {\n        return \"\" !== ($value = strtr($value, $from)) ? $value : null;\n    }\n    // `r('…', ['…', '…'], function ($c) { … })`\n    if (is_callable($to)) {\n        usort($from, function ($a, $b) {\n            return strlen($b) <=> strlen($a);\n        });\n        $i = 0;\n        $max = strlen($value);\n        $r = \"\";\n        while ($i < $max) {\n            $done = false;\n            foreach ($from as $v) {\n                $w = substr($value, $i, $n = strlen($v));\n                if ($n && ($strict ? $v === $w : 0 === strcasecmp($v, $w))) {\n                    $done = true;\n                    $i += $n;\n                    $r .= $to($w);\n                    break;\n                }\n            }\n            if (!$done) {\n                $r .= $value[$i++];\n            }\n        }\n        return \"\" !== $r ? $r : null;\n    }\n    // `r('…', ['…', '…'], '…')`\n    if (is_string($to)) {\n        $to = array_fill(0, count($from), $to);\n    }\n    // `r('…', ['…', '…'], ['…', '…'])`\n    return \"\" !== ($value = strtr($value, array_combine($from, array_replace($from, $to)))) ? $value : null;\n}\n\nfunction s($value, array $lot = []) {\n    if (is_array($value)) {\n        foreach ($value as &$v) {\n            $v = s($v, $lot);\n        }\n        unset($v);\n        return $value;\n    }\n    if (true === $value) {\n        return $lot['true'] ?? 'true';\n    }\n    if (false === $value) {\n        return $lot['false'] ?? 'false';\n    }\n    if (null === $value) {\n        return $lot['null'] ?? 'null';\n    }\n    if (is_string($value)) {\n        return $lot[$value] ?? $value;\n    }\n    if (is_object($value)) {\n        if (method_exists($value, '__toString')) {\n            return $value->__toString();\n        }\n        return json_encode($value);\n    }\n    return (string) $value;\n}\n\nfunction t(?string $value, string $open = '\"', ?string $close = null) {\n    if ($value) {\n        if (\"\" !== $open && 0 === strpos($value, $open)) {\n            $value = substr($value, strlen($open));\n        }\n        $close = $close ?? $open;\n        if (\"\" !== $close && $close === substr($value, $end = -strlen($close))) {\n            $value = substr($value, 0, $end);\n        }\n    }\n    return \"\" !== $value ? $value : null;\n}\n\nfunction u(?string $value) {\n    $value = (string) $value;\n    $value = function_exists('mb_strtoupper') ? mb_strtoupper($value) : strtoupper($value);\n    return \"\" !== $value ? $value : null;\n}\n\nfunction v(?string $value, string $c = \"'\", string $d = '-+*/=:()[]{}<>^$.?!|\\\\') {\n    $lot = [];\n    foreach (str_split($c . $d, 1) as $v) {\n        $lot[\"\\\\\" . $v] = $v;\n    }\n    return \"\" !== ($value = strtr($value ?? \"\", $lot)) ? $value : null;\n}\n\nfunction w(?string $value, $keep = [], $break = false) {\n    $value = (string) $value;\n    // Should be a HTML input (if `$keep` is not empty, assume that input is a HTML anyway)\n    if ($keep || false !== strpos($value, '<') || false !== strpos($value, ' ') || false !== strpos($value, \"\\n\")) {\n        $keep = is_string($keep) ? explode(',', $keep) : (array) $keep;\n        $value = trim(preg_replace($break ? '/[ \\t]+/' : '/\\s+/', ' ', strip_tags($value, $keep)));\n        return \"\" !== $value ? $value : null;\n    }\n    // Remove `-`, `.`, `_`, and `~` prefix/suffix from the file name then replace `-` with a space\n    $value = trim(rawurldecode(preg_replace('/[-]+/', ' ', trim($value, '-._~'))));\n    return \"\" !== $value ? $value : null;\n}\n\nfunction x(?string $value, string $c = \"'\", string $d = '-+*/=:()[]{}<>^$.?!|\\\\') {\n    return \"\" !== ($value = addcslashes($value ?? \"\", $c . $d)) ? $value : null;\n}\n\nfunction y(iterable $value, $deep = 0) {\n    if ($value instanceof Traversable) {\n        $value = iterator_to_array($value, true);\n        if (true === $deep) {\n            foreach ($value as &$v) {\n                $v = is_iterable($v) || $v instanceof stdClass ? y($v, $deep) : $v;\n            }\n            unset($v);\n            return $value;\n        }\n        if ($deep > 0) {\n            foreach ($value as &$v) {\n                $v = is_iterable($v) || $v instanceof stdClass ? y($v, $deep - 1) : $v;\n            }\n            unset($v);\n            return $value;\n        }\n        return $value;\n    }\n    return (array) $value;\n}\n\nfunction z($value, $short = true) {\n    if (is_object($value)) {\n        if ($value instanceof stdClass) {\n            return '(object)' . z((array) $value, $short);\n        }\n        if (method_exists($value, '__set_state')) {\n            $content = $stack = \"\";\n            foreach (array_slice(token_get_all('<?php ' . var_export($value, true)), 1) as $v) {\n                if (is_array($v)) {\n                    if (T_CONSTANT_ENCAPSED_STRING === $v[0]) {\n                        $content .= z(substr($v[1], 1, -1), $short);\n                        continue;\n                    }\n                    if (T_NAME_FULLY_QUALIFIED === $v[0]) {\n                        $content .= trim($v[1], \"\\\\\");\n                        continue;\n                    }\n                    if (T_WHITESPACE === $v[0]) {\n                        continue;\n                    }\n                    $content .= \"''\" === ($v = $v[1]) ? '\"\"' : ('NULL' === $v ? 'null' : $v);\n                    continue;\n                }\n                if ('(' === $v) {\n                    if ($short && 'array' === substr($content, -5)) {\n                        $content = substr($content, 0, -5) . '[';\n                        $stack .= '[';\n                        continue;\n                    }\n                    $content .= $v;\n                    $stack .= '(';\n                    continue;\n                }\n                if (')' === $v) {\n                    $content = trim($content, ',');\n                    if ($short && '[' === substr($stack, -1)) {\n                        $content .= ']';\n                        $stack = substr($stack, 0, -1);\n                        continue;\n                    }\n                    $content .= $v;\n                    $stack = substr($stack, 0, -1);\n                    continue;\n                }\n                $content .= $v;\n            }\n            return $content;\n        }\n        return 'new ' . get_class($value); // Broken :(\n    }\n    if (is_array($value)) {\n        $r = [];\n        if (array_is_list($value)) {\n            foreach ($value as $k => $v) {\n                $r[] = z($v, $short);\n            }\n        } else {\n            foreach ($value as $k => $v) {\n                $r[] = z($k, $short) . '=>' . z($v, $short);\n            }\n        }\n        return ($short ? '[' : 'array(') . implode(',', $r) . ($short ? ']' : ')');\n    }\n    $value = var_export($value, true);\n    if (\"''\" === $value) {\n        return '\"\"';\n    }\n    if ('NULL' === $value) {\n        return 'null';\n    }\n    $test = substr($value, 1);\n    if (0 === strpos($test, $v = ENGINE . D)) {\n        $value = \"ENGINE.D.'\" . strtr(substr($test, strlen($v)), [D => \"'.D.'\"]);\n    } else if (0 === strpos($test, $v = LOT . D)) {\n        $value = \"LOT.D.'\" . strtr(substr($test, strlen($v)), [D => \"'.D.'\"]);\n    } else if (0 === strpos($test, $v = PATH . D)) {\n        $value = \"PATH.D.'\" . strtr(substr($test, strlen($v)), [D => \"'.D.'\"]);\n    }\n    return $value;\n}"
  },
  {
    "path": "engine/fire.php",
    "content": "<?php !session_id() && session_start();\n\nif (defined('TEST')) {\n    if (!is_dir($folder = __DIR__ . D . 'log')) {\n        mkdir($folder, 0775, true);\n    }\n    ini_set('error_log', $folder . D . 'error');\n    if (false === TEST) {\n        error_reporting(0);\n        ini_set('display_errors', false);\n        ini_set('display_startup_errors', false);\n        ini_set('max_execution_time', 300); // 5 minute(s)\n    } else {\n        error_reporting(E_ALL);\n        ini_set('display_errors', true);\n        ini_set('display_startup_errors', true);\n        ini_set('html_errors', 0);\n    }\n}\n\nlot('F', [\n    '°' => '0',\n    '¹' => '1',\n    '²' => '2',\n    '³' => '3',\n    'À' => 'A',\n    'Á' => 'A',\n    'Â' => 'A',\n    'Ã' => 'A',\n    'Ä' => 'AE',\n    'Å' => 'A',\n    'Æ' => 'AE',\n    'Ç' => 'C',\n    'È' => 'E',\n    'É' => 'E',\n    'Ê' => 'E',\n    'Ë' => 'E',\n    'Ì' => 'I',\n    'Í' => 'I',\n    'Î' => 'I',\n    'Ï' => 'I',\n    'Ð' => 'Dj',\n    'Ñ' => 'N',\n    'Ò' => 'O',\n    'Ó' => 'O',\n    'Ô' => 'O',\n    'Õ' => 'O',\n    'Ö' => 'OE',\n    'Ø' => 'O',\n    'Ù' => 'U',\n    'Ú' => 'U',\n    'Û' => 'U',\n    'Ü' => 'UE',\n    'Ý' => 'Y',\n    'Þ' => 'TH',\n    'ß' => 'ss',\n    'à' => 'a',\n    'á' => 'a',\n    'â' => 'a',\n    'ã' => 'a',\n    'ä' => 'ae',\n    'å' => 'a',\n    'æ' => 'ae',\n    'ç' => 'c',\n    'è' => 'e',\n    'é' => 'e',\n    'ê' => 'e',\n    'ë' => 'e',\n    'ì' => 'i',\n    'í' => 'i',\n    'î' => 'i',\n    'ï' => 'i',\n    'ð' => 'dj',\n    'ñ' => 'n',\n    'ò' => 'o',\n    'ó' => 'o',\n    'ô' => 'o',\n    'õ' => 'o',\n    'ö' => 'oe',\n    'ø' => 'o',\n    'ù' => 'u',\n    'ú' => 'u',\n    'û' => 'u',\n    'ü' => 'ue',\n    'ý' => 'y',\n    'þ' => 'th',\n    'ÿ' => 'y',\n    '‘' => \"'\",\n    '’' => \"'\",\n    '“' => '\"',\n    '”' => '\"'\n]);\n\n// Map the request body to the `$_GET`, `$_POST`, and/or `$_REQUEST` variable(s) if it is an `application/json` request\n// to make it easier to process. For request type(s) other than “GET” and “POST”, the `$_REQUEST` variable can be used.\n$q = strtoupper($_SERVER['REQUEST_METHOD'] ?? \"\");\nif ('application/json' === strtolower(type() ?? \"\") && null !== ($r = json_decode(file_get_contents('php://input'), true))) {\n    if ('GET' === $q) {\n        $_GET = $_REQUEST = $r;\n    } else if ('POST' === $q) {\n        $_POST = $_REQUEST = $r;\n    } else {\n        $_REQUEST = $r;\n    }\n} else {\n    // Evaluate `$_GET`, `$_POST`, `$_REQUEST` value(s)\n    $value = [&$_GET, &$_POST, &$_REQUEST];\n    array_walk_recursive($value, static function (&$v) {\n        // Trim (right) white-space and normalize line-break\n        $v = rtrim(strtr($v, [\"\\r\\n\" => \"\\n\", \"\\r\" => \"\\n\"]));\n        // Replace all empty value with `null` and evaluate other(s)\n        $v = \"\" === $v ? null : e($v);\n    });\n    // Normalize `$_FILES` property to `$_POST`\n    if ('POST' === $q) {\n        // <https://stackoverflow.com/a/30342756/1163000>\n        $tidy = static function (array $lot) use (&$tidy) {\n            $alter = [\n                'error' => 'status',\n                'tmp_name' => 'path'\n            ];\n            $r = [];\n            if (!is_array(reset($lot))) {\n                if (isset($lot[$k = 'full_path'])) {\n                    $v = strtr($lot[$k], [D => '/']);\n                    $r['route'] = \"\" !== $v ? '/' . $v : null;\n                    unset($lot[$k]);\n                }\n                foreach ($lot as $k => $v) {\n                    $r[$alter[$k] ?? $k] = $v;\n                }\n                ksort($r);\n                return $r;\n            }\n            if (isset($lot[$k = 'full_path'])) {\n                foreach ($lot[$k] as $kk => $vv) {\n                    $vv = strtr($vv, [D => '/']);\n                    $r[$kk]['route'] = \"\" !== $vv ? '/' . $vv : null;\n                }\n                unset($lot[$k]);\n            }\n            foreach ($lot as $k => $v) {\n                foreach ($v as $kk => $vv) {\n                    $r[$kk][$alter[$k] ?? $k] = $vv;\n                }\n                ksort($r[$kk]);\n            }\n            foreach ($r as &$v) {\n                $v = $tidy($v);\n            }\n            unset($v);\n            return $r;\n        };\n        foreach ($_FILES as $k => $v) {\n            $_POST[$k] = array_replace_recursive($_POST[$k] ?? [], $tidy($v));\n        }\n    }\n}\n\n// Load class(es)…\nd($folder = __DIR__ . D . 'kernel', static function ($object, $f) use ($folder) {\n    if (is_file($file = dirname($folder) . D . 'plug' . D . $f . '.php')) {\n        extract(lot(), EXTR_SKIP);\n        require $file;\n    }\n    // Load plug(s) of extension(s) and layout(s)…\n    foreach (glob(dirname($folder, 2) . D . 'lot' . D . '{x,y}' . D . '*' . D . 'engine' . D . 'plug' . D . $f . '.php', GLOB_BRACE | GLOB_NOSORT) as $v) {\n        if (!is_file(dirname($file = stream_resolve_include_path($v), 3) . D . 'index.php')) {\n            continue; // Skip in-active extension(s) and layout(s)\n        }\n        require $file;\n    }\n});\n\n// Add a hook that will execute just before the response body is sent\nheader_register_callback(static function () {\n    Hook::fire('enter');\n});\n\n// Add a hook that will execute just after the response body is sent\nregister_shutdown_function(static function () {\n    error_get_last() && type('text/plain');\n    // This hook will also execute when the application is forced to stop by using the `exit` or `die` command\n    Hook::fire('exit');\n});\n\n// Set default state(s)…\n$state = is_file($file = __DIR__ . D . '..' . D . 'state.php') ? require $file : [];\n\nlot('state', $state = new State($state));\n\n$hash = !empty($_COOKIE['hash']) ? '#' . $_COOKIE['hash'] : null;\n$host = $_SERVER['HTTP_HOST'] ?? $_SERVER['SERVER_NAME'] ?? \"\";\n$port = (int) $_SERVER['SERVER_PORT'];\n$scheme = 'http' . (!empty($_SERVER['HTTPS']) && 'off' !== $_SERVER['HTTPS'] || 443 === $port ? 's' : \"\");\n\n[$path, $query] = array_replace([\"\", \"\"], explode('?', $_SERVER['REQUEST_URI'], 2));\n\n// Prevent directory traversal attack\n$path = trim($path, '/');\nwhile (false !== strpos($path, '../')) {\n    $path = strtr($path, ['../' => \"\"]);\n}\n\nif ($path && (false !== strpos($path, '%2F') || false !== strpos($path, '%5C'))) {\n    exit; // Nasty!\n}\n\n// If server root is `.\\srv\\http` and you have this system installed in `.\\srv\\http\\a\\s\\d\\f`\n// then the sub-folder path of this system will be `a\\s\\d\\f`\n$sub = trim(strtr(PATH . D, [rtrim(strtr($_SERVER['DOCUMENT_ROOT'] . D, '/', D), D) . D => \"\"]), D);\n\n// Remove sub-folder from path\n$path = \"\" !== $sub ? substr($path, strlen($sub) + 1) : $path;\n\n$path = \"\" !== $path ? '/' . $path : null;\n$query = \"\" !== $query ? '?' . $query : null;\n\nlot('link', $link = new Link($scheme . '://' . $host . $path . $query . $hash));\n\nfunction batch(...$lot) {\n    return Batch::from(...$lot);\n}\n\nfunction hook(...$lot) {\n    return count($lot) < 2 ? Hook::get(...$lot) : Hook::set(...$lot);\n}\n\nfunction kick(?string $to = null, ?int $status = null) {\n    $to = Hook::fire('kick', [$to, $status]);\n    header('location: ' . (\"\" === $to ? '/' : ($to ?? '/')), true, $status ?? 301);\n    exit;\n}\n\nfunction long(string $value) {\n    $base = ($link = lot('link'))->base;\n    // `long(\"\")`\n    if (\"\" === $value) {\n        return $link->current;\n    }\n    // `long('/')`\n    if ('/' === $value) {\n        return $base;\n    }\n    // `long('//127.0.0.1')`\n    if (0 === strpos($value, '//')) {\n        return $link->scheme . $value;\n    }\n    if (\n        0 === strpos($value, 'blob:') ||\n        0 === strpos($value, 'data:') ||\n        0 === strpos($value, 'javascript:') ||\n        0 === strpos($value, 'mailto:') ||\n        false !== strpos($value, '://')\n    ) {\n        return $value;\n    }\n    // `long('./foo/bar')`\n    if ($value === '.' || 0 === strpos($value, './')) {\n        $value = substr($value, 1);\n    }\n    // `long('/foo/bar')`\n    if (0 === strpos($value, '/')) {\n        return $base . (strspn($value = substr($value, 1), '?&#') ? \"\" : '/') . $value;\n    }\n    $path = substr($v = $link->current, 0, strcspn($v, '?&#'));\n    // `long('foo/bar')`\n    if ($value && strcspn($value, '.?&#') && $path !== $base) {\n        $path = dirname($path);\n    }\n    // `long('../foo/bar')`\n    while (0 === strpos($value, '../') && $path !== $base) {\n        $path = dirname($path);\n        $value = substr($value, 3);\n    }\n    return strtr(rtrim($path . '/' . ltrim($value, '/'), '/'), [\n        '/#' => '#',\n        '/&' => '?',\n        '/?' => '?'\n    ]);\n}\n\nfunction short(string $value) {\n    $base = ($link = lot('link'))->base;\n    if (0 === strpos($value, '//')) {\n        $value = $link->scheme . substr($value, 2);\n    }\n    // Ignore external link(s)\n    if (0 !== strpos($value . '/', $base . '/')) {\n        return $value;\n    }\n    return \"\" === ($value = substr($value, strlen($base))) ? '/' : (0 === strpos($value, '&') ? '?' . substr($value, 1) : $value);\n}\n\nfunction state(...$lot) {\n    if (count($lot) < 2) {\n        $lot[] = true; // Force to array\n        return State::get(...$lot);\n    }\n    return State::set(...$lot);\n}\n\ntry {\n    $uses = [];\n    foreach (glob(dirname(__DIR__) . D . 'lot' . D . '{x,y}' . D . '*' . D . 'index.php', GLOB_BRACE | GLOB_NOSORT) as $v) {\n        $n = basename($folder = dirname($v = stream_resolve_include_path($v)));\n        if (empty(lot(strtoupper($r = basename(dirname($folder))))[0][$v])) {\n            $uses[$v] = content($folder . D . '.stack') ?? $r . '.' . $n;\n            // Load state(s)…\n            State::set($r . '.' . ($k = strtr($n, ['.' => \"\\\\.\"])), []);\n            if (is_file($v = $folder . D . 'state.php')) {\n                (static function ($k, $v, $lot) {\n                    extract(lot(), EXTR_SKIP);\n                    State::set($r . '.' . $k, array_replace_recursive((array) require $v, $lot));\n                })($k, $v, $state[$r][$n] ?? []);\n            }\n        }\n    }\n    natsort($uses);\n    foreach ($uses = array_keys($uses) as $use) {\n        lot(strtoupper(basename(dirname($use, 2))))[1][] = $use;\n    }\n    // Load class(es)…\n    foreach ($uses as $v) {\n        d($folder = dirname($v) . D . 'engine' . D . 'kernel', static function ($object, $f) use ($folder) {\n            if (is_file($file = dirname($folder) . D . 'plug' . D . $f . '.php')) {\n                extract(lot(), EXTR_SKIP);\n                require $file;\n            }\n            // Load plug(s) of other extension(s) and layout(s)…\n            foreach (glob(dirname($folder, 3) . D . '*' . D . 'engine' . D . 'plug' . D . $f . '.php', GLOB_BRACE | GLOB_NOSORT) as $v) {\n                if ($file === ($v = stream_resolve_include_path($v))) {\n                    continue; // Skip current plug\n                }\n                if (!is_file(dirname($v, 3) . D . 'index.php')) {\n                    continue; // Skip in-active extension(s) and layout(s)\n                }\n                require $v;\n            }\n        });\n    }\n    // Load extension(s) and layout(s)…\n    foreach ($uses as $v) {\n        (static function ($v) {\n            // Load task(s)…\n            if (is_file($k = dirname($v) . D . 'task.php')) {\n                (static function ($k) {\n                    extract(lot(), EXTR_SKIP);\n                    require $k;\n                })($k);\n            }\n            extract(lot(), EXTR_SKIP);\n            require $v;\n        })($v);\n    }\n} catch (Throwable $e) {\n    // Core error?\n    if (0 === strpos($file = $e->getFile(), ENGINE . D)) {\n        file_put_contents(ENGINE . D . 'log' . D . 'error', ((string) $e) . PHP_EOL, FILE_APPEND);\n    // Catch error that occurs in the extension and layout file(s) then immediately disable!\n    } else {\n        [$k, $name] = explode(D, substr($file, strlen($folder = LOT . D)), 3);\n        file_put_contents(ENGINE . D . 'log' . D . 'error-' . $k, ((string) $e) . PHP_EOL, FILE_APPEND);\n        rename($folder . $k . D . $name . D . 'index.php', $folder . $k . D . $name . D . '.index.php');\n    }\n}\n\n// Set default response status and header(s)\nstatus(403, ['x-powered-by' => 'Mecha/' . VERSION]);\n\n// Set default response type\ntype('text/' . (error_get_last() ? 'plain' : 'html'));\n\n// Set default time zone and locale\nzone($state->zone);\n\n// Run task(s) if any…\nif (is_file($task = PATH . D . 'task.php')) {\n    (static function ($f) {\n        extract(lot(), EXTR_SKIP);\n        require $f;\n    })($task);\n}\n\n// Reset all possible global variable(s) to keep the presence of user-defined variable(s) clean. We don’t use\n// special feature to define variable in the response so clearing user data on global scope becomes necessary.\nunset($e, $f, $file, $folder, $hash, $host, $k, $n, $name, $path, $port, $q, $query, $r, $scheme, $sub, $task, $use, $uses, $v, $value, $x);\n\nHook::fire(['set', 'get', 'let']);"
  },
  {
    "path": "engine/kernel/batch.php",
    "content": "<?php\n\nclass Batch extends Proxy {\n\n    protected $join;\n    protected $lot;\n\n    protected static $c = [];\n\n    public function __call(string $kin, array $lot = []) {\n        return $this->__get__($kin) ? $this->{$kin} : parent::__call($kin, $lot);\n    }\n\n    public function __construct(iterable $lot = [], string $join = ', ') {\n        $this->join = $join;\n        $this->lot = y($lot);\n    }\n\n    public function __get(string $key): mixed {\n        return $this->__fire__($key) ? $this->{$key}() : $this->__call($key);\n    }\n\n    public function __invoke(string $join = ', ', $valid = true): mixed {\n        return implode($join, $valid ? is($this->lot, is_callable($valid) ? $valid : function ($v, $k) {\n            // Ignore value(s) that cannot be converted to a string\n            if (is_array($v) || is_object($v) && !method_exists($v, '__toString')) {\n                return false;\n            }\n            // Ignore `false` and `null` value(s)\n            return false !== $v && null !== $v;\n        }, false, $this) : $this->lot);\n    }\n\n    public function __toString(): string {\n        return (string) $this->join($this->join);\n    }\n\n    public function all($valid) {\n        return all($this->lot, $valid, $this);\n    }\n\n    public function any($valid) {\n        return any($this->lot, $valid, $this);\n    }\n\n    public function batch() {\n        return 0 !== ($r = self::$c[spl_object_id($this)][0] ?? 0) ? new static($r, $this->join) : $this;\n    }\n\n    public function chunk(int $step = 5, int $at = -1, $keys = false) {\n        $that = new static($this->lot, $this->join);\n        if ($step < 1) {\n            return $that;\n        }\n        self::$c[spl_object_id($that)] = [$lot = $that->lot, $step];\n        $lot = array_chunk($lot, $step, $keys);\n        if ($at > -1) {\n            $lot = $lot[$at] ?? [];\n        }\n        $that->lot = $lot;\n        return $that;\n    }\n\n    public function count(): int {\n        return count($this->lot);\n    }\n\n    public function find(callable $valid) {\n        return find($this->lot, $valid, $this);\n    }\n\n    public function first() {\n        return first($this->lot);\n    }\n\n    public function get(?string $key = null) {\n        if (!$this->lot) {\n            return null;\n        }\n        return isset($key) ? get($this->lot, $key) : $this->lot;\n    }\n\n    public function getIterator(): Traversable {\n        return new ArrayIterator($this->lot);\n    }\n\n    public function has(?string $key) {\n        return has($this->lot, $key);\n    }\n\n    public function index(string $key) {\n        if (!($lot = $this->lot) || !array_key_exists($key, $lot)) {\n            return null;\n        }\n        $at = 0;\n        foreach ($lot as $k => $v) {\n            if ($key === $k) {\n                return $at;\n            }\n            ++$at;\n        }\n        return null;\n    }\n\n    public function is(callable $valid, $keys = false) {\n        return new static(is($this->lot, $valid, $keys, $this), $this->join);\n    }\n\n    public function join(string $join = ', ') {\n        return $this->__invoke($join);\n    }\n\n    public function key(int $index) {\n        if ($index < 0 || $index >= $this->count()) {\n            return null;\n        }\n        $at = 0;\n        foreach ($this->lot as $k => $v) {\n            if ($index === $at) {\n                return $k;\n            }\n            ++$at;\n        }\n        return null;\n    }\n\n    public function keys() {\n        return new static(array_keys($this->lot), $this->join);\n    }\n\n    public function last() {\n        return last($this->lot);\n    }\n\n    public function let(?string $key = null) {\n        if (isset($key)) {\n            return let($this->lot, $key);\n        }\n        $this->lot = [];\n        return true;\n    }\n\n    public function limit(int $limit = 5, $keys = false) {\n        return $this->slice(0, $limit, $keys);\n    }\n\n    public function map(callable $at) {\n        return new static(map($this->lot, $at, $this), $this->join);\n    }\n\n    public function not($valid, $keys = false) {\n        return new static(not($this->lot, $valid, $keys, $this), $this->join);\n    }\n\n    public function offsetExists($key): bool {\n        return array_key_exists($key, $this->lot);\n    }\n\n    public function offsetGet($key): mixed {\n        return $this->lot[$key] ?? null;\n    }\n\n    public function offsetSet($key, $value): void {\n        if (isset($key)) {\n            $this->lot[$key] = $value;\n        } else {\n            $this->lot[] = $value;\n        }\n    }\n\n    public function offsetUnset($key): void {\n        unset($this->lot[$key]);\n    }\n\n    public function pluck(string $key, $value = null) {\n        return new static(pluck($this->lot, $key, $value, $this), $this->join);\n    }\n\n    public function pop($keys = false) {\n        return pop($this->lot, $keys);\n    }\n\n    public function reverse($keys = false) {\n        return new static(array_reverse($this->lot, $keys), $this->join);\n    }\n\n    public function set($key, $value = null) {\n        return set($this->lot, $key, $value);\n    }\n\n    public function shake($keys = false) {\n        return new static(shake($this->lot, $keys), $this->join);\n    }\n\n    public function shift($keys = false) {\n        return shift($this->lot, $keys);\n    }\n\n    public function slice(int $at, ?int $limit = null, $keys = false) {\n        return new static(array_slice($this->lot, $at, $limit, $keys), $this->join);\n    }\n\n    public function sort($sort = 1, $keys = false) {\n        if (count($lot = $this->lot) < 2) {\n            if (!$keys && $lot) {\n                $this->lot = [current($lot)];\n            }\n            return $this;\n        }\n        if (is_callable($sort)) {\n            $c = cue($sort, $this);\n            $keys ? uasort($lot, $c) : usort($lot, $c);\n            $this->lot = $lot;\n            return $this;\n        }\n        if (is_array($sort)) {\n            [$d, $k, $v] = array_replace([1, \"\", null], $sort);\n        } else {\n            $d = $sort;\n            $k = $v = null;\n        }\n        $desc = -1 === $d || SORT_DESC === $d;\n        if (null !== $k) {\n            $c = is_string($k) && false !== strpos(strtr($k, [\"\\\\.\" => P]), '.') ? static function ($a, $b) use ($desc, $k, $v) {\n                $a = is_array($a) ? (get($a, $k) ?? $v) : $v;\n                $b = is_array($b) ? (get($b, $k) ?? $v) : $v;\n                $c = $a <=> $b;\n                return $desc ? -$c : $c;\n            } : static function ($a, $b) use ($desc, $k, $v) {\n                $a = is_array($a) ? ($a[$k] ?? $v) : $v;\n                $b = is_array($b) ? ($b[$k] ?? $v) : $v;\n                $c = $a <=> $b;\n                return $desc ? -$c : $c;\n            };\n            $keys ? uasort($lot, $c) : usort($lot, $c);\n        } else {\n            $keys ? ($desc ? arsort($lot) : asort($lot)) : ($desc ? rsort($lot) : sort($lot));\n        }\n        $this->lot = $lot;\n        return $this;\n    }\n\n    public function step() {\n        return self::$c[spl_object_id($this)][1] ?? 1;\n    }\n\n    public function total() {\n        return count(self::$c[spl_object_id($this)][0] ?? $this->lot);\n    }\n\n    public function values() {\n        return new static(array_values($this->lot), $this->join);\n    }\n\n    public function with($key, $value = null) {\n        if (!$this->lot) {\n            return $this;\n        }\n        $deep = is_string($key) && false !== strpos(strtr($key, [\"\\\\.\" => P]), '.');\n        $lot =& $this->lot;\n        if (!is_string($value) && is_callable($value)) {\n            $c = cue($value, $this);\n            foreach ($lot as $k => &$v) {\n                if (!is_array($v)) {\n                    continue;\n                }\n                $deep ? set($v, $key, $c($v, $k)) : ($v[$key] = $c($v, $k));\n            }\n        } else {\n            foreach ($lot as &$v) {\n                if (!is_array($v)) {\n                    continue;\n                }\n                $deep ? set($v, $key, $value) : ($v[$key] = $value);\n            }\n        }\n        unset($lot, $v);\n        return $this;\n    }\n\n    public static function from(...$lot) {\n        if (isset($lot[0]) && is_string($lot[0])) {\n            $lot[0] = explode($lot[1] ?? ', ', $lot[0]);\n        }\n        return new static(...$lot);\n    }\n\n}"
  },
  {
    "path": "engine/kernel/file.php",
    "content": "<?php\n\nclass File extends Proxy {\n\n    public $path;\n\n    public function __call(string $kin, array $lot = []) {\n        return $this->__get__($kin) ? $this->{$kin} : parent::__call($kin, $lot);\n    }\n\n    public function __construct($path = null) {\n        if (is_string($path = path($path)) && 0 === strpos($path, PATH . D)) {\n            $this->path = is_file($path) ? $path : null;\n        }\n    }\n\n    public function __get(string $key): mixed {\n        return $this->__fire__($key) ? $this->{$key}() : $this->__call($key);\n    }\n\n    public function __isset(string $key): bool {\n        return null !== $this->__get($key);\n    }\n\n    public function __serialize(): array {\n        $lot = parent::__serialize();\n        if (is_string($path = $lot['path'] ?? 0) && 0 === strpos($path, PATH . D)) {\n            $lot['path'] = '.' . strtr(substr($path, strlen(PATH)), [D => \"\\\\\"]);\n        }\n        return $lot;\n    }\n\n    public function __toString(): string {\n        if (is_string($path = $this->path)) {\n            if (0 === strpos($path, PATH . D)) {\n                return '.' . strtr(substr($path, strlen(PATH)), [D => \"\\\\\"]);\n            }\n        }\n        return \"\";\n    }\n\n    public function __unserialize(array $lot): void {\n        if (is_string($path = $lot['path'] ?? 0) && 0 === strpos($path, \".\\\\\")) {\n            $lot['path'] = PATH . strtr(substr($path, 1), [\"\\\\\" => D]);\n        }\n        parent::__unserialize($lot);\n    }\n\n    public function _aTime() {\n        return is_string($path = $this->path) ? fileatime($path) : null;\n    }\n\n    public function _cTime() {\n        return $this->_time();\n    }\n\n    public function _mTime() {\n        return is_string($path = $this->path) ? filemtime($path) : null;\n    }\n\n    public function _seal() {\n        return is_string($path = $this->path) ? (fileperms($path) & 0777) : null;\n    }\n\n    public function _size() {\n        return is_string($path = $this->path) ? filesize($path) : null;\n    }\n\n    public function _time() {\n        return is_string($path = $this->path) ? filectime($path) : null;\n    }\n\n    public function ID() {\n        return ($route = $this->route()) ? sprintf('%u', crc32($route)) : null;\n    }\n\n    public function aTime(?string $pattern = null) {\n        return $this->time($pattern, $this->_aTime());\n    }\n\n    public function cTime(?string $pattern = null) {\n        return $this->time($pattern);\n    }\n\n    public function content() {\n        if (is_string($path = $this->path) && false !== ($content = file_get_contents($path))) {\n            return $content;\n        }\n        return null;\n    }\n\n    public function count(): int {\n        return $this->path ? 1 : 0;\n    }\n\n    public function exist() {\n        return $this->path ?? false;\n    }\n\n    public function link() {\n        return ($route = $this->route()) ? new Link(long($route)) : null;\n    }\n\n    public function mTime(?string $pattern = null) {\n        return $this->time($pattern, $this->_mTime());\n    }\n\n    public function name(...$lot) {\n        if (is_string($path = $this->path)) {\n            if (true === ($x = array_shift($lot) ?? false)) {\n                return basename($path);\n            }\n            return pathinfo($path, PATHINFO_FILENAME) . (is_string($x) ? '.' . $x : \"\");\n        }\n        return null;\n    }\n\n    public function parent() {\n        return is_string($path = $this->path) ? new Folder(dirname($path)) : null;\n    }\n\n    public function route() {\n        return is_string($path = $this->path) ? '/' . strtr(rawurlencode(trim(strtr($path, [PATH . D => '/', D => '/']), '/')), ['%2F' => '/']) : null;\n    }\n\n    public function seal() {\n        return is_int($seal = $this->_seal()) ? substr(sprintf('%o', $seal), -3) : null;\n    }\n\n    public function size(?string $unit = null, int $fix = 2, int $base = 1000) {\n        return is_int($size = $this->_size()) ? size($size, $unit, $fix, $base) : null;\n    }\n\n    public function stream(?int $max = 1024): Traversable {\n        return is_string($path = $this->path) ? stream($path, $max) : new EmptyIterator;\n    }\n\n    public function time(?string $pattern = null, ?int $time = null) {\n        if (is_int($time ??= $this->_time())) {\n            $t = new Time($time);\n            return $pattern ? $t($pattern) : $t;\n        }\n        return null;\n    }\n\n    public function type() {\n        if (!is_string($path = $this->path)) {\n            return null;\n        }\n        // Even with the `finfo` feature available, the return type value is sometimes still messed up :(\n        static $fix = [\n            // <https://www.rfc-editor.org/rfc/rfc4287.html#section-2>\n            'atom' => 'application/atom+xml',\n            // <https://www.rfc-editor.org/rfc/rfc2318.html#section-4>\n            'css' => 'text/css',\n            // <https://www.rfc-editor.org/rfc/rfc4180.html#section-3>\n            'csv' => 'text/csv',\n            'html' => 'text/html',\n            // <https://www.rfc-editor.org/rfc/rfc9239.html#section-6.1>\n            'js' => 'text/javascript',\n            // <https://www.rfc-editor.org/rfc/rfc8259.html#section-1.2>\n            'json' => 'application/json',\n            // <https://www.rfc-editor.org/rfc/rfc7519.html#section-10.3.1>\n            'jwt' => 'application/jwt',\n            // <https://www.rfc-editor.org/rfc/rfc7763.html#section-2>\n            'markdown' => 'text/markdown',\n            'md' => 'text/markdown',\n            // <https://www.rfc-editor.org/rfc/rfc9239.html#section-6>\n            'mjs' => 'text/javascript',\n            // <https://www.php.net/manual/en/install.unix.apache2.php>\n            'php' => 'application/x-httpd-php',\n            'phps' => 'application/x-httpd-php-source',\n            'phtm' => 'application/x-httpd-php',\n            'phtml' => 'application/x-httpd-php',\n            // <https://www.iana.org/assignments/media-types/image/svg+xml>\n            'svg' => 'image/svg+xml',\n            // <https://www.iana.org/assignments/media-types/text/tab-separated-values>\n            'tsv' => 'text/tab-separated-values',\n            // <https://www.iana.org/assignments/media-types/text/vtt>\n            'vtt' => 'text/vtt',\n            // <https://www.rfc-editor.org/rfc/rfc7303.html#section-4.1>\n            'xml' => 'application/xml',\n            // <https://www.rfc-editor.org/rfc/rfc9512.html#section-2>\n            'yaml' => 'application/yaml',\n            'yml' => 'application/yaml'\n        ];\n        if (isset($fix[$x = $this->x() ?? 0])) {\n            return $fix[$x];\n        }\n        if (0 === filesize($path)) {\n            return 'text/plain'; // `application/x-empty`\n        }\n        if (function_exists('finfo_open')) {\n            static $c = [];\n            static $f;\n            if (isset($c[$path])) {\n                return $c[$path];\n            }\n            $f ??= finfo_open(FILEINFO_MIME_TYPE);\n            $c[$path] = $type = finfo_file($f, $path);\n        } else {\n            $type = mime_content_type($path);\n        }\n        return is_string($type) && \"\" !== $type ? $type : null;\n    }\n\n    public function x() {\n        if (is_string($path = $this->path)) {\n            return false !== strpos(basename($path), '.') ? strtolower(pathinfo($path, PATHINFO_EXTENSION)) : null;\n        }\n        return null;\n    }\n\n    public static function __set_state(array $lot): object {\n        return new static($lot['path'] ?? null);\n    }\n\n    public static function from(...$lot) {\n        return new static(...$lot);\n    }\n\n}"
  },
  {
    "path": "engine/kernel/folder.php",
    "content": "<?php\n\nclass Folder extends Proxy {\n\n    public $path;\n\n    public function __call(string $kin, array $lot = []) {\n        return $this->__get__($kin) ? $this->{$kin} : parent::__call($kin, $lot);\n    }\n\n    public function __construct($path = null) {\n        if (is_string($path = path($path)) && 0 === strpos($path, PATH . D)) {\n            $this->path = is_dir($path) ? $path : null;\n        }\n    }\n\n    public function __get(string $key): mixed {\n        return $this->__fire__($key) ? $this->{$key}() : $this->__call($key);\n    }\n\n    public function __isset(string $key): bool {\n        return null !== $this->__get($key);\n    }\n\n    public function __serialize(): array {\n        $lot = parent::__serialize();\n        if (is_string($path = $lot['path'] ?? 0) && 0 === strpos($path, PATH . D)) {\n            $lot['path'] = '.' . strtr(substr($path, strlen(PATH)), [D => \"\\\\\"]);\n        }\n        return $lot;\n    }\n\n    public function __toString(): string {\n        if (is_string($path = $this->path)) {\n            if (0 === strpos($path, PATH . D)) {\n                return '.' . strtr(substr($path, strlen(PATH)), [D => \"\\\\\"]);\n            }\n        }\n        return \"\";\n    }\n\n    public function __unserialize(array $lot): void {\n        if (is_string($path = $lot['path'] ?? 0) && 0 === strpos($path, \".\\\\\")) {\n            $lot['path'] = PATH . strtr(substr($path, 1), [\"\\\\\" => D]);\n        }\n        parent::__unserialize($lot);\n    }\n\n    public function _seal() {\n        return is_string($path = $this->path) ? (fileperms($path) & 0777) : null;\n    }\n\n    public function _size() {\n        if (is_string($path = $this->path)) {\n            // Scan all file(s) to get the total size\n            $size = 0;\n            foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS)) as $v) {\n                $size += $v->getSize();\n            }\n            return $size;\n        }\n        return null;\n    }\n\n    public function _aTime() {\n        return is_string($path = $this->path) ? fileatime($path) : null;\n    }\n\n    public function _cTime() {\n        return $this->_time();\n    }\n\n    public function _mTime() {\n        return is_string($path = $this->path) ? filemtime($path) : null;\n    }\n\n    public function _time() {\n        return is_string($path = $this->path) ? filectime($path) : null;\n    }\n\n    public function ID() {\n        return ($route = $this->route()) ? sprintf('%u', crc32($route)) : null;\n    }\n\n    public function aTime(?string $pattern = null) {\n        return $this->time($pattern, $this->_aTime());\n    }\n\n    public function cTime(?string $pattern = null) {\n        return $this->time($pattern);\n    }\n\n    public function content() {\n        return null;\n    }\n\n    public function count(): int {\n        return $this->path ? 1 : 0;\n    }\n\n    public function exist() {\n        return $this->path ?? false;\n    }\n\n    public function link() {\n        return ($route = $this->route()) ? new Link(long($route)) : null;\n    }\n\n    public function mTime(?string $pattern = null) {\n        return $this->time($pattern, $this->_mTime());\n    }\n\n    public function name() {\n        return is_string($path = $this->path) ? basename($path) : null;\n    }\n\n    public function parent() {\n        return is_string($path = $this->path) ? new static(dirname($path)) : null;\n    }\n\n    public function route() {\n        return is_string($path = $this->path) ? '/' . strtr(rawurlencode(trim(strtr($path, [PATH . D => '/', D => '/']), '/')), ['%2F' => '/']) : null;\n    }\n\n    public function seal() {\n        return is_int($seal = $this->_seal()) ? substr(sprintf('%o', $seal), -3) : null;\n    }\n\n    public function size(?string $unit = null, int $fix = 2, int $base = 1000) {\n        return is_int($size = $this->_size()) ? size($size, $unit, $fix, $base) : null;\n    }\n\n    public function stream($x = null, $deep = 0): Traversable {\n        if (is_string($path = $this->path)) {\n            foreach (g($path, $x, $deep) as $k => $v) {\n                yield $k => 0 === $v ? new static($k) : new File($k);\n            }\n        }\n        return new EmptyIterator;\n    }\n\n    public function time(?string $pattern = null, ?int $time = null) {\n        if (is_int($time ??= $this->_time())) {\n            $t = new Time($time);\n            return $pattern ? $t($pattern) : $t;\n        }\n        return null;\n    }\n\n    public function type() {\n        return null;\n    }\n\n    public function x() {\n        return null;\n    }\n\n    public static function __set_state(array $lot): object {\n        return new static($lot['path'] ?? null);\n    }\n\n    public static function from(...$lot) {\n        return new static(...$lot);\n    }\n\n}"
  },
  {
    "path": "engine/kernel/from.php",
    "content": "<?php\n\nclass From extends Proxy {\n\n    private function __construct() {}\n\n    public static function __callStatic(string $kin, array $lot = []) {\n        return parent::_($kin) ? parent::__callStatic($kin, $lot) : $lot[0];\n    }\n\n}"
  },
  {
    "path": "engine/kernel/h-t-m-l.php",
    "content": "<?php\n\nclass HTML extends XML {\n\n    protected $raw = [\n        'script' => 1,\n        'style' => 1,\n        'textarea' => 1\n    ];\n\n    // <https://www.w3.org/TR/2011/WD-html-markup-20110113/syntax.html#void-element>\n    protected $void = [\n        'area' => 1,\n        'base' => 1,\n        'br' => 1,\n        'col' => 1,\n        'command' => 1,\n        'embed' => 1,\n        'hr' => 1,\n        'img' => 1,\n        'input' => 1,\n        'keygen' => 1,\n        'link' => 1,\n        'meta' => 1,\n        'param' => 1,\n        'source' => 1,\n        'track' => 1,\n        'wbr' => 1\n    ];\n\n    public function __construct($value = [], $deep = false, $strict = null) {\n        parent::__construct($value, $deep, $strict ?? (is_string($value) && '/>' === substr($value, -2)));\n    }\n\n}"
  },
  {
    "path": "engine/kernel/hook.php",
    "content": "<?php\n\nclass Hook extends Proxy {\n\n    private function __construct() {}\n\n    protected static $current;\n    protected static $lot;\n\n    public static function fire($name, array $lot = [], $that = null, $scope = null) {\n        $c = static::class;\n        if (is_array($name)) {\n            foreach ($name as $v) {\n                if (null !== ($r = self::fire($v, $lot, $that, $scope))) {\n                    $lot[0] = $r;\n                }\n            }\n        } else {\n            self::$current[$c] = $name;\n            if (!isset(self::$lot[1][$c][$name])) {\n                self::$lot[1][$c][$name] = [];\n                return $lot[0] ?? null;\n            }\n            if (null !== $that) {\n                foreach (self::$lot[1][$c][$name] as $v) {\n                    if (null !== ($r = fire($v['task'], $lot, $that, $scope))) {\n                        $lot[0] = $r;\n                    }\n                }\n            } else {\n                foreach (self::$lot[1][$c][$name] as $v) {\n                    if (null !== ($r = fire($v['task'], $lot))) {\n                        $lot[0] = $r;\n                    }\n                }\n            }\n        }\n        return $lot[0] ?? null;\n    }\n\n    public static function get(?string $name = null) {\n        $c = static::class;\n        if (isset($name)) {\n            return self::$lot[1][$c][$name] ?? null;\n        }\n        return self::$lot[1][$c] ?? [];\n    }\n\n    public static function is(?string $name = null) {\n        $c = static::class;\n        return isset($name) ? self::$current[$c] === $name : self::$current[$c];\n    }\n\n    public static function let($name = null, ?callable $task = null) {\n        $c = static::class;\n        if (is_string($task)) {\n            $task = trim($task, \"\\\\\");\n        }\n        if (is_array($name)) {\n            foreach ($name as $v) {\n                self::let($v, $name);\n            }\n        } else if (isset($name)) {\n            if (isset(self::$lot[1][$c][$name])) {\n                if (isset($task)) {\n                    self::$lot[0][$c][$name] = [];\n                    foreach (self::$lot[1][$c][$name] as $k => $v) {\n                        if ($v['task'] === $task) {\n                            self::$lot[0][$c][$name][is_object($task) ? spl_object_id($task) : $task] = $v;\n                            unset(self::$lot[1][$c][$name][$k]);\n                        }\n                    }\n                } else {\n                    self::$lot[0][$c][$name] = 1;\n                    unset(self::$lot[1][$c][$name]);\n                }\n            } else {\n                if (isset($task)) {\n                    self::$lot[0][$c][$name][is_object($task) ? spl_object_id($task) : $task] = 1;\n                } else {\n                    self::$lot[0][$c][$name] = 1;\n                }\n            }\n        } else {\n            self::$lot[1][$c] = [];\n        }\n    }\n\n    public static function set($name, callable $task, float $stack = 10) {\n        $c = static::class;\n        if (is_string($task)) {\n            $task = trim($task, \"\\\\\");\n        }\n        if (is_array($name)) {\n            foreach ($name as $v) {\n                self::set((string) $v, $task, $stack);\n            }\n        } else {\n            if (!empty(self::$lot[0][$c][$name][is_object($task) ? spl_object_id($task) : $task])) {\n                // Skip!\n            } else {\n                if (!isset(self::$lot[1][$c][$name])) {\n                    self::$lot[1][$c][$name] = [];\n                }\n                self::$lot[1][$c][$name][] = [\n                    'stack' => (float) $stack,\n                    'task' => $task\n                ];\n                if (count(self::$lot[1][$c][$name]) > 1) {\n                    usort(self::$lot[1][$c][$name], function ($a, $b) {\n                        return $a['stack'] <=> $b['stack'];\n                    });\n                }\n            }\n        }\n    }\n\n}"
  },
  {
    "path": "engine/kernel/is.php",
    "content": "<?php\n\nclass Is extends Proxy {\n\n    private function __construct() {}\n\n    public static function __callStatic(string $kin, array $lot = []) {\n        return parent::_($kin) ? parent::__callStatic($kin, $lot) : null;\n    }\n\n    // Check for IP address\n    public static function IP($value) {\n        return false !== filter_var($value, FILTER_VALIDATE_IP);\n    }\n\n    // Check for JSON pattern\n    public static function JSON($value) {\n        if (!is_string($value) || \"\" === ($value = trim($value))) {\n            return false;\n        }\n        return json_validate($value);\n    }\n\n    // Check for email address\n    public static function email($value) {\n        return false !== filter_var($value, FILTER_VALIDATE_EMAIL);\n    }\n\n    // Check for valid file name\n    public static function file($value) {\n        return is_string($value) && strlen($value) <= 260 && is_file($value);\n    }\n\n    // Check for valid folder name\n    public static function folder($value) {\n        return is_string($value) && strlen($value) <= 260 && is_dir($value);\n    }\n\n    // Check for link address\n    public static function link($value) {\n        return false !== filter_var($value, FILTER_VALIDATE_URL);\n    }\n\n    // Check for valid local path address (whether it is exists or not)\n    public static function path($value, $exist = false) {\n        if (!is_string($value)) {\n            return false;\n        }\n        return 0 === strpos($value, PATH . D) && false === strpos($value, \"\\n\") && (!$exist || stream_resolve_include_path($value));\n    }\n\n    // Check for valid serial string <https://github.com/WordPress/wordpress-develop/blob/5.9/src/wp-includes/functions.php#L660-L716>\n    public static function serial($value) {\n        // If it isn’t a string, it isn’t serialized\n        if (!is_string($value)) {\n            return false;\n        }\n        $value = trim($value);\n        if ('N;' === $value) {\n            return true;\n        }\n        if (strlen($value) < 4) {\n            return false;\n        }\n        if (':' !== $value[1]) {\n            return false;\n        }\n        if ($value && strcspn($value, ';}', -1)) {\n            return false;\n        }\n        $v = $value[0];\n        if ('s' === $v && false === strpos($value, '\"')) {\n            return false;\n        }\n        if (strspn($v, 'Oa')) {\n            return (bool) preg_match('/^' . $v . ':[0-9]+:/s', $value);\n        }\n        if (strspn($v, 'bdi')) {\n            return (bool) preg_match('/^' . $v . ':[0-9.E+-]+;$/', $value);\n        }\n        return false;\n    }\n\n    // Check for valid boolean value\n    public static function toggle($value) {\n        return null !== filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);\n    }\n\n    // Check for empty string, array or object\n    public static function void($value) {\n        if ($value instanceof Traversable) {\n            $value->rewind();\n            return !$value->valid();\n        }\n        // `0` integer and `0` string is not considered void\n        return (\n            \"\" === $value ||\n            false === $value ||\n            null === $value ||\n            is_string($value) && \"\" === trim($value) ||\n            is_array($value) && empty($value) ||\n            is_object($value) && empty((array) $value)\n        );\n    }\n\n}"
  },
  {
    "path": "engine/kernel/link.php",
    "content": "<?php\n\nclass Link extends Proxy {\n\n    private $lot = [];\n\n    private function _hash(?string $v = null) {\n        if (\"\" === ($v = $v ?? \"\")) {\n            $v = $this->lot['hash'] ?? \"\";\n            if (\"\" !== $v && is_string($v)) {\n                return '#' . $v;\n            }\n            return null;\n        }\n        $this->lot['hash'] = trim($v, '#');\n    }\n\n    private function _host(?string $v = null) {\n        if (\"\" === ($v = $v ?? \"\")) {\n            $v = $this->lot['host'] ?? \"\";\n            if (\"\" !== $v && is_string($v)) {\n                return $v;\n            }\n            return null;\n        }\n        $this->lot['host'] = strstr($v . ':', ':', true);\n    }\n\n    private function _path(?string $v = null) {\n        if (\"\" === ($v = $v ?? \"\")) {\n            $v = $this->lot['path'] ?? \"\";\n            if (\"\" !== $v && is_string($v)) {\n                return '/' . $v;\n            }\n            return null;\n        }\n        $this->lot['path'] = trim($v, '/');\n    }\n\n    private function _port(?string $v = null) {\n        if (\"\" === ($v = $v ?? \"\")) {\n            $v = $this->lot['port'] ?? \"\";\n            if (\"\" !== $v && is_string($v)) {\n                return ':' . $v;\n            }\n            return null;\n        }\n        $this->lot['port'] = $v;\n    }\n\n    private function _query(?string $v = null) {\n        if (\"\" === ($v = $v ?? \"\")) {\n            $v = $this->lot['query'] ?? \"\";\n            if (\"\" !== $v && is_string($v)) {\n                return '?' . $v;\n            }\n            return null;\n        }\n        $this->lot['query'] = trim($v, '&?');\n    }\n\n    private function _scheme(?string $v = null) {\n        if (\"\" === ($v = $v ?? \"\")) {\n            $v = $this->lot['scheme'] ?? \"\";\n            if (\"\" !== $v && is_string($v)) {\n                return $v . '://';\n            }\n            return null;\n        }\n        $this->lot['scheme'] = strstr($v . ':', ':', true);\n    }\n\n    public function __call(string $kin, array $lot = []) {\n        if (parent::_($kin)) {\n            return parent::__call($kin, $lot);\n        }\n        if (method_exists($this, $key = '_' . $kin)) {\n            return $this->{$key}(...$lot);\n        }\n        return null;\n    }\n\n    public function __construct(?string $value = null) {\n        if (0 === strpos($value = $value ?? \"\", '//')) {\n            $value = 'http:' . $value; // Force scheme\n        }\n        extract(parse_url($value), EXTR_SKIP);\n        $this->_hash((string) ($fragment ?? \"\"));\n        $this->_host((string) ($host ?? \"\"));\n        $this->_path((string) ($path ?? \"\"));\n        $this->_port((string) ($port ?? \"\"));\n        $this->_query((string) ($query ?? \"\"));\n        $this->_scheme((string) ($scheme ?? \"\"));\n    }\n\n    public function __get(string $key): mixed {\n        return $this->__fire__($key) ? $this->{$key}() : $this->__call($key);\n    }\n\n    public function __isset(string $key): bool {\n        return !!$this->__get($key);\n    }\n\n    public function __serialize(): array {\n        return $this->lot ?? [];\n    }\n\n    public function __set(string $key, $value = null): void {\n        if (method_exists($this, $key = '_' . $key)) {\n            $this->{$key}($value);\n        }\n    }\n\n    public function __toString(): string {\n        return (string) $this->current();\n    }\n\n    public function __unserialize(array $lot): void {\n        $this->lot = $lot;\n    }\n\n    public function __unset(string $key): void {\n        unset($this->lot[$key]);\n    }\n\n    public function base($path = false, $query = false, $hash = false) {\n        $hash = true === $hash ? $this->_hash() : (is_string($hash) && \"\" !== ($hash = trim($hash, '#')) ? '#' . $hash : \"\");\n        $path = true === $path ? $this->_path() : (is_array($path) ? $this->path($path) : (is_string($path) && \"\" !== ($path = trim($path, '/')) ? '/' . $path : \"\"));\n        $query = true === $query ? $this->_query() : (is_array($query) ? $this->query($query) : (is_string($query) && \"\" !== ($query = trim($query, '&?')) ? '?' . $query : \"\"));\n        return $this->_scheme() . $this->_host() . $this->_port() . $path . $query . $hash;\n    }\n\n    public function count(): int {\n        return count($this->lot);\n    }\n\n    public function current($query = true, $hash = true) {\n        return $this->base(true, $query, $hash);\n    }\n\n    public function getIterator(): Traversable {\n        foreach ($this->lot as $k => $v) {\n            yield $k => $this->{'_' . $k}();\n        }\n    }\n\n    public function offsetExists($key): bool {\n        return isset($this->lot[$key]);\n    }\n\n    public function offsetGet($key): mixed {\n        if ('port' === $key) {\n            return (int) ($this->lot[$key] ?? 0);\n        }\n        return $this->lot[$key] ?? null;\n    }\n\n    public function offsetSet($key, $value): void {\n        $this->{'_' . $key}($value);\n    }\n\n    public function offsetUnset($key): void {\n        $this->__unset($key);\n    }\n\n    public function path(array $lot = []) {\n        if ($lot) {\n            $path = trim($this->_path() ?? \"\", '/');\n            return '/' . implode('/', array_replace(explode('/', $path), $lot));\n        }\n        return $this->_path();\n    }\n\n    public function query(array $lot = []) {\n        if ($lot) {\n            return To::query(array_replace_recursive(From::query($this->_query()), $lot));\n        }\n        return $this->_query();\n    }\n\n}"
  },
  {
    "path": "engine/kernel/proxy.php",
    "content": "<?php\n\nabstract class Proxy implements ArrayAccess, Countable, IteratorAggregate, JsonSerializable, Stringable {\n\n    protected function __fire__($key) {\n        static $c = [];\n        if (isset($c[$k = static::class][$key])) {\n            return $c[$k][$key];\n        }\n        if (!method_exists($this, $key)) {\n            return ($c[$k][$key] = false);\n        }\n        if ((new ReflectionMethod($this, $key))->isPublic()) {\n            return ($c[$k][$key] = true);\n        }\n        return ($c[$k][$key] = false);\n    }\n\n    protected function __get__($key) {\n        static $c = [];\n        if (isset($c[$k = static::class][$key])) {\n            return $c[$k][$key];\n        }\n        if (!property_exists($this, $key)) {\n            return ($c[$k][$key] = false);\n        }\n        if ((new ReflectionProperty($this, $key))->isPublic()) {\n            return ($c[$k][$key] = true);\n        }\n        return ($c[$k][$key] = false);\n    }\n\n    protected function __has__($key) {\n        return $this->__fire__($key) || $this->__get__($key);\n    }\n\n    private static function _fire(string $kin, array $lot, $that = null) {\n        foreach (self::__chain__() as $k) {\n            if (!empty(self::$_[$k]) && array_key_exists($kin, self::$_[$k])) {\n                $v = self::$_[$k][$kin];\n                if (is_callable($v[0])) {\n                    // Alter default function argument(s)\n                    if (isset($v[1])) {\n                        $lot = array_replace((array) $v[1], $lot);\n                    }\n                    // Limit function argument(s)\n                    if (isset($v[2])) {\n                        $lot = array_slice($lot, 0, $v[2]);\n                    }\n                    return fire($v[0], $lot, $that);\n                }\n                return $v[0];\n            }\n        }\n        if (defined('TEST') && TEST) {\n            $c = static::class;\n            throw new BadMethodCallException('Method ' . ($that ? '$' . strtr($c, [\"\\\\\" => '__']) . '->' : $c . '::') . $kin . '() does not exist.');\n        }\n    }\n\n    protected static function __chain__() {\n        static $c = [];\n        if (!isset($c[$k = static::class])) {\n            $r = class_parents($k);\n            unset($r[self::class]);\n            $c[$k] = [$k, ...$r];\n        }\n        return $c[$k];\n    }\n\n    public function __call(string $kin, array $lot = []) {\n        return self::_fire($kin, $lot, $this);\n    }\n\n    public function __clone(): void {}\n\n    public function __construct() {}\n\n    public function __debugInfo(): array {\n        return $this->__serialize();\n    }\n\n    public function __destruct() {}\n\n    public function __get(string $key): mixed {\n        return null;\n    }\n\n    public function __invoke(): mixed {}\n\n    public function __isset(string $key): bool {\n        return false;\n    }\n\n    public function __serialize(): array {\n        return get_object_vars($this);\n    }\n\n    public function __set(string $key, $value): void {}\n\n    public function __toString(): string {\n        return json_encode($this->__serialize(), JSON_UNESCAPED_UNICODE) ?: \"\";\n    }\n\n    public function __unserialize(array $lot): void {\n        foreach ($lot as $k => $v) {\n            $this->{$k} = $v;\n        }\n    }\n\n    public function __unset(string $key): void {}\n\n    public function count(): int {\n        return count($this->__serialize());\n    }\n\n    public function getIterator(): Traversable {\n        return new ArrayIterator($this->__serialize());\n    }\n\n    public function jsonSerialize(): mixed {\n        return $this->__serialize();\n    }\n\n    public function offsetExists($key): bool {\n        return false;\n    }\n\n    public function offsetGet($key): mixed {\n        return null;\n    }\n\n    public function offsetSet($key, $value): void {}\n\n    public function offsetUnset($key): void {}\n\n    public static $_ = [];\n\n    public static function _(...$lot) {\n        $c = static::class;\n        $max = count($lot);\n        // Get\n        if (0 === $max) {\n            return self::$_[$c] ?? [];\n        }\n        // Get\n        if (1 === $max) {\n            return self::$_[$c][$lot[0]] ?? null;\n        }\n        // Let\n        if (null === $lot[1]) {\n            unset(self::$_[$c][$lot[0]]);\n        // Set\n        } else {\n            self::$_[$c][$lot[0]] = (array) $lot[1];\n        }\n    }\n\n    public static function __callStatic(string $kin, array $lot = []) {\n        return self::_fire($kin, $lot);\n    }\n\n    public static function __set_state(array $lot): object {\n        $that = new static;\n        $that->__unserialize($lot);\n        return $that;\n    }\n\n}"
  },
  {
    "path": "engine/kernel/state.php",
    "content": "<?php\n\nclass State extends Proxy {\n\n    protected static $lot = [];\n\n    public $state;\n\n    public function __call(string $kin, array $lot = []) {\n        if (parent::_($kin)) {\n            return parent::__call($kin, $lot);\n        }\n        return self::__callStatic($kin, $lot);\n    }\n\n    public function __construct(array $value = []) {\n        self::$lot[static::class] = $this->state = $value;\n    }\n\n    public function __get(string $key): mixed {\n        if (parent::_($key)) {\n            return $this->__call($key);\n        }\n        return self::get(p2f($key));\n    }\n\n    public function __invoke(...$lot): mixed {\n        return count($lot) < 2 ? self::get(...$lot) : self::set(...$lot);\n    }\n\n    public function __isset(string $key): bool {\n        return !!$this->__get($key);\n    }\n\n    public function __set(string $key, $value = null): void {\n        self::set(p2f($key), $value);\n    }\n\n    public function __serialize(): array {\n        return ['state' => self::$lot[static::class] ?? []];\n    }\n\n    public function __toString(): string {\n        return serialize(self::get(null, true));\n    }\n\n    public function __unserialize(array $lot): void {\n        self::$lot[static::class] = $lot['state'] ?? [];\n        parent::__unserialize($lot);\n    }\n\n    public function __unset(string $key): void {\n        self::let(p2f($key));\n    }\n\n    public function count(): int {\n        return count(self::$lot[static::class] ?? []);\n    }\n\n    public function getIterator(): Traversable {\n        return new ArrayIterator(self::$lot[static::class] ?? []);\n    }\n\n    public function offsetExists($key): bool {\n        return null !== self::offsetGet($key);\n    }\n\n    public function offsetGet($key): mixed {\n        return self::$lot[static::class][$key] ?? null;\n    }\n\n    public function offsetSet($key, $value): void {\n        $c = static::class;\n        if (isset($key)) {\n            self::$lot[$c][$key] = $value;\n        } else {\n            self::$lot[$c][] = $value;\n        }\n    }\n\n    public function offsetUnset($key): void {\n        unset(self::$lot[static::class][$key]);\n    }\n\n    public static function __callStatic(string $kin, array $lot = []) {\n        if (parent::_($kin)) {\n            return parent::__callStatic($kin, $lot);\n        }\n        $kin = p2f($kin); // `fooBar_baz` → `foo-bar_baz`\n        if ($lot) {\n            $value = self::get($kin);\n            // Asynchronous value\n            if ($value instanceof Closure || !is_string($value) && is_callable($value)) {\n                return $value(...$lot);\n            }\n            // Else, static value\n            return self::get($kin . '.' . $lot[0], !empty($lot[1]));\n        }\n        return self::get($kin);\n    }\n\n    public static function get($key = null, $array = false) {\n        $c = static::class;\n        if ($key && is_array($key)) {\n            $r = [];\n            // `State::get(['a', 'b', 'c'])`\n            if (array_is_list($key)) {\n                foreach ($key as $k) {\n                    $r[] = self::get($k, $array);\n                }\n            // `State::get(['a' => null, 'b' => null, 'c' => null])`\n            } else {\n                foreach ($key as $k => $v) {\n                    $r[$k] = self::get($k, $array) ?? $v;\n                }\n            }\n            return $array ? $r : o($r);\n        }\n        // `State::get('a')`\n        if (isset($key) && !is_array($key)) {\n            $r = self::$lot[$c] ?? [];\n            $r = get($r, (string) $key);\n            return $array ? $r : o($r);\n        }\n        // `State::get()`\n        $r = self::$lot[$c] ?? [];\n        return $array ? $r : o($r);\n    }\n\n    public static function let($key = null) {\n        $c = static::class;\n        if ($key && is_array($key)) {\n            // `State::let(['a', 'b', 'c'])`\n            if (array_is_list($key)) {\n                foreach ($key as $k) {\n                    self::let($k);\n                }\n            // `State::let(['a' => null, 'b' => null, 'c' => null])`\n            } else {\n                foreach ($key as $k => $v) {\n                    if ($v === self::get($k)) {\n                        self::let($k);\n                    }\n                }\n            }\n        // `State::let('a')`\n        } else if (isset($key) && !is_array($key)) {\n            let(self::$lot[$c], (string) $key);\n        // `State::let()`\n        } else {\n            self::$lot[$c] = [];\n        }\n    }\n\n    public static function set($key, $value = null) {\n        $c = static::class;\n        $r = [];\n        if (is_array($key)) {\n            if (array_is_list($key)) {\n                foreach ($key as $k) {\n                    set($r, $k, $value);\n                }\n            } else {\n                foreach ($key as $k => $v) {\n                    set($r, $k, $v);\n                }\n            }\n        } else {\n            set($r, $key, $value);\n        }\n        self::$lot[$c] = array_replace_recursive(self::$lot[$c] ?? [], $r);\n    }\n\n}"
  },
  {
    "path": "engine/kernel/time.php",
    "content": "<?php\n\nclass Time extends Proxy {\n\n    public $value;\n    public $zone;\n\n    public function __call(string $kin, array $lot = []) {\n        return $this->__get__($kin) ? $this->{$kin} : parent::__call($kin, $lot);\n    }\n\n    public function __construct($value = null) {\n        $this->zone = zone();\n        if (is_numeric($value)) {\n            $this->value = date('Y-m-d H:i:s', (int) $value);\n        } else if (is_string($value) && strspn($value, '-0123456789') >= 19 && 5 === substr_count($value, '-')) {\n            if ($date = DateTime::createFromFormat('Y-m-d-H-i-s', $value)) {\n                $this->value = $date->format('Y-m-d H:i:s');\n            } else {\n                $this->value = date('Y-m-d H:i:s', 0);\n            }\n        } else {\n            $this->value = date('Y-m-d H:i:s', $value ? strtotime($value) : null);\n        }\n    }\n\n    public function __get(string $key): mixed {\n        if ($this->__fire__($key)) {\n            return $this->{$key}();\n        }\n        if ($v = parent::_($key)) {\n            if (is_string($v = $v[0]) && false !== strpos($v, '%')) {\n                return $this->i($v);\n            }\n        }\n        if (defined($v = 'DATE_' . strtoupper($key))) {\n            return $this->format(constant($v));\n        }\n        return parent::__call($key);\n    }\n\n    public function __invoke(string $pattern = '%Y-%m-%d %T'): mixed {\n        return $this->i($pattern);\n    }\n\n    public function __toString(): string {\n        return (string) $this->value;\n    }\n\n    public function date() {\n        return $this->format('d');\n    }\n\n    public function day($type = null) {\n        if (is_array($type)) {\n            return $type[$day = $this->format('l')] ?? $day;\n        }\n        if (is_string($type)) {\n            return $this->i('%A'); // The day name, translated\n        }\n        return str_pad($this->format('w'), 2, '0', STR_PAD_LEFT);\n    }\n\n    public function i(string $pattern = '%Y-%m-%d %T') {\n        // Can no longer use `strfmtime()` function because this function will be removed in PHP 9.0.0 :(\n        // Here, we use `strfmtime()` format in the user input, but use the `date()` function internally.\n        // <https://php.watch/versions/8.1/strftime-gmstrftime-deprecated>\n        // <https://www.php.net/manual/en/function.date.php>\n        // <https://www.php.net/manual/en/function.strftime.php>\n        $r = date(strtr($pattern, [\n            '%%' => '%',\n            '%A' => 'l',\n            '%B' => 'F',\n            '%D' => 'm/d/y',\n            '%F' => 'Y-m-d',\n            '%H' => 'H',\n            '%I' => 'h',\n            '%M' => 'i',\n            '%P' => 'a',\n            '%R' => 'H:i',\n            '%S' => 's',\n            '%T' => 'H:i:s',\n            '%W' => 'W',\n            '%X' => 'H:i:s',\n            '%Y' => 'Y',\n            '%Z' => 'T',\n            '%a' => 'D',\n            '%b' => 'M',\n            '%c' => 'D M j H:i:s Y',\n            '%d' => 'd',\n            '%e' => 'j',\n            '%h' => 'M',\n            '%k' => 'G',\n            '%l' => 'g',\n            '%m' => 'm',\n            '%n' => \"\\n\",\n            '%p' => 'A',\n            '%r' => 'h:i:s A',\n            '%s' => 'U',\n            '%t' => \"\\t\",\n            '%u' => 'N',\n            '%w' => 'w',\n            '%x' => 'm/d/y',\n            '%y' => 'y',\n            '%z' => 'O'\n        ]), strtotime($this->value));\n        // Make the date translation system to work without PHP `intl` extension\n        if (\n            // ‘Sun’ through ‘Sat’ or ‘Sunday’ through ‘Saturday’\n            false !== stripos($pattern, '%a') ||\n            // ‘Jan’ through ‘Dec’ or ‘January’ through ‘December’\n            false !== stripos($pattern, '%b') ||\n            // Preferred date and time stamp based on locale\n            false !== stripos($pattern, '%c') ||\n            // An alias of `%b`\n            false !== stripos($pattern, '%h') ||\n            // ‘AM’ or ‘PM’ based on the given time\n            false !== stripos($pattern, '%p')\n        ) {\n            return r($r, ['AM', 'Apr', 'April', 'Aug', 'August', 'Dec', 'December', 'Feb', 'February', 'Fri', 'Friday', 'Jan', 'January', 'Jul', 'July', 'Jun', 'June', 'Mar', 'March', 'May', 'May', 'Mon', 'Monday', 'Nov', 'November', 'Oct', 'October', 'PM', 'Sat', 'Saturday', 'Sep', 'September', 'Sun', 'Sunday', 'Thu', 'Thursday', 'Tue', 'Tuesday', 'Wed', 'Wednesday'], function ($c) {\n                return i($c);\n            });\n        }\n        return $r;\n    }\n\n    public function format(string $format = 'Y-m-d H:i:s') {\n        return date($format, strtotime($this->value)); // Generic PHP date formatter\n    }\n\n    public function hour($type = null) {\n        return $this->format(12 === $type ? 'h' : 'H');\n    }\n\n    public function minute() {\n        return $this->format('i');\n    }\n\n    public function month($type = null) {\n        if (is_array($type)) {\n            return $type[$month = $this->format('F')] ?? $month;\n        }\n        if (is_string($type)) {\n            return $this->i('%B'); // The month name, translated\n        }\n        return $this->format('m');\n    }\n\n    // Convert date to file name\n    public function name(string $join = '-') {\n        return strtr($this->value, '- :', str_repeat($join, 3));\n    }\n\n    public function second() {\n        return $this->format('s');\n    }\n\n    public function to(?string $zone = null, ?string $offset = null) {\n        $date = new DateTime($this->value);\n        $date->setTimeZone(new DateTimeZone($zone = $zone ?? $this->zone));\n        if (isset($offset)) {\n            $date->modify($offset);\n        }\n        $that = new static($date->format('Y-m-d H:i:s'));\n        $that->zone = 'UTC' !== $zone ? $zone : null;\n        return $that;\n    }\n\n    public function year() {\n        return $this->format('Y');\n    }\n\n    public static function from(...$lot) {\n        return new static(...$lot);\n    }\n\n}"
  },
  {
    "path": "engine/kernel/to.php",
    "content": "<?php\n\nclass To extends Proxy {\n\n    private function __construct() {}\n\n    public static function __callStatic(string $kin, array $lot = []) {\n        return parent::_($kin) ? parent::__callStatic($kin, $lot) : $lot[0];\n    }\n\n}"
  },
  {
    "path": "engine/kernel/x-m-l.php",
    "content": "<?php\n\nclass XML extends Proxy {\n\n    protected $lot = [\n        0 => null,\n        1 => null,\n        2 => []\n    ];\n\n    protected $raw = [];\n    protected $void = [];\n\n    protected function apart($value, $raw, $void, $deep, $strict) {\n        $i = -1;\n        $lot = [];\n        $stack = 0;\n        foreach (apart($value, $raw, $void) as $v) {\n            if ($stack > 0) {\n                if (2 === $v[1]) {\n                    if ('/' === $v[0][1]) {\n                        $lot[$i][3] = -$v[2];\n                        $stack -= 1;\n                    } else {\n                        $stack += 1;\n                    }\n                }\n                $lot[$i][0] .= $v[0];\n                continue;\n            }\n            if (2 === $v[1]) {\n                $stack += 1;\n            }\n            $lot[++$i] = $v;\n        }\n        foreach ($lot as &$v) {\n            if (1 === $v[1]) {\n                // <https://www.w3.org/TR/xml#sec-cdata-sect>\n                // <https://www.w3.org/TR/xml#sec-comments>\n                // <https://www.w3.org/TR/xml#sec-prolog-dtd>\n                if (strspn($v[0], '!?', 1)) {\n                    $v = [null, $v[0], []];\n                    continue;\n                }\n                // <https://www.w3.org/TR/xml#d0e2480>\n                $n = substr($t = substr($v[0], 1, $v[2] - 2), 0, $x = strcspn($t, \" \\n\\r\\t\"));\n                $v = [$n, isset($v[3]) && is_int($v[3]) ? substr($v[0], $v[2], $v[3]) : false, $this->pair(trim(substr($t, $x), '/'))];\n                continue;\n            }\n            // <https://www.w3.org/TR/xml#sec-starttags>\n            if (2 === $v[1]) {\n                $n = substr($t = substr($v[0], 1, $v[2] - 2), 0, $x = strcspn($t, \" \\n\\r\\t\"));\n                $r = substr($v[0], $v[2]);\n                // <https://www.w3.org/TR/xml#d0e2403>\n                if (isset($v[3]) && is_int($v[3])) {\n                    $r = substr($r, 0, $v[3]);\n                    $r = $deep ? $this->apart($r, $raw, $void, true === $deep ? $deep : (is_int($deep) && $deep > 1 ? $deep - 1 : false), $strict) : $r;\n                    if ($deep && is_array($r) && 1 === count($r) && is_string($r[0] ?? 0)) {\n                        $r = $r[0];\n                    }\n                    $v = [$n, $r ?: \"\", $this->pair(trim(substr($t, $x), '/'))];\n                    continue;\n                }\n                if ($strict) {\n                    throw new ParseError($v[0]);\n                }\n                $v = [$n, false, $this->pair(trim(substr($t, $x), '/'))];\n                continue;\n            }\n            // <https://www.w3.org/TR/xml#charsets>\n            // <https://www.w3.org/TR/xml#sec-references>\n            $v = $v[0];\n        }\n        unset($v);\n        return $lot;\n    }\n\n    protected function pair(string $value) {\n        $lot = [];\n        foreach (pair($value) as $k => $v) {\n            if ($v && is_string($v)) {\n                $lot[$k] = $this->v($v);\n                continue;\n            }\n            $lot[$k] = $v;\n        }\n        return $lot;\n    }\n\n    protected function v(string $v) {\n        return htmlspecialchars_decode($v, ENT_HTML5 | ENT_QUOTES | ENT_SUBSTITUTE);\n    }\n\n    protected function x(string $v) {\n        return htmlspecialchars($v, ENT_HTML5 | ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8', false);\n    }\n\n    public $deep;\n    public $strict;\n\n    public function __construct($value = [], $deep = false, $strict = true) {\n        $this->deep = $deep;\n        $this->strict = $strict;\n        if (is_array($value)) {\n            $this->lot = array_replace_recursive($this->lot, $value);\n        } else if (is_object($value) && $value instanceof self) {\n            $this->lot[0] = $value[0];\n            $this->lot[1] = $value[1];\n            $this->lot[2] = $value[2];\n        } else if (is_string($value)) {\n            $raw = array_keys(array_filter($this->raw));\n            $void = array_keys(array_filter($this->void));\n            // Must start with `<` and end with `>`\n            if ('<' === substr($value = trim($value), 0, 1) && '>' === substr($value, -1)) {\n                // Must be an element\n                if (1 === count($lot = $this->apart($value, $raw, $void, $deep, $strict))) {\n                    $this->lot = reset($lot);\n                } else if (defined('TEST') && TEST) {\n                    throw new ParseError($value);\n                }\n            } else if (defined('TEST') && TEST) {\n                throw new ParseError($value);\n            }\n        }\n    }\n\n    public function __serialize(): array {\n        $lot = parent::__serialize();\n        unset($lot['raw'], $lot['void']);\n        return $lot;\n    }\n\n    public function __toString(): string {\n        $deep = $this->deep;\n        $lot = $this->lot;\n        $strict = $this->strict;\n        if (!isset($lot[0]) || false === $lot[0]) {\n            $value = \"\";\n            if ($deep && is_array($lot[1])) {\n                foreach ($lot[1] as $v) {\n                    $value .= is_string($v) ? $v : new static($v, $deep, $strict);\n                }\n                return $value;\n            }\n            return is_array($lot[1]) || is_object($lot[1]) ? json_encode($lot[1]) : (null !== $lot[1] ? s($lot[1]) : \"\");\n        }\n        $value = '<' . $lot[0];\n        if (!empty($lot[2])) {\n            ksort($lot[2]);\n            foreach ($lot[2] as $k => $v) {\n                if (false === $v || null === $v) {\n                    continue;\n                }\n                if (true === $v) {\n                    $value .= ' ' . $k . ($strict ? '=\"' . $k . '\"' : \"\");\n                    continue;\n                }\n                $value .= ' ' . $k . '=\"' . $this->x(is_array($v) || is_object($v) ? json_encode($v) : (null !== $v ? s($v) : \"\")) . '\"';\n            }\n        }\n        if (false === $lot[1]) {\n            return $value . ($strict ? '/' : \"\") . '>';\n        }\n        $value .= '>';\n        if ($deep && is_array($lot[1])) {\n            foreach ($lot[1] as $v) {\n                if (is_array($v) || is_object($v)) {\n                    $value .= new static($v, $deep, $strict);\n                    continue;\n                }\n                $value .= (null !== $v ? s($v) : \"\");\n            }\n        } else {\n            $value .= (null !== $lot[1] ? s($lot[1]) : \"\");\n        }\n        return $value . '</' . $lot[0] . '>';\n    }\n\n    public function count(): int {\n        return 1; // Single node is always `1`\n    }\n\n    public function jsonSerialize(): mixed {\n        $lot = $this->__serialize()['lot'] ?? [];\n        if (isset($lot[2])) {\n            $lot[2] = (object) $lot[2];\n        }\n        return $lot;\n    }\n\n    public function offsetExists($key): bool {\n        if (is_numeric($key)) {\n            return isset($this->lot[$key]);\n        }\n        return isset($this->lot[2][$key]);\n    }\n\n    public function offsetGet($key): mixed {\n        if (is_numeric($key)) {\n            return $this->lot[$key] ?? null;\n        }\n        return $this->lot[2][$key] ?? null;\n    }\n\n    public function offsetSet($key, $value): void {\n        if (isset($key)) {\n            if (is_numeric($key)) {\n                $this->lot[$key] = $value;\n            } else {\n                $this->lot[2][$key] = $value;\n            }\n        } else {\n            $this->lot[] = $value;\n        }\n    }\n\n    public function offsetUnset($key): void {\n        if (is_numeric($key)) {\n            $this->lot[$key] = 2 === $key ? [] : null;\n        } else {\n            unset($this->lot[2][$key]);\n        }\n    }\n\n}"
  },
  {
    "path": "engine/plug/from.php",
    "content": "<?php\n\nforeach ([\n    'HTML' => static function (?string $value, $deep = false): ?string {\n        $r = htmlspecialchars($value ?? \"\", ENT_HTML5 | ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8', !!$deep);\n        return \"\" !== $r ? $r : null;\n    },\n    'JSON' => static function (?string $value, $array = false) {\n        $r = json_decode($value ?? \"\", $array);\n        return \"\" !== $r ? $r : null;\n    },\n    'base64' => static function (?string $value): ?string {\n        return \"\" !== ($value = base64_decode($value ?? \"\")) ? $value : null;\n    },\n    'entity' => static function (?string $value): ?string {\n        return \"\" !== ($value = html_entity_decode($value ?? \"\", ENT_HTML5 | ENT_QUOTES)) ? $value : null;\n    },\n    'link' => 'To::path',\n    'path' => 'To::link',\n    'query' => static function (?string $from, $eval = true, $value = true): array {\n        if (\"\" === ($from = trim($from ?? \"\"))) {\n            return [];\n        }\n        if ('?' === $from[0]) {\n            $from = substr($from, 1);\n        }\n        $to = [];\n        foreach (explode('&', $from) as $v) {\n            $v = explode('=', $v, 2);\n            $v[0] = urldecode($v[0]);\n            if (isset($v[1])) {\n                $v[1] = urldecode($v[1]);\n                $v[1] = $eval ? e($v[1]) : $v[1];\n            } else {\n                $v[1] = $value;\n            }\n            $keys = explode('[', strtr($v[0], [']' => \"\"]));\n            $r =& $to;\n            while (isset($keys[1])) {\n                $r[$k = \"\" === ($k = array_shift($keys)) ? count($r) : $k] ??= [];\n                $r =& $r[$k];\n            }\n            $r[\"\" === ($k = array_shift($keys)) ? count($r) : $k] = $v[1];\n            ksort($r);\n        }\n        return $to;\n    },\n    'serial' => static function (?string $value): ?string {\n        return \"\" !== ($value = unserialize($value)) ? $value : null;\n    }\n] as $k => $v) {\n    From::_($k, $v);\n}\n\n// Alias(es)…\nforeach ([\n    'html' => 'HTML',\n    'json' => 'JSON'\n] as $k => $v) {\n    From::_($k, From::_($v));\n}"
  },
  {
    "path": "engine/plug/to.php",
    "content": "<?php\n\nforeach ([\n    'HTML' => static function (?string $value): ?string {\n        $value = htmlspecialchars_decode($value ?? \"\", ENT_HTML5 | ENT_QUOTES | ENT_SUBSTITUTE);\n        return \"\" !== $value ? $value : null;\n    },\n    'JSON' => static function ($value, $dent = false): ?string {\n        if ($dent) {\n            $value = json_encode($value ?? \"\", JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_TAG | JSON_PRESERVE_ZERO_FRACTION | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);\n            if (is_int($dent)) {\n                $dent = str_repeat(' ', $dent);\n            }\n            if (is_string($dent)) {\n                $value = strtr($value, ['    ' => $dent]);\n            }\n            return \"\" !== $value ? $value : null;\n        }\n        return \"\" !== ($value = json_encode($value ?? \"\", JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_TAG | JSON_PRESERVE_ZERO_FRACTION | JSON_UNESCAPED_UNICODE)) ? $value : null;\n    },\n    'base64' => static function (?string $value): ?string {\n        return \"\" !== ($value = base64_encode($value ?? \"\")) ? $value : null;\n    },\n    'camel' => \"\\\\c\",\n    'entity' => static function (?string $value, $hex = false, int $pad = 4): ?string {\n        $r = \"\";\n        $utf8 = function_exists('mb_ord');\n        $value = (string) $value;\n        $value = $utf8 ? mb_str_split($value, 1, 'UTF-8') : str_split($value);\n        for ($i = 0, $count = count($value); $i < $count; ++$i) {\n            $v = $utf8 ? mb_ord($value[$i], 'UTF-8') : ord($value[$i]);\n            if ($hex) {\n                $v = dechex($v);\n            }\n            if ($pad) {\n                $v = str_pad($v, $pad, '0', STR_PAD_LEFT);\n            }\n            $r .= '&#' . ($hex ? 'x' : \"\") . $v . ';';\n        }\n        return \"\" !== $r ? $r : null;\n    },\n    'file' => static function (?string $value, string $keep = '._'): ?string {\n        if (\"\" === trim($value ?? \"\")) {\n            return null;\n        }\n        $r = [];\n        if ($value = explode('/', strtr($value, D, '/'))) {\n            $x = strtolower(trim(pathinfo($name = array_pop($value), PATHINFO_EXTENSION)));\n            $value[] = h(trim(pathinfo($name, PATHINFO_FILENAME)), '-', true, $keep) . (\"\" !== $x ? '.' . $x : \"\");\n        }\n        foreach ($value as $v) {\n            if (\"\" === ($v = trim($v))) {\n                continue;\n            }\n            if (strspn($v, '.') === strlen($v)) {\n                continue;\n            }\n            $r[] = h($v, '-', true, $keep);\n        }\n        return $r ? implode(D, $r) : null;\n    },\n    'folder' => static function (?string $value, string $keep = '._'): ?string {\n        if (\"\" === trim($value ?? \"\")) {\n            return null;\n        }\n        $r = [];\n        foreach (explode('/', strtr($value, D, '/')) as $v) {\n            if (\"\" === ($v = trim($v))) {\n                continue;\n            }\n            if (strspn($v, '.') === strlen($v)) {\n                continue;\n            }\n            $r[] = h($v, '-', true, $keep);\n        }\n        return $r ? implode(D, $r) : null;\n    },\n    'kebab' => static function (?string $value, string $join = '-', $accent = false): ?string {\n        $value = trim(h($value, $join, $accent) ?? \"\", $join);\n        return \"\" !== $value ? $value : null;\n    },\n    'link' => static function (?string $value) {\n        if (0 === strpos($value = strtr($value ?? \"\", '/', D), $v = PATH . D)) {\n            $value = substr($value, strlen($v));\n        }\n        $r = [];\n        foreach (explode('/', rtrim(long('/' . strtr($value, D, '/')), '/')) as $v) {\n            $r[] = !empty($v) ? rawurlencode($v) : $v;\n        }\n        // The `http:` part\n        if (!empty($r[0]) && '%3A' === substr($r[0], -3)) {\n            $r[0] = substr($r[0], 0, -3) . ':';\n        }\n        // The `127.0.0.1:80` part\n        if (!empty($r[2])) {\n            $r[2] = strtr($r[2], ['%3A' => ':']);\n        }\n        return $r ? implode('/', $r) : null;\n    },\n    'lower' => \"\\\\l\",\n    'pascal' => \"\\\\p\",\n    'path' => static function (?string $value): ?string {\n        if (0 === strpos($value = strtr($value ?? \"\", D, '/'), $v = long('/') . '/')) {\n            $value = substr($value, strlen($v));\n        }\n        $r = [];\n        foreach (explode(D, rtrim(PATH . D . strtr($value, '/', D), D)) as $v) {\n            $r[] = !empty($v) ? rawurldecode($v) : $v;\n        }\n        $r = stream_resolve_include_path($r = implode(D, $r)) ?: $r;\n        return \"\" !== $r ? $r : null;\n    },\n    'query' => static function (?array $value): ?string {\n        if (!$value) {\n            return null;\n        }\n        $from = [[$value, \"\"]];\n        $to = [];\n        while ($from) {\n            [$value, $x] = array_pop($from);\n            ksort($value);\n            foreach ($value as $k => $v) {\n                $k = $x . urlencode($k) . (\"\" !== $x ? ']' : \"\");\n                if (is_array($v)) {\n                    $from[] = [$v, $k . '['];\n                    continue;\n                }\n                // `['a' => false, 'b' => 'false', 'c' => null, 'd' => 'null']` → `b=false&d=null`\n                if (false === $v || null === $v) {\n                    continue;\n                }\n                // `['a' => true, 'b' => 'true', 'c' => \"\"]` → `a&b=true&c=`\n                $to[] = true === $v ? $k : $k . '=' . urlencode(s($v));\n            }\n        }\n        return $to ? '?' . implode('&', $to) : null;\n    },\n    'serial' => static function ($value): ?string {\n        return \"\" !== ($value = serialize($value)) ? $value : null;\n    },\n    'snake' => static function (?string $value, $accent = false): ?string {\n        $value = trim(h($value, '_', $accent) ?? \"\", '_');\n        return \"\" !== $value ? $value : null;\n    },\n    'text' => \"\\\\w\",\n    'upper' => \"\\\\u\"\n] as $k => $v) {\n    To::_($k, $v);\n}\n\n// Alias(es)…\nforeach ([\n    'files' => 'folder',\n    'html' => 'HTML'\n] as $k => $v) {\n    To::_($k, To::_($v));\n}"
  },
  {
    "path": "index.php",
    "content": "<?php\n\n/**\n * =========================================\n *  MECHA · CONTENT MANAGEMENT SYSTEM (CMS)\n * =========================================\n *  © 2014 – 2026 · Taufik Nurrohman\n * -----------------------------------------\n */\n\ndefine('VERSION', '4.0.0'); // Current version\n\ndefine('D', DIRECTORY_SEPARATOR); // Directory separator\ndefine('N', PHP_EOL); // Line break\ndefine('P', \"\\u{001A}\"); // Placeholder character\ndefine('S', \"\\u{200C}\"); // Invisible character\n\ndefine('PATH', __DIR__);\ndefine('ENGINE', PATH . D . 'engine');\ndefine('LOT', PATH . D . 'lot');\n\ndefine('TEST', true); // Change to `true` to enable test mode\n\n// When working with virtual host feature on a server —especially an Apache web server— you may find that the\n// application’s URL format is not formed properly after installation. Typically, this issue is indicated by a messy\n// appearance of the site, as the CSS and JavaScript file(s) fail to load. When you open the site’s source code, the URL\n// prefix usually becomes the private root file path, which should be the public root site domain.\n//\n// Mecha uses `$_SERVER['DOCUMENT_ROOT']` value to determine whether the application is installed in a sub-folder or in\n// the root directory. If the `$_SERVER['DOCUMENT_ROOT']` value is not recognized or does not align with the `PATH`\n// constant value (if the application is installed in a sub-folder, the `$_SERVER['DOCUMENT_ROOT']` value will start the\n// `PATH` constant value; if the application is installed in the root directory, the `$_SERVER['DOCUMENT_ROOT']` value\n// will be the same as the `PATH` constant value), Mecha will most likely fail to automatically construct the site URL.\n//\n// If you don’t have access to modify the web server configuration file(s) to make the `DocumentRoot` value consistent\n// with the `PATH` constant value, you can enter the value manually here. Mecha does not use this variable much for file\n// and folder operation(s), so this change will not affect much.\n$_SERVER['DOCUMENT_ROOT'] = $r = rtrim(strtr($_SERVER['DOCUMENT_ROOT'] ?? PATH, '/', D), D);\nif (0 !== strpos(PATH . D, $r . D)) {\n    // $_SERVER['DOCUMENT_ROOT'] = '/srv/http';\n}\n\nrequire ENGINE . D . 'f.php';\nrequire ENGINE . D . 'fire.php';"
  },
  {
    "path": "lot/.htaccess",
    "content": "Deny from all"
  },
  {
    "path": "lot/asset/.htaccess",
    "content": "Allow from all"
  },
  {
    "path": "lot/page/about.txt",
    "content": "---\ntitle: About\ndescription: Lorem ipsum dolor sit amet.\nauthor: Taufik Nurrohman\ntype: Markdown\n...\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\nmagna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl\nut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie\nconsequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit\npraesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.\n\nNam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim\nassum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes\ndemonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur\nmutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit\nlitterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum\nclari, fiant sollemnes in futurum."
  },
  {
    "path": "lot/page/article/example-1-1.json",
    "content": "{\n  \"title\": \"Example 1.1 (JSON)\",\n  \"description\": \"Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.\",\n  \"type\": \"Markdown\",\n  \"content\": \"Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.\\n\\nNam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum.\"\n}"
  },
  {
    "path": "lot/page/article/example-2-1.md",
    "content": "---\ntitle: Example 2.1 (Markdown)\ndescription: >-\n  Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\n  magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis\n  nisl ut aliquip ex ea commodo consequat.\n...\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\nmagna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis\nnisl ut aliquip ex ea commodo consequat.\n\nNam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim\nassum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes\ndemonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur\nmutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit\nlitterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur\nparum clari, fiant sollemnes in futurum."
  },
  {
    "path": "lot/page/article/example-2-2.md",
    "content": "---\ntitle: Example 2.2 (Markdown)\ndescription: >-\n  Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\n  magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis\n  nisl ut aliquip ex ea commodo consequat.\n---\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\nmagna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis\nnisl ut aliquip ex ea commodo consequat.\n\nNam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim\nassum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes\ndemonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur\nmutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit\nlitterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur\nparum clari, fiant sollemnes in futurum."
  },
  {
    "path": "lot/page/article/example-3-1.txt",
    "content": "---\ntitle: Example 3.1 (Default)\ndescription: >-\n  Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\n  magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis\n  nisl ut aliquip ex ea commodo consequat.\ntype: Markdown\n...\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\nmagna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis\nnisl ut aliquip ex ea commodo consequat.\n\nNam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim\nassum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes\ndemonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur\nmutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit\nlitterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur\nparum clari, fiant sollemnes in futurum."
  },
  {
    "path": "lot/page/article/example-3-2.txt",
    "content": "---\ntitle: Example 3.2 (Default)\ndescription: >-\n  Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\n  magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis\n  nisl ut aliquip ex ea commodo consequat.\ntype: Markdown\n---\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\nmagna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis\nnisl ut aliquip ex ea commodo consequat.\n\nNam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim\nassum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes\ndemonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur\nmutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit\nlitterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur\nparum clari, fiant sollemnes in futurum."
  },
  {
    "path": "lot/page/article/example-4-1.yaml",
    "content": "title: Example 4.1 (YAML)\ndescription: >-\n  Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\n  magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis\n  nisl ut aliquip ex ea commodo consequat.\ntype: Markdown\ncontent: |\n\n  Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\n  magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis\n  nisl ut aliquip ex ea commodo consequat.\n\n  Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim\n  assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes\n  demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur\n  mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit\n  litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur\n  parum clari, fiant sollemnes in futurum."
  },
  {
    "path": "lot/page/article/example-4-2.yaml",
    "content": "---\ntitle: Example 4.2 (YAML)\ndescription: >-\n  Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\n  magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis\n  nisl ut aliquip ex ea commodo consequat.\ntype: Markdown\n--- |\n\n  Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\n  magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis\n  nisl ut aliquip ex ea commodo consequat.\n\n  Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim\n  assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes\n  demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur\n  mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit\n  litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur\n  parum clari, fiant sollemnes in futurum."
  },
  {
    "path": "lot/page/article/markdown-content.txt",
    "content": "---\ntitle: Markdown Content\ndescription: Using Markdown syntax in page title, description and content.\nauthor: Taufik Nurrohman\ntype: Markdown\n...\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\nmagna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl\nut aliquip ex ea commodo consequat.\n\n - List Item 1\n - List Item 2\n - List Item 3\n - List Item 4\n\nNam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim\nassum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes\ndemonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur\nmutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit\nlitterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum\nclari, fiant sollemnes in futurum."
  },
  {
    "path": "lot/page/article/markup-content.txt",
    "content": "---\ntitle: Markup Content\ndescription: >-\n  Using plain <abbr title=\"Hyper Text Markup Language\">HTML</abbr> syntax in page title, description and content.\nauthor: Taufik Nurrohman\ntype: HTML\n...\n\n<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\nmagna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl\nut aliquip ex ea commodo consequat.</p>\n\n<ul>\n  <li>List Item 1</li>\n  <li>List Item 2</li>\n  <li>List Item 3</li>\n  <li>List Item 4</li>\n</ul>\n\n<p>Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim\nassum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes\ndemonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur\nmutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit\nlitterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum\nclari, fiant sollemnes in futurum.</p>"
  },
  {
    "path": "lot/page/article.txt",
    "content": "---\ntitle: Article\ndescription: >-\n  Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\n  magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis\n  nisl ut aliquip ex ea commodo consequat.\nauthor: Taufik Nurrohman\ntype: Markdown\nsort: [ -1, time ]\n...\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\nmagna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl\nut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie\nconsequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit\npraesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.\n\nNam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim\nassum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes\ndemonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur\nmutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit\nlitterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum\nclari, fiant sollemnes in futurum."
  },
  {
    "path": "lot/page/contact.txt",
    "content": "---\ntitle: Contact\ndescription: Quis nostrud exerci tation ullamcorper suscipit.\nauthor: Taufik Nurrohman\ntype: Markdown\n...\n\nEst usus legentis in <email@domain.com>."
  },
  {
    "path": "lot/page/index.txt",
    "content": "---\ntitle: Home\ndescription: My personal home page.\nauthor: Taufik Nurrohman\ntype: Markdown\n...\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore\nmagna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl\nut aliquip ex ea commodo consequat.\n\nNam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim\nassum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes\ndemonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur\nmutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit\nlitterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum\nclari, fiant sollemnes in futurum."
  },
  {
    "path": "state.php",
    "content": "<?php\n\nreturn [\n    'description' => 'Site description.',\n    'home' => '/index',\n    'title' => 'Site Title',\n    'zone' => zone()\n];"
  }
]