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EACA,SACA,MAAAE,EAAA,GACA,IAAAC,EAAA,EACA,QAAAC,EAAAG,EAAAC,KAAAR,GAA0B,OAAAI,EAAYA,EAAAG,EAAAC,KAAAR,GACtCG,IAAAC,EAAAK,OAAAP,EAAAQ,KAAA,CAA8BC,KAAAX,EAAAY,OAAAT,EAAAC,EAAAK,MAAAN,KAAgCA,EAAAI,EAAAM,UAAAX,EAAAQ,KAAA,CAA6BI,MAAAV,EAAA,KAC3F,OAAAD,IAAAH,EAAAlB,QAAAoB,EAAAQ,KAAA,CAAoCC,KAAAX,EAAAY,OAAAT,EAAAH,EAAAlB,OAAAqB,KAAiCD,CACrE,CAlBaa,CAAAf,GAAA,CAAAA,IAAApB,EAAA,GACb,OAAS0B,EAAAU,SAACC,QAAAf,GAAA,GAAAgB,KACN,EAAAZ,EAAAa,gBAACD,IAAAA,EAAAnD,OAAAqD,GAAAF,EAAAG,MAAArK,OAAA4H,EAAAsC,EAAAG,MAAArK,MAAAkK,EAAAG,MAAApB,aACC,EAAAqB,EAAAC,KAACpB,EAAA,CAAM5K,UAAA6K,EAAAH,SAAAI,EAAAmB,IAAAN,GAAAA,EAAAP,MAAA/B,EAAAsC,EAAAJ,SACb,CAEA,SAAAM,GAAanB,SAAAD,IACb,OAAS,EAAAsB,EAAAC,KAAC,QAAWtB,SAAAD,GACrB,CAHAD,EAAAhJ,MAAAqK,EAIA,MAAAb,EAAA","sources":["webpack://@logos/commerceweb-frontend/./Scripts/site/clients/license-claim-client.js","webpack://@logos/commerceweb-frontend/./Scripts/site/components/license-claim/shared.less?f152","webpack://@logos/commerceweb-frontend/./Scripts/site/components/license-claim/shared.jsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/license-claim/send-button/index.jsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/license-claim/verification-code-request/index.jsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/license-claim/verification-code-request/index.less?4ca7","webpack://@logos/commerceweb-frontend/javascript/node_modules/classnames/bind.js","webpack://@logos/commerceweb-frontend/javascript/node_modules/@faithlife/command-sentence-control/dist/command-sentence.js"],"sourcesContent":["import { fetch } from './../util/fetch';\n\nexport default class LicenseClaimClient {\n\tstatic async sendLibraryClaimLink(sendLibraryClaimLinkUrl, request) {\n\t\tconst response = await fetch.postWithBody({\n\t\t\turl: sendLibraryClaimLinkUrl,\n\t\t\tbody: request,\n\t\t});\n\n\t\treturn await response.json();\n\t}\n}\n","// extracted by mini-css-extract-plugin\nexport default {\"button\":\"shared--button--gSV9d btn btn-primary\",\"container\":\"shared--container--TWLgJ\",\"inputContainer\":\"shared--inputContainer--BxkyU\",\"inputBox\":\"shared--inputBox---a3o8\",\"inputButton\":\"shared--inputButton--sYYAi btn btn-secondary\",\"header\":\"shared--header--ob0CU\",\"subHeader\":\"shared--subHeader--JtCqo\",\"description\":\"shared--description--G4Zg1\",\"spinnerOverlay\":\"shared--spinnerOverlay--kH9I3\",\"logoContainer\":\"shared--logoContainer--K0Tjf\",\"logoSvg\":\"shared--logoSvg--E8SWV\",\"institutionSvg\":\"shared--institutionSvg--VtQNE\",\"institutionName\":\"shared--institutionName--xy7tV\",\"plus\":\"shared--plus--A0KGl\",\"errorInput\":\"shared--errorInput--dCFc4\",\"errorMessage\":\"shared--errorMessage--tofwC\"};","import React from 'react';\nimport { theme } from '@faithlife/styled-ui';\nimport { Plus } from '@faithlife/styled-ui/icons/12px';\nimport { CommandSentence } from '@faithlife/command-sentence-control';\nimport { useLocalization } from '../../localization';\nimport sharedStyles from './shared.less';\n\nexport const LogoHeader = ({ logosOrVerbum, institutionLogoUri, institutionName }) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.LicenseClaim.LicenseClaim');\n\treturn (\n\t\t<div className={sharedStyles.logoContainer}>\n\t\t\t<img\n\t\t\t\tclassName={sharedStyles.logoSvg}\n\t\t\t\tsrc={\n\t\t\t\t\tlogosOrVerbum === 'Verbum'\n\t\t\t\t\t\t? 'https://files.logoscdn.com/v1/files/53603903/assets/12332695/content.svg?signature=YQUpVRlKc0ds48hPxgGWhDcgNRI'\n\t\t\t\t\t\t: 'https://files.logoscdn.com/v1/assets/14904106/optimized?share=OdlwiB5OxhoI1yI0'\n\t\t\t\t}\n\t\t\t\talt={logosOrVerbum === 'Verbum' ? resources.VerbumIcon : resources.LogosIcon}\n\t\t\t/>\n\t\t\t<Plus className={sharedStyles.plus} color={theme.colors.gray66} />\n\t\t\t{institutionLogoUri ? (\n\t\t\t\t<img className={sharedStyles.institutionSvg} src={institutionLogoUri} alt={resources.InstitutionIcon} />\n\t\t\t) : (\n\t\t\t\t<p className={sharedStyles.institutionName}>{institutionName}</p>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport const PageHeader = ({ logoHeader, logosOrVerbum, pageDescription, pageSubHeader, header, headingRef }) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.LicenseClaim.LicenseClaim');\n\tconst descriptionComponent =\n\t\tpageDescription === undefined ? null : typeof pageDescription === 'string' ? (\n\t\t\t<p className={sharedStyles.description}>{pageDescription}</p>\n\t\t) : (\n\t\t\t<div className={sharedStyles.description}>{pageDescription}</div>\n\t\t);\n\treturn (\n\t\t<>\n\t\t\t{logoHeader === undefined ? null : logoHeader}\n\t\t\t<h1 ref={headingRef} className={sharedStyles.header}>\n\t\t\t\t{header ?? (\n\t\t\t\t\t<CommandSentence Container={React.Fragment} template={resources.PageHeader}>\n\t\t\t\t\t\t<CommandSentence.Field name=\"BRAND_NAME\">{logosOrVerbum}</CommandSentence.Field>\n\t\t\t\t\t</CommandSentence>\n\t\t\t\t)}\n\t\t\t</h1>\n\t\t\t{pageSubHeader === undefined ? null : <p className={sharedStyles.subHeader}>{pageSubHeader}</p>}\n\t\t\t{descriptionComponent}\n\t\t</>\n\t);\n};\n","import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport classNamesBind from 'classnames/bind';\nimport sharedStyles from '../shared.less';\n\nconst cx = classNamesBind.bind(sharedStyles);\n\nconst confirmationDisplayTimeMs = 3000;\n\nexport const SendButton = ({ isLoading, buttonText, loadingText, confirmationText, actionComplete, onClick }) => {\n\tconst [shouldShowConfirmation, setShouldShowConfirmation] = useState(false);\n\tconst confirmationEndTimeout = useRef(null);\n\n\tconst handleClick = () => {\n\t\tif (!isLoading) {\n\t\t\tonClick();\n\t\t}\n\t};\n\n\tconst handlePointerMove = useCallback(() => {\n\t\tif (confirmationEndTimeout.current) {\n\t\t\tclearTimeout(confirmationEndTimeout.current);\n\t\t}\n\t\tif (shouldShowConfirmation) {\n\t\t\tsetShouldShowConfirmation(false);\n\t\t}\n\t}, [shouldShowConfirmation]);\n\n\tuseEffect(() => {\n\t\tif (!actionComplete) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetShouldShowConfirmation(true);\n\t\tconfirmationEndTimeout.current = setTimeout(() => {\n\t\t\tsetShouldShowConfirmation(false);\n\t\t}, confirmationDisplayTimeMs);\n\n\t\treturn () => {\n\t\t\tif (confirmationEndTimeout.current) {\n\t\t\t\tclearTimeout(confirmationEndTimeout.current);\n\t\t\t}\n\t\t};\n\t}, [actionComplete]);\n\n\treturn (\n\t\t<button\n\t\t\tclassName={cx(sharedStyles.inputButton)}\n\t\t\tonClick={handleClick}\n\t\t\tdisabled={isLoading || shouldShowConfirmation}\n\t\t\tonPointerMove={handlePointerMove}\n\t\t>\n\t\t\t{isLoading ? loadingText : actionComplete ? (shouldShowConfirmation ? confirmationText : buttonText) : buttonText}\n\t\t</button>\n\t);\n};\n","import React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { Input, LoadingSpinner } from '@faithlife/styled-ui';\nimport classNamesBind from 'classnames/bind';\nimport { CommandSentence } from '@faithlife/command-sentence-control';\nimport { useLocalization } from '../../../localization';\nimport LicenseClaimClient from '../../../clients/license-claim-client';\nimport { validateEmailAddress } from '../../../util/email';\nimport sharedStyles from '../shared.less';\nimport { LogoHeader, PageHeader } from '../shared';\nimport { SendButton } from '../send-button';\nimport styles from './index.less';\n\nconst cx = classNamesBind.bind(sharedStyles);\n\nconst VerificationCodeRequest = ({\n\tinstitutionCode,\n\tinstitutionName,\n\tinstitutionLogoUri,\n\tisAcademicInstitution,\n\tlogosOrVerbum,\n\tinitialEmail,\n\troutes,\n\tverificationError: verificationErrorFromProps,\n}) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.LicenseClaim.LicenseClaim');\n\tconst [email, setEmail] = useState(initialEmail ?? '');\n\tconst [isLoading, setIsLoading] = useState(false);\n\tconst [emailSentCount, setEmailSentCount] = useState(0);\n\tconst [isActionComplete, setIsActionComplete] = useState(false);\n\tconst [inputErrorMessage, setInputErrorMessage] = useState(null);\n\tconst [verificationError, setVerificationError] = useState(verificationErrorFromProps);\n\tconst headingRef = useRef(null);\n\n\tconst handleEmailChange = useCallback(\n\t\tevent => {\n\t\t\tsetEmail(event.target.value);\n\t\t\tif (verificationError) {\n\t\t\t\tsetVerificationError(null);\n\t\t\t}\n\t\t},\n\t\t[verificationError]\n\t);\n\n\tconst verificationErrorMessageTemplate = useMemo(() => {\n\t\tif (!verificationError) {\n\t\t\treturn null;\n\t\t}\n\n\t\tswitch (verificationError.toLowerCase()) {\n\t\t\tcase 'expired':\n\t\t\t\treturn resources.VerificationCodeExpired;\n\t\t\tcase 'redeemed':\n\t\t\t\treturn resources.VerificationCodeClaimed;\n\t\t\tcase 'invalid':\n\t\t\t\treturn resources.InvalidVerificationCode;\n\t\t\tdefault:\n\t\t\t\treturn resources.UnknownValidationError;\n\t\t}\n\t}, [resources, verificationError]);\n\n\tconst sendLibraryClaimLink = useCallback(async () => {\n\t\tsetIsActionComplete(false);\n\t\tsetIsLoading(true);\n\t\tsetInputErrorMessage(null);\n\n\t\tconst validationError = validateEmailAddress(email, resources.EmptyEmail, resources.InvalidEmail);\n\t\tif (validationError) {\n\t\t\tsetInputErrorMessage(validationError);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tconst libraryClaimLinkResult = await LicenseClaimClient.sendLibraryClaimLink(routes.SendLibraryClaimLinkUrl, {\n\t\t\t\t\temail: email,\n\t\t\t\t\tinstitutionCode: institutionCode,\n\t\t\t\t});\n\n\t\t\t\tif (!libraryClaimLinkResult?.success) {\n\t\t\t\t\tthrow new Error('Library claim link request failed.');\n\t\t\t\t}\n\n\t\t\t\tsetEmailSentCount(emailSentCount + 1);\n\t\t\t\tsetIsActionComplete(true);\n\t\t\t} catch {\n\t\t\t\tsetInputErrorMessage(resources.FailedToSendVerificationCode);\n\t\t\t}\n\t\t}\n\t\tsetIsLoading(false);\n\t}, [email, emailSentCount, institutionCode, resources, routes.SendLibraryClaimLinkUrl]);\n\n\tconst handleFormSubmitted = useCallback(\n\t\tasync event => {\n\t\t\tevent.preventDefault();\n\t\t\tawait sendLibraryClaimLink();\n\t\t},\n\t\t[sendLibraryClaimLink]\n\t);\n\n\tconst { firstBodyTemplate, secondBodyTemplate } = useMemo(() => {\n\t\tconst firstBodyTemplate = emailSentCount\n\t\t\t? resources.VerificationCodeValidationDescription\n\t\t\t: resources.PageDescription;\n\t\tconst secondBodyTemplate =\n\t\t\temailSentCount > 1\n\t\t\t\t? resources.VerificationCodeValidationResendDescription2\n\t\t\t\t: emailSentCount\n\t\t\t\t\t? resources.VerificationCodeValidationResendDescription\n\t\t\t\t\t: resources.EmailVerificationDescription;\n\n\t\treturn { firstBodyTemplate, secondBodyTemplate };\n\t}, [emailSentCount, resources]);\n\tconst headerTemplate =\n\t\temailSentCount > 1 ? resources.LinkResent : emailSentCount ? resources.AlmostDone : resources.PageHeader;\n\n\tuseLayoutEffect(() => {\n\t\tif (!emailSentCount || !headingRef.current) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { top, bottom } = headingRef.current.getBoundingClientRect();\n\t\tconst isHeadingVisible = top >= 0 && bottom <= window.innerHeight;\n\n\t\tif (!isHeadingVisible) {\n\t\t\theadingRef.current.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n\t\t}\n\t}, [emailSentCount]);\n\n\treturn (\n\t\t<>\n\t\t\t{isLoading && (\n\t\t\t\t<div aria-label={resources.LoadingAriaLabel} className={sharedStyles.spinnerOverlay}>\n\t\t\t\t\t<LoadingSpinner variant=\"medium\" />\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<div className={sharedStyles.container}>\n\t\t\t\t<div className={sharedStyles.inputContainer}>\n\t\t\t\t\t<PageHeader\n\t\t\t\t\t\theadingRef={headingRef}\n\t\t\t\t\t\tlogoHeader={\n\t\t\t\t\t\t\t<LogoHeader\n\t\t\t\t\t\t\t\tinstitutionLogoUri={institutionLogoUri}\n\t\t\t\t\t\t\t\tlogosOrVerbum={logosOrVerbum}\n\t\t\t\t\t\t\t\tinstitutionName={institutionName}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\theader={\n\t\t\t\t\t\t\t<CommandSentence key={headerTemplate} Container=\"span\" template={headerTemplate}>\n\t\t\t\t\t\t\t\t<CommandSentence.Field name=\"BRAND_NAME\">{logosOrVerbum}</CommandSentence.Field>\n\t\t\t\t\t\t\t</CommandSentence>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpageDescription={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tmarginBottom: '32px',\n\t\t\t\t\t\t\t\t\t\tlineHeight: '135%',\n\t\t\t\t\t\t\t\t\t\t...(emailSentCount ? { fontSize: '24px', lineHeight: '125%' } : {}),\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CommandSentence key={firstBodyTemplate} Container=\"span\" template={firstBodyTemplate}>\n\t\t\t\t\t\t\t\t\t\t<CommandSentence.Field name=\"BRAND_NAME\">{logosOrVerbum}</CommandSentence.Field>\n\t\t\t\t\t\t\t\t\t\t<CommandSentence.Field name=\"EMAIL_ADDRESS\">\n\t\t\t\t\t\t\t\t\t\t\t<strong>{email}</strong>\n\t\t\t\t\t\t\t\t\t\t</CommandSentence.Field>\n\t\t\t\t\t\t\t\t\t</CommandSentence>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div style={{ ...(emailSentCount ? {} : { fontSize: '24px', lineHeight: '125%' }) }}>\n\t\t\t\t\t\t\t\t\t<CommandSentence key={secondBodyTemplate} Container=\"span\" template={secondBodyTemplate}>\n\t\t\t\t\t\t\t\t\t\t<CommandSentence.Field name=\"INSTITUTION_NAME\">\n\t\t\t\t\t\t\t\t\t\t\t<strong>{institutionName}</strong>\n\t\t\t\t\t\t\t\t\t\t</CommandSentence.Field>\n\t\t\t\t\t\t\t\t\t\t<CommandSentence.Field name=\"BRAND_NAME\">{logosOrVerbum}</CommandSentence.Field>\n\t\t\t\t\t\t\t\t\t\t<CommandSentence.Field name=\"RESEND_BUTTON_TEXT\">{resources.ResendButton}</CommandSentence.Field>\n\t\t\t\t\t\t\t\t\t\t<CommandSentence.Field name=\"EMAIL_ADDRESS\">\n\t\t\t\t\t\t\t\t\t\t\t<strong>{email}</strong>\n\t\t\t\t\t\t\t\t\t\t</CommandSentence.Field>\n\t\t\t\t\t\t\t\t\t</CommandSentence>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogosOrVerbum={logosOrVerbum}\n\t\t\t\t\t/>\n\t\t\t\t\t<form onSubmit={handleFormSubmitted}>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tclassName={cx(sharedStyles.inputBox, {\n\t\t\t\t\t\t\t\terrorInput: inputErrorMessage !== null,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tvariant=\"medium\"\n\t\t\t\t\t\t\ttype={emailSentCount ? 'hidden' : 'email'}\n\t\t\t\t\t\t\tvalue={email}\n\t\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\t\tisAcademicInstitution ? resources.AcademicEmailPlaceholder : resources.EnterpriseEmailPlaceholder\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonChange={handleEmailChange}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{inputErrorMessage && <div className={sharedStyles.errorMessage}>{inputErrorMessage}</div>}\n\t\t\t\t\t\t{verificationErrorMessageTemplate && (\n\t\t\t\t\t\t\t<p className={cx(sharedStyles.errorMessage, styles.verificationError)}>\n\t\t\t\t\t\t\t\t<CommandSentence\n\t\t\t\t\t\t\t\t\tkey={verificationErrorMessageTemplate}\n\t\t\t\t\t\t\t\t\tContainer=\"span\"\n\t\t\t\t\t\t\t\t\ttemplate={verificationErrorMessageTemplate}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CommandSentence.Field name=\"INSTITUTION_NAME\">{institutionName}</CommandSentence.Field>\n\t\t\t\t\t\t\t\t\t<CommandSentence.Field name=\"GET_MY_CODE_BUTTON_TEXT\">\n\t\t\t\t\t\t\t\t\t\t{resources.GetMyCodeButton}\n\t\t\t\t\t\t\t\t\t</CommandSentence.Field>\n\t\t\t\t\t\t\t\t</CommandSentence>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<SendButton\n\t\t\t\t\t\t\tbuttonText={emailSentCount ? resources.ResendButton : resources.GetMyCodeButton}\n\t\t\t\t\t\t\tactionComplete={isActionComplete}\n\t\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\t\tonClick={sendLibraryClaimLink}\n\t\t\t\t\t\t\tloadingText={resources.SendingCodeButtonText}\n\t\t\t\t\t\t\tconfirmationText={resources.SentCodeButtonText}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default VerificationCodeRequest;\n","// extracted by mini-css-extract-plugin\nexport default {\"verificationError\":\"index--verificationError--NJnxD\"};","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import { jsx as u } from \"react/jsx-runtime\";\nimport { useMemo as c, Children as x, isValidElement as l } from \"react\";\nfunction m({ template: e, children: s, Container: n = \"div\", className: t }) {\n  const d = c(() => p(e), [e]), i = {};\n  return x.forEach(s || [], (r) => {\n    l(r) && r.type === f && r.props.name && (i[r.props.name] = r.props.children);\n  }), u(n, { className: t, children: d.map((r) => r.text || i[r.field]) });\n}\nm.Field = f;\nfunction f({ children: e }) {\n  return u(\"span\", { children: e });\n}\nconst o = /%([A-Z0-9_]+)%/g;\nfunction p(e) {\n  if (!e)\n    return [];\n  const s = [];\n  let n = 0;\n  for (let t = o.exec(e); t !== null; t = o.exec(e))\n    n !== t.index && s.push({ text: e.substr(n, t.index - n) }), n = o.lastIndex, s.push({ field: t[1] });\n  return n !== e.length && s.push({ text: e.substr(n, e.length - n) }), s;\n}\nexport {\n  m as CommandSentence\n};\n//# sourceMappingURL=command-sentence.js.map\n"],"names":["LicenseClaimClient","sendLibraryClaimLink","sendLibraryClaimLinkUrl","request","response","fetch","postWithBody","url","body","json","shared","button","container","inputContainer","inputBox","inputButton","header","subHeader","description","spinnerOverlay","logoContainer","logoSvg","institutionSvg","institutionName","plus","errorInput","errorMessage","LogoHeader","_ref","logosOrVerbum","institutionLogoUri","resources","useLocalization","React","className","sharedStyles","src","alt","VerbumIcon","LogosIcon","Plus","color","theme","colors","gray66","InstitutionIcon","PageHeader","_ref2","logoHeader","pageDescription","pageSubHeader","headingRef","descriptionComponent","undefined","ref","CommandSentence","Container","template","Field","name","cx","classNamesBind","SendButton","isLoading","buttonText","loadingText","confirmationText","actionComplete","onClick","_useState","useState","_useState2","_slicedToArray","shouldShowConfirmation","setShouldShowConfirmation","confirmationEndTimeout","useRef","handlePointerMove","useCallback","current","clearTimeout","useEffect","setTimeout","handleClick","disabled","onPointerMove","license_claim_verification_code_request","institutionCode","isAcademicInstitution","initialEmail","routes","verificationErrorFromProps","verificationError","email","setEmail","_useState3","_useState4","setIsLoading","_useState5","_useState6","emailSentCount","setEmailSentCount","_useState7","_useState8","isActionComplete","setIsActionComplete","_useState9","_useState0","inputErrorMessage","setInputErrorMessage","_useState1","_useState10","setVerificationError","handleEmailChange","event","target","value","verificationErrorMessageTemplate","useMemo","toLowerCase","VerificationCodeExpired","VerificationCodeClaimed","InvalidVerificationCode","UnknownValidationError","async","validationError","validateEmailAddress","EmptyEmail","InvalidEmail","libraryClaimLinkResult","SendLibraryClaimLinkUrl","success","Error","_unused","FailedToSendVerificationCode","handleFormSubmitted","preventDefault","_useMemo","firstBodyTemplate","VerificationCodeValidationDescription","PageDescription","secondBodyTemplate","VerificationCodeValidationResendDescription2","VerificationCodeValidationResendDescription","EmailVerificationDescription","headerTemplate","LinkResent","AlmostDone","useLayoutEffect","_headingRef$current$g","getBoundingClientRect","top","bottom","window","innerHeight","scrollIntoView","behavior","block","LoadingAriaLabel","LoadingSpinner","variant","key","style","_objectSpread","marginBottom","lineHeight","fontSize","ResendButton","onSubmit","Input","type","placeholder","AcademicEmailPlaceholder","EnterpriseEmailPlaceholder","onChange","GetMyCodeButton","SendingCodeButtonText","SentCodeButtonText","__WEBPACK_AMD_DEFINE_RESULT__","hasOwn","hasOwnProperty","classNames","classes","i","arguments","length","arg","appendClass","parseValue","call","this","Array","isArray","apply","toString","Object","prototype","includes","newClass","module","exports","default","m","e","children","s","n","t","d","react__WEBPACK_IMPORTED_MODULE_1__","o","exec","index","push","text","substr","lastIndex","field","p","Children","forEach","r","isValidElement","f","props","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsx","map"],"sourceRoot":""}