[{"name":"Clerk","comment":" Clerk authentication for Elm, bridged through ClerkJS by the companion\nnpm package `@viewengine/elm-clerk`.\n\nThis package holds the typed state, the decoders and the command API. The\ntwo ports live in your own application, because the Elm package registry\ndoes not allow a package to declare them. Copy `Ports.elm` from the\nelm-clerk repository into your app: it declares `clerkOut : Value -> Cmd\nmsg` and `clerkIn : (Value -> msg) -> Sub msg`, and it never changes.\n\nThen hand both of them to this package as a `Ports` record:\n\n    clerkPorts : Clerk.Ports Msg\n    clerkPorts =\n        { toJs = Ports.clerkOut, fromJs = Ports.clerkIn }\n\n\n# State\n\n@docs State, Msg, Ports, Event\n\n\n# Wiring\n\n@docs init, update, subscriptions\n\n\n# Commands\n\n@docs signOut, openSignIn, openSignUp, openUserProfile\n@docs mountSignIn, mountUserButton, unmount\n@docs requestToken, setActiveOrganization\n\n\n# Flags\n\n@docs stateDecoder\n\n","unions":[{"name":"Event","comment":" What just happened, returned by [`update`](#update) so the app can react\nto it. Ignore the events you do not care about.\n\n`Error` carries a human readable description of anything that went wrong,\nincluding an unknown message tag and a message this package could not\ndecode. It never crashes the app.\n\n","args":[],"cases":[["StateChanged",["Clerk.State"]],["TokenReceived",["{ requestId : String.String, token : String.String }"]],["TokenFailed",["{ requestId : String.String, reason : String.String }"]],["Error",["String.String"]]]},{"name":"State","comment":" Everything the app knows about the current visitor.\n\n`Loading` is the only state before the shim reports the first\n`stateChanged`, so every app must render something for it.\n\n","args":[],"cases":[["Loading",[]],["SignedOut",[]],["SignedIn",["{ session : Clerk.Session.Session, user : Clerk.User.User, organization : Maybe.Maybe Clerk.Organization.Organization }"]]]}],"aliases":[{"name":"Msg","comment":" An opaque message produced by [`subscriptions`](#subscriptions). Wrap it\nin one of your own constructors and hand it back to [`update`](#update).\n","args":[],"type":"Clerk.Internal.Protocol.Msg"},{"name":"Ports","comment":" The two ports the shim talks over. They are passed to every function in\nthis module, so this package declares none of its own.\n","args":["msg"],"type":"{ toJs : Json.Decode.Value -> Platform.Cmd.Cmd msg, fromJs : (Json.Decode.Value -> msg) -> Platform.Sub.Sub msg }"}],"values":[{"name":"init","comment":" The state before the shim has said anything, which is `Loading`.\n\nIf the shim hands you the current state as a flag, decode that with\n[`stateDecoder`](#stateDecoder) instead so the first render is correct.\n\n","type":"Clerk.State"},{"name":"mountSignIn","comment":" Mount Clerk's sign-in component into the element with the given id.\n\nThe element must already be in the document, so send this from a command\nafter the view that contains it has rendered.\n\n","type":"Clerk.Ports msg -> String.String -> Platform.Cmd.Cmd msg"},{"name":"mountUserButton","comment":" Mount Clerk's user button into the element with the given id.\n","type":"Clerk.Ports msg -> String.String -> Platform.Cmd.Cmd msg"},{"name":"openSignIn","comment":" Open Clerk's hosted sign-in modal.\n","type":"Clerk.Ports msg -> Platform.Cmd.Cmd msg"},{"name":"openSignUp","comment":" Open Clerk's hosted sign-up modal.\n","type":"Clerk.Ports msg -> Platform.Cmd.Cmd msg"},{"name":"openUserProfile","comment":" Open Clerk's hosted user profile modal.\n","type":"Clerk.Ports msg -> Platform.Cmd.Cmd msg"},{"name":"requestToken","comment":" Ask for a session token, optionally minted from a JWT template.\n\nYou choose the `requestId` and get it back on the matching\n`TokenReceived` or `TokenFailed` event, so several requests can be in\nflight at once.\n\n    Clerk.requestToken clerkPorts\n        { requestId = \"backend-call-1\", template = Just \"backend\" }\n\n","type":"Clerk.Ports msg -> { requestId : String.String, template : Maybe.Maybe String.String } -> Platform.Cmd.Cmd msg"},{"name":"setActiveOrganization","comment":" Make the organization with the given id the active one. The shim\nreports the result as a `stateChanged` event.\n","type":"Clerk.Ports msg -> String.String -> Platform.Cmd.Cmd msg"},{"name":"signOut","comment":" Sign the current user out, ending the session in every tab.\n","type":"Clerk.Ports msg -> Platform.Cmd.Cmd msg"},{"name":"stateDecoder","comment":" Decode the state JSON the shim sends, which is also what it passes as\nthe initial flag:\n\n    { \"status\": \"loading\" }\n\n    { \"status\": \"signedOut\" }\n\n    { \"status\": \"signedIn\"\n    , \"session\": Session\n    , \"user\": User\n    , \"organization\": Organization | null\n    }\n\nUse it on your flags so the very first render already knows who is signed\nin:\n\n    Decode.decodeValue Clerk.stateDecoder flags\n        |> Result.withDefault Clerk.init\n\n","type":"Json.Decode.Decoder Clerk.State"},{"name":"subscriptions","comment":" Listen for messages from the shim.\n\n    subscriptions : Model -> Sub Msg\n    subscriptions _ =\n        Clerk.subscriptions clerkPorts ClerkMsg\n\n","type":"Clerk.Ports msg -> (Clerk.Msg -> msg) -> Platform.Sub.Sub msg"},{"name":"unmount","comment":" Unmount whatever Clerk component was mounted on the element with the\ngiven id.\n","type":"Clerk.Ports msg -> String.String -> Platform.Cmd.Cmd msg"},{"name":"update","comment":" Fold an incoming message into the state.\n\nA `stateChanged` message replaces the state and reports\n`Just (StateChanged newState)`; every other message leaves the state alone\nand only reports an event.\n\n    update : Msg -> Model -> ( Model, Cmd Msg )\n    update msg model =\n        case msg of\n            ClerkMsg clerkMsg ->\n                let\n                    ( clerk, cmd, event ) =\n                        Clerk.update clerkPorts clerkMsg model.clerk\n                in\n                ( { model | clerk = clerk }, cmd )\n\n","type":"Clerk.Ports msg -> Clerk.Msg -> Clerk.State -> ( Clerk.State, Platform.Cmd.Cmd msg, Maybe.Maybe Clerk.Event )"}],"binops":[]},{"name":"Clerk.Organization","comment":" The Clerk organization resource, reduced to the fields listed in\n`coverage.json`.\n\nAn organization is only present when one is active; see\n`Clerk.setActiveOrganization`.\n\n@docs Organization, decoder\n\n","unions":[],"aliases":[{"name":"Organization","comment":" The active Clerk organization.\n","args":[],"type":"{ id : String.String, name : String.String, slug : Maybe.Maybe String.String, imageUrl : String.String }"}],"values":[{"name":"decoder","comment":" Decode an `Organization` from the JSON the shim sends.\n\n    { \"id\": \"org_1\"\n    , \"name\": \"Acme\"\n    , \"slug\": \"acme\"\n    , \"imageUrl\": \"https://img.clerk.com/acme\"\n    }\n\n`slug` accepts `null`.\n\n","type":"Json.Decode.Decoder Clerk.Organization.Organization"}],"binops":[]},{"name":"Clerk.Session","comment":" The Clerk session resource, reduced to the fields listed in\n`coverage.json`.\n\nThe session token is deliberately absent: tokens are only available through\n`Clerk.requestToken`, which round-trips to ClerkJS so the token is always\nfresh.\n\n@docs Session, decoder\n\n","unions":[],"aliases":[{"name":"Session","comment":" The active Clerk session.\n\n`status` is passed through as ClerkJS reports it (for example `\"active\"`),\nso a new status value never fails to decode.\n\n","args":[],"type":"{ id : String.String, status : String.String, lastActiveAt : Time.Posix, expireAt : Time.Posix }"}],"values":[{"name":"decoder","comment":" Decode a `Session` from the JSON the shim sends.\n\n    { \"id\": \"sess_1\"\n    , \"status\": \"active\"\n    , \"lastActiveAt\": 1700000000000\n    , \"expireAt\": 1700003600000\n    }\n\nBoth timestamps arrive as epoch milliseconds.\n\n","type":"Json.Decode.Decoder Clerk.Session.Session"}],"binops":[]},{"name":"Clerk.User","comment":" The Clerk user resource, reduced to the fields listed in `coverage.json`.\n\nFields that ClerkJS exposes but this package does not decode are simply\nignored, so a Clerk release that adds a field cannot break decoding.\n\n@docs User, decoder\n\n","unions":[],"aliases":[{"name":"User","comment":" A signed-in Clerk user.\n\n`primaryEmailAddress` is the email address string itself\n(`user.primaryEmailAddress?.emailAddress` in ClerkJS), not the resource object.\n\n","args":[],"type":"{ id : String.String, primaryEmailAddress : Maybe.Maybe String.String, firstName : Maybe.Maybe String.String, lastName : Maybe.Maybe String.String, imageUrl : String.String, createdAt : Maybe.Maybe Time.Posix }"}],"values":[{"name":"decoder","comment":" Decode a `User` from the JSON the shim sends.\n\n    { \"id\": \"user_1\"\n    , \"primaryEmailAddress\": \"ada@example.com\"\n    , \"firstName\": \"Ada\"\n    , \"lastName\": \"Lovelace\"\n    , \"imageUrl\": \"https://img.clerk.com/ada\"\n    , \"createdAt\": 1700000000000\n    }\n\nEvery nullable field accepts `null`. `createdAt` arrives as epoch\nmilliseconds.\n\n","type":"Json.Decode.Decoder Clerk.User.User"}],"binops":[]}]