[{"name":"AppUrl","comment":" URLs for applications.\n\n\n# Types\n\n@docs AppUrl, QueryParameters\n\n\n# Create\n\n@docs fromUrl, fromPath\n\n\n# Stringify\n\n@docs toString\n\n\n# Parse\n\nAre you looking for functions to parse routes in your app? There are none! The\nidea is to use good old pattern matching on `.path`. See the [README] example\nfor inspiration.\n\n[README]: https://package.elm-lang.org/packages/lydell/elm-app-url/latest\n\n","unions":[],"aliases":[{"name":"AppUrl","comment":" You might recognize this diagram from the core [Url] type documentation:\n\n      https://example.com:8042/over/there?name=ferret#nose\n      \\___/   \\______________/\\_________/ \\_________/ \\__/\n        |            |            |            |        |\n      scheme     authority       path        query   fragment\n\n`AppUrl` represents only path + query + fragment:\n\n      https://example.com:8042/over/there?name=ferret#nose\n                              \\__________________________/\n                                            |\n                                         AppUrl\n\nThat’s the part you’ll work the most with in your app.\n\nAn `AppUrl` is “more parsed“ than [Url] (where everything is a string):\n\n  - `path`: `List String`. The path, split by slash. This makes it convenient to\n    pattern match on the segments.\n  - `queryParameters`: [QueryParameters](#QueryParameters). A dict of the query\n    parameters, with keys mapped to the values.\n  - `fragment`: `Maybe String`. The fragment, without the leading hash symbol.\n\nEach path segment, query parameter key, query parameter value and the fragment\nare all percent decoded, so you never need to think about that. For example,\n`%20` is turned into a space and `%2F` is turned into a slash.\n\nYou can think of [Url] as the type you get from Elm when using\n[Browser.application]. From it you can create an `AppUrl`, and that’s what\nyou’ll use when parsing which page you’re on and when creating links.\n\nDifferent ways of creating an `AppUrl`:\n\n  - [AppUrl.fromUrl](#fromUrl)\n\n  - [AppUrl.fromPath](#fromPath)\n\n  - Create the record directly:\n\n        { path = [ \"my\", \"path\" ]\n        , queryParameters = Dict.singleton \"my\" [ \"parameter\" ]\n        , fragment = Just \"my-fragment\"\n        }\n\n[Browser.application]: https://package.elm-lang.org/packages/elm/browser/latest/Browser#application\n[Url]: https://package.elm-lang.org/packages/elm/url/latest/Url#Url\n\n","args":[],"type":"{ path : List.List String.String, queryParameters : AppUrl.QueryParameters, fragment : Maybe.Maybe String.String }"},{"name":"QueryParameters","comment":" A dict of the query parameters, with keys mapped to the values. The same key\nmight be given more than once, so each key is mapped to a list of values.\n\nGet all values of a key:\n\n    Dict.get \"myParam\" url.queryParameters\n\nGet the first value:\n\n    Dict.get \"myParam\" url.queryParameters |> Maybe.andThen List.head\n\nGet the last value:\n\n    Dict.get \"myParam\" url.queryParameters |> Maybe.andThen List.Extra.last\n\nCreate query parameters:\n\n    Dict.fromList\n        [ ( \"myRequiredParam\", [ \"myValue\" ] )\n\n        -- Parameters set to the empty list are omitted.\n        , ( \"myOptionalParam\", Maybe.Extra.toList someMaybeString )\n        ]\n\nSee also [choosing a query parameter][choose] and [query parameter\nparsing][parse] for extra details.\n\n[choose]: https://github.com/lydell/elm-app-url/blob/main/docs/details.md#choosing-a-query-parameter\n[parse]: https://github.com/lydell/elm-app-url/blob/main/docs/details.md#query-parameter-parsing\n\n","args":[],"type":"Dict.Dict String.String (List.List String.String)"}],"values":[{"name":"fromPath","comment":" Convenience function for creating an [AppUrl](#AppUrl) from just a path,\nwhen you don’t need any query parameters or fragment.\n\nIt’s nothing more than this helper function:\n\n    fromPath : List String -> AppUrl\n    fromPath path =\n        { path = path\n        , queryParameters = Dict.empty\n        , fragment = Nothing\n        }\n\nExample:\n\n    AppUrl.fromPath [ \"my\", \"path\" ]\n    --> { path = [ \"my\", \"path\" ], queryParameters = Dict.empty, fragment = Nothing }\n\n","type":"List.List String.String -> AppUrl.AppUrl"},{"name":"fromUrl","comment":" Turn a [Url] from [elm/url] into an [AppUrl](#AppUrl).\n\nThis removes one trailing slash from the end of the path (if any), for convenience.\nFor example, `/one/two` and `/one/two/` are both turned into `[ \"one\", \"two\" ]`.\n\nSome sites use a trailing slash, some don’t. Users don’t know what to use where.\nThis lets you support both. It’s up to you if you want to update the URL in the\nlocation bar of the browser to a canonical version.\n\nNote: You can add an empty string at the end of the path, like `[ \"one\", \"two\", \"\" ]`\nif you want to create a string with a trailing slash.\n\nExample:\n\n        AppUrl.fromUrl\n            { protocol = Url.Https\n            , host = \"example.com\"\n            , port_ = Nothing\n            , path = \"/my/path\"\n            , query = Just \"my=parameter\"\n            , fragment = Just \"my-fragment\"\n            }\n            --> { path = [ \"my\", \"path\" ]\n            --  , queryParameters = Dict.singleton \"my\" [ \"parameter\" ]\n            --  , fragment = Just \"my-fragment\"\n            --  }\n\n[Url]: https://package.elm-lang.org/packages/elm/url/latest/Url#Url\n[elm/url]: https://package.elm-lang.org/packages/elm/url/latest\n\n","type":"Url.Url -> AppUrl.AppUrl"},{"name":"toString","comment":" Turn an [AppUrl](#AppUrl) into a string.\n\n    AppUrl.toString\n        { path = [ \"my\", \"path\" ]\n        , queryParameters = Dict.singleton \"my\" [ \"parameter\" ]\n        , fragment = Just \"my-fragment\"\n        }\n        --> \"/my/path?my=parameter#my-fragment\"\n\n  - The string always starts with `/`.\n  - It only contains a `?` if there are any query parameters.\n  - Similarly, it only contains a `#` if there is a fragment.\n  - Query parameters with the empty string as the value don’t get any equals\n    sign: `?k`, not `?k=`.\n  - Query parameters are sorted by key.\n\nEach path segment, query parameter key, query parameter value and the fragment\nare all percent encoded, but very minimally. See [escaping] and [plus and space] for details.\n\nSee also [Full and relative URLs].\n\n[Full and relative URLs]: https://github.com/lydell/elm-app-url/blob/main/docs/details.md#full-and-relative-urls\n[escaping]: https://github.com/lydell/elm-app-url/blob/main/docs/details.md#escaping\n[plus and space]: https://github.com/lydell/elm-app-url/blob/main/docs/details.md#plus-and-space\n\n","type":"AppUrl.AppUrl -> String.String"}],"binops":[]}]