{"version":3,"sources":["webpack:///./src/framework/payment/order-builder.ts","webpack:///./src/framework/payment/helpers.ts","webpack:///./src/web-api/entry-views/entry-set.ts","webpack:///./src/framework/model/extensions/lookup-field/lookup-manager.ts","webpack:///./src/assets/ex.svg","webpack:///./src/framework/model/extensions/lookup-field/cascade-filter-manager.ts","webpack:///./src/web-api/diff-patch/CognitoJsonPatchFormatter.ts","webpack:///./src/web-api/diff-patch/custom-patch-pipes.ts","webpack:///./src/web-api/diff-patch/CognitoJsonDiffPatcher.ts","webpack:///./src/web-api/concurrent-entry-service.ts","webpack:///./src/util/helpers.ts","webpack:///./src/web-api/entry-views/entry-view-util.ts","webpack:///./src/localization/resources lazy ^\\.\\/.*$ namespace object","webpack:///./src/localization/countries lazy ^\\.\\/.*\\.json$ namespace object","webpack:///./src/style/_motion.scss?505a","webpack:///./src/util/user-agent.ts","webpack:///./src/components/Col.vue?5815","webpack:///src/components/Col.vue","webpack:///./src/components/Col.vue?7744","webpack:///./src/components/Col.vue","webpack:///./src/util/debounce.ts","webpack:///./src/mixins/validated-source-path.js","webpack:///./src/components/form-resizing.ts","webpack:///./src/web-api/entry-service.ts","webpack:///./src/mixins/show-label.ts","webpack:///./src/components/Button.vue?19b7","webpack:///src/components/Button.vue","webpack:///./src/components/Button.vue?c634","webpack:///./src/components/Button.vue?40cb","webpack:///./src/components/Button.vue","webpack:///./src/style/_error-message.scss?95d8","webpack:///./src/framework/logging/error.ts","webpack:///./src/framework/model/core.ts","webpack:///./src/util/base62.ts","webpack:///./src/util/combined-number.ts","webpack:///./src/assets/cog.svg","webpack:///./src/components/Row.vue?0f74","webpack:///src/components/Row.vue","webpack:///./src/components/Row.vue?1d9d","webpack:///./src/components/Row.vue","webpack:///./src/components/VisibleTransition.vue?d4eb","webpack:///./src/components/VisibleTransition.vue?f065","webpack:///src/components/VisibleTransition.vue","webpack:///./src/components/VisibleTransition.vue","webpack:///./src/assets/error-outline.svg","webpack:///./src/util/dom.ts","webpack:///./src/style/_slide-transition.scss?2940","webpack:///./src/mixins/slide-transition.ts","webpack:///./src/components/StatusButton.vue?9aee","webpack:///./src/components/StatusButton.vue?5051","webpack:///src/components/StatusButton.vue","webpack:///./src/assets/check-outline.svg","webpack:///./src/components/StatusButton.vue?1b26","webpack:///./src/components/StatusButton.vue","webpack:///./src/components/Header.vue?1724","webpack:///./src/components/Button.vue?2033","webpack:///./src/style/_motion.scss","webpack:///./src/components/StatusButton.vue?3027","webpack:///./src/components/Page.vue?1b21","webpack:///./src/assets/graphics/paypal-logo.svg","webpack:///./src/util/model.ts","webpack:///./src/style/_field-placeholders.scss","webpack:///./src/style/_error-message.scss","webpack:///./src/components/Field.vue?134e","webpack:///./src/components/Choice.vue?1aa3","webpack:///./src/style/_slide-transition.scss","webpack:///./node_modules/@cognitoforms/element-ui/lib/locale/lang lazy ^\\.\\/.*$ namespace object","webpack:///./src/util/random.ts","webpack:///./src/web-api/form-session.ts","webpack:///./src/web-api/public-entry-service.ts","webpack:///./src/web-api/session-service.ts","webpack:///./src/components/Header.vue?41bc","webpack:///src/components/Header.vue","webpack:///./src/components/Header.vue?4eb5","webpack:///./src/components/Header.vue?5d4f","webpack:///./src/components/Header.vue","webpack:///./src/components/Page.vue?b96c","webpack:///./src/components/Captcha.vue?d2b8","webpack:///src/components/Captcha.vue","webpack:///./src/components/Captcha.vue?cb41","webpack:///./src/components/Captcha.vue","webpack:///./src/components/Page.vue?215a","webpack:///src/components/Page.vue","webpack:///./src/assets/back.svg","webpack:///./src/assets/next.svg","webpack:///./src/components/Page.vue?7cac","webpack:///./src/components/Page.vue","webpack:///./src/components/Field.vue?e5f4","webpack:///./src/style/_field-placeholders.scss?b567","webpack:///src/components/Field.vue","webpack:///./src/components/Field.vue?7a81","webpack:///./src/components/Field.vue?5135","webpack:///./src/components/Field.vue","webpack:///./src/components/Void.js","webpack:///./src/components/Choice.vue?49c9","webpack:///./src/components/Choice.vue?1afd","webpack:///src/components/Choice.vue","webpack:///./src/components/Choice.vue?2dd4","webpack:///./src/components/Choice.vue","webpack:///./src/components/SectionPlaceholder.vue?b7ce","webpack:///./src/components/SectionPlaceholder.vue","webpack:///./src/mixins/css-vars.ts","webpack:///./src/util/retryable-import.ts","webpack:///./src/components/FormBase.ts","webpack:///./src/util/array.ts","webpack:///./src/framework/form-theme.ts","webpack:///./src/framework/form-definition.ts","webpack:///./src/web-api/form-service.ts","webpack:///./serve/themes/entries.txt","webpack:///./src/web-api/file-service.ts","webpack:///./src/localization/product-supported-locales.generated.ts","webpack:///./src/localization/element-supported-languages.generated.ts","webpack:///./src/localization/element-localization.ts","webpack:///./src/framework/logging/app-insights.ts","webpack:///./src/framework/logging/log.ts","webpack:///./src/util/reference.ts","webpack:///./src/web-api/preview-entry-service.ts","webpack:///./src/web-api/entries-entry-service.ts","webpack:///./src/framework/internal-api.ts","webpack:///./src/framework/break-words-filter.ts","webpack:///./src/web-api/custom-response-error.ts","webpack:///./src/framework/model/serialization/converters/date-converter.ts","webpack:///./src/framework/model/serialization/converters/time-converter.ts","webpack:///./src/framework/model/serialization/converters/order-converter.ts","webpack:///./src/framework/model/serialization/converters/enum-converter.ts","webpack:///./src/framework/model/serialization/converters/ignore-circular-reference-converter.ts","webpack:///./src/framework/model/serialization/converters/initialize-back-references-converter.ts","webpack:///./src/framework/model/serialization/injectors/storage-property-injector.ts","webpack:///./src/framework/model/countries.ts","webpack:///./src/framework/model/extensions/address-extensions.ts","webpack:///./src/framework/model/extensions/name-extensions.ts","webpack:///./src/framework/model/extensions/signature-extensions.ts","webpack:///./src/framework/model/serialization/converters/calculation-converter.ts","webpack:///./src/framework/model/serialization/converters/date-time-converter.ts","webpack:///./src/framework/model/serialization/converters/lookup-converter.ts","webpack:///./src/framework/model/serialization/converters/yesno-converter.ts","webpack:///./src/framework/model/serialization/converters/entry-extension-converter.ts","webpack:///./src/framework/model/extensions/entity-init-extensions.ts","webpack:///./src/framework/model/extensions/lookup-field/lookup-model-extension.ts","webpack:///./src/framework/model/serialization/converters/ignore-signature-file-converter.ts","webpack:///./src/framework/model/extensions/workflow-action-extensions.ts","webpack:///./src/framework/model/serialization/converters/entry-meta-converter.ts","webpack:///./src/framework/forms-model.ts","webpack:///./src/framework/model/extensions/payment-extensions.ts","webpack:///./src/style/_toast-message.scss?668e","webpack:///./src/components/ToastMessageEx.vue?6ec8","webpack:///./src/components/ToastMessageEx.vue?77d5","webpack:///src/components/ToastMessageEx.vue","webpack:///./src/components/ToastMessageEx.vue","webpack:///./src/components/ToastMessage.ts","webpack:///./src/util/clientside-configuration.ts","webpack:///./src/style/_toast-message.scss","webpack:///./src/web-api/base-service.ts","webpack:///./src/mixins/form-status.ts","webpack:///./src/util/scroll-into-view.ts"],"names":["OrderBuilder","entry","lineItemMetaData","transactionFees","processingFees","applicationFee","domesticCountryCode","processingFeeDescription","processorName","europeanCountries","processorFeeModes","$culture","$resource","$namespace","idIndex","cardData","additionalFees","processorFee","useStripePaymentElement","model","meta","type","this","getResource","bind","Line_Item_Metadata","Transaction_Fees","Processing_Fees","Application_Fee","Domestic_Country_Code","Processing_Fee_Description","European_Countries","Processor_Fee_Modes","Use_Stripe_Payment_Element","orderInfo","Object","keys","billingFields","forEach","key","Amount","orderAmount","lineItems","lineItemData","lst","getPath","path","propertyList","slice","propertyLineItems","generateLineItems","concat","sort","item1","item2","idCompare","GroupId","split","map","gLineItem","Name","Description","Group","i1","parseInt","i2","parentEntity","group","groupId","property","isConstant","visibleProp","getProperty","length","createLineItems","instance","Array","isArray","createListLineItems","entityList","containerLineItems","listProp","itemLabel","id","groupIdLastHalf","splice","ItemNumber","itemGroupId","parentType","name","getLineItemName","join","isList","lineItem","createLineItem","selectedChoicesProperty","selectedChoices","value","createLookupCheckboxLineItems","createChoiceCheckboxLineItems","amountProperty","description","getLineItemDescription","lineItemIsNegative","allowNegatives","zeroDollarLineItem","includes","hasUnspecifiedQuantity","quantitySelected","indexOf","choiceOrLookupHasBlankSelection","containingType","roundCurrency","lookupEntry","toString","lookup","labelFormat","parent","paths","pricePath","choicesProperty","choiceOptions","label","choiceOption","find","c","Label","Price","filter","item","descriptionProperty","quantityValue","trim","nameProperty","labelIsFormat","isWithinTable","subtotal","Require_Payment","Save_Customer_Card","fee","IsProcessingFee","Entry","PaymentToken","Card","push","getCardFee","getMaximumFee","fees","percent","sum","fixed","PercentageAmount","FixedAmount","feeAmt","totalWithFees","maxFee","maxFeeAmount","feeAmount","isAmex","Brand","isEuropean","Country","isInternational","Modes","getFlags","Mode","priorityFees","options","flags","k1","k2","i","val","num","digits","multiplier","Math","pow","nFixed","toFixed","nInt","floor","nDecimals","remainder","round","roundToPrecision","numberFormat","CurrencyDecimalDigits","f","reduce","f1","f2","billingFieldPaths","values","billingField","p","Billing_Name_Field","Email","Billing_Email_Field","Address","Billing_Address_Field","Phone","Billing_Phone_Field","tFee","amount","processingFee","calculateProcessingFee","updateLineItems","rebuildOrder","order","AmountPaid","Fee","Payment","LineItem","orderBuilder","LineItems","apply","d","update","Fees","Rebuild_Count","defaultSort","a","b","ak","SortKey","bk","EntrySet","viewService","entryType","view","service","indexes","Map","entries","form","sortCriteria","refreshPromise","Promise","resolve","getIndex","has","delete","sorted","list","from","get","state","constructAsync","index","getId","typeCacheEntry","types","loadEntries","loadEntryData","e","set","Id","constructEntry","missing","listIndex","fei","criteria","entryFor","ensureEntriesLoaded","instances","findLookupManagers","entity","managers","visitEntity","lookupManager","indexType","pooledIndex","baseType","getPooledIndex","AdditionalValues","av","Value","prop","FieldId","JSON","parse","propertyType","Boolean","Number","construct","fullName","LookupManager","Prop","Watch","Component","entrySet","initializing","filterHasRun","defaultHasRun","isValid","syntheticIndexes","Set","filteredIndexes","defaultIndexes","readyTask","setDefaultsTask","entryViewService","isValidView","viewId","initialize","Deferred","refresh","o","container","isNew","lookupProperty","listValue","getIndexItem","syntheticIndex","Summary","summaryFormat","descriptionFormat","add","unshift","$emit","$nextTick","initialized","updateFilteredIndexes","IsIncluded","updateDefaultIndexes","some","v","IsDefaulted","allowUnknownEntry","setLookupValue","oldOptions","isNewEntry","hasNoValue","hasValue","all","getEntryById","pending","ignoreFilter","getEntry","batchUpdate","updateArray","promise","Vue","getLookupManager","lookupInfo","propsData","functional","render","_h","_vm","_c","staticClass","class","data","style","staticStyle","attrs","CascadeFilterManager","$once","valueFromFilterField","indexProperty","allowedStrings","flatMap","extract","stringify","isAllowed","setFieldValue","cascadeProperty","format","convertFromString","convertToString","ready","prerequisites","fromEntries","priorFilters","prior","filterField","requiredFunc","required","function","idx","every","priorFormat","priorValue","indexValueFormatted","indexValue","getCascadeFilterManager","isMoveOp","op","isRemoveOp","last","arr","opsByDescendingOrder","removeOps","sortBy","pred","indexA","indexB","lastA","lastB","splitA","splitB","isNaN","CognitoJsonPatchFormatter","diff","moveOps","removedOps","restOps","formatters","jsonpatch","partitionOps","delta","left","reorderOps","context","leftKey","movedFrom","isLast","default","compare","numerically","numericallyBy","PatchContext","pipe","result","hasResult","exiting","next","nextPipe","root","children","nextAfterChildren","Pipe","child","childName","addIdsToRepeatingSectionObjects","leftIsArray","_t","setResult","exit","right","$id","filterName","arrayFilterPreventModificationsFromMissingItems","nested","array","toRemove","toInsert","toModify","Error","indexDiff","itemIndex","findIndex","objectHash","toInsertLength","insertion","toModifyLength","modification","leftSide","arraysCollectPreventDuplicateCollections","diffPatcher","create","propertyFilter","propertyName","startsWith","lastIndexOf","textDiff","minLength","MAX_SAFE_INTEGER","obj","arrays","detectMove","processor","pipes","replace","patch","jsonPatchFormatter","ConcurrentEntryConflict","ConcurrentEntryService","session","isAdmin","initialEntryJson","embedUrl","saveAndRedirect","entryToken","entryJson","serialize","Order","performActionForNewEntry","Action","diffPatch","performActionForExistingEntry","Version","Role","User","response","submissionResult","parseStoreResult","entryDocuments","documents","doc","link","encodeURIComponent","sessionToken","parseSubmissionError","error","resumePage","saveAndResume","saveNewEntry","saveExistingEntry","saveResult","clone","emailAddress","saveAndResumeRecipients","emailMessage","postSaveEntryJson","entryId","recipient","message","serviceRequest","method","endpoint","parseError","formId","params","action","role","CustomResponseError","Type","Data","patchedEntry","entryVersion","paymentToken","user","isCognitoJson","headers","getValidationHeaders","FormId","EntryId","EntryVersion","Patch","EntryToken","EmbedUrl","OrderAmount","SaveAndRedirect","UserInfo","EntryJson","AccessToken","accessToken","LastPageViewed","validationMethod","validationToken","botValidation","token","EntryService","$format","template","arg1","source","arguments","prototype","call","match","p1","hasProp","hasOwnProperty","removeEmptyProps","k","undefined","getFormatPrecision","precision","capitalizeKeys","n","newObj","z","charAt","toUpperCase","substr","removeExtraSpace","text","getTimestamp","webpackAsyncContext","req","__webpack_require__","then","code","ids","module","exports","t","locals","getDeviceType","useragent","isDeviceType","navigator","query","deviceType","userAgent","toLowerCase","isLegacyEdge","test","isIE","isSafari","safariVersion","regEx","window","versionNumber","parseFloat","$createElement","_self","colNumClass","_withStripped","component","__file","debounce","callback","time","interval","deferred","args","clearTimeout","setTimeout","thisDeferred","reject","uiDebounce","rafId","cancelAnimationFrame","requestAnimationFrame","mixins","VueModel","SourcePath","inject","pageNumber","props","validationFilter","RegExp","isDirty","lostFocus","mounted","registerField","detectDirtyEntity","$el","addEventListener","evt","elGainingFocus","relatedTarget","contains","document","activeElement","beforeDestroy","unregisterField","created","firstError","handleErrorChange","watch","err","computed","showValidation","workflowEnabled","readonly","hasError","hasFormatError","ignoreError","conditions","$source","workflowIgnoreQuantityError","Next_Status","isQuantityLimitError","quantityError","formatError","methods","isEntityType","markDirtyForTrueChange","oldValue","changed","unsubscribe","subscribe","endsWith","forceValidation","ensureMinHeight","publicEvents","minHeight","emit","FormEvent","FormEvents","Resize","emitResizeEvent","height","postMessage","sentinel","isDelta","enableResizeDetection","ResizeObserver","contentRect","devicePixelRatio","DVPDecimal","heightMultiplier","observe","ResumeMode","SubmissionResultStatus","entryTokenRegex","tryParseEntryToken","decodeURIComponent","success","actionId","groups","isFieldShown","Page_Index","pageVisibleProp","condition","properties","isLookupField","validateEntry","ServiceWithSession","responseData","sr","Status","status","exceptionMessage","Message","showLabel","hideLabel","noStyle","on","click","handleClick","$slots","icon","_e","_v","hasText","icon2","CError","log","stack","additionalProperties","FriendlyError","setBackReferenceProperties","ParentSection","Form","subscribeOne","newValue","propagateFormProperty","generateListItemId","version","listItemIndex","number","toBase62","n1","n2","randomByte1","randomByte2","n1Bytes","n2Bytes","randomByte","random","headerByte","combineUInt16sWithPadding","randomInt","getListItemIdMap","idMap","ensureChildProperties","formEntry","getFormEntry","currentEntryVersion","attempts","randomText","itemForId","ensureUniqueListItemId","ensureEnumInstances","enumValues","known","EnumType","jstype","DisplayName","getEnumInstance","constructor","getEnumInstanceById","getEnumInstanceByName","duration","beforeEnter","beforeLeave","afterEnter","afterLeave","findContainer","$parent","isComponent","ref","$on","scroll","el","disableTransitions","getAttribute","matchMedia","matches","removeProperty","visibility","$children","handleResize","Function","width","clientWidth","clientHeight","scrollIntoView","display","overflow","classList","transition","maxWidth","maxHeight","remove","clearStyles","_obj","internalStatus","scopedSlots","_u","fn","proxy","escape","FORM_ENTRY_TYPE_NAME","circular","visited","visit","visitType","substring","max","scaleFactor","includeDigits","str","remainingLength","chunk","chunkLength","min","BotValidationMethod","PublicEntryService","SaveAndResume_EmbedUrl","SaveAndResume_LastPageViewed","FormSession","sessionData","_botChallenge","resources","apiKey","organizationId","isReadonly","paymentProcessor","paymentTestMode","paymentApiKey","paymentLocationId","paymentLocationCurrencyCode","paymentSdkUrl","formStatus","fileUploadLimit","viewTokens","encryptionKey","isAnonymous","cognitoHostName","isValidSharedLink","publicRole","userInfo","formUrl","linkText","botChallenge","defineProperty","enumerable","writable","freeze","evidence","resource","chars","parseUrlHostname","CognitoConfiguration","SiteUrl","SessionService","embedContext","EmbedContext","Public","formJson","isAdminSession","Publish","Preview","Entries","request","res","FormStatus","pascalStr","camelCaseFlags","flag","ensureCamelCaseFlags","assign","BaseService","visible","layout","logo","alignment","src","alt","title","_s","showConfirmation","domProps","innerHTML","virtual","directives","rawName","expression","paging","_g","_b","tag","enter","onEnter","current","canRender","hideNumber","isSubmission","visibleNumber","showSaveButton","validated","captchaValidated","showNavigation","hasButtons","navIsCondensed","measuringIfNavIsCondensed","showBackButton","nativeOn","$event","avoidOrphans","backButton","_l","allowedActions","ActionName","getActionStatus","preventDefault","handleSubmitClick","ButtonText","nextButtonType","submitStatus","handleNext","submitButtonText","nextButton","saveStatus","handleSave","saveButtonText","showSubmissionWarning","toggleRecaptcha","sitekey","loadRecaptchaScript","fieldContainerType","isTable","isFocused","fieldIndex","subtypeClass","subtype","customClass","containerOnly","validationOnly","forceShown","labelType","for","_f","showAsterisk","field","focusLost","handleFocusLost","helptext","duplicateError","h","checkable","columns","choices","choice","allowOther","processCssVars","cleanSlate","importWithRetry","getImport","onLine","once","Header","Row","Col","Page","Field","Void","VisibleTransition","Choice","_asyncComponentImports","registerAsyncComponent","importPromise","FormBase","components","CGoogleAnalytics","CTrackingPixel","CPageProgress","CRepeatingSection","loading","SectionPlaceholder","delay","CTable","CSection","CRatingScale","CContent","CInput","CInvalidForm","CNumberDropdown","CName","CAddress","CSpinner","CSelect","CDate","CTime","CCheckboxGroup","CCheckbox","CRadioGroup","COrder","COrderDetails","CPayment","CBillingInfo","CTransactionDetails","CToggle","CSignature","CUpload","CSaveResumeDialog","CBranding","CAbuse","CConfirmation","CLookup","CCascadeFilter","CWebsite","Provide","FormEventScope","immediate","internalEntryToken","showReceipt","entryDetailsVisible","pages","fields","Default","hostingPageUrl","location","href","saveResumeInfo","open","emailStatus","enableSend","paymentError","focusPlace","headerRef","bodyRef","_keydownListener","enforceValidation","pageTransitioning","themeSettings","logoAlt","headerLayout","headerAlignment","isChameleon","resizeObserver","fieldsChanging","fieldsChangingTimeout","unsubscribeFromToastRequests","cb","Action_IsLocked","AllowedActionsChanged","ActionChanged","NewStatus","Form_ReadOnly","OrderUpdated","newNumber","oldNumber","closeAllToastMessages","autoSave","AfterNavigate","direction","NavigationDirection","Forward","Backward","sourcePage","destinationPage","currentPage","event","submitButton","target","closest","onLastField","getLastFieldElement","onSubmitButton","actionName","navigate","forward","validateCaptcha","getCaptchaValidator","page","incoming","getKey","ascending","mid","cmp","incomingKey","low","high","insertPosition","binaryInsert","disableValidation","readonlyChanged","handlePrint","handleOffline","onToastMessageRequested","_message","ScrollToTop","pageLoad","setAttribute","$refs","header","body","embedded","CaptureHost","url","waitForFieldsToUpdate","Ready","startingPage","navigateTo","handleTab","handleLastFieldEnter","processPayment","removeEventListener","unobserve","isSafariOrMobile","mobile","onLastPage","which","tabDirection","shiftKey","indexToTry","focusIndex","elements","focus","querySelectorAll","row","querySelector","widths","size","ceil","offlineMessage","createToastMessage","showClose","handleOnline","close","currentHeight","pageSpeed","getComputedStyle","transitionDuration","$root","getBoundingClientRect","top","head","createElement","appendChild","activePage","getFirstInvalidFieldElement","formContainer","align","useNativeScrolling","transitionStyles","getElementById","parentNode","removeChild","firstInput","preventScroll","$props","getFirstFieldElement","getTextArea","base","nodeName","firstErrorComponent","input","$options","showErrors","scrollToAndFocusFirstInvalidFieldElement","hasErrors","FailedValidation","ToastMessage","fileService","busy","targetPage","fileServiceBusy","BeforeNavigate","firstPage","lastPage","errorExists","assertValidation","authorizeNavigation","validatePageRange","submit","file","UploadFile","Size","markPersisted","formsModel","forceResubmit","IsAllowed","blockSubmission","quantityService","firstAccessiblePage","tempPage","visiblePages","reverse","InProgress","wasAuthenticating","Authenticating","Attempted_Action","canSubmit","BeforeSubmit","orderComponent","paymentComponent","getPaymentToken","getOrderInfo","IsOpen","entryReset","setEntryResetTrue","ResetEntry","entryService","shouldSaveAndRedirectPayment","off","finalEntry","finalOrder","Success","reset","hasInitialState","afterSubmit","CaptchaError","Captcha","onlyShowToast","handleConcurrentEntryConflict","InvalidSharedLinkError","PublicLinksDisabledError","AfterSubmit","redirectOrShowConfirmationPage","submissionSettings","paymentRedirectUrl","redirect","showConfirmationPage","authenticate","PaymentStatus","paymentDeclined","AlreadyPaid","CardDeclined","PaymentDeclined","OrderMismatch","QuantityLimitExceeded","AlreadySubmitted","Unknown","Redirect","actions","URL","PaymentMessage","isExistingEntry","save","showDialog","reportStatus","setStatus","isValidUrl","hash","parseUrlHash","AfterSave","email","emailResumeLink","fieldCount","Workflow_Actions","Allowed_Actions","enablePaging","submissionPage","PaymentURL","readonlyAndPaid","forceHideOrder","orderExists","shouldSaveCard","saveCustomerCard","shouldCollectPayment","isActionPayable","paypal","Payment_Processor_Name","chameleon","SourceRoot","createThemeStylesheet","className","rel","FormTheme","links","themeData","css","createThemeStyle","theme","linkUrls","updateStyleRules","element","parentElement","modelOptionsFn","pendingModules","modelOptions","core","m","importOptionalModule","FormDefinitionBuilder","formInternalName","_component","_modelPromise","_theme","extend","entryTypeName","formTypeNames","FormsModel","createModel","FormDefinition","themeDef","prepareModelOptions","builder","compileComponent","createTheme","FormService","getUri","formDef","script","getFormDef","onload","onerror","FileService","inProgress","deserializeFileDataRef","onProgress","encrypt","cancelPromise","cancel","axios","CancelToken","FormData","append","cancelToken","onUploadProgress","total","loaded","ct","ContentType","productSupportedLocales","en","hu","th","sv","es","hi","nl","fi","bg","zh","it","pt","nb","pl","fr","ja","da","tr","de","hr","elementSupportedLanguages","productLocaleToElementLangOverrides","importElementLanguage","locale","langCode","localeName","overrideElementLangCode","getElementLanguageCode","configureElementLocalization","elementLocalization","localizedResources","cultureInfo","lang","overriddenResourcePaths","overrides","dateTimeFormat","MonthNames","AbbreviatedDayNames","AbbreviatedMonthNames","createMissing","j","overrideResourcePath","updateElementLanguageModule","use","AppInsights","endpointUrl","appInsights","initializer","ApplicationInsightsInitializer","config","isCookieUseDisabled","instrumentationKey","enableUnhandledPromiseRejectionTracking","maxBatchInterval","loadAppInsights","exception","trackException","trackPageView","telemetryInitializer","addTelemetryInitializer","eventName","trackEvent","ignoredExceptions","Log","isEnabled","baseData","metadata","errorHandler","onError","warnHandler","onWarning","console","trace","isWarning","warn","logCustomEvent","$vm","getInstance","cError","pageView","customEvent","InternalName","formName","WriteableReference","_value","_setValueTask","PreviewEntryService","formJSON","entryJSON","orderJSON","saveAndResumeAddresses","SaveAndResumeNotification","Recipients","EntriesEntryService","getEntryViewServiceIfNeeded","hasLookups","hasQuantityLimits","mountInvalidFormView","provide","$mount","CRequireAuthenticationEmbed","loader","getElementsByClassName","InternalApi","forms","sessionService","newSession","formService","getDefinition","catch","reportLoadingError","roleName","getFormDefinition","entriesEntryService","entryState","handle","handleIsReady","entryHash","resume","concurrentEditing","getEntryService","OverrideText","overrideResource","resourceName","Prefill","json","JSON5","formRef","FormComponent","couldParseEntryToken","userEmail","requireAuthenticationEmbedded","mountRequireAuthenticationView","getQuantityServiceIfNeeded","registerEntry","$locale","$resources","registerResources","objects","preventVueObservability","preventObservability","formOptions","mode","View","lastPageViewed","$parse","$expandDateFormat","expandDateFormat","Iframe","Seamless","formAvailableProp","available","isCalculated","defaultsSet","Form_Available","PaymentRedirect","resumeAfterPaymentRedirect","errorInfo","DateConverter","Date","specifier","getFullYear","getMonth","getDate","parseDate","date","parts","PropertyConverter","TimeConverter","getHours","getMinutes","getSeconds","fullDate","OrderConverter","ORDER_TYPE_NAME","IgnoreProperty","EnumConverter","propModelType","enum","IgnoreCircularReferenceConverter","InitializeBackReferencesConverter","shouldConvert","deserialize","StoragePropertyInjector","results","countryNameWithParensExpr","countryNameWithCommaExpr","AddressExtensions","country","CountryCode","countryCode","countries","getAlpha2Code","cleansedName","nameWithoutSpaces","replaceAll","getCountryCode","validateRequiredAddress","enforceableFields","countryLabelUS","errorCount","validateZipCode","PostalCode","NameExtensions","validateRequiredName","firstIsMissing","First","lastIsMissing","Last","SignatureExtensions","validateRequiredSignature","Svg","CalculationConverter","DateTimeConverter","LookupConverter","lookupValue","YesNoConverter","defaultValue","exceptionRegex","EntryExtensionConverter","applyEntityInitExtensions","referenceProperties","isName","isAddress","initExisting","ensurePropertyInitialized","isRootLookupProperty","propDef","isNestedLookupProperty","isCascadeFilterProperty","getManagerPropName","getLookupDefaultUpdateRule","manager","dependsOn","defaultPaths","getLookupFilterUpdateRule","filterPaths","IgnoreSignatureFileConverter","addWorkflowActionsProperty","actionDataMap","String","IsArchived","addRule","execute","actionType","actionData","onInit","register","entryMetaType","firstAllowedAction","onChangeOf","getPaths","getActiveEntryStatus","statusIdOrName","newStatus","Entry_Statuses","s","ReplacementId","applyWorkflowActionExtensions","resolveType","entryMeta","nextStatus","addWorkflowNextStatusProperty","EntryMetaConverter","statuses","Entity","isEntryIncomplete","DateSubmitted","getDefaultStatus","localeResources","lookupValueResolver","captureEnumValues","preprocessOptions","autogeneratePropertyLabels","maxEventScopeDepth","maxExitingEventScopeTransferCount","configureSerialization","applyCustomTypeExtensions","Signature","captureActionData","Require_Payment_Expression","Save_Card_Agreement","newOrderState","AdditionalFees","AmountDue","SubTotal","orderType","applyPaymentExtensions","postprocessModel","lookupMappings","typeName","typeDef","$storageProperties","alias","serializer","registerPropertyAlias","propName","$lookupFieldInfo","registerValueResolver","initialValueResolver","registerPropertyConverter","registerPropertyInjector","modelType","getIdFromState","createSync","formatNumber","formatDate","parseNumber","addLookupManagerProperty","indexTypeName","addCascadeFilterManagerProperty","filterInfo","cascadeManagerProp","lookupPropertyName","indexPropertyName","lookupViews","currentType","cascadeManagersToInitialize","currentProperty","addCascadeFilterManager","unloadedIds","dataLoaded","lookupEntries","entryData","reason","extendModelWithLookups","$version","$enum","$extends","$data","CultureInfo","typeExtensions","typeExtension","enumTypeName","enumJsType","getJsType","enumType","originalGet","countriesModule","registerLocale","definedLocales","defineResources","modulePromise","ExClass","IEx","toastListeners","messagesDisplayed","messageInstance","onClose","exInstance","RequestCancelledError","StripePaymentIntentError","InternalServerError","isAxiosError","baseUrl","client","baseURL","origin","xsrfCookieName","defaults","post","common","interceptors","modelSerialization","receiveServerTime","receiveSessionToken","isAbsoluteURL","combineUrls","buildURL","paramsSerializer","passive","transformServiceRequestOptions","isCancel","transformErrorFromResponse","serverTime","serverTimeOffset","getTime","CustomEvent","dispatchEvent","receiveAccessToken","errorHeading","parseSvcError","FormStatusProp","validator","settings","rect","behavior","bottom","innerHeight","documentElement"],"mappings":"6WA2BqBA,E,WAw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AAU,KAAKvV,OA/IpC,+O,gCCMO,SAASic,EAAa5U,GAC5B,OAAOA,EAAMQ,GAAGxM,MAAM,KAAK,GAGrB,SAASiM,EAAMD,GACrB,OAAOA,EAAMQ,GAAGxM,MAAM,KAAK,GAT5B,qE,oBCFA,IAAIC,EAAM,CACT,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAA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,CACV,IACA,IAED,UAAW,CACV,IACA,IAED,aAAc,CACb,IACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,UAAW,CACV,IACA,IAED,aAAc,CACb,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,UAAW,CACV,IACA,IAED,aAAc,CACb,IACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,IAED,aAAc,CACb,IACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,UAAW,CACV,IACA,IAED,aAAc,CACb,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,UAAW,CACV,IACA,IAED,aAAc,CACb,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,OAAQ,CACP,IACA,GACA,IAED,UAAW,CACV,IACA,GACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,UAAW,CACV,IACA,IAED,aAAc,CACb,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,UAAW,CACV,IACA,IAED,aAAc,CACb,IACA,IAED,UAAW,CACV,IACA,IAED,aAAc,CACb,IACA,IAED,OAAQ,CACP,IACA,IAED,UAAW,CACV,IACA,IAED,UAAW,CACV,KAED,aAAc,CACb,KAED,UAAW,CACV,IACA,IAED,aAAc,CACb,IACA,KAGF,SAAS4gB,EAAoBC,GAC5B,IAAIC,EAAoBpR,EAAE1P,EAAK6gB,GAC9B,OAAOzV,QAAQC,UAAU0V,MAAK,WAC7B,IAAI1U,EAAI,IAAImM,MAAM,uBAAyBqI,EAAM,KAEjD,MADAxU,EAAE2U,KAAO,mBACH3U,KAIR,IAAI4U,EAAMjhB,EAAI6gB,GAAMpf,EAAKwf,EAAI,GAC7B,OAAO7V,QAAQiG,IAAI4P,EAAI3hB,MAAM,GAAGU,IAAI8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xqC,IAAUA,EAAMV,UAA0C,iCAA9BU,EAAMV,SAAS9I,KAAKwJ,MACrE,OAAO,IAAIsqC,EACP,GAAIE,EAAaxqC,IAAUA,EAAMV,UAAsC,MAA1BU,EAAMV,SAAS8N,OAAgB,CAChF,IAAM++B,EAAevqD,KAAK0c,QAAQzc,YAAY,kCAK9C,OAJAuoC,YAAaxoC,KAAK0c,QAAQ4C,OAAQ,CACjCvf,KAAM,QACNkf,QAASsrC,GAAgB,0BAEnB,IAAI5B,EAEP,OAAI3oD,KAAK0c,QAAQxT,MAAMgxC,kBACpBl6C,KAAKwqD,cAAcpsC,GAEpBA,IApCT,oCAuCeA,GACb,GAAIA,aAAiBsB,IAAqB,CACzC,GAAyB,wBAArBtB,EAAMxJ,KAAKwJ,MACd,OAAO,IAAIytB,EACP,GAAyB,0BAArBztB,EAAMxJ,KAAKwJ,MACnB,OAAO,IAAI0tB,EACP,GAAyB,iCAArB1tB,EAAMxJ,KAAKwJ,MACnB,OAAO,IAAIsqC,EAEb,OAAOtqC,MAhDT,GAAwCgY,I,wGCrM5BN,E,gBAAAA,K,kBAAAA,E,kBAAAA,E,wBAAAA,E,cAAAA,E,kBAAAA,E,iCAAAA,M,KASL,IAAM20B,EAAiB,CAC7B1qD,KAAM4hD,OACN9oC,QAASid,EAAW0J,QACpBkrB,UAAW/lD,GACH9D,OAAO8J,OAAOmrB,GAAY1wB,SAAST,K,gCCb5C,sBAQemsB,IAPQ,CAACuR,EAAqBsoB,EAAsCzlC,EAAsCmiB,GAA8B,KACtJ,IAAMujB,EAAOvoB,EAAOuE,wBAChBS,EACHhF,EAAOvR,eAAe,CAAE+5B,SAAU,YAC1BD,EAAK/jB,IAAM,GAAK+jB,EAAKE,QAAUtmC,OAAOumC,aAAe7jC,SAAS8jC,gBAAgBn6B,gBACtFb,IAAOqS,EAAQsoB,EAAUzlC","file":"149.ae231204035d8992bd49.js","sourcesContent":["import { OrderInfo } from './payment-types';\r\nimport { CardInformation } from '../../server-types/payment/model/card-information';\r\nimport { CultureInfo, Entity, Property } from '@cognitoforms/vuemodel';\r\nimport { FeeProperties } from '../../server-types/payment/model/fee';\r\nimport { TransactionFeeProperties } from '../../server-types/payment/model/transaction-fee';\r\nimport { LineItemProperties } from '../../server-types/payment/model/line-item';\r\nimport { Order } from '../../server-types/payment/model/order';\r\nimport { FormEntry, LineItemMetaData } from 'src/server-types/forms/model/form-entry';\r\nimport { Country } from 'src/server-types/model/country';\r\nimport { roundToPrecision } from './helpers';\r\nimport { Type } from '@cognitoforms/model.js';\r\nimport { Choice } from 'src/server-types/model/choice';\r\nimport { CustomerInformation, CustomerInformationProperties } from 'src/server-types/model/customer-information';\r\n\r\ninterface GroupedLineItem extends LineItemProperties {\r\n\tGroupId: string;\r\n}\r\n\r\ninterface StripeProcessorFeeProperties extends TransactionFeeProperties {\r\n\tCountry?: Country;\r\n\tMode?: number;\r\n}\r\n\r\ntype BillingFieldMap = {\r\n\t[P in keyof CustomerInformationProperties]?: string;\r\n}\r\n\r\nexport default class OrderBuilder {\r\n\t// -------------- Properties --------------\r\n\tentry: Entity;\r\n\r\n\tlineItemMetaData: Array = [];\r\n\r\n\ttransactionFees: Array = [];\r\n\r\n\tprocessingFees: Array = [];\r\n\r\n\tapplicationFee: TransactionFeeProperties = null;\r\n\r\n\tdomesticCountryCode: string = 'US';\r\n\r\n\tprocessingFeeDescription: string = null;\r\n\r\n\tprocessorName: string = null;\r\n\r\n\teuropeanCountries: string[];\r\n\r\n\tprocessorFeeModes: { [key: string]: number };\r\n\r\n\t// -------------- Injections --------------\r\n\t$culture: CultureInfo;\r\n\r\n\t$resource: (name: string) => string;\r\n\r\n\t$namespace: any;\r\n\r\n\t// -------------- Data --------------\r\n\tidIndex: number = 0;\r\n\r\n\tcardData: CardInformation = null;\r\n\r\n\tadditionalFees: number = 0;\r\n\r\n\tprocessorFee: number = 0;\r\n\r\n\tuseStripePaymentElement: Boolean = false;\r\n\r\n\tconstructor(entry: FormEntry) {\r\n\t\tconst model = entry.meta.type.model;\r\n\t\tthis.$namespace = model.$namespace;\r\n\t\tthis.$culture = model.$culture;\r\n\t\tthis.$resource = model.getResource.bind(model);\r\n\r\n\t\tthis.entry = entry;\r\n\t\tthis.lineItemMetaData = entry.Line_Item_Metadata;\r\n\t\tthis.transactionFees = entry.Transaction_Fees;\r\n\t\tthis.processingFees = entry.Processing_Fees;\r\n\t\tthis.applicationFee = entry.Application_Fee;\r\n\t\tthis.domesticCountryCode = entry.Domestic_Country_Code;\r\n\t\tthis.processingFeeDescription = entry.Processing_Fee_Description;\r\n\t\tthis.europeanCountries = entry.European_Countries;\r\n\t\tthis.processorFeeModes = entry.Processor_Fee_Modes;\r\n\r\n\t\tthis.useStripePaymentElement = entry.Use_Stripe_Payment_Element;\r\n\t}\r\n\r\n\t// -------------- Computed --------------\r\n\tget billingFields(): CustomerInformation {\r\n\t\tif (!this.billingFieldPaths)\r\n\t\t\treturn null;\r\n\r\n\t\tconst values = {};\r\n\r\n\t\tObject.keys(this.billingFieldPaths).forEach((billingField: keyof CustomerInformationProperties) => {\r\n\t\t\tconst path = this.billingFieldPaths[billingField];\r\n\t\t\tif (!path)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tconst paths = path.split('.');\r\n\t\t\tlet parentEntity = this.entry;\r\n\t\t\tlet property = null;\r\n\r\n\t\t\t// Find the property and the parent instance\r\n\t\t\tfor (let i = 0; i < paths.length; i++) {\r\n\t\t\t\tconst p = paths[i];\r\n\t\t\t\t// Can not be in a dynamic container\r\n\t\t\t\tproperty = parentEntity.meta.type.getPath(p);\r\n\r\n\t\t\t\tif (i !== paths.length - 1)\r\n\t\t\t\t\tparentEntity = parentEntity ? parentEntity[p] : null;\r\n\r\n\t\t\t\t// If the parent is unset/empty (Lookup), return\r\n\t\t\t\tif (!parentEntity)\r\n\t\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst val = property.value(parentEntity);\r\n\t\t\tif (val)\r\n\t\t\t\tvalues[billingField] = val;\r\n\t\t});\r\n\r\n\t\treturn values as CustomerInformation;\r\n\t};\r\n\r\n\tget billingFieldPaths(): BillingFieldMap {\r\n\t\treturn {\r\n\t\t\tName: this.entry.Billing_Name_Field,\r\n\t\t\tEmail: this.entry.Billing_Email_Field,\r\n\t\t\tAddress: this.entry.Billing_Address_Field,\r\n\t\t\tPhone: this.entry.Billing_Phone_Field\r\n\t\t};\r\n\t}\r\n\r\n\tget subtotal(): number {\r\n\t\treturn this.sum(this.lineItems, 'Amount');\r\n\t};\r\n\r\n\tget fees(): Array {\r\n\t\tif (!this.transactionFees && !this.processingFees)\r\n\t\t\treturn null;\r\n\r\n\t\tconst subtotal = this.subtotal;\r\n\r\n\t\t// Fees should not be present if there is no money due\r\n\t\tif (subtotal <= 0)\r\n\t\t\treturn [];\r\n\r\n\t\t// Parse the transaction fees list\r\n\t\tconst fees = [] as Array;\r\n\r\n\t\t// Calculate the amount for each fee and the display value\r\n\t\tthis.transactionFees.forEach((tFee) => {\r\n\t\t\tif (!tFee.Description)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tlet amount = tFee.FixedAmount || 0;\r\n\t\t\tif (tFee.PercentageAmount) {\r\n\t\t\t\tamount += this.roundCurrency(subtotal * tFee.PercentageAmount);\r\n\t\t\t}\r\n\t\t\tfees.push({\r\n\t\t\t\tName: tFee.Description,\r\n\t\t\t\tAmount: amount,\r\n\t\t\t\tDescription: tFee.Description,\r\n\t\t\t\tIsProcessingFee: false\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tthis.additionalFees = this.sum(fees, 'Amount');\r\n\r\n\t\t// Calculate the amount for each processing fee, the display value, and set the description\r\n\t\tconst processingFee = this.calculateProcessingFee();\r\n\t\tif (processingFee) {\r\n\t\t\tfees.push(processingFee);\r\n\t\t}\r\n\r\n\t\treturn fees;\r\n\t};\r\n\r\n\tget orderAmount(): number {\r\n\t\treturn this.subtotal + this.sum(this.fees, 'Amount');\r\n\t};\r\n\r\n\tget lineItems() : Array {\r\n\t\treturn this.updateLineItems();\r\n\t}\r\n\r\n\t// -------------- Methods --------------\r\n\tgetOrderInfo() : OrderInfo {\r\n\t\tconst orderInfo = {} as OrderInfo;\r\n\r\n\t\tObject.keys(this.billingFields).forEach((key) => {\r\n\t\t\torderInfo[key] = this.billingFields[key];\r\n\t\t});\r\n\r\n\t\torderInfo.Amount = this.orderAmount;\r\n\r\n\t\treturn orderInfo;\r\n\t}\r\n\r\n\tupdateLineItems() : Array {\r\n\t\tlet lineItems = [] as Array;\r\n\r\n\t\tthis.lineItemMetaData.forEach((lineItemData) => {\r\n\t\t\tconst lst = this.entry.meta.type.getPath(lineItemData.path);\r\n\t\t\tlineItemData.propertyList = lst['properties'] ? lst['properties'] as Property[] : [lst as Property];\r\n\t\t});\r\n\r\n\t\tthis.lineItemMetaData.forEach((lineItemData) => {\r\n\t\t\tconst propertyList: Property[] = lineItemData.propertyList.slice();\r\n\r\n\t\t\tthis.idIndex = 0;\r\n\r\n\t\t\t// Create the line items for the property\r\n\t\t\tconst propertyLineItems = this.generateLineItems(lineItemData, propertyList, this.entry, '', '');\r\n\r\n\t\t\t// If line items were created, add the line items to the list\r\n\t\t\tif (propertyLineItems) {\r\n\t\t\t\tlineItems = lineItems.concat(propertyLineItems);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tlineItems = lineItems.sort((item1, item2) => { return this.idCompare(item1.GroupId.split('-'), item2.GroupId.split('-')); });\r\n\r\n\t\t// Line items should appear in the order they appear on the form unless they have a group\r\n\t\t// Grouped line items should appear in the order they appear on the form\r\n\t\t// The group is placed where it is first encountered\r\n\t\treturn lineItems.map((gLineItem) => {\r\n\t\t\treturn {\r\n\t\t\t\tName: gLineItem.Name,\r\n\t\t\t\tDescription: gLineItem.Description,\r\n\t\t\t\tGroup: gLineItem.Group,\r\n\t\t\t\tAmount: gLineItem.Amount ? gLineItem.Amount : 0\r\n\t\t\t};\r\n\t\t});\r\n\t}\r\n\r\n\tidCompare(item1: string[], item2: string[]) : number {\r\n\t\tconst i1 = parseInt(item1[0]) || -1;\r\n\t\tconst i2 = parseInt(item2[0]) || -1;\r\n\t\tif (i1 === i2)\r\n\t\t\treturn i1 === -1 ? 0 : this.idCompare(item1.slice(1), item2.slice(1));\r\n\t\treturn i1 > i2 ? 1 : -1;\r\n\t}\r\n\r\n\t// Create line items for the given property list\r\n\tgenerateLineItems(lineItemData: LineItemMetaData, propertyList: Property[], parentEntity: Entity, group: string, groupId: string) : Array {\r\n\t\tconst property = propertyList[0];\r\n\r\n\t\t// If the field is always hidden, its value should be constant to differentiate it from conditionally visible fields\r\n\t\tlet isConstant = false;\r\n\t\tconst visibleProp = parentEntity.meta.type.getProperty(`${property.path}_Visible`);\r\n\t\tif (visibleProp)\r\n\t\t\tisConstant = visibleProp.isConstant;\r\n\r\n\t\t// Conditionally hidden fields do not generate line items\r\n\t\tif (parentEntity[`${property.path}_Visible`] === false && !isConstant && !parentEntity[`${property.path}_IncludeInInvoice`])\r\n\t\t\treturn [];\r\n\r\n\t\t// Non-container, leaf property\r\n\t\tif (propertyList.length === 1) {\r\n\t\t\t// TODO: For choice checkboxes, amount property doesn't look right\r\n\t\t\treturn this.createLineItems(lineItemData, propertyList, parentEntity, group, groupId);\r\n\t\t}\r\n\r\n\t\tthis.idIndex++;\r\n\t\tconst instance = parentEntity[property.path];\r\n\t\tlet lineItems = [] as Array;\r\n\r\n\t\t// Dynamic container (ie: repeating section)\r\n\t\tif (Array.isArray(instance)) {\r\n\t\t\tlineItems = this.createListLineItems(instance, lineItemData, propertyList, parentEntity, group, groupId);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tpropertyList = propertyList.slice(1);\r\n\t\t\t// Non-dynamic container (ie: section)\r\n\t\t\tlineItems = this.generateLineItems(lineItemData, propertyList, instance, group, groupId);\r\n\t\t}\r\n\t\tthis.idIndex--;\r\n\t\treturn lineItems;\r\n\t}\r\n\r\n\t// Create line items for a dynamic container (ie: repeating section)\r\n\tcreateListLineItems(entityList: Entity[], lineItemData: LineItemMetaData, propertyList: Property[], parentEntity: Entity, group: string, groupId: any) : Array {\r\n\t\tlet containerLineItems = [] as Array;\r\n\t\tconst listProp = propertyList[0];\r\n\t\tconst itemLabel = parentEntity[`${listProp.path}_ItemLabel`];\r\n\r\n\t\tif (!groupId)\r\n\t\t\tgroupId = lineItemData.id.slice();\r\n\r\n\t\tconst groupIdLastHalf = groupId.splice(this.idIndex);\r\n\t\tthis.idIndex++;\r\n\r\n\t\t// Create line items for each item in the container\r\n\t\tfor (const instance of entityList) {\r\n\t\t\tgroup = (itemLabel || 'Item') + ' ' + instance.ItemNumber;\r\n\t\t\t// Add the item number to the group id so that sorting will factor in the item number\r\n\t\t\tconst itemGroupId = groupId.concat([instance.ItemNumber]).concat(groupIdLastHalf);\r\n\t\t\tconst lineItems = this.generateLineItems(lineItemData, propertyList.slice(1), instance, group, itemGroupId);\r\n\t\t\tif (lineItems) {\r\n\t\t\t\tcontainerLineItems = containerLineItems.concat(lineItems);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.idIndex--;\r\n\r\n\t\treturn containerLineItems;\r\n\t}\r\n\r\n\t// Create line items for a single property\r\n\tcreateLineItems(lineItemData: LineItemMetaData, propertyList: Property[], parentEntity: Entity, group: string, groupId: any) : Array {\r\n\t\tconst property = propertyList[0];\r\n\r\n\t\tconst parentType = parentEntity.meta.type;\r\n\t\t// Get the name property if it exists\r\n\t\tconst name = this.getLineItemName(lineItemData, property, parentEntity, parentType);\r\n\r\n\t\tif (!groupId) {\r\n\t\t\tgroupId = lineItemData.id;\r\n\t\t}\r\n\r\n\t\tgroupId = groupId.join('-');\r\n\r\n\t\tif (!property.isList) {\r\n\t\t\tconst lineItem = this.createLineItem(property, lineItemData, name, group, groupId, parentEntity, parentType);\r\n\t\t\treturn lineItem ? [lineItem] : [];\r\n\t\t}\r\n\r\n\t\tconst selectedChoicesProperty = parentEntity.meta.type.getProperty(property.path);\r\n\t\tif (!selectedChoicesProperty)\r\n\t\t\treturn;\r\n\r\n\t\tconst selectedChoices = selectedChoicesProperty.value(parentEntity) as any[];\r\n\r\n\t\tif (lineItemData.type === 'Lookup') {\r\n\t\t\treturn this.createLookupCheckboxLineItems(lineItemData, selectedChoices, name, group, groupId);\r\n\t\t}\r\n\t\telse if (lineItemData.type === 'Choice') {\r\n\t\t\treturn this.createChoiceCheckboxLineItems(lineItemData, selectedChoices, name, group, groupId, parentEntity, parentType);\r\n\t\t}\r\n\t}\r\n\r\n\tcreateLineItem(property: Property, lineItemData: LineItemMetaData, name: string, group: string, groupId: string, parentEntity: Entity, parentType: Type): GroupedLineItem {\r\n\t\tconst valueProperty = lineItemData.amountProperty ? parentType.getProperty(lineItemData.amountProperty) : property;\r\n\t\tconst value = valueProperty.value(parentEntity);\r\n\r\n\t\t// Create the description\r\n\t\tconst description = this.getLineItemDescription(lineItemData, property, parentEntity, parentType);\r\n\r\n\t\t// Negative line items should not be created (unless allowed)\r\n\t\tconst lineItemIsNegative = (value < 0 && !lineItemData.allowNegatives);\r\n\r\n\t\t// $0 line items should not be created for non-Choice/Lookup fields\r\n\t\tconst zeroDollarLineItem = (!value && !['Choice', 'Lookup'].includes(lineItemData.type));\r\n\r\n\t\t// For quantity-specified line items, if the quantity isn't specified don't create the line item\r\n\t\tconst hasUnspecifiedQuantity = lineItemData.quantitySelected && (!description || description.indexOf('(') === -1);\r\n\r\n\t\t// Choice/Lookup with no value selected should not have line items\r\n\t\tconst choiceOrLookupHasBlankSelection = ['Choice', 'Lookup'].includes(lineItemData.type) && property.containingType.getProperty(`${property.name}_Price`).value(parentEntity) == null;\r\n\r\n\t\tif (zeroDollarLineItem || lineItemIsNegative || hasUnspecifiedQuantity || choiceOrLookupHasBlankSelection)\r\n\t\t\treturn null;\r\n\r\n\t\t// Return the line item\r\n\t\treturn {\r\n\t\t\tAmount: this.roundCurrency(value),\r\n\t\t\tName: name,\r\n\t\t\tGroup: group,\r\n\t\t\tDescription: description,\r\n\t\t\tGroupId: groupId\r\n\t\t};\r\n\t}\r\n\r\n\tcreateLookupCheckboxLineItems(lineItemData: LineItemMetaData, selectedChoices: Entity[], name: string, group: string, groupId: string): Array {\r\n\t\treturn selectedChoices.map(lookupEntry => {\r\n\t\t\tconst description = lookupEntry.toString(lineItemData.lookup.labelFormat);\r\n\t\t\tlet parent = lookupEntry;\r\n\r\n\t\t\tconst paths = lineItemData.lookup.pricePath.split('.');\r\n\r\n\t\t\t// Note: The price path can not be in a repeating section\r\n\t\t\tpaths.slice(0, -1).forEach((path) => {\r\n\t\t\t\tparent = parent[path];\r\n\t\t\t});\r\n\r\n\t\t\tconst price = parent[paths.slice(-1)[0]];\r\n\r\n\t\t\treturn {\r\n\t\t\t\tAmount: price,\r\n\t\t\t\tName: name,\r\n\t\t\t\tGroup: group,\r\n\t\t\t\tDescription: description,\r\n\t\t\t\tGroupId: groupId\r\n\t\t\t} as GroupedLineItem;\r\n\t\t});\r\n\t}\r\n\r\n\tcreateChoiceCheckboxLineItems(lineItemData: LineItemMetaData, selectedChoices: string[], name: string, group: string, groupId: string, parentEntity: Entity, parentType: Type) : Array {\r\n\t\tconst property = lineItemData.propertyList[lineItemData.propertyList.length - 1];\r\n\t\tconst choicesProperty = parentEntity.meta.type.getProperty(property.path + '_Choices');\r\n\r\n\t\tif (!choicesProperty)\r\n\t\t\treturn [];\r\n\r\n\t\tconst choiceOptions = choicesProperty.value(parentEntity) as Choice[];\r\n\r\n\t\treturn selectedChoices.map(label => {\r\n\t\t\tconst choiceOption = choiceOptions.find(c => c.Label === label);\r\n\r\n\t\t\tif (choiceOption)\r\n\t\t\t\treturn {\r\n\t\t\t\t\tAmount: choiceOption.Price,\r\n\t\t\t\t\tName: name,\r\n\t\t\t\t\tGroup: group,\r\n\t\t\t\t\tDescription: label,\r\n\t\t\t\t\tGroupId: groupId\r\n\t\t\t\t};\r\n\t\t\telse\r\n\t\t\t\treturn null;\r\n\t\t}).filter(item => !!item);\r\n\t}\r\n\r\n\t// Get the description for a line item\r\n\tgetLineItemDescription(lineItemData: LineItemMetaData, property: Property, parentEntity: Entity, parentType: Type): string {\r\n\t\tlet description = '';\r\n\r\n\t\tif (lineItemData.descriptionProperty)\r\n\t\t\tdescription = parentEntity[lineItemData.descriptionProperty] || '';\r\n\t\telse if (lineItemData.type === 'Choice' || lineItemData.type === 'Lookup')\r\n\t\t\tdescription = parentEntity.toString(`[${property.path}]`);\r\n\r\n\t\tif (lineItemData.quantitySelected) {\r\n\t\t\tconst quantitySelected = parentType.getProperty(lineItemData.quantitySelected);\r\n\t\t\tconst quantityValue = quantitySelected ? quantitySelected.value(parentEntity) : null;\r\n\t\t\t// Check if description is empty to ensure empty choice value doesn't get a description\r\n\t\t\tif (quantityValue && description)\r\n\t\t\t\tdescription += ' (' + quantityValue + ')';\r\n\t\t\telse\r\n\t\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn description.trim();\r\n\t}\r\n\r\n\tgetLineItemName(lineItemData: LineItemMetaData, property: Property, parentEntity: Entity, parentType: Type): string {\r\n\t\tif (lineItemData.nameProperty) {\r\n\t\t\tconst nameProperty = parentType.getProperty(lineItemData.nameProperty);\r\n\t\t\tif (nameProperty)\r\n\t\t\t\treturn nameProperty.value(parentEntity);\r\n\t\t}\r\n\r\n\t\tif (property.label) {\r\n\t\t\tif (property.labelIsFormat) {\r\n\t\t\t\tif (lineItemData.isWithinTable) {\r\n\t\t\t\t\t// Labels for fields in tables are evaulated in the table's parent context (since the labels are used as column headers)\r\n\t\t\t\t\tconst tableParentEntity = parentEntity['ParentSection'] || parentEntity['Form'];\r\n\t\t\t\t\treturn tableParentEntity.toString(property.label);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn parentEntity.toString(property.label);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn property.label;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcalculateProcessingFee(): FeeProperties {\r\n\t\tconst subtotal = this.roundCurrency(this.subtotal + this.additionalFees);\r\n\t\tlet processingFees = [] as Array;\r\n\r\n\t\tif (!subtotal || !this.processingFees || !(this.entry.Require_Payment || this.entry.Save_Customer_Card))\r\n\t\t\treturn null;\r\n\r\n\t\tconst processingFeeDescription = this.processingFeeDescription ? this.processingFeeDescription : this.$resource('payment-processing-fees');\r\n\r\n\t\tconst fee: FeeProperties = {\r\n\t\t\tName: processingFeeDescription,\r\n\t\t\tAmount: 0,\r\n\t\t\tDescription: processingFeeDescription,\r\n\t\t\tIsProcessingFee: true\r\n\t\t};\r\n\r\n\t\tif (this.processingFees.length > 1) {\r\n\t\t\tconst cardData = this.entry.Entry.PaymentToken ? this.entry.Entry.PaymentToken.Card as CardInformation : null;\r\n\t\t\tif (!cardData) {\r\n\t\t\t\tif (this.useStripePaymentElement) {\r\n\t\t\t\t\t// If there is no card data when using the Stripe Element, assume the largest of the fees\r\n\t\t\t\t\tprocessingFees.push(this.getMaximumFee());\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\treturn fee;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprocessingFees.push(this.getCardFee(cardData));\r\n\t\t}\r\n\t\telse\r\n\t\t\tprocessingFees = this.processingFees;\r\n\r\n\t\tif (!processingFees.length && !this.applicationFee)\r\n\t\t\treturn null;\r\n\r\n\t\tconst fees = {\r\n\t\t\tprocessing: {\r\n\t\t\t\tpercent: this.sum(processingFees, 'PercentageAmount'),\r\n\t\t\t\tfixed: this.sum(processingFees, 'FixedAmount')\r\n\t\t\t},\r\n\t\t\tapplication: {\r\n\t\t\t\tpercent: this.applicationFee ? (this.applicationFee.PercentageAmount || 0) : 0,\r\n\t\t\t\tfixed: this.applicationFee ? (this.applicationFee.FixedAmount || 0) : 0\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tlet feeAmt = this.roundCurrency(subtotal + fees.processing.fixed + fees.application.fixed);\r\n\t\tfeeAmt = this.roundCurrency(feeAmt / (1 - (fees.processing.percent + fees.application.percent))) - subtotal;\r\n\t\tconst totalWithFees = subtotal + feeAmt;\r\n\r\n\t\tconst processorFee = this.roundCurrency(totalWithFees * fees.processing.percent + fees.processing.fixed);\r\n\t\tconst applicationFee = this.applicationFee ? this.roundCurrency(totalWithFees * fees.application.percent + fees.application.fixed) : 0;\r\n\r\n\t\tfee.Amount = applicationFee + processorFee;\r\n\r\n\t\tthis.processorFee = fee.Amount;\r\n\r\n\t\t// Calculate the amount for each processing fee, the display value, and set the description\r\n\t\treturn fee;\r\n\t}\r\n\r\n\tgetMaximumFee() {\r\n\t\tconst subtotal = this.roundCurrency(this.subtotal + this.additionalFees);\r\n\r\n\t\tlet maxFee = null;\r\n\t\tlet maxFeeAmount = 0;\r\n\r\n\t\tthis.processingFees.forEach(fee => {\r\n\t\t\tconst feeAmount = fee.FixedAmount + fee.PercentageAmount * subtotal;\r\n\r\n\t\t\tif (feeAmount > maxFeeAmount) {\r\n\t\t\t\tmaxFee = fee;\r\n\t\t\t\tmaxFeeAmount = feeAmount;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn maxFee;\r\n\t}\r\n\r\n\tgetCardFee(cardData: CardInformation): TransactionFeeProperties {\r\n\t\tif (!this.processingFees)\r\n\t\t\treturn null;\r\n\r\n\t\tconst isAmex = cardData.Brand === 'amex';\r\n\t\tconst isEuropean = this.europeanCountries.indexOf(cardData.Country) >= 0;\r\n\t\tconst isInternational = this.domesticCountryCode !== cardData.Country;\r\n\r\n\t\tconst fees = this.processingFees.filter((fee) => {\r\n\t\t\tif (!fee.Modes)\r\n\t\t\t\tfee.Modes = this.getFlags(fee.Mode, this.processorFeeModes);\r\n\r\n\t\t\tif (fee.Modes.indexOf('Any') >= 0)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tif (isAmex && fee.Modes.indexOf('AMEX') >= 0)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tif (!isAmex && fee.Modes.indexOf('NonAMEX') >= 0)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tif (isEuropean && fee.Modes.indexOf('EuropeanCards') >= 0)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tif (!isEuropean && fee.Modes.indexOf('NonEuropeanCards') >= 0)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tif (isInternational && fee.Modes.indexOf('International') >= 0)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tif (!isInternational && fee.Modes.indexOf('Domestic') >= 0)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\treturn false;\r\n\t\t});\r\n\r\n\t\tif (fees.length === 1)\r\n\t\t\treturn fees[0];\r\n\r\n\t\t// These fees take priority over other fees. For example, if the card is AMEX and Domestic, there will be two fees. However,\r\n\t\t// the AMEX fee is higher priority than the Domestic fee\r\n\t\tconst priorityFees = fees.filter((fee) => { return fee.Modes.indexOf('AMEX') >= 0 || fee.Modes.indexOf('International') >= 0 || fee.Modes.indexOf('EuropeanCards') >= 0;});\r\n\r\n\t\treturn priorityFees.length >= 1 ? priorityFees[0] : fees[0];\r\n\t}\r\n\r\n\tgetFlags(value: number, options: { [key: string]: number }): string[] {\r\n\t\tconst flags = [];\r\n\t\tif (value === 0)\r\n\t\t\treturn flags;\r\n\r\n\t\t// Keys from smallest value to largest value\r\n\t\tconst keys = Object.keys(options).sort((k1, k2) => { return options[k1] > options[k2] ? 1 : -1; });\r\n\r\n\t\tfor (let i = keys.length - 1; i >= 0; i--) {\r\n\t\t\tconst key = keys[i];\r\n\t\t\tconst val = options[key];\r\n\t\t\tif (value >= val) {\r\n\t\t\t\tflags.push(key);\r\n\t\t\t\tvalue -= val;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn flags;\r\n\t}\r\n\r\n\troundCurrency(num: number): number {\r\n\t\treturn roundToPrecision(num, this.$culture.numberFormat.CurrencyDecimalDigits);\r\n\t}\r\n\r\n\tsum(lst: any[], property: string): number {\r\n\t\tif (lst.length === 0)\r\n\t\t\treturn 0;\r\n\r\n\t\treturn lst.length === 1 ? lst[0][property] : lst.map((f) => { return f[property];}).reduce((f1, f2) => { return f1 + f2;}, 0);\r\n\t}\r\n}\r\n\r\nexport function rebuildOrder(entry: FormEntry, order: Order) {\r\n\tif (!order || order.AmountPaid) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tconst Fee = entry.meta.type.model.$namespace.Payment.Fee;\r\n\tconst LineItem = entry.meta.type.model.$namespace.Payment.LineItem;\r\n\r\n\tconst orderBuilder = new OrderBuilder(entry);\r\n\r\n\torder.LineItems.splice.apply(order.LineItems, ([0, order.LineItems.length] as any[]).concat(orderBuilder.lineItems.map(d => new LineItem(d))));\r\n\r\n\torder.update('SubTotal', orderBuilder.subtotal);\r\n\r\n\torder.update('AdditionalFees', orderBuilder.additionalFees);\r\n\torder.update('ProcessingFees', orderBuilder.processorFee);\r\n\torder.Fees.splice.apply(order.Fees, ([0, order.Fees.length] as any[]).concat(orderBuilder.fees.map(d => new Fee(d))));\r\n\r\n\torder.update('AmountDue', orderBuilder.orderAmount);\r\n\torder.update('OrderAmount', orderBuilder.orderAmount);\r\n\r\n\tconst billingFields = orderBuilder.billingFields;\r\n\torder.update('BillingName', billingFields.Name);\r\n\torder.update('EmailAddress', billingFields.Email);\r\n\torder.update('BillingAddress', billingFields.Address);\r\n\torder.update('PhoneNumber', billingFields.Phone);\r\n\r\n\torder.Rebuild_Count += 1;\r\n\r\n\treturn true;\r\n}\r\n","/**\r\n * Rounds the given number to a particular number of digits\r\n * NOTE: Ported from 'Cognito.Forms.roundToEven'\r\n * @param num The number to rund\r\n * @param digits The number of digits to round to\r\n */\r\nexport function roundToPrecision(num: number, digits: number) : number {\r\n\tdigits = digits || 0;\r\n\tconst multiplier = Math.pow(10, digits);\r\n\tconst nFixed = + (digits ? num * multiplier : num).toFixed(8);\r\n\tconst nInt = Math.floor(nFixed);\r\n\tconst nDecimals = nFixed - nInt;\r\n\tconst e = 1e-8;\r\n\tconst remainder = (nDecimals > 0.5 - e && nDecimals < 0.5 + e) ? ((nInt % 2 === 0) ? nInt : nInt + 1) : Math.round(nFixed);\r\n\r\n\treturn digits ? remainder / multiplier : remainder;\r\n}\r\n","import { FormEntryIndex } from 'src/server-types/forms/model/form-entry-index';\r\nimport { FormEntry } from 'src/server-types/forms/model/form-entry';\r\nimport EntryViewService from './entry-view-service';\r\nimport { getId } from './entry-view-util';\r\n\r\ntype ObjectLookup = { [key: string]: T };\r\n\r\n// Default sorting by server-side sort key\r\nfunction defaultSort(a: FormEntryIndex, b: FormEntryIndex) {\r\n\tconst ak = a.SortKey;\r\n\tconst bk = b.SortKey;\r\n\treturn ak === bk ? 0 : ak < bk ? -1 : 1;\r\n}\r\n\r\nexport default class EntrySet {\r\n\tprivate readonly service: EntryViewService;\r\n\tprivate readonly entryType: string;\r\n\tprivate indexes = new Map();\r\n\tprivate entries = new Map();\r\n\treadonly form: string;\r\n\treadonly view: string;\r\n\tsortCriteria: any;\r\n\r\n\tprivate constructor(viewService: EntryViewService, entryType: string, view: string) {\r\n\t\tthis.service = viewService;\r\n\t\tthis.entryType = entryType;\r\n\t\tthis.form = view.split('-')[0];\r\n\t\tthis.view = view;\r\n\t}\r\n\r\n\tprivate static instances = new Map();\r\n\tstatic get(viewService: EntryViewService, entryType: string, view: string) {\r\n\t\tconst instance = EntrySet.instances.get(view) || new EntrySet(viewService, entryType, view);\r\n\t\tthis.instances.set(view, instance);\r\n\t\treturn instance;\r\n\t}\r\n\r\n\tprivate refreshPromise: Promise;\r\n\trefresh() {\r\n\t\tif (this.refreshPromise)\r\n\t\t\treturn this.refreshPromise;\r\n\r\n\t\tthis.refreshPromise = new Promise(async resolve => {\r\n\t\t\tthis.indexes = await this.service.getIndex(this.form, this.view);\r\n\r\n\t\t\t// Cleanup entries no longer present in the index (not strictly necessary, but optimizes memory usage if large deletes occur while the user is on the page)\r\n\t\t\tfor (const id of this.entries.keys()) {\r\n\t\t\t\tif (!this.indexes.has(id))\r\n\t\t\t\t\tthis.entries.delete(id);\r\n\t\t\t}\r\n\r\n\t\t\tthis.refreshPromise = null;\r\n\r\n\t\t\t// Finalize the refresh\r\n\t\t\tresolve();\r\n\t\t});\r\n\r\n\t\treturn this.refreshPromise;\r\n\t}\r\n\r\n\tlistIndex(sorted = true) {\r\n\t\tconst list = Array.from(this.indexes.values());\r\n\t\tif (sorted)\r\n\t\t\tlist.sort(defaultSort);\r\n\t\treturn list;\r\n\t}\r\n\r\n\tgetIndexItem(id: string) {\r\n\t\treturn this.indexes.get(id);\r\n\t}\r\n\r\n\tprivate constructEntry(state: ObjectLookup) {\r\n\t\treturn this.service.model.constructAsync(this.entryType, state);\r\n\t}\r\n\r\n\tasync getEntry(index: FormEntryIndex) {\r\n\t\tconst id = getId(index);\r\n\t\tconst entry = this.entries.get(id);\r\n\t\tif (entry)\r\n\t\t\treturn entry;\r\n\r\n\t\tconst typeCacheEntry = this.service.model.model.types['Forms.FormEntry'].get(id);\r\n\t\tif (typeCacheEntry)\r\n\t\t\treturn typeCacheEntry;\r\n\r\n\t\tawait this.loadEntries([index]);\r\n\t\treturn this.entries.get(id);\r\n\t}\r\n\r\n\tprivate async loadEntries(indexes: FormEntryIndex[]) {\r\n\t\tconst entries = await this.service.loadEntryData(this.view, ...indexes);\r\n\r\n\t\tfor (const e of entries)\r\n\t\t\tthis.entries.set(e.Id, await this.constructEntry(e));\r\n\t}\r\n\r\n\tprivate async ensureEntriesLoaded() {\r\n\t\tconst missing = this.listIndex().filter(fei => !this.entries.has(getId(fei)));\r\n\t\t// Load missing entries\r\n\t\tconst entries = await this.service.loadEntryData(this.view, ...missing);\r\n\t\t// Store in memory\r\n\t\tfor (const e of entries) {\r\n\t\t\tthis.entries.set(e.Id, await this.constructEntry(e));\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a sorted list of `FormEntryIndex` objects contained in the `EntrySet`.\r\n\t * @param criteria\r\n\t */\r\n\tasync sort(criteria: (a: FormEntry, b: FormEntry) => number) {\r\n\t\t// Store the criteria for future use\r\n\t\tthis.sortCriteria = criteria;\r\n\r\n\t\tconst entryFor = (index: FormEntryIndex) => this.entries.get(getId(index));\r\n\r\n\t\t// Otherwise, load all entries and use them to sort the index\r\n\t\tawait this.ensureEntriesLoaded();\r\n\t\treturn this.listIndex(false).sort((a, b) => criteria(entryFor(a), entryFor(b)));\r\n\t}\r\n\r\n\t/**\r\n\t * Not needed on public forms, defer implementation\r\n\t */\r\n\tasync filter() {\r\n\t\t// const filtered = new EntrySet(this.view, scope, this.token);\r\n\t\t// filtered.timestamp = this.timestamp;\r\n\t\t// filtered.sortCriteria = this.sortCriteria;\r\n\t\t// filtered.scope = scope;\r\n\r\n\t\t// // First, see if the filter is an entry view filter\r\n\t\t// if (filter.meta && filter.meta.type.fullName === 'Cognito.Forms.EntryViewFilter') {\r\n\t\t// \t// If so, convert the filter into a function before getting the filtered set\r\n\t\t// \tgetFilterFunction(filter, function (filterFn) {\r\n\t\t// \t\tgetFilteredEntrySet(entrySet, filtered, filterFn, callback);\r\n\t\t// \t});\r\n\t\t// }\r\n\r\n\t\t// // Otherwise, assume the filter is a filter function and immediately get the filtered set\r\n\t\t// else\r\n\t\t// \tgetFilteredEntrySet(entrySet, filtered, filter, callback);\r\n\t}\r\n}","import { Entity, EntityType, ObservableArray, Property, Type, updateArray } from '@cognitoforms/model.js';\r\nimport { FormEntry } from 'src/server-types/forms/model/form-entry';\r\nimport { FormEntryIndex } from 'src/server-types/forms/model/form-entry-index';\r\nimport { Deferred } from 'src/util/deferred';\r\nimport { visitEntity } from 'src/util/model';\r\nimport EntrySet from 'src/web-api/entry-views/entry-set';\r\nimport EntryViewService from 'src/web-api/entry-views/entry-view-service';\r\nimport { getId } from 'src/web-api/entry-views/entry-view-util';\r\nimport Vue from 'vue';\r\nimport Component from 'vue-class-component';\r\nimport { Prop, Watch } from 'vue-property-decorator';\r\nimport { FormsModel } from '../../../forms-model';\r\n\r\nexport type LookupIndexInfo = {\r\n\tviewId: string;\r\n\tindexTypeName: string;\r\n\tsummaryFormat: string;\r\n\tdescriptionFormat: string;\r\n\tfilterPaths: string[];\r\n\tdefaultPaths: string[];\r\n};\r\n\r\nexport type LookupEntryIndex = FormEntryIndex & {\r\n\tIsIncluded(container: Entity): boolean;\r\n\tIsDefaulted(container: Entity): boolean;\r\n\tDefault?: boolean;\r\n}\r\n\r\n/**\r\n * It is currently possible for two lookup fields to have different index types,\r\n * but share a lookup view. This results in trying to construct an index with an\r\n * already-pooled id. The long term fix is to ensure these fields use the same type,\r\n * but for compatibility reasons it is currently simpler to handle this edge case\r\n * by obtaining the pooled instance via the baseType.\r\n */\r\nfunction getPooledIndex(type: Type, id: string): Entity | null {\r\n\twhile (type) {\r\n\t\tconst instance = type.get(id);\r\n\t\tif (instance)\r\n\t\t\treturn instance;\r\n\t\ttype = type.baseType;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\nexport function findLookupManagers(entity: Entity) {\r\n\tconst managers = [];\r\n\tvisitEntity(entity, (e, p) => {\r\n\t\tconst lookupManager = e[p.name + '_LookupManager'];\r\n\t\tif (lookupManager)\r\n\t\t\tmanagers.push(lookupManager);\r\n\t}, true);\r\n\treturn managers;\r\n}\r\n\r\nexport function getIndex(model: FormsModel, indexType: Type, state: FormEntryIndex): LookupEntryIndex {\r\n\tif (state.Id) {\r\n\t\tconst pooledIndex = getPooledIndex(indexType, state.Id);\r\n\t\tif (pooledIndex)\r\n\t\t\treturn pooledIndex as LookupEntryIndex;\r\n\t}\r\n\r\n\tif (state.AdditionalValues) {\r\n\t\tfor (const av of state.AdditionalValues) {\r\n\t\t\tlet val: any = av.Value;\r\n\t\t\tconst prop = indexType.getProperty(av.FieldId);\r\n\r\n\t\t\tif (prop) {\r\n\t\t\t\tif (prop.isList && typeof val === 'string')\r\n\t\t\t\t\tval = JSON.parse(val);\r\n\t\t\t\telse if (prop.propertyType === Boolean)\r\n\t\t\t\t\tval = val === 'True';\r\n\t\t\t\telse if (prop.propertyType === Number)\r\n\t\t\t\t\tval = Number(val);\r\n\t\t\t}\r\n\r\n\t\t\tstate[av.FieldId] = val;\r\n\t\t}\r\n\t}\r\n\r\n\treturn model.construct(indexType.fullName, state);\r\n}\r\n\r\n@Component\r\nexport default class LookupManager extends Vue {\r\n\t@Prop()\r\n\tviewId: string;\r\n\r\n\t@Prop()\r\n\tindexType: Type;\r\n\r\n\t@Prop()\r\n\tsummaryFormat: string;\r\n\r\n\t@Prop()\r\n\tdescriptionFormat: string;\r\n\r\n\t@Prop()\r\n\tcontainer: Entity;\r\n\r\n\t@Prop()\r\n\tlookupProperty: Property;\r\n\r\n\t@Prop()\r\n\tentryViewService: EntryViewService;\r\n\r\n\tentrySet: EntrySet\r\n\tindexes: LookupEntryIndex[] = [];\r\n\tinitializing = false;\r\n\t// used to prevent the lookup from being cleared as a result of the first filtration of the indexes\r\n\tprivate filterHasRun = false;\r\n\t// used to prevent the lookup from being defaulted as a result of the first filtration of the indexes\r\n\tprivate defaultHasRun = false;\r\n\tisValid = true;\r\n\t// Indexes that are no longer part of the entry set, but represent the current value for the lookup field\r\n\tsyntheticIndexes = new Set();\r\n\tfilteredIndexes: LookupEntryIndex[] = [];\r\n\tdefaultIndexes: LookupEntryIndex[] = [];\r\n\tprivate readyTask: Deferred;\r\n\tprivate setDefaultsTask: Deferred;\r\n\r\n\tasync created() {\r\n\t\tif (this.entryViewService.isValidView(this.viewId))\r\n\t\t\tthis.initialize();\r\n\t\telse\r\n\t\t\tthis.isValid = false;\r\n\t}\r\n\r\n\tasync initialize() {\r\n\t\tthis.initializing = true;\r\n\t\tthis.filterHasRun = false;\r\n\t\tthis.defaultHasRun = false;\r\n\t\tthis.readyTask = new Deferred();\r\n\t\tthis.setDefaultsTask = new Deferred();\r\n\t\tthis.entrySet = EntrySet.get(this.entryViewService, this.entryType.fullName, this.viewId);\r\n\t\tawait this.entrySet.refresh();\r\n\r\n\t\tconst indexes = this.entrySet.listIndex().map(o => getIndex(this.entryViewService.model, this.indexType, o));\r\n\r\n\t\tif (!this.container.meta.isNew) {\r\n\t\t\tconst missing = ((this.lookupProperty.isList ? this.listValue : [this.value])).filter(e => e && !this.entrySet.getIndexItem(e.Id));\r\n\r\n\t\t\tfor (const entry of missing) {\r\n\t\t\t\tconst syntheticIndex = getIndex(this.entryViewService.model, this.indexType, {\r\n\t\t\t\t\tId: `fake|idx|${entry.Id}`,\r\n\t\t\t\t\tSummary: entry.toString(this.summaryFormat),\r\n\t\t\t\t\tDescription: this.descriptionFormat ? entry.toString(this.descriptionFormat) : ''\r\n\t\t\t\t} as any);\r\n\r\n\t\t\t\tthis.syntheticIndexes.add(syntheticIndex);\r\n\t\t\t\tindexes.unshift(syntheticIndex);\r\n\t\t\t}\r\n\t\t\tthis.$emit('synthetic-indexes-changed', this.syntheticIndexes);\r\n\t\t}\r\n\r\n\t\tthis.indexes = indexes;\r\n\r\n\t\t// allow computed/watchers to run before setting loading to false\r\n\t\tawait this.$nextTick();\r\n\t\tawait this.container.initialized;\r\n\r\n\t\tthis.readyTask.resolve();\r\n\t\tthis.initializing = false;\r\n\r\n\t\tthis.updateFilteredIndexes();\r\n\t}\r\n\r\n\tget allowUnknownEntry() {\r\n\t\treturn !this.container.meta.isNew;\r\n\t}\r\n\r\n\tget entryType() {\r\n\t\treturn (this.lookupProperty.propertyType as EntityType).meta;\r\n\t}\r\n\r\n\tget ready() {\r\n\t\treturn this.readyTask.promise;\r\n\t}\r\n\r\n\tget defaultsSet() {\r\n\t\treturn this.setDefaultsTask.promise;\r\n\t}\r\n\r\n\tget isList() {\r\n\t\treturn this.lookupProperty.isList;\r\n\t}\r\n\r\n\tget value() {\r\n\t\treturn this.lookupProperty.value(this.container) as FormEntry;\r\n\t}\r\n\r\n\tget listValue() {\r\n\t\treturn this.lookupProperty.value(this.container) as FormEntry[];\r\n\t}\r\n\r\n\tget hasValue() {\r\n\t\treturn this.isList ? this.listValue.length > 0 : !!this.value;\r\n\t}\r\n\r\n\tupdateFilteredIndexes() {\r\n\t\tif (!this.indexes)\r\n\t\t\tthis.filteredIndexes = [];\r\n\t\telse\r\n\t\t\tthis.filteredIndexes = this.indexes.filter(o => {\r\n\t\t\t\tif (!o.IsIncluded)\r\n\t\t\t\t\treturn true;\r\n\t\t\t\ttry {\r\n\t\t\t\t\treturn o.IsIncluded(this.container);\r\n\t\t\t\t}\r\n\t\t\t\tcatch (e) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\tthis.updateDefaultIndexes();\r\n\t}\r\n\r\n\tupdateDefaultIndexes() {\r\n\t\tfunction staticDefault(option: FormEntryIndex) {\r\n\t\t\treturn option.AdditionalValues.some(v => v.FieldId === 'Default' && v.Value === 'True');\r\n\t\t}\r\n\r\n\t\tif (!this.indexes)\r\n\t\t\tthis.defaultIndexes = [];\r\n\t\telse\r\n\t\t\tthis.defaultIndexes = this.filteredIndexes.filter(o => {\r\n\t\t\t\tif (staticDefault(o))\r\n\t\t\t\t\treturn true;\r\n\t\t\t\ttry {\r\n\t\t\t\t\treturn o.IsDefaulted && o.IsDefaulted(this.container);\r\n\t\t\t\t}\r\n\t\t\t\tcatch (e) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * When the filtered options no longer include the currently selected value, clear the value.\r\n\t * @param options The new set of filtered options.\r\n\t */\r\n\t@Watch('filteredIndexes')\r\n\tindexesChanged(options: LookupEntryIndex[]) {\r\n\t\t// only clear the value if the allowed options change after the initial load\r\n\t\tif (!this.initializing && (!this.allowUnknownEntry || this.filterHasRun)) {\r\n\t\t\tif (this.isList)\r\n\t\t\t\tthis.setLookupValue(this.value.filter((entry: { Id: string; }) => options.some(o => getId(o) === entry.Id)));\r\n\t\t\telse if (this.value && !options.some(o => getId(o) === this.value.Id))\r\n\t\t\t\tthis.setLookupValue(null);\r\n\t\t}\r\n\t\tthis.filterHasRun = true;\r\n\t}\r\n\r\n\t@Watch('defaultIndexes')\r\n\tasync defaultChanged(options: LookupEntryIndex[], oldOptions: LookupEntryIndex[]) {\r\n\t\tif (options.length !== 0 || oldOptions.length !== 0) {\r\n\t\t\tconst isNewEntry = this.container.meta.isNew;\r\n\t\t\tconst hasNoValue = !this.hasValue && isNewEntry;\r\n\t\t\t// if this runs while initializing, and an initial value was provided or it's an existing entry, don't set the default value(s)\r\n\t\t\tif ((this.defaultHasRun || hasNoValue) && options.length) {\r\n\t\t\t\tif (this.isList)\r\n\t\t\t\t\tthis.setLookupValue(await Promise.all(options.map(o => getId(o)).map(id => this.getEntryById(id))));\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.setLookupValue(await this.getEntryById(getId(options[0])));\r\n\t\t\t}\r\n\t\t\telse if (this.defaultHasRun && !this.initializing && !options.length) {\r\n\t\t\t\tthis.setLookupValue(this.isList ? [] : null);\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.defaultHasRun = true;\r\n\r\n\t\tif (this.setDefaultsTask.pending)\r\n\t\t\tthis.setDefaultsTask.resolve();\r\n\t}\r\n\r\n\tgetEntryById(id: string, ignoreFilter: boolean = false): Promise {\r\n\t\treturn this.entrySet.getEntry(ignoreFilter ? this.indexes.find(o => getId(o) === id) : this.filteredIndexes.find(o => getId(o) === id));\r\n\t}\r\n\r\n\tsetLookupValue(value: FormEntry | FormEntry[]) {\r\n\t\tif (this.isList) {\r\n\t\t\tconst list = (this.listValue as ObservableArray);\r\n\t\t\tlist.batchUpdate(() => updateArray(list, value as FormEntry[]));\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis.lookupProperty.value(this.container, value);\r\n\t}\r\n}\r\n\r\nexport type LookupManagerOptions = {\r\n\tlookupInfo: LookupIndexInfo,\r\n\tindexType: Type;\r\n\tlookupProperty: Property;\r\n\tcontainer: Entity;\r\n\tentryViewService: EntryViewService;\r\n};\r\n\r\nexport type LookupManagerFactory = (options: LookupManagerOptions) => LookupManager;\r\n\r\nexport function getLookupManager({ lookupInfo, indexType, lookupProperty, container, entryViewService }: LookupManagerOptions) {\r\n\treturn new LookupManager({\r\n\t\tpropsData: {\r\n\t\t\tentryViewService,\r\n\t\t\tviewId: lookupInfo.viewId,\r\n\t\t\tindexType,\r\n\t\t\tcontainer,\r\n\t\t\tlookupProperty,\r\n\t\t\tsummaryFormat: lookupInfo.summaryFormat,\r\n\t\t\tdescriptionFormat: lookupInfo.descriptionFormat\r\n\t\t}\r\n\t});\r\n}","\n export default {\n functional: true,\n render: \n function render(_h, _vm) {\n var _c=_vm._c;return _c('svg',{staticClass:\"cog-icon cog-i-ex\",class:[_vm.data.class, _vm.data.staticClass],style:([_vm.data.style, _vm.data.staticStyle]),attrs:{\"viewBox\":\"0 0 18 18\",\"focusable\":\"false\"}},[_c('defs'),_c('g',[_c('path',{attrs:{\"d\":\"M4.2 4.2l9.6 9.6M13.8 4.2l-9.6 9.6\"}})])])\n }\n \n }\n ","import { Format, ObservableArray, Property, updateArray } from '@cognitoforms/model.js';\r\nimport Vue from 'vue';\r\nimport Component from 'vue-class-component';\r\nimport { Prop, Watch } from 'vue-property-decorator';\r\nimport LookupManager, { LookupEntryIndex } from './lookup-manager';\r\n\r\nexport type CascadeFilterInfo = {\r\n\tlookupPropertyName: string;\r\n\tindexTypeName: string;\r\n\tindexPropertyName: string;\r\n\tpriorFilters: { filterField: string, indexProperty: string }[];\r\n}\r\n\r\n@Component\r\nexport default class CascadeFilterManager extends Vue {\r\n\t@Prop()\r\n\tlookupManager: LookupManager;\r\n\r\n\t@Prop()\r\n\tcascadeProperty: Property;\r\n\r\n\t@Prop()\r\n\tindexProperty: Property;\r\n\r\n\t@Prop()\r\n\tpriorFilters: { filterField: string, indexProperty: string }[];\r\n\r\n\tcreated() {\r\n\t\tthis.lookupManager.$once('synthetic-indexes-changed', () => {\r\n\t\t\t// ensure synthetic index properties are initialized based on the initial value of the cascade property\r\n\t\t\tfor (const index of this.lookupManager.syntheticIndexes) {\r\n\t\t\t\tconst valueFromFilterField = this.isList ? this.listValue[0] : this.value;\r\n\t\t\t\tif (this.indexProperty.isList)\r\n\t\t\t\t\tthis.indexProperty.value(index).push(valueFromFilterField);\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.indexProperty.value(index, valueFromFilterField);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tget ready() {\r\n\t\treturn this.lookupManager.ready;\r\n\t}\r\n\r\n\tget value() {\r\n\t\treturn this.cascadeProperty.value(this.container) as any;\r\n\t}\r\n\r\n\tget listValue() {\r\n\t\treturn this.cascadeProperty.value(this.container) as any[];\r\n\t}\r\n\r\n\tget isList() {\r\n\t\treturn Array.isArray(this.value);\r\n\t}\r\n\r\n\tget container() {\r\n\t\treturn this.lookupManager.container;\r\n\t}\r\n\r\n\tget indexes() {\r\n\t\treturn this.lookupManager.indexes;\r\n\t}\r\n\r\n\tget format() {\r\n\t\treturn this.cascadeProperty.format;\r\n\t}\r\n\r\n\tget filteredIndexes(): LookupEntryIndex[] {\r\n\t\tconst prerequisites = Object.fromEntries(this.priorFilters.map(prior => {\r\n\t\t\tconst prop = this.container.meta.type.getProperty(prior.filterField);\r\n\t\t\tconst requiredFunc = typeof prop.required === 'function'\r\n\t\t\t\t? prop.required\r\n\t\t\t\t: typeof prop.required === 'object'\r\n\t\t\t\t\t? prop.required.function\r\n\t\t\t\t\t: null;\r\n\t\t\treturn [\r\n\t\t\t\tprior.filterField,\r\n\t\t\t\tprop.required === true || (requiredFunc && requiredFunc.bind(this.container)())\r\n\t\t\t];\r\n\t\t}));\r\n\r\n\t\tif (this.indexProperty === null)\r\n\t\t\treturn [];\r\n\t\telse\r\n\t\t\treturn this.indexes\r\n\t\t\t\t.filter(idx => this.stringify(this.indexProperty.value(idx)) !== '')\r\n\t\t\t\t.filter(idx => this.priorFilters.every(prior => {\r\n\t\t\t\t\tconst priorFormat = this.container.meta.type.getProperty(prior.filterField).format || null;\r\n\t\t\t\t\tconst priorValue = this.container[prior.filterField];\r\n\t\t\t\t\tconst indexValueFormatted = this.stringify(idx[prior.indexProperty], priorFormat);\r\n\t\t\t\t\tconst indexValue = idx[prior.indexProperty];\r\n\r\n\t\t\t\t\tif (Array.isArray(indexValue) && Array.isArray(priorValue))\r\n\t\t\t\t\t\treturn (!prerequisites[prior.filterField] && !priorValue.length) || priorValue.some(v => indexValue.includes(this.stringify(v, priorFormat)));\r\n\t\t\t\t\telse if (Array.isArray(indexValue))\r\n\t\t\t\t\t\treturn (!prerequisites[prior.filterField] && priorValue === null) || indexValue.some(v => priorValue === this.stringify(v, priorFormat));\r\n\t\t\t\t\telse if (Array.isArray(priorValue))\r\n\t\t\t\t\t\treturn (!prerequisites[prior.filterField] && !priorValue.length) || priorValue.some(v => indexValueFormatted === this.stringify(v, priorFormat));\r\n\r\n\t\t\t\t\treturn (!prerequisites[prior.filterField] && priorValue === null) || indexValueFormatted === this.stringify(priorValue, priorFormat);\r\n\t\t\t\t}));\r\n\t}\r\n\r\n\t/**\r\n\t * When the filtered options no longer include the currently selected value, clear the value.\r\n\t * @param indexes The new set of filtered options.\r\n\t */\r\n\t@Watch('filteredIndexes')\r\n\tfilteredIndexesChanged(indexes: LookupEntryIndex[]) {\r\n\t\tconst allowedStrings = indexes.flatMap(this.extract).map(val => this.stringify(val));\r\n\t\tconst isAllowed = (val: any) => allowedStrings.includes(this.stringify(val));\r\n\r\n\t\tif (this.isList)\r\n\t\t\tthis.setFieldValue(this.listValue.filter(isAllowed));\r\n\t\telse if (!isAllowed(this.value))\r\n\t\t\tthis.setFieldValue(null);\r\n\t}\r\n\r\n\tsetFieldValue(value: any | any[]) {\r\n\t\tif (this.isList) {\r\n\t\t\tconst list = (this.listValue as ObservableArray);\r\n\t\t\tlist.batchUpdate(() => updateArray(list, value as any[]));\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis.cascadeProperty.value(this.container, value);\r\n\t}\r\n\r\n\tparse(value: string) {\r\n\t\treturn this.format ? this.format.convertFromString(value) : value;\r\n\t}\r\n\r\n\tstringify(value: any, format: Format = this.format) {\r\n\t\tif (value === null)\r\n\t\t\treturn '';\r\n\t\treturn format ? format.convertToString(value) : '' + value;\r\n\t}\r\n\r\n\textract(index: LookupEntryIndex) {\r\n\t\treturn this.indexProperty.value(index);\r\n\t}\r\n}\r\n\r\nexport type CascadeFilterManagerOptions = {\r\n\tlookupManager: LookupManager;\r\n\tcascadeProperty: Property;\r\n\tindexProperty: Property;\r\n\tpriorFilters: { filterField: string, indexProperty: string }[];\r\n};\r\n\r\nexport type CascadeFilterManagerFactory = (options: CascadeFilterManagerOptions) => CascadeFilterManager;\r\n\r\nexport function getCascadeFilterManager({ lookupManager, cascadeProperty, indexProperty, priorFilters }: CascadeFilterManagerOptions) {\r\n\treturn new CascadeFilterManager({\r\n\t\tpropsData: {\r\n\t\t\tlookupManager,\r\n\t\t\tcascadeProperty,\r\n\t\t\tindexProperty,\r\n\t\t\tpriorFilters\r\n\t\t}\r\n\t});\r\n}","import { formatters } from 'jsondiffpatch';\r\n\r\n// Copied from https://github.com/benjamine/jsondiffpatch/blob/master/src/formatters/jsonpatch.js\r\nconst isMoveOp = ({ op }) => op === 'move';\r\nconst isRemoveOp = ({ op }) => op === 'remove';\r\nconst last = arr => arr[arr.length - 1];\r\n\r\nconst sortBy = (arr, pred) => {\r\n\tarr.sort(pred);\r\n\treturn arr;\r\n};\r\n\r\nconst compareByIndexDesc = (indexA, indexB) => {\r\n\tconst lastA = parseInt(indexA, 10);\r\n\tconst lastB = parseInt(indexB, 10);\r\n\tif (!(isNaN(lastA) || isNaN(lastB))) {\r\n\t\treturn lastB - lastA;\r\n\t}\r\n\telse {\r\n\t\treturn 0;\r\n\t}\r\n};\r\n\r\nconst opsByDescendingOrder = removeOps => sortBy(removeOps, (a, b) => {\r\n\tconst splitA = a.path.split('/');\r\n\tconst splitB = b.path.split('/');\r\n\tif (splitA.length !== splitB.length) {\r\n\t\treturn splitA.length - splitB.length;\r\n\t}\r\n\telse {\r\n\t\treturn compareByIndexDesc(last(splitA), last(splitB));\r\n\t}\r\n});\r\n// end copied code\r\n\r\nexport class CognitoJsonPatchFormatter extends formatters.jsonpatch.default {\r\n\tprivate static reorderOps(diff) {\r\n\t\tconst [moveOps, removedOps, restOps] = formatters.jsonpatch.partitionOps(diff, [isMoveOp, isRemoveOp]);\r\n\t\tconst removeOpsReverse = opsByDescendingOrder(removedOps);\r\n\t\treturn [...removeOpsReverse, ...moveOps, ...restOps];\r\n\t}\r\n\r\n\tformat(delta, left) {\r\n\t\treturn CognitoJsonPatchFormatter.reorderOps(super.format(delta, left));\r\n\t}\r\n\r\n\trecurse(context, delta, left, key, leftKey, movedFrom, isLast) {\r\n\t\tif (key !== '$id')\r\n\t\t\tsuper.recurse(context, delta, left, key, leftKey, movedFrom, isLast);\r\n\t}\r\n}\r\n","import { Delta, Pipe } from 'jsondiffpatch';\r\n\r\nconst compare = {\r\n\tnumerically(a, b) {\r\n\t\treturn a - b;\r\n\t},\r\n\tnumericallyBy(name) {\r\n\t\treturn (a, b) => a[name] - b[name];\r\n\t}\r\n};\r\n\r\n// https://github.com/benjamine/jsondiffpatch/blob/master/src/contexts/context.js\r\n// Added properties for intelisense\r\nclass Context {\r\n\tresult: any;\r\n\thasResult: boolean;\r\n\texiting: boolean;\r\n\tnext: any\r\n\tnextPipe: any;\r\n\troot: any;\r\n\tchildren: any;\r\n\tnextAfterChildren: any;\r\n\toptions: any;\r\n\tsetResult(result) {\r\n\t\tthis.result = result;\r\n\t\tthis.hasResult = true;\r\n\t\treturn this;\r\n\t}\r\n\r\n\texit() {\r\n\t\tthis.exiting = true;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tswitchTo(next, pipe) {\r\n\t\tif (typeof next === 'string' || next instanceof Pipe) {\r\n\t\t\tthis.nextPipe = next;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.next = next;\r\n\t\t\tif (pipe) {\r\n\t\t\t\tthis.nextPipe = pipe;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this;\r\n\t}\r\n\r\n\tpush(child, name) {\r\n\t\tchild.parent = this;\r\n\t\tif (typeof name !== 'undefined') {\r\n\t\t\tchild.childName = name;\r\n\t\t}\r\n\t\tchild.root = this.root || this;\r\n\t\tchild.options = child.options || this.options;\r\n\t\tif (!this.children) {\r\n\t\t\tthis.children = [child];\r\n\t\t\tthis.nextAfterChildren = this.next || null;\r\n\t\t\tthis.next = child;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.children[this.children.length - 1].next = child;\r\n\t\t\tthis.children.push(child);\r\n\t\t}\r\n\t\tchild.next = this;\r\n\t\treturn this;\r\n\t}\r\n}\r\n\r\n// https://github.com/benjamine/jsondiffpatch/blob/master/src/contexts/patch.js\r\n// Added properties for intelisense\r\nclass PatchContext extends Context {\r\n\tleft;\r\n\tdelta: Delta;\r\n\tpipe: string\r\n\tconstructor(left, delta) {\r\n\t\tsuper();\r\n\t\tthis.left = left;\r\n\t\tthis.delta = delta;\r\n\t\tthis.pipe = 'patch';\r\n\t}\r\n}\r\n\r\n// https://github.com/benjamine/jsondiffpatch/blob/master/src/filters/nested.js\r\n// collectChildrenDiffFilter()\r\n// Add ids to the delta if the object contains an Id\r\nexport const addIdsToRepeatingSectionObjects = (context) => {\r\n\tif (!context || !context.children) {\r\n\t\treturn;\r\n\t}\r\n\tconst length = context.children.length;\r\n\tlet child;\r\n\tlet result = context.result;\r\n\tfor (let index = 0; index < length; index++) {\r\n\t\tchild = context.children[index];\r\n\t\tif (typeof child.result === 'undefined') {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tresult = result || {};\r\n\t\tresult[child.childName] = child.result;\r\n\t}\r\n\tif (result && context.leftIsArray) {\r\n\t\tresult._t = 'a';\r\n\t}\r\n\tcontext.setResult(result).exit();\r\n\r\n\t// Start Cognito-specific patching logic for repeating sections\r\n\t// Add ids to the delta if the object contains an Id\r\n\tif (context.hasResult && context.result && (context.right.Id || context.left.Id) && !(context.right.Id || context.left.Id).includes('-')) {\r\n\t\tcontext.result.$id = context.right.Id || context.left.Id;\r\n\t}\r\n\t// End Cognito-specific patching logic for repeating sections\r\n};\r\naddIdsToRepeatingSectionObjects.filterName = 'addIdsToRepeatingSectionObjects';\r\n\r\n// https://github.com/benjamine/jsondiffpatch/blob/master/src/filters/arrays.js\r\n// nestedPatchFilter()\r\nexport const arrayFilterPreventModificationsFromMissingItems = (context) => {\r\n\tif (!context.nested) {\r\n\t\treturn;\r\n\t}\r\n\tif (context.delta._t !== 'a') {\r\n\t\treturn;\r\n\t}\r\n\tlet index;\r\n\r\n\tconst ARRAY_MOVE = 3;\r\n\tconst delta = context.delta;\r\n\tconst array = context.left;\r\n\r\n\t// first, separate removals, insertions and modifications\r\n\tlet toRemove = [];\r\n\tlet toInsert = [];\r\n\tconst toModify = [];\r\n\tfor (index in delta) {\r\n\t\tif (index !== '_t') {\r\n\t\t\tif (index[0] === '_') {\r\n\t\t\t\t// removed item from original array\r\n\t\t\t\tif (delta[index][2] === 0 || delta[index][2] === ARRAY_MOVE) {\r\n\t\t\t\t\ttoRemove.push(parseInt(index.slice(1), 10));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthrow new Error(\r\n\t\t\t\t\t\t'only removal or move can be applied at original array indices,' +\r\n ` invalid diff type: ${delta[index][2]}`\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (delta[index].length === 1) {\r\n\t\t\t\t\t// added item at new array\r\n\t\t\t\t\ttoInsert.push({\r\n\t\t\t\t\t\tindex: parseInt(index, 10),\r\n\t\t\t\t\t\tvalue: delta[index][0]\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// modified item at new array\r\n\t\t\t\t\ttoModify.push({\r\n\t\t\t\t\t\tindex: parseInt(index, 10),\r\n\t\t\t\t\t\tdelta: delta[index]\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// remove items, in reverse order to avoid sawing our own floor\r\n\ttoRemove = toRemove.sort(compare.numerically);\r\n\tfor (index = toRemove.length - 1; index >= 0; index--) {\r\n\t\tconst indexDiff = delta[`_${toRemove[index]}`];\r\n\t\tconst itemIndex = array.findIndex(item => context.options.objectHash(indexDiff[0]) === context.options.objectHash(item));\r\n\t\tif (itemIndex !== -1) {\r\n\t\t\tarray.splice(itemIndex, 1);\r\n\r\n\t\t\tif (indexDiff && indexDiff[2] === ARRAY_MOVE) {\r\n\t\t\t\t// reinsert later\r\n\t\t\t\ttoInsert.push({\r\n\t\t\t\t\tindex: array.length + toInsert.length,\r\n\t\t\t\t\tvalue: indexDiff[0]\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// insert items, in reverse order to avoid moving our own floor\r\n\ttoInsert = toInsert.sort(compare.numericallyBy('index'));\r\n\tconst toInsertLength = toInsert.length;\r\n\tfor (index = 0; index < toInsertLength; index++) {\r\n\t\tconst insertion = toInsert[index];\r\n\t\tarray.splice(insertion.index, 0, insertion.value);\r\n\t}\r\n\r\n\t// apply modifications\r\n\tconst toModifyLength = toModify.length;\r\n\tlet child;\r\n\tif (toModifyLength > 0) {\r\n\t\tfor (index = 0; index < toModifyLength; index++) {\r\n\t\t\tconst modification = toModify[index];\r\n\t\t\t// Start Cognito-specific patching logic for repeating sections\r\n\t\t\tif (modification.delta.$id != null) {\r\n\t\t\t\t// Prevent modifications to objects that are not in the array\r\n\t\t\t\tconst leftSide = context.left.find((left) => left.Id === modification.delta.$id);\r\n\t\t\t\tif (leftSide) {\r\n\t\t\t\t\tdelete modification.delta.$id;\r\n\t\t\t\t\tchild = new PatchContext(\r\n\t\t\t\t\t\tleftSide,\r\n\t\t\t\t\t\tmodification.delta\r\n\t\t\t\t\t);\r\n\t\t\t\t\tcontext.push(child, modification.index);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// End Cognito-specific patching logic for repeating sections\r\n\t\t\telse {\r\n\t\t\t\tchild = new PatchContext(\r\n\t\t\t\t\tcontext.left[modification.index],\r\n\t\t\t\t\tmodification.delta\r\n\t\t\t\t);\r\n\t\t\t\tcontext.push(child, modification.index);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (!context.children) {\r\n\t\tcontext.setResult(context.left).exit();\r\n\t\treturn;\r\n\t}\r\n\tcontext.exit();\r\n};\r\narrayFilterPreventModificationsFromMissingItems.filterName = 'arrayFilterPreventModificationsFromMissingItems';\r\n\r\n// https://github.com/benjamine/jsondiffpatch/blob/master/src/filters/arrays.js\r\n// collectChildrenPatchFilter()\r\nexport const arraysCollectPreventDuplicateCollections = (context) => {\r\n\tif (!context || !context.children) {\r\n\t\treturn;\r\n\t}\r\n\tif (context.delta._t !== 'a') {\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst length = context.children.length;\r\n\tfor (let index = 0; index < length; index++) {\r\n\t\tconst child = context.children[index];\r\n\t\t// Start Cognito-specific patching logic for repeating sections\r\n\t\t// Prevent adding results that are already in the array\r\n\t\tif (context.left.map(left => left.Id).indexOf(child.result.Id) === -1)\r\n\t\t\tcontext.left[child.childName] = child.result;\r\n\t\t// End Cognito-specific patching logic for repeating sections\r\n\t}\r\n\tcontext.setResult(context.left).exit();\r\n};\r\narraysCollectPreventDuplicateCollections.filterName = 'arraysCollectPreventDuplicateCollections';\r\n","import { create, DiffContext } from 'jsondiffpatch';\r\nimport { addIdsToRepeatingSectionObjects, arrayFilterPreventModificationsFromMissingItems, arraysCollectPreventDuplicateCollections } from './custom-patch-pipes';\r\n\r\nconst diffPatcher = create({\r\n\tpropertyFilter: (propertyName: string, context: DiffContext) => {\r\n\t\t// Don't include changes from null to null\r\n\t\t// eslint-disable-next-line eqeqeq\r\n\t\tif (context.left[propertyName] == null && context.right[propertyName] == null)\r\n\t\t\treturn false;\r\n\t\telse if (propertyName.startsWith('$'))\r\n\t\t\treturn false;\r\n\t\t// Remove pseudo properties like Choice_Price since they never get serialized by model.js\r\n\t\t// eslint-disable-next-line eqeqeq\r\n\t\telse if (propertyName.lastIndexOf('_') > 0)\r\n\t\t\treturn false;\r\n\t\t// root properties don't have a child name\r\n\t\t// eslint-disable-next-line eqeqeq\r\n\t\telse if (context.childName == null && ['Entry', 'Form', 'Id', 'Order'].includes(propertyName))\r\n\t\t\treturn false;\r\n\t\telse if (['ItemNumber'].includes(propertyName))\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\treturn true;\r\n\t},\r\n\t// Formatters don't support textDiff\r\n\ttextDiff: {\r\n\t\tminLength: Number.MAX_SAFE_INTEGER\r\n\t},\r\n\t// Used to differentiate between array objects\r\n\tobjectHash: (obj: any) => {\r\n\t\treturn obj.Id || JSON.stringify(obj);\r\n\t},\r\n\tarrays: {\r\n\t\tdetectMove: false\r\n\t}\r\n});\r\n\r\ndiffPatcher.processor.pipes.diff.replace('collectChildren', addIdsToRepeatingSectionObjects);\r\ndiffPatcher.processor.pipes.patch.replace('arrays', arrayFilterPreventModificationsFromMissingItems);\r\ndiffPatcher.processor.pipes.patch.replace('arraysCollectChildren', arraysCollectPreventDuplicateCollections);\r\n\r\nexport { diffPatcher };","import { EntrySaveResult, EntryService, EntrySubmissionResult, parseStoreResult, ResumeEntryResult } from './entry-service';\r\nimport { FormEntry } from 'src/server-types/forms/model/form-entry';\r\nimport { Delta } from 'jsondiffpatch';\r\nimport { ServiceRequestError, ServiceRequestResult } from './base-service';\r\nimport { CustomResponseError } from './custom-response-error';\r\nimport { PaymentToken } from 'src/server-types/payment/model/payment-token';\r\nimport { CognitoJsonPatchFormatter } from './diff-patch/CognitoJsonPatchFormatter';\r\nimport { diffPatcher } from './diff-patch/CognitoJsonDiffPatcher';\r\nimport { ObjectLookup } from 'src/util';\r\n\r\nconst jsonPatchFormatter = new CognitoJsonPatchFormatter();\r\nexport class ConcurrentEntryConflict extends Error {\r\n\tentry: any;\r\n\torder: any;\r\n\r\n\tconstructor(entry: any, order: any) {\r\n\t\tsuper('Entry Conflict');\r\n\t\tthis.entry = entry;\r\n\t\tthis.order = order;\r\n\t}\r\n}\r\n\r\nexport default class ConcurrentEntryService extends EntryService {\r\n\tinitialEntryJson: any = {};\r\n\tprivate isAdmin: boolean = false;\r\n\r\n\tget diffPatcher() {\r\n\t\treturn diffPatcher;\r\n\t}\r\n\r\n\tget jsonPatchFormatter() {\r\n\t\treturn jsonPatchFormatter;\r\n\t}\r\n\r\n\tconstructor(session: any, isAdmin: boolean) {\r\n\t\tsuper(session);\r\n\t\tthis.isAdmin = isAdmin;\r\n\t}\r\n\r\n\tasync submit(entry: FormEntry, embedUrl: string, saveAndRedirect: boolean, entryToken: string): Promise {\r\n\t\tlet result;\r\n\t\tlet delta;\r\n\t\tconst entryJson = entry.serialize() as any;\r\n\t\tconst order = entry.Order;\r\n\r\n\t\tif (entry.meta.isNew)\r\n\t\t\tresult = await this.performActionForNewEntry(entry.Entry.Action, entryJson, order, embedUrl, saveAndRedirect);\r\n\t\telse {\r\n\t\t\tdelta = this.diffPatcher.diff(this.initialEntryJson, entryJson);\r\n\t\t\tconst diffPatch = this.jsonPatchFormatter.format(delta);\r\n\t\t\tresult = await this.performActionForExistingEntry(entry.Id, entry.Entry.Version, entry.Entry.Action, diffPatch, order, entryJson.Entry.PaymentToken, embedUrl, entryToken, saveAndRedirect, entry.Entry.Role, entryJson.Entry.User);\r\n\t\t}\r\n\r\n\t\tif (result.response && result.response.data) {\r\n\t\t\tconst data = result.response.data;\r\n\t\t\tconst submissionResult = parseStoreResult(data) as EntrySubmissionResult;\r\n\r\n\t\t\tthis.initialEntryJson = submissionResult.entry;\r\n\r\n\t\t\tsubmissionResult.entry.Entry.Action = entry.Entry.Action;\r\n\t\t\tsubmissionResult.entry.Entry.Role = entry.Entry.Role;\r\n\r\n\t\t\t// Add the session token to document links to support downloads\r\n\t\t\tif (data.entryDocuments) {\r\n\t\t\t\tsubmissionResult.documents = data.entryDocuments.map(doc => {\r\n\t\t\t\t\tdoc.link = doc.link + '&token=' + encodeURIComponent(this.sessionToken);\r\n\t\t\t\t\treturn doc;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\treturn submissionResult;\r\n\t\t}\r\n\r\n\t\tthrow this.parseSubmissionError(result.error, delta, entry.Entry.Action, entry.Entry.Role);\r\n\t}\r\n\r\n\tasync save(entry: FormEntry, embedUrl: string, entryToken: string, resumePage?: number): Promise {\r\n\t\tif (!this.session.flags.saveAndResume)\r\n\t\t\tthrow new Error('Entry saving is unsupported.');\r\n\r\n\t\tlet result;\r\n\t\tlet delta;\r\n\t\tconst entryJson = entry.serialize() as any;\r\n\t\tconst order = entry.Order;\r\n\r\n\t\tif (entry.meta.isNew)\r\n\t\t\tresult = await this.saveNewEntry(entryJson, order, embedUrl, resumePage);\r\n\t\telse {\r\n\t\t\tdelta = this.diffPatcher.diff(this.initialEntryJson, entryJson);\r\n\t\t\tconst diffPatch = this.jsonPatchFormatter.format(delta);\r\n\t\t\tresult = await this.saveExistingEntry(entry.Id, entry.Entry.Version, diffPatch, order, embedUrl, entryToken, resumePage, entryJson.Entry.User, entryJson.Entry.Role);\r\n\t\t}\r\n\r\n\t\tif (result.response && result.response.data) {\r\n\t\t\tconst data = result.response.data;\r\n\t\t\tconst saveResult = parseStoreResult(data) as unknown as EntrySaveResult;\r\n\r\n\t\t\tthis.initialEntryJson = this.diffPatcher.clone(saveResult.entry);\r\n\r\n\t\t\tsaveResult.emailAddress = data.saveAndResumeRecipients;\r\n\t\t\tsaveResult.emailMessage = data.emailMessage;\r\n\t\t\tsaveResult.link = data.link;\r\n\t\t\tsaveResult.entry.Entry.Action = entry.Entry.Action;\r\n\t\t\tsaveResult.entry.Entry.Role = entry.Entry.Role;\r\n\t\t\t// Avoid loss of changes made while save request was in flight\r\n\t\t\tconst postSaveEntryJson = entry.serialize();\r\n\t\t\tdelta = this.diffPatcher.diff(this.initialEntryJson, postSaveEntryJson);\r\n\t\t\tif (delta)\r\n\t\t\t\tsaveResult.entry = this.diffPatcher.patch(saveResult.entry, delta);\r\n\t\t\treturn saveResult;\r\n\t\t}\r\n\r\n\t\tthrow this.parseSubmissionError(result.error, delta, entry.Entry.Action, entry.Entry.Role);\r\n\t}\r\n\r\n\tasync emailResumeLink(entryId: string, recipient: string, message: string, embedUrl: string) {\r\n\t\tconst result = await this.serviceRequest({\r\n\t\t\tmethod: 'post',\r\n\t\t\tendpoint: 'svc/save-resume/send-email',\r\n\t\t\tdata: { entryId, recipient, message, embedUrl }\r\n\t\t});\r\n\r\n\t\tif (result.error)\r\n\t\t\tthrow this.parseError(result.error);\r\n\t}\r\n\r\n\tasync resume(formId: string, entryToken: string): Promise {\r\n\t\tconst result = await this.serviceRequest({\r\n\t\t\tmethod: 'get',\r\n\t\t\tendpoint: 'forms/public/entry',\r\n\t\t\tparams: { formId, entryToken }\r\n\t\t});\r\n\r\n\t\tthis.initialEntryJson = result.response.data.entry;\r\n\r\n\t\tif (result.response && result.response.data)\r\n\t\t\treturn result.response.data;\r\n\r\n\t\tthrow this.parseError(result.error);\r\n\t}\r\n\r\n\tupdateInitialEntryJson(entryJson: ObjectLookup) {\r\n\t\tthis.initialEntryJson = entryJson;\r\n\t}\r\n\r\n\tparseSubmissionError(error: ServiceRequestError, delta: Delta, action: string, role: string): Error {\r\n\t\tif (error instanceof CustomResponseError && error.data && error.data.Type === 'Entry Conflict') {\r\n\t\t\tthis.initialEntryJson = error.data.Data.entry;\r\n\r\n\t\t\tconst patchedEntry = this.diffPatcher.patch(this.diffPatcher.clone(this.initialEntryJson), delta);\r\n\t\t\tpatchedEntry.Entry.Action = action;\r\n\t\t\tpatchedEntry.Entry.Role = role;\r\n\t\t\treturn new ConcurrentEntryConflict(patchedEntry, error.data.Data.order);\r\n\t\t}\r\n\t\treturn this.parseError(error);\r\n\t}\r\n\r\n\tprivate performActionForExistingEntry(entryId: string, entryVersion: number, action: string, patch: any[], order: any, paymentToken: PaymentToken, embedUrl: string, entryToken: string, saveAndRedirect: boolean, role?: string, user?:object): Promise {\r\n\t\treturn this.serviceRequest({\r\n\t\t\tmethod: 'post',\r\n\t\t\tendpoint: 'svc/update-entry/perform-action' + (this.isAdmin ? '/admin' : ''),\r\n\t\t\tisCognitoJson: true,\r\n\t\t\theaders: this.getValidationHeaders(),\r\n\t\t\tdata: {\r\n\t\t\t\tFormId: this.session.formId,\r\n\t\t\t\tEntryId: entryId,\r\n\t\t\t\tEntryVersion: entryVersion,\r\n\t\t\t\tAction: action,\r\n\t\t\t\tPatch: patch,\r\n\t\t\t\tEntryToken: entryToken,\r\n\t\t\t\tEmbedUrl: embedUrl,\r\n\t\t\t\tOrderAmount: order ? order.OrderAmount : null,\r\n\t\t\t\tPaymentToken: paymentToken || null,\r\n\t\t\t\tSaveAndRedirect: saveAndRedirect,\r\n\t\t\t\tRole: this.isAdmin && role ? role : null,\r\n\t\t\t\tUserInfo: user\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tprivate performActionForNewEntry(action: string, entry: object, order: any, embedUrl: string, saveAndRedirect: boolean): Promise {\r\n\t\treturn this.serviceRequest({\r\n\t\t\tmethod: 'post',\r\n\t\t\tendpoint: 'svc/update-entry/perform-action/new-entry' + (this.isAdmin ? '/admin' : ''),\r\n\t\t\tisCognitoJson: true,\r\n\t\t\theaders: this.getValidationHeaders(),\r\n\t\t\tdata: {\r\n\t\t\t\tFormId: this.session.formId,\r\n\t\t\t\tAction: action,\r\n\t\t\t\tEntryJson: JSON.stringify(entry),\r\n\t\t\t\tAccessToken: this.session.accessToken,\r\n\t\t\t\tEmbedUrl: embedUrl,\r\n\t\t\t\tOrderAmount: order ? order.OrderAmount : null,\r\n\t\t\t\tSaveAndRedirect: saveAndRedirect\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tprivate saveNewEntry(entry: object, order: any, embedUrl: string, resumePage?: number): Promise {\r\n\t\treturn this.serviceRequest({\r\n\t\t\tmethod: 'post',\r\n\t\t\tendpoint: 'svc/update-entry/save/new-entry' + (this.isAdmin ? '/admin' : ''),\r\n\t\t\tisCognitoJson: true,\r\n\t\t\theaders: this.getValidationHeaders(),\r\n\t\t\tdata: {\r\n\t\t\t\tFormId: this.session.formId,\r\n\t\t\t\tEntryJson: JSON.stringify(entry),\r\n\t\t\t\tAccessToken: this.session.accessToken,\r\n\t\t\t\tEmbedUrl: embedUrl,\r\n\t\t\t\tOrderAmount: order ? order.OrderAmount : null,\r\n\t\t\t\tLastPageViewed: resumePage\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tprivate saveExistingEntry(entryId: string, entryVersion: number, patch: any[], order: any, embedUrl: string, entryToken: string, resumePage?: number, user?: object, role?: string): Promise {\r\n\t\treturn this.serviceRequest({\r\n\t\t\tmethod: 'post',\r\n\t\t\tendpoint: 'svc/update-entry/save' + (this.isAdmin ? '/admin' : ''),\r\n\t\t\tisCognitoJson: true,\r\n\t\t\theaders: this.getValidationHeaders(),\r\n\t\t\tdata: {\r\n\t\t\t\tFormId: this.session.formId,\r\n\t\t\t\tEntryId: entryId,\r\n\t\t\t\tEntryVersion: entryVersion,\r\n\t\t\t\tPatch: patch,\r\n\t\t\t\tEntryToken: entryToken,\r\n\t\t\t\tEmbedUrl: embedUrl,\r\n\t\t\t\tOrderAmount: order ? order.OrderAmount : null,\r\n\t\t\t\tLastPageViewed: resumePage,\r\n\t\t\t\tUserInfo: user,\r\n\t\t\t\tRole: role\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tprivate getValidationHeaders(): object {\r\n\t\tlet validationMethod = null;\r\n\t\tlet validationToken = null;\r\n\t\tif (this.session && this.session.botValidation && this.session.botValidation.method && this.session.botValidation.token) {\r\n\t\t\tvalidationMethod = this.session.botValidation.method;\r\n\t\t\tvalidationToken = this.session.botValidation.token;\r\n\t\t}\r\n\r\n\t\treturn validationMethod && validationToken ? { [validationMethod]: validationToken } : null;\r\n\t}\r\n}","/**\r\n * Determine whether the given value satisfies \"required\" validation\r\n * NOTE: Taken from 'RequiredRule.hasVavlue' in ExoWeb\r\n * @param val The value to test for requiredness\r\n */\r\nexport function hasValue(val: any): boolean {\r\n\treturn val !== undefined && val !== null && (typeof val !== 'string' || val.trim() !== '') && (!(val instanceof Array) || val.length > 0);\r\n}\r\n\r\n/**\r\n * Evaluates a numerical index based format string, akin to `String.format()` in .NET.\r\n * NOTE: Take from $format in ExoWeb...\r\n * @param template The format template string\r\n * @param values The values to insert for tokens in the template string\r\n */\r\nexport function $format(template: string, values: any[]): string;\r\nexport function $format(template: string, ...values: any[]): string;\r\nexport function $format(template: string, arg1: any): string {\r\n\tlet source: any[];\r\n\r\n\tif (arguments.length < 2) {\r\n\t\treturn template;\r\n\t}\r\n\r\n\tif (arguments.length > 2) {\r\n\t\t// Use arguments passed to function as array\r\n\t\tsource = Array.prototype.slice.call(arguments, 1);\r\n\t}\r\n\telse {\r\n\t\tsource = !(arg1 instanceof Array) ? [arg1] : arg1;\r\n\t}\r\n\r\n\treturn template.replace(/\\{([0-9]+)\\}/ig, function (match: string, p1: string): string {\r\n\t\tconst index = parseInt(p1, 10);\r\n\t\tlet result = source[index];\r\n\r\n\t\tif (result !== null && result !== undefined && typeof result !== 'string') {\r\n\t\t\t// Convert non string values to string\r\n\t\t\tresult = result.toString();\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t});\r\n}\r\n\r\n/**\r\n * Shorthand for `Object.hasOwnProperty`\r\n */\r\n// todo: necessary?\r\nexport function hasProp(obj: any, prop: string): boolean {\r\n\treturn Object.prototype.hasOwnProperty.call(obj, prop);\r\n}\r\n\r\n/**\r\n * Clones the top-level own properties of an object\r\n * @param obj The object to clone\r\n */\r\n// todo: necessary? Object.assign() accomplishes the same\r\nexport function shallowClone(obj: T): T {\r\n\tconst result: any = {};\r\n\tfor (const prop in obj) {\r\n\t\tif (hasProp(obj, prop)) {\r\n\t\t\tresult[prop] = obj[prop];\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}\r\n\r\n/**\r\n * Performs a deep removal of null and undefined properties from an object.\r\n * @param obj The object from which to remove properties\r\n */\r\nexport function removeEmptyProps(obj) {\r\n\tObject.keys(obj).forEach(k => {\r\n\t\tif (obj[k] && typeof obj[k] === 'object')\r\n\t\t\tremoveEmptyProps(obj[k]);\r\n\t\telse if (obj[k] === null || obj[k] === undefined)\r\n\t\t\tdelete obj[k];\r\n\t});\r\n\treturn obj;\r\n};\r\n\r\n/**\r\n * Gets the precision of the format\r\n * @param format String of the format ex. \"C\", \"P1\", \"N0\"\r\n * @returns Number\r\n */\r\nexport function getFormatPrecision(format: string) {\r\n\tif (format === 'C')\r\n\t\treturn 2;\r\n\r\n\tlet precision = parseInt(format.replace(/[^0-9]/, '')) || 0;\r\n\r\n\tif (format.startsWith('P'))\r\n\t\tprecision += 2;\r\n\r\n\treturn precision;\r\n}\r\n\r\n/**\r\n * Returns a string with the first letter Capitalized\r\n * @param val\r\n * @returns String\r\n */\r\nexport function capitalizeString(val: string) {\r\n\tif (!val)\r\n\t\treturn val;\r\n\telse\r\n\t\treturn val.charAt(0).toUpperCase() + val.substr(1);\r\n}\r\n\r\n/**\r\n * Recursively capitalizes property keys within an object. Does not modify the provided object.\r\n * @param obj The object on which to recursively capitalize property keys.\r\n * @returns Object\r\n */\r\nexport function capitalizeKeys(obj) {\r\n\tif (!obj)\r\n\t\treturn;\r\n\telse if (typeof obj === 'string')\r\n\t\treturn obj;\r\n\r\n\tconst keys = Object.keys(obj);\r\n\tlet n = keys.length;\r\n\tconst newObj = {};\r\n\twhile (n--) {\r\n\t\tconst key: string = keys[n];\r\n\t\tlet data;\r\n\t\tif (Array.isArray(obj[key]))\r\n\t\t\tdata = obj[key].map(z => {\r\n\t\t\t\treturn capitalizeKeys(z);\r\n\t\t\t});\r\n\t\telse if (typeof(obj[key]) === 'object')\r\n\t\t\tdata = capitalizeKeys(obj[key]);\r\n\t\telse\r\n\t\t\tdata = obj[key];\r\n\r\n\t\tnewObj[capitalizeString(key)] = data;\r\n\t}\r\n\treturn newObj;\r\n};\r\n\r\nexport function removeExtraSpace(text: string): string {\r\n\treturn text.replace(/ {2,}/g, ' ').trim();\r\n}","import { FormEntryIndex } from 'src/server-types/forms/model/form-entry-index';\r\n\r\nexport function getViewId(index: FormEntryIndex) {\r\n\treturn index.Id.split('|')[0];\r\n}\r\n\r\nexport function getTimestamp(index: FormEntryIndex) {\r\n\treturn index.Id.split('|')[1];\r\n}\r\n\r\nexport function getId(index: FormEntryIndex) {\r\n\treturn index.Id.split('|')[2];\r\n}","var map = {\n\t\"./bg\": [\n\t\t158,\n\t\t50,\n\t\t25\n\t],\n\t\"./bg.js\": [\n\t\t158,\n\t\t50,\n\t\t25\n\t],\n\t\"./da\": [\n\t\t159,\n\t\t53,\n\t\t26\n\t],\n\t\"./da.js\": [\n\t\t159,\n\t\t53,\n\t\t26\n\t],\n\t\"./de\": [\n\t\t160,\n\t\t54,\n\t\t27\n\t],\n\t\"./de.js\": [\n\t\t160,\n\t\t54,\n\t\t27\n\t],\n\t\"./el\": [\n\t\t161,\n\t\t56,\n\t\t28\n\t],\n\t\"./el.js\": [\n\t\t161,\n\t\t56,\n\t\t28\n\t],\n\t\"./en\": [\n\t\t162,\n\t\t57,\n\t\t29\n\t],\n\t\"./en.js\": [\n\t\t162,\n\t\t57,\n\t\t29\n\t],\n\t\"./es\": [\n\t\t163,\n\t\t59,\n\t\t30\n\t],\n\t\"./es.js\": [\n\t\t163,\n\t\t59,\n\t\t30\n\t],\n\t\"./fi\": [\n\t\t164,\n\t\t62,\n\t\t31\n\t],\n\t\"./fi.js\": [\n\t\t164,\n\t\t62,\n\t\t31\n\t],\n\t\"./fr\": [\n\t\t165,\n\t\t63,\n\t\t32\n\t],\n\t\"./fr.js\": [\n\t\t165,\n\t\t63,\n\t\t32\n\t],\n\t\"./hi\": [\n\t\t166,\n\t\t33\n\t],\n\t\"./hi.js\": [\n\t\t166,\n\t\t33\n\t],\n\t\"./hr\": [\n\t\t167,\n\t\t65,\n\t\t34\n\t],\n\t\"./hr.js\": [\n\t\t167,\n\t\t65,\n\t\t34\n\t],\n\t\"./hu\": [\n\t\t168,\n\t\t66,\n\t\t35\n\t],\n\t\"./hu.js\": [\n\t\t168,\n\t\t66,\n\t\t35\n\t],\n\t\"./it\": [\n\t\t169,\n\t\t69,\n\t\t37\n\t],\n\t\"./it.js\": [\n\t\t169,\n\t\t69,\n\t\t37\n\t],\n\t\"./ja\": [\n\t\t170,\n\t\t70,\n\t\t38\n\t],\n\t\"./ja.js\": [\n\t\t170,\n\t\t70,\n\t\t38\n\t],\n\t\"./nb\": [\n\t\t171,\n\t\t39\n\t],\n\t\"./nb.js\": [\n\t\t171,\n\t\t39\n\t],\n\t\"./nl\": [\n\t\t172,\n\t\t80,\n\t\t40\n\t],\n\t\"./nl.js\": [\n\t\t172,\n\t\t80,\n\t\t40\n\t],\n\t\"./pl\": [\n\t\t173,\n\t\t81,\n\t\t41\n\t],\n\t\"./pl.js\": [\n\t\t173,\n\t\t81,\n\t\t41\n\t],\n\t\"./pt\": [\n\t\t174,\n\t\t82,\n\t\t42\n\t],\n\t\"./pt.js\": [\n\t\t174,\n\t\t82,\n\t\t42\n\t],\n\t\"./sv\": [\n\t\t175,\n\t\t43\n\t],\n\t\"./sv.js\": [\n\t\t175,\n\t\t43\n\t],\n\t\"./th\": [\n\t\t176,\n\t\t91,\n\t\t44\n\t],\n\t\"./th.js\": [\n\t\t176,\n\t\t91,\n\t\t44\n\t],\n\t\"./tl\": [\n\t\t177,\n\t\t45\n\t],\n\t\"./tl.js\": [\n\t\t177,\n\t\t45\n\t],\n\t\"./tr\": [\n\t\t178,\n\t\t46\n\t],\n\t\"./tr.js\": [\n\t\t178,\n\t\t46\n\t],\n\t\"./zh\": [\n\t\t179,\n\t\t99\n\t],\n\t\"./zh.js\": [\n\t\t179,\n\t\t99\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn Promise.all(ids.slice(1).map(__webpack_require__.e)).then(function() {\n\t\treturn __webpack_require__(id);\n\t});\n}\nwebpackAsyncContext.keys = function webpackAsyncContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackAsyncContext.id = 234;\nmodule.exports = webpackAsyncContext;","var map = {\n\t\"./bg.json\": [\n\t\t240,\n\t\t135\n\t],\n\t\"./da.json\": [\n\t\t241,\n\t\t136\n\t],\n\t\"./de.json\": [\n\t\t242,\n\t\t137\n\t],\n\t\"./el.json\": [\n\t\t243,\n\t\t138\n\t],\n\t\"./en.json\": [\n\t\t244,\n\t\t139\n\t],\n\t\"./es.json\": [\n\t\t245,\n\t\t141\n\t],\n\t\"./fi.json\": [\n\t\t246,\n\t\t142\n\t],\n\t\"./fr.json\": [\n\t\t247,\n\t\t143\n\t],\n\t\"./hi.json\": [\n\t\t248,\n\t\t144\n\t],\n\t\"./hr.json\": [\n\t\t249,\n\t\t145\n\t],\n\t\"./hu.json\": [\n\t\t250,\n\t\t146\n\t],\n\t\"./it.json\": [\n\t\t251,\n\t\t150\n\t],\n\t\"./ja.json\": [\n\t\t252,\n\t\t151\n\t],\n\t\"./nb.json\": [\n\t\t253,\n\t\t153\n\t],\n\t\"./nl.json\": [\n\t\t254,\n\t\t154\n\t],\n\t\"./pl.json\": [\n\t\t255,\n\t\t155\n\t],\n\t\"./pt.json\": [\n\t\t256,\n\t\t156\n\t],\n\t\"./sv.json\": [\n\t\t257,\n\t\t160\n\t],\n\t\"./th.json\": [\n\t\t258,\n\t\t161\n\t],\n\t\"./tr.json\": [\n\t\t259,\n\t\t163\n\t],\n\t\"./zh.json\": [\n\t\t260,\n\t\t175\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(function() {\n\t\treturn __webpack_require__.t(id, 3);\n\t});\n}\nwebpackAsyncContext.keys = function webpackAsyncContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackAsyncContext.id = 235;\nmodule.exports = webpackAsyncContext;","import api from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../node_modules/css-loader/index.js!../../node_modules/sass-loader/dist/cjs.js!../../node_modules/sass-resources-loader/lib/loader.js??ref--4-oneOf-1-3!./_motion.scss\";\n\nvar options = {\"attributes\":{\"class\":\"cog-style\"}};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\r\n * Gets a friendly name for the device type for the given user-agent string\r\n * @param useragent The user agent string\r\n * Examples\r\n * Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1\r\n * Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1\r\n * Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1\r\n * Mozilla/5.0 (Linux; Android 7.0; SM-G955F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Mobile Safari/537.36\r\n * Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.104 Mobile Safari/537.36\r\n * Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0\r\n */\r\nexport function getDeviceType(useragent: string): DeviceType {\r\n\t// Modified version of:\r\n\t// http://www.competa.com/blog/how-to-detect-mobile-devices-with-vanilla-javascript/\r\n\t// Also found in Cognito-core.js\r\n\tif (useragent.match(/Windows NT/i))\r\n\t\treturn 'windows-desktop';\r\n\telse if (useragent.match(/Android/i))\r\n\t\treturn 'android';\r\n\telse if (useragent.match(/webOS/i))\r\n\t\treturn 'webos';\r\n\telse if (useragent.match(/iPhone/i))\r\n\t\treturn 'iphone';\r\n\telse if (useragent.match(/iPod/i))\r\n\t\treturn 'ipod';\r\n\telse if (useragent.match(/iPad/i))\r\n\t\treturn 'ipad';\r\n\telse if (useragent.match(/Windows Phone/i))\r\n\t\treturn 'windows-phone';\r\n\telse if (useragent.match(/SymbianOS/i))\r\n\t\treturn 'symbian';\r\n\telse if (useragent.match(/RIM/i) || useragent.match(/BB/i))\r\n\t\treturn 'blackberry';\r\n\telse if (useragent.match(/OS X/i))\r\n\t\treturn 'mac-desktop';\r\n\treturn 'unknown';\r\n}\r\n\r\n/**\r\n * The friendly names for various device types\r\n */\r\nexport type DeviceType = 'windows-desktop' | 'android' | 'webos' | 'iphone' | 'ipod' | 'ipad' | 'windows-phone' | 'symbian' | 'blackberry' | 'mac-desktop' | 'unknown';\r\n\r\n/**\r\n * Determines whether the navigator's user agent matches the given device type query\r\n * @param navigator The navigator object (i.e. window.navigator)\r\n * @param query The device type query to check, ex: \"iphone|ipod|ipad\"\r\n */\r\nexport function isDeviceType(navigator: { userAgent: string }, query: string): boolean {\r\n\tconst deviceType = getDeviceType(navigator.userAgent);\r\n\tconst deviceTypesToCheck = query.split('|');\r\n\treturn deviceTypesToCheck.some(d => d.toLowerCase() === deviceType);\r\n}\r\n\r\nexport function isLegacyEdge(navigator: { userAgent: string }) {\r\n\treturn /Edge\\//.test(navigator.userAgent);\r\n}\r\n\r\nexport function isIE(navigator: { userAgent: string }) {\r\n\treturn /Trident\\//.test(navigator.userAgent);\r\n}\r\n\r\nexport function isSafari(navigator: { userAgent: string }) {\r\n\tconst deviceType = getDeviceType(navigator.userAgent);\r\n\treturn deviceType === 'mac-desktop' || deviceType === 'ipad' || deviceType === 'iphone' || deviceType === 'ipod';\r\n}\r\n\r\nexport function safariVersion(navigator: { userAgent: string }) {\r\n\tconst regEx = /Version\\/\\d*.\\d*/;\r\n\tif (!isSafari(window.navigator) || !window.navigator.userAgent.match(regEx))\r\n\t\treturn false;\r\n\telse {\r\n\t\tconst versionNumber = parseFloat(window.navigator.userAgent.match(regEx)[0].replace('Version/', ''));\r\n\t\treturn isNaN(versionNumber) ? false : versionNumber;\r\n\t}\r\n}","var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n { class: [\"cog-col \" + _vm.colNumClass] },\n [_vm._t(\"default\")],\n 2\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","\r\n\r\n","import mod from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Col.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Col.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Col.vue?vue&type=template&id=3721e780&\"\nimport script from \"./Col.vue?vue&type=script&lang=js&\"\nexport * from \"./Col.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"C:\\\\a\\\\1\\\\s\\\\Cognito.Services\\\\client\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('3721e780')) {\n api.createRecord('3721e780', component.options)\n } else {\n api.reload('3721e780', component.options)\n }\n module.hot.accept(\"./Col.vue?vue&type=template&id=3721e780&\", function () {\n api.rerender('3721e780', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"src/components/Col.vue\"\nexport default component.exports","import { Deferred } from './deferred';\r\n\r\n/**\r\n * Returns a function which, when called, will in turn call the given {callback} function once,\r\n * after the returned function has not been called within the {time} interval. The callback function\r\n * is called with the arguments that are passed to it in the _last_ call.\r\n *\r\n * This can be used to ensure that a given function is not called multiple times in rapid succession.\r\n * @param callback The target callback function to call.\r\n * @param time The amount of time to wait before calling the callback function.\r\n * @returns A function which may be used in place of the callback function.\r\n */\r\nexport default function debounce(callback: (...args: any[]) => Promise | T, time: number = 200): (...args: any[]) => Promise {\r\n\tlet interval = 0;\r\n\tlet deferred: Deferred = null;\r\n\treturn (...args) => {\r\n\t\t// If the function has previously been called, then clear the timeout\r\n\t\t// Otherwise, set up a deferred to use for promise resolution\r\n\t\tif (interval)\r\n\t\t\tclearTimeout(interval);\r\n\t\telse\r\n\t\t\tdeferred = new Deferred();\r\n\r\n\t\t// Set a timeout to fire in {time} milliseconds\r\n\t\tinterval = window.setTimeout(async () => {\r\n\t\t\t// Capture the deferred and null out closure variables,\r\n\t\t\t// this creates a new \"debouncing timeframe\"\r\n\t\t\tconst thisDeferred = deferred;\r\n\t\t\tinterval = 0;\r\n\t\t\tdeferred = null;\r\n\r\n\t\t\t// Await the result of the callback (if it is asynchronous)\r\n\t\t\ttry {\r\n\t\t\t\tconst result = await callback(...args);\r\n\r\n\t\t\t\t// Resolve the promise with the resulting value\r\n\t\t\t\tthisDeferred.resolve(result);\r\n\t\t\t}\r\n\t\t\tcatch (e) {\r\n\t\t\t\tthisDeferred.reject(e);\r\n\t\t\t}\r\n\t\t}, time);\r\n\r\n\t\t// Return the deferred promise so that the caller can await the result\r\n\t\treturn deferred.promise;\r\n\t};\r\n}\r\n\r\nexport function uiDebounce(callback) {\r\n\tlet rafId;\r\n\r\n\treturn (...args) => {\r\n\t\t// If it is currently handling a request, cancel it\r\n\t\tif (rafId)\r\n\t\t\tcancelAnimationFrame(rafId);\r\n\r\n\t\trafId = requestAnimationFrame(() => callback(...args));\r\n\t};\r\n}","import VueModel, { isEntityType } from '@cognitoforms/vuemodel';\r\n\r\nexport default {\r\n\tmixins: [VueModel.mixins.SourcePath],\r\n\tinject: {\r\n\t\tform: {},\r\n\t\tpageNumber: { default: 1 }\r\n\t},\r\n\tprops: {\r\n\t\t// If a validation filter is specified, then the list of validation conditions considered will be filtered to those\r\n\t\t// where the ConditionType's code matches the expression, ex: /.QuantityValidation$/ will only include quantity limit errors\r\n\t\tvalidationFilter: {\r\n\t\t\ttype: RegExp,\r\n\t\t\trequired: false,\r\n\t\t\tdefault: null\r\n\t\t}\r\n\t},\r\n\tdata() {\r\n\t\treturn {\r\n\t\t\tisDirty: false,\r\n\t\t\tlostFocus: false\r\n\t\t};\r\n\t},\r\n\tmounted() {\r\n\t\tif (this.form)\r\n\t\t\tthis.form.registerField(this);\r\n\r\n\t\t// The $source.value watcher that marks this component as dirty does not trigger when updating entity sub fields (Address.City, Name.First, etc.)\r\n\t\tthis.detectDirtyEntity();\r\n\r\n\t\tthis.$el.addEventListener('focusout', evt => {\r\n\t\t\tconst elGainingFocus = evt.relatedTarget;\r\n\t\t\t// Allow focus to be in limbo for just a bit before considering it lost. Cf. Select.vue\r\n\t\t\tconst lostFocusDelay = 50;\r\n\t\t\tif (this.isDirty && (!elGainingFocus || !this.$el.contains(elGainingFocus)))\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tif (!this.$el.contains(document.activeElement))\r\n\t\t\t\t\t\tthis.lostFocus = true;\r\n\t\t\t\t}, lostFocusDelay);\r\n\t\t});\r\n\t},\r\n\tbeforeDestroy() {\r\n\t\tif (this.form)\r\n\t\t\tthis.form.unregisterField(this);\r\n\t},\r\n\tcreated() {\r\n\t\tif (this.firstError) {\r\n\t\t\t// Trigger the error change handler when the component is first created in order to mark quantity limit errors as dirty.\r\n\t\t\t// The watcher may not fire in some cases, for example when switching between table and responsive section mode.\r\n\t\t\tthis.handleErrorChange(this.firstError);\r\n\t\t}\r\n\t},\r\n\twatch: {\r\n\t\t'$source.value': function() {\r\n\t\t\tthis.isDirty = true;\r\n\t\t},\r\n\t\tfirstError: function(err) {\r\n\t\t\tthis.handleErrorChange(err);\r\n\t\t}\r\n\t},\r\n\tcomputed: {\r\n\t\tshowValidation() {\r\n\t\t\tif (!this.form.flags.workflowEnabled && this.form.readonly)\r\n\t\t\t\treturn false;\r\n\r\n\t\t\treturn (this.isDirty && this.lostFocus && this.hasError) || this.hasFormatError;\r\n\t\t},\r\n\t\thasError() {\r\n\t\t\treturn !!this.firstError && !this.ignoreError;\r\n\t\t},\r\n\t\tconditions() {\r\n\t\t\tif (this.validationFilter)\r\n\t\t\t\treturn this.$source.conditions.filter(c => this.validationFilter.test(c.type.code));\r\n\t\t\telse\r\n\t\t\t\treturn this.$source.conditions;\r\n\t\t},\r\n\t\tfirstError() {\r\n\t\t\tif (!this.$source.firstError)\r\n\t\t\t\treturn null;\r\n\r\n\t\t\tconst workflowIgnoreQuantityError = this.form.flags.workflowEnabled && this.form.entry.Next_Status === 'Incomplete';\r\n\t\t\tconst conditions = this.conditions.filter(c => !workflowIgnoreQuantityError || !this.isQuantityLimitError(c));\r\n\r\n\t\t\tconst quantityError = conditions.find(this.isQuantityLimitError);\r\n\t\t\tif (quantityError)\r\n\t\t\t\treturn quantityError;\r\n\t\t\telse\r\n\t\t\t\treturn conditions.length ? conditions[0] : null;\r\n\t\t},\r\n\t\thasFormatError() {\r\n\t\t\treturn this.firstError && this.firstError.formatError;\r\n\t\t}\r\n\t},\r\n\tmethods: {\r\n\t\tdetectDirtyEntity() {\r\n\t\t\tif (this.$source.property && isEntityType(this.$source.property.propertyType) && this.$source.value) {\r\n\t\t\t\tconst markDirtyForTrueChange = e => {\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * Initialization of entity sub properties is triggering change on the entity.\r\n\t\t\t\t\t * Use existence of oldValue to determine if it is a true change, or just init.\r\n\t\t\t\t\t * Ex: Initialization of Name.First (undefined -> null) triggers change on the Name entity\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (e.oldValue !== undefined) {\r\n\t\t\t\t\t\tthis.isDirty = true;\r\n\t\t\t\t\t\tthis.$source.value.changed.unsubscribe(markDirtyForTrueChange);\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\tthis.$source.value.changed.subscribe(markDirtyForTrueChange);\r\n\t\t\t}\r\n\t\t},\r\n\t\thandleErrorChange(err) {\r\n\t\t\t// mark this field as having been modified by the user to allow showing quantity validation\r\n\t\t\tif (this.isQuantityLimitError(err)) {\r\n\t\t\t\tthis.isDirty = true;\r\n\t\t\t\tthis.lostFocus = true;\r\n\t\t\t}\r\n\t\t},\r\n\t\tisQuantityLimitError(err) {\r\n\t\t\treturn err && err.type.code.endsWith('.QuantityValidation');\r\n\t\t},\r\n\t\tforceValidation() {\r\n\t\t\tthis.isDirty = true;\r\n\t\t\tthis.lostFocus = true;\r\n\t\t}\r\n\t}\r\n};","import FormBase from './FormBase';\r\nimport { FormEvents } from 'src/framework/public/events';\r\nimport { FormEvent } from 'src/framework/eventing/form-event';\r\nimport ResizeObserver from 'resize-observer-polyfill';\r\nimport { FormEventScope } from 'src/framework/eventing/form-event-scope';\r\n\r\nexport function ensureMinHeight(publicEvents: FormEventScope, minHeight: number) {\r\n\tif (!window.name.includes('amp_iframe'))\r\n\t\tpublicEvents.emit(new FormEvent(FormEvents.Resize, {\r\n\t\t\tminHeight\r\n\t\t}));\r\n}\r\n\r\nexport function emitResizeEvent(form: FormBase, height?: number) {\r\n\tif (!window.name.includes('amp_iframe')) {\r\n\t\tform.publicEvents.emit(new FormEvent(FormEvents.Resize, {\r\n\t\t\theight: height,\r\n\t\t\tisDelta: false\r\n\t\t}));\r\n\t}\r\n\telse\r\n\t\twindow.parent.postMessage(\r\n\t\t\t{\r\n\t\t\t\tsentinel: 'amp',\r\n\t\t\t\ttype: 'embed-size',\r\n\t\t\t\theight: height\r\n\t\t\t},\r\n\t\t\t'*'\r\n\t\t);\r\n}\r\n\r\nexport function enableResizeDetection(form: FormBase) {\r\n\tconst resizeObserver = new ResizeObserver((entries) => {\r\n\t\tconst { height } = entries[0].contentRect;\r\n\r\n\t\t// The different rounding fixes #20816 for different pixel desnsities\r\n\t\tif (window.devicePixelRatio % 1) {\r\n\t\t\tconst DVPDecimal:number = +(window.devicePixelRatio % 1).toFixed(2);\r\n\t\t\tconst heightMultiplier = DVPDecimal > .5 ? 1 - DVPDecimal : DVPDecimal;\r\n\t\t\temitResizeEvent(form, Math.round(height * heightMultiplier) / heightMultiplier);\r\n\t\t}\r\n\t\telse {\r\n\t\t\temitResizeEvent(form, Math.round(height));\r\n\t\t}\r\n\t});\r\n\r\n\tresizeObserver.observe(form.$el);\r\n}","import { ServiceWithSession } from './base-service';\r\nimport { FormEntry } from 'src/server-types/forms/model/form-entry';\r\nimport { QuantityData } from './quantity-service';\r\nimport { Entity } from '@cognitoforms/vuemodel';\r\nimport { isLookupField } from 'src/util/model';\r\n\r\nconst entryTokenRegex = /#?((?\\d+):)?(?.{44}[*!])/;\r\n\r\nexport function tryParseEntryToken(token: string): { success: boolean; actionId?: number; entryToken?: string; } {\r\n\ttoken = decodeURIComponent(token);\r\n\tconst match = token.match(entryTokenRegex);\r\n\tif (match)\r\n\t\treturn {\r\n\t\t\tsuccess: true,\r\n\t\t\tactionId: Number(match.groups.actionId),\r\n\t\t\tentryToken: match.groups.entryToken\r\n\t\t};\r\n\telse\r\n\t\treturn { success: false };\r\n}\r\n\r\ntype BaseEntryStoreResult = {\r\n\tstatus: SubmissionResultStatus,\r\n\tentry?: any,\r\n\torder?: any,\r\n\tmessage?: string,\r\n\tdata?: any\r\n}\r\n\r\nexport type EntryDocument = {\r\n\tlink: string;\r\n\ttitle: string;\r\n\ttype: string;\r\n}\r\n\r\nexport type EntrySubmissionResult = BaseEntryStoreResult & {\r\n\tdocuments?: EntryDocument[],\r\n\tentryToken?: string\r\n}\r\n\r\nexport type EntrySaveResult = BaseEntryStoreResult & {\r\n\temailAddress: string;\r\n\temailMessage: string;\r\n\tlink: string;\r\n\tentryToken: string;\r\n\tenableSend: boolean;\r\n}\r\n\r\nexport enum ResumeMode {\r\n\tView = 'View',\r\n\tEdit = 'Edit',\r\n\tPaymentRedirect = 'PayPal'\r\n}\r\n\r\nexport enum SubmissionResultStatus {\r\n\tSuccess = 'Success',\r\n\tAlreadyPaid = 'AlreadyPaid',\r\n\tQuantityLimitExceeded = 'QuantityLimitExceeded',\r\n\tPaymentDeclined = 'PaymentDeclined',\r\n\tCardDeclined = 'CardDeclined',\r\n\tOrderMismatch = 'OrderMismatch',\r\n\tAlreadySubmitted = 'AlreadySubmitted',\r\n\tUnknown = 'Unknown',\r\n\tError = 'Error'\r\n}\r\n\r\nexport type ResumeEntryResult = {\r\n\tentry: any;\r\n\torder?: any;\r\n\tmode: ResumeMode;\r\n\tentryDocuments?: EntryDocument[];\r\n\tlastPageViewed?: string;\r\n\tuserEmail?: string;\r\n}\r\n\r\nexport abstract class EntryService extends ServiceWithSession {\r\n\tabstract submit(entry: FormEntry, embedUrl: string, saveAndRedirect: boolean, entryToken: string): Promise;\r\n\r\n\tabstract save(entry: FormEntry, embedUrl: string, entryToken: string, resumePage?: number): Promise;\r\n\r\n\tabstract emailResumeLink(entryId: string, recipient: string, message: string, link: string): void;\r\n\r\n\tabstract resume(formId: string, entryToken: string, actionId: number): Promise;\r\n\r\n\tvalidateEntry(entity: Entity, parent: Entity) {\r\n\t\t// If this isn't an entity type, return\r\n\t\tif (!entity || !entity.meta || !entity.meta.conditions)\r\n\t\t\treturn true;\r\n\r\n\t\t// Only validate fields that are visible on entry\r\n\t\tconst isFieldShown = (property: any) => {\r\n\t\t\tif (entity[property.name] === undefined)\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t// Skip over fields on hidden pages\r\n\t\t\tif (!parent && entity.Page_Index) {\r\n\t\t\t\tconst pageNumber = entity.Page_Index[property.name];\r\n\t\t\t\tconst pageVisibleProp = `Page${pageNumber}Visible`;\r\n\t\t\t\tif (entity[pageVisibleProp] === false)\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// Skip fields that are hidden\r\n\t\t\tif (entity[property.name + '_Visible'] === false)\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t// Skip payment since suppressed here\r\n\t\t\tif (property.name === 'Save_Card_Agreement')\r\n\t\t\t\treturn false;\r\n\r\n\t\t\treturn true;\r\n\t\t};\r\n\r\n\t\t// If any visible properties have conditions that aren't met, return false\r\n\t\tconst conditions = entity.meta.conditions;\r\n\t\tconst visibleCondition = conditions.find(condition => {\r\n\t\t\treturn condition.properties.find(property => isFieldShown(property));\r\n\t\t});\r\n\r\n\t\tif (visibleCondition)\r\n\t\t\treturn false;\r\n\r\n\t\t// Recursively check sections and repeating sections for unmet conditions\r\n\t\tfor (const property of entity.meta.type.properties) {\r\n\t\t\t// Avoid recursively validating invisible children, lookups, and 'entity.Form'\r\n\t\t\tif (!isLookupField(property) && isFieldShown(property) && property.name !== 'Form') {\r\n\t\t\t\tconst child = entity[property.name];\r\n\r\n\t\t\t\t// Rating scales reference their parent section, skip this property\r\n\t\t\t\tif (child === parent)\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t// Recursively check each element in repeating sections and tables\r\n\t\t\t\tif (property.isList) {\r\n\t\t\t\t\tif (!Array.isArray(child))\r\n\t\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t\tconst invalidItem = child.find(item => !this.validateEntry(item, entity));\r\n\t\t\t\t\tif (invalidItem)\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t// Recursively check sections\r\n\t\t\t\telse if (typeof child === 'object' && !this.validateEntry(child, entity))\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n};\r\n\r\n// TODO: Do we need to transform the result? It seems like it would be easier to reason about if the data the client worked with was the same shape as the data the server responded with.\r\nexport function parseStoreResult(responseData: any) {\r\n\tconst sr = responseData.submissionResult || { Status: 'Unknown' };\r\n\r\n\t// Return the entry submission result\r\n\treturn {\r\n\t\tstatus: SubmissionResultStatus[sr.Status as string],\r\n\t\tmessage: responseData.exceptionMessage || sr.Message,\r\n\t\tentry: responseData.entry,\r\n\t\torder: responseData.order,\r\n\t\tresponseData: sr.Data as QuantityData[],\r\n\t\tentryToken: responseData.entryToken\r\n\t};\r\n}","export default {\r\n\tcomputed: {\r\n\t\tshowLabel() {\r\n\t\t\treturn !this.hideLabel && this.$source.label && this.$source.label.trim().length;\r\n\t\t}\r\n\t}\r\n};\r\n","var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"el-button\",\n {\n class: _vm.noStyle ? \"cog-button--no-style\" : \"cog-button\",\n on: { click: _vm.handleClick }\n },\n [\n _vm.$slots.icon\n ? _c(\"span\", { staticClass: \"cog-button__icon\" }, [_vm._t(\"icon\")], 2)\n : _vm._e(),\n _vm._v(\" \"),\n !_vm.noStyle && _vm.hasText\n ? _c(\n \"span\",\n { staticClass: \"cog-button__text\" },\n [_vm._t(\"default\")],\n 2\n )\n : _vm._t(\"default\"),\n _vm._v(\" \"),\n _vm.$slots.icon2\n ? _c(\"span\", { staticClass: \"cog-button__icon\" }, [_vm._t(\"icon2\")], 2)\n : _vm._e(),\n _vm._v(\" \"),\n [_vm._t(\"status-icon\")]\n ],\n 2\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Button.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Button.vue?vue&type=script&lang=js&\"","import api from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/sass-loader/dist/cjs.js!../../node_modules/sass-resources-loader/lib/loader.js??ref--4-oneOf-1-3!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Button.vue?vue&type=style&index=0&lang=scss&\";\n\nvar options = {\"attributes\":{\"class\":\"cog-style\"}};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import { render, staticRenderFns } from \"./Button.vue?vue&type=template&id=015de462&\"\nimport script from \"./Button.vue?vue&type=script&lang=js&\"\nexport * from \"./Button.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Button.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"C:\\\\a\\\\1\\\\s\\\\Cognito.Services\\\\client\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('015de462')) {\n api.createRecord('015de462', component.options)\n } else {\n api.reload('015de462', component.options)\n }\n module.hot.accept(\"./Button.vue?vue&type=template&id=015de462&\", function () {\n api.rerender('015de462', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"src/components/Button.vue\"\nexport default component.exports","import api from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../node_modules/css-loader/index.js!../../node_modules/sass-loader/dist/cjs.js!../../node_modules/sass-resources-loader/lib/loader.js??ref--4-oneOf-1-3!./_error-message.scss\";\n\nvar options = {\"attributes\":{\"class\":\"cog-style\"}};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import { ObjectLookup } from 'src/util';\r\n\r\n/**\r\n\t * An extension of Error, allows for adding additional properties\r\n\t * to the error object and a flag denoting whether or not to track\r\n\t * the error\r\n\t */\r\nexport class CError extends Error {\r\n\tname: string;\r\n\tmessage: string;\r\n\t// An error is not logged when `log` is exactly false\r\n\tlog?: boolean;\r\n\tstack?: string;\r\n\tadditionalProperties?: ObjectLookup;\r\n\r\n\tconstructor(message: string, log: boolean = true, name?: string, stack?: string, additionalProperties?: ObjectLookup) {\r\n\t\tsuper(message);\r\n\r\n\t\tthis.message = message;\r\n\t\tthis.log = log;\r\n\t\tthis.name = name || this.name;\r\n\t\tthis.stack = stack || this.stack;\r\n\t\tthis.additionalProperties = additionalProperties;\r\n\t}\r\n}\r\n\r\n/**\r\n\t * A version of CError that by default, doesn't log the error\r\n\t * to the server. Used for errors consumed by the end-user.\r\n\t */\r\nexport class FriendlyError extends CError {\r\n\tconstructor(message: string, name?: string) {\r\n\t\tsuper(message, false, name);\r\n\t}\r\n}","import { Entity } from '@cognitoforms/vuemodel';\r\nimport { FormEntry } from 'src/server-types/forms/model/form-entry';\r\nimport { randomText, randomInt } from 'src/util/random';\r\nimport { combineUInt16sWithPadding } from 'src/util/combined-number';\r\nimport { toBase62 } from 'src/util/base62';\r\nimport { Type } from '@cognitoforms/model.js';\r\nimport { ObjectLookup } from '@cognitoforms/model.js/@types/helpers';\r\n\r\n/**\r\n * Either set the child's `Form` property, or propogate it from the parent when it is set\r\n * @param parent The parent entity (either a FormEntry or Section/RepeatingSection/TableRow entity)\r\n * @param child The child entity\r\n */\r\nfunction propagateFormProperty(parent: Entity, child: Entity) {\r\n\t// In case the parent's Form property is not yet set, propagate when it is set\r\n\tif (!parent.Form)\r\n\t\tparent.meta.type.getProperty('Form').changed.subscribeOne(e => (child.Form = e.newValue));\r\n\telse\r\n\t\tchild.Form = parent.Form;\r\n}\r\n\r\n/**\r\n * Set \"backreference\" properties (i.e. `Form` and `ParentSection`) on a child entity\r\n * @param parent The parent entity (either a FormEntry or Section/RepeatingSection/TableRow entity)\r\n * @param child The child entity\r\n */\r\nfunction setBackReferenceProperties(parent: Entity, child: Entity) {\r\n\tif ('ParentSection' in child) {\r\n\t\tchild.ParentSection = parent;\r\n\t\tpropagateFormProperty(parent, child);\r\n\t}\r\n\telse\r\n\t\tchild.Form = parent;\r\n}\r\n\r\n/**\r\n * Generate an id based on the given entry version and list item index\r\n * @param {number} version The form entry version to be saved\r\n * @param {number} listItemIndex The item's index in the list\r\n * @returns {string} The generated list item Id\r\n */\r\nfunction generateListItemId(version: number, listItemIndex: number): string {\r\n\tif (version > 0xffff)\r\n\t\tthrow new Error('Value ' + version + ' exceeds maximum unsigned short value of ' + 0xffff + '.');\r\n\r\n\tif (listItemIndex > 0xffff)\r\n\t\tthrow new Error('Value ' + listItemIndex + ' exceeds maximum unsigned short value of ' + 0xffff + '.');\r\n\r\n\tconst randomByte1 = randomInt(255);\r\n\tconst randomByte2 = randomInt(255);\r\n\tconst num = combineUInt16sWithPadding(version, listItemIndex, randomByte1, randomByte2);\r\n\tconst id = toBase62(num);\r\n\t// console.log(`generateListItemId(${version}, ${listItemIndex}) => ${id}`);\r\n\treturn id;\r\n}\r\n\r\n/**\r\n * Get a map of list item ids to their index in the list\r\n * @param list The list of entities which have an Id property\r\n * @returns A map of id to entity for all of the items in the list\r\n */\r\nfunction getListItemIdMap(list: Entity[]): { [id: string]: Entity } {\r\n\tconst idMap = {};\r\n\tfor (let i = 0; i < list.length; i++) {\r\n\t\tif (list[i]) {\r\n\t\t\tconst id = list[i].Id;\r\n\t\t\tif (id && !idMap.hasOwnProperty(id)) {\r\n\t\t\t\tidMap[id] = list[i];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn idMap;\r\n}\r\n\r\n/**\r\n * Ensures that the given id is unique to the list,\r\n * and returns a unique pseudo-random id if it is not\r\n * @param list The list of items\r\n * @param item The item in the list who's Id is being validated\r\n * @param id The id to check for uniqueness\r\n * @param incorporateOriginal Whether to incorporate the original id when generating a unique id\r\n * @param idMap An optional pre-built map of ids to items\r\n * @returns The unique list item Id to use\r\n */\r\nfunction ensureUniqueListItemId(list: Entity[], item: Entity, id: string, idMap: { [id: string]: Entity } = null): string {\r\n\t// Generate the id map on-demand if needed\r\n\tif (!idMap) {\r\n\t\tidMap = getListItemIdMap(list);\r\n\t}\r\n\r\n\tlet itemForId = idMap[id];\r\n\r\n\t// If the Id isn't used or is used by the item being checked, then return it\r\n\tif (!itemForId || itemForId === item) {\r\n\t\treturn id;\r\n\t}\r\n\r\n\t// Otherwise, fall back to a pseudo-random string\r\n\tfor (let attempts = 0; attempts < 10; attempts++) {\r\n\t\tid = 'U-' + randomText(5 + attempts, true);\r\n\t\titemForId = idMap[id];\r\n\t\tif (!itemForId) {\r\n\t\t\treturn id;\r\n\t\t}\r\n\t}\r\n\r\n\t// Don't assign an id rather than knowingly use a duplicate\r\n\treturn null;\r\n}\r\n\r\n/**\r\n * Get the form entry for the given entity (either a descendant of the form entry or the form entry itself)\r\n * @param entity Either a descendant of the form entry, or the form entry itself\r\n */\r\nfunction getFormEntry(entity: Entity): FormEntry {\r\n\tif (!entity)\r\n\t\tthrow new Error('Can\\'t get form entry for a null entity.');\r\n\tif (entity.meta.type.baseType && entity.meta.type.baseType.fullName === 'Forms.FormEntry')\r\n\t\treturn entity as FormEntry;\r\n\tif ('Form' in entity)\r\n\t\treturn entity.Form;\r\n\tthrow new Error(`Can't get form entry for entity '${entity.meta.type.fullName}|${entity.meta.id || '?'}'.`);\r\n}\r\n\r\n/**\r\n * Initializes common properties of child entities: `Form`, `ParentSection`, and `Id`\r\n * @param parent The parent object that owns the child entity or entities\r\n * @param propertyName The property of the parent that contains the child entity or entities\r\n */\r\nexport function ensureChildProperties(parent: Entity, propertyName: string): void {\r\n\tconst value = parent.get(propertyName);\r\n\tif (Array.isArray(value)) {\r\n\t\tvalue.forEach(item => setBackReferenceProperties(parent, item));\r\n\t}\r\n\telse if (value) {\r\n\t\tsetBackReferenceProperties(parent, value);\r\n\t}\r\n\r\n\tif (Array.isArray(value)) {\r\n\t\t// Attempt to get the form entry from the parent object\r\n\t\tlet formEntry: FormEntry;\r\n\t\ttry {\r\n\t\t\tformEntry = getFormEntry(parent);\r\n\t\t}\r\n\t\tcatch {\r\n\t\t\t// TODO: Log error to App Insights?\r\n\t\t}\r\n\r\n\t\t// Build a map of Ids once so that the list doesn't have to be traversed repeatedly to ensure unique Ids\r\n\t\t// NOTE: Store the id map on the list so that the id for an item that is deleted doesn't get reused, since it could have been referenced\r\n\t\tconst idMap: { [id: string]: Entity } = value['__idMap'] || (value['__idMap'] = getListItemIdMap(value));\r\n\r\n\t\t// TODO: Make this more efficient by only processing added items?\r\n\t\tvalue.forEach((item, index) => {\r\n\t\t\t// Only generate Ids for new objects, or objects that don't already have an id\r\n\t\t\tif (item.meta.isNew || !item.Id) {\r\n\t\t\t\tlet id: string;\r\n\t\t\t\tif (formEntry) {\r\n\t\t\t\t\t// Generate an encoded id based on the entry version and the items index in the list\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tconst currentEntryVersion = formEntry.Entry ? (formEntry.Entry.Version || 0) : 0;\r\n\t\t\t\t\t\tlet attempts = 0;\r\n\t\t\t\t\t\tdo {\r\n\t\t\t\t\t\t\tid = generateListItemId(currentEntryVersion + 1, index);\r\n\t\t\t\t\t\t} while (idMap[id] && ++attempts <= 10);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (e) {\r\n\t\t\t\t\t\t// If an error occurs, fall back to a pseudo-random string\r\n\t\t\t\t\t\t// TODO: Log error to App Insights?\r\n\t\t\t\t\t\tid = 'E-' + randomText(5, true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// Fall back to generate a random id\r\n\t\t\t\t\tid = 'F-' + randomText(5, true);\r\n\t\t\t\t}\r\n\t\t\t\t// Ensure that the list item's Id will be unique, generating a psuedo random Id if necessary\r\n\t\t\t\tid = ensureUniqueListItemId(value, item, id, idMap);\r\n\t\t\t\t// Assign the item's Id property\r\n\t\t\t\titem.Id = id;\r\n\t\t\t\t// Update the id map for future use\r\n\t\t\t\tidMap[id] = item;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * Ensures that enum instances are created for the given enum type\r\n */\r\nfunction ensureEnumInstances(type: Type, enumValues: ObjectLookup | string[]): Entity[] {\r\n\tconst instances = type.known().reduce((obj, v) => { obj[v.meta.id] = v; return obj; }, {});\r\n\tconst EnumType = type.jstype;\r\n\tif (Array.isArray(enumValues)) {\r\n\t\treturn enumValues.map((name: string) => {\r\n\t\t\treturn instances[name] || new EnumType(name, {\r\n\t\t\t\tName: name,\r\n\t\t\t\tDisplayName: name\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\telse {\r\n\t\treturn Object.keys(enumValues).map((value: string) => {\r\n\t\t\treturn instances[value] || new EnumType(value, {\r\n\t\t\t\tId: parseInt(value, 10),\r\n\t\t\t\tName: enumValues[value],\r\n\t\t\t\tDisplayName: enumValues[value]\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * Override of `Type.get` that ensure that enum values are created\r\n */\r\nexport function getEnumInstance(type: Type, ...args: any[]): Entity {\r\n\tconst enumValues = type['enum'];\r\n\tif (!enumValues) {\r\n\t\t// TODO: Warn about an invalid call to `ensureEnumInstances`?\r\n\t\treturn;\r\n\t}\r\n\r\n\t// Ensure that all enum instances are created\r\n\tensureEnumInstances(type, enumValues);\r\n\r\n\t// Call the original Type.get prototype method\r\n\tconst Type = type.constructor;\r\n\treturn Type.prototype.get.apply(type, args);\r\n}\r\n\r\nexport function getEnumInstanceById(type: Type, id: string) {\r\n\tconst enumValues = type['enum'];\r\n\tif (!enumValues) {\r\n\t\t// TODO: Warn about an invalid call to `ensureEnumInstances`?\r\n\t\treturn;\r\n\t}\r\n\r\n\t// Ensure that all enum instances are created\r\n\tconst instances = ensureEnumInstances(type, enumValues);\r\n\r\n\t// Get the first instance with the matching id\r\n\treturn instances.filter(i => i.Id === id)[0] || null;\r\n}\r\n\r\nexport function getEnumInstanceByName(type: Type, name: string) {\r\n\tconst enumValues = type['enum'];\r\n\tif (!enumValues) {\r\n\t\t// TODO: Warn about an invalid call to `ensureEnumInstances`?\r\n\t\treturn;\r\n\t}\r\n\r\n\t// Ensure that all enum instances are created\r\n\tconst instances = ensureEnumInstances(type, enumValues);\r\n\r\n\t// Get the first instance with the matching name\r\n\treturn instances.filter(i => i.Name === name)[0] || null;\r\n}\r\n","export function toBase62(number: number): string {\r\n\tif (typeof number === 'undefined' || number === null) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tif (typeof number !== 'number') {\r\n\t\tthrow new Error('Function `toBase62` recieved invalid \\'number\\' parameter of type \\'' + (typeof number) + '\\'.');\r\n\t}\r\n\telse if (number === 0) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tconst digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n\r\n\tlet text = '';\r\n\r\n\tlet value = number;\r\n\r\n\twhile (value > 0) {\r\n\t\tconst remainder = value % 62;\r\n\t\tvalue = Math.floor(value / 62);\r\n\t\ttext = digits.charAt(remainder) + text;\r\n\t}\r\n\r\n\treturn text;\r\n}\r\n\r\nexport function fromBase62(text: string): number {\r\n\tif (typeof text === 'undefined' || text === null) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tif (typeof text !== 'string') {\r\n\t\tthrow new Error('Function `fromBase62` recieved invalid \\'text\\' parameter of type \\'' + (typeof text) + '\\'.');\r\n\t}\r\n\telse if (text.length === 0) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tconst digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n\r\n\tlet number = 0;\r\n\r\n\tfor (let i = text.length - 1; i >= 0; i--) {\r\n\t\tconst c = text[i];\r\n\t\tconst idx = digits.indexOf(c);\r\n\t\tconst b = text.length - 1 - i;\r\n\t\tconst pow = Math.pow(62, b);\r\n\t\tnumber += pow * idx;\r\n\t}\r\n\r\n\treturn number;\r\n}\r\n","export function combineUInt16sWithPadding(n1: number, n2: number, randomByte1: number, randomByte2: number): number {\r\n\tif (n1 > 0xffff) {\r\n\t\tthrow new Error('Value ' + n1 + ' exceeds maximum unsigned short value of ' + 0xffff + '.');\r\n\t}\r\n\r\n\tconst n1Bytes = n1 > 0xff ? 2 : 1;\r\n\r\n\tif (n2 > 0xffff) {\r\n\t\tthrow new Error('Value ' + n2 + ' exceeds maximum unsigned short value of ' + 0xffff + '.');\r\n\t}\r\n\r\n\tconst n2Bytes = n2 > 0xff ? 2 : 1;\r\n\r\n\tif (n1Bytes > 1 && n2Bytes > 1) {\r\n\t\tthrow new Error('Both values ' + n1 + ' and ' + n2 + ' exceeds maximum byte value of ' + 0xff + '.');\r\n\t}\r\n\r\n\tlet result = 0;\r\n\r\n\tlet randomByte: number;\r\n\r\n\tif (arguments.length > 2 && typeof randomByte1 === 'number') {\r\n\t\trandomByte = randomByte1;\r\n\t}\r\n\telse {\r\n\t\trandomByte = Math.floor(Math.random() * 255);\r\n\t}\r\n\r\n\trandomByte = randomByte & 0xff;\r\n\r\n\t// Bytes for n2\r\n\tresult += n2;\r\n\r\n\t// Bytes for n1\r\n\tresult += ((n1 << (n2Bytes === 2 ? 16 : 8))) >>> 0;\r\n\r\n\tif (n1Bytes === 1 && n2Bytes === 1) {\r\n\t\t// Random byte\r\n\t\tresult += randomByte << 16;\r\n\r\n\t\t// Generate another random byte for the header\r\n\t\tif (arguments.length > 3 && typeof randomByte2 === 'number') {\r\n\t\t\trandomByte = randomByte2;\r\n\t\t}\r\n\t\telse {\r\n\t\t\trandomByte = Math.floor(Math.random() * 255);\r\n\t\t}\r\n\r\n\t\trandomByte = randomByte & 0xff;\r\n\t}\r\n\r\n\t// Header byte: n1 and n2 byte size, and random bits\r\n\tlet headerByte = 0;\r\n\theaderByte += n2Bytes;\r\n\theaderByte += n1Bytes << 2;\r\n\theaderByte += (randomByte << 4) & 0x000000f0;\r\n\tresult += (headerByte << 24) >>> 0;\r\n\r\n\treturn result;\r\n}\r\n\r\nexport function splitUInt32WithPadding(i: number): [number, number] {\r\n\tconst headerByte = (i & 0xff000000) >>> 24;\r\n\r\n\tlet n2: number;\r\n\tconst n2Bytes = (headerByte & 0x07) & 0x3;\r\n\tif (n2Bytes === 2) {\r\n\t\tn2 = i & 0x0000ffff;\r\n\t}\r\n\telse {\r\n\t\tn2 = i & 0x000000ff;\r\n\t}\r\n\r\n\tlet n1: number;\r\n\tconst n1Bytes = ((headerByte & 0x0f) >> 2) & 0x3;\r\n\tif (n2Bytes === 2) {\r\n\t\tn1 = (i >>> 16) & 0xff;\r\n\t}\r\n\telse if (n1Bytes === 2) {\r\n\t\tn1 = (i >>> 8) & 0xffff;\r\n\t}\r\n\telse {\r\n\t\tn1 = (i >>> 8) & 0xff;\r\n\t}\r\n\r\n\treturn [n1, n2];\r\n}\r\n","\n export default {\n functional: true,\n render: \n function render(_h, _vm) {\n var _c=_vm._c;return _c('svg',{staticClass:\"cog-icon cog-i-cog\",class:[_vm.data.class, _vm.data.staticClass],style:([_vm.data.style, _vm.data.staticStyle]),attrs:{\"viewBox\":\"0 0 18 18\",\"focusable\":\"false\"}},[_c('g',[_c('path',{attrs:{\"d\":\"M15.5 9.8V8.17l-1.83-.32a5.21 5.21 0 00-.56-1.33L14.16 5 13 3.83l-1.52 1.08a8.28 8.28 0 00-1.32-.54L9.82 2.5H8.19l-.34 1.87a4.87 4.87 0 00-1.3.53L5 3.84 3.87 4.92l1 1.64a4.53 4.53 0 00-.54 1.31L2.5 8.2v1.64l1.86.34a5 5 0 00.55 1.3L3.87 13 5 14.19l1.54-1.06a4.89 4.89 0 001.31.56l.33 1.81h1.63l.33-1.86a5.38 5.38 0 001.34-.54L13 14.15 14.16 13l-1.06-1.53a5.46 5.46 0 00.57-1.34zM9 11a2 2 0 112-2 2 2 0 01-2 2z\"}})])])\n }\n \n }\n ","var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"cog-row\" }, [_vm._t(\"default\")], 2)\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n","import mod from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Row.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Row.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Row.vue?vue&type=template&id=513a62da&\"\nimport script from \"./Row.vue?vue&type=script&lang=js&\"\nexport * from \"./Row.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"C:\\\\a\\\\1\\\\s\\\\Cognito.Services\\\\client\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('513a62da')) {\n api.createRecord('513a62da', component.options)\n } else {\n api.reload('513a62da', component.options)\n }\n module.hot.accept(\"./Row.vue?vue&type=template&id=513a62da&\", function () {\n api.rerender('513a62da', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"src/components/Row.vue\"\nexport default component.exports","var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"transition\",\n {\n attrs: { name: \"visible\", duration: _vm.duration },\n on: {\n \"before-enter\": _vm.beforeEnter,\n \"before-leave\": _vm.beforeLeave,\n \"after-enter\": _vm.afterEnter,\n \"after-leave\": _vm.afterLeave\n }\n },\n [_vm._t(\"default\")],\n 2\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import mod from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VisibleTransition.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VisibleTransition.vue?vue&type=script&lang=js&\"","\r\n\r\n","import { render, staticRenderFns } from \"./VisibleTransition.vue?vue&type=template&id=142fd7e7&\"\nimport script from \"./VisibleTransition.vue?vue&type=script&lang=js&\"\nexport * from \"./VisibleTransition.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"C:\\\\a\\\\1\\\\s\\\\Cognito.Services\\\\client\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('142fd7e7')) {\n api.createRecord('142fd7e7', component.options)\n } else {\n api.reload('142fd7e7', component.options)\n }\n module.hot.accept(\"./VisibleTransition.vue?vue&type=template&id=142fd7e7&\", function () {\n api.rerender('142fd7e7', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"src/components/VisibleTransition.vue\"\nexport default component.exports","\n export default {\n functional: true,\n render: \n function render(_h, _vm) {\n var _c=_vm._c;return _c('svg',{staticClass:\"cog-icon cog-i-error-outline\",class:[_vm.data.class, _vm.data.staticClass],style:([_vm.data.style, _vm.data.staticStyle]),attrs:{\"viewBox\":\"0 0 18 18\",\"focusable\":\"false\"}},[_c('defs'),_c('g',[_c('path',{staticClass:\"cog-i-error-outline__triangle\",attrs:{\"stroke-miterlimit\":\"10\",\"d\":\"M2.86 14.62L9 4.13l6.14 10.49H2.86z\"}}),_c('g',{staticClass:\"cog-i-error-outline__exclamation\"},[_c('circle',{attrs:{\"cx\":\"9\",\"cy\":\"12.2\",\"r\":\".74\"}}),_c('path',{attrs:{\"d\":\"M8.3 8.47l.12 2.18a.2.2 0 00.19.19h.78a.2.2 0 00.19-.19l.12-2.18a.2.2 0 00-.18-.2h-1a.19.19 0 00-.19.19z\"}})])])])\n }\n \n }\n ","import Vue from 'vue';\r\n\r\nexport function findContainer(component: Vue, match: (parent: Vue) => boolean): Vue {\r\n\tif (component.$parent) {\r\n\t\tconst parent = component.$parent;\r\n\r\n\t\tif (match(parent))\r\n\t\t\treturn parent;\r\n\r\n\t\treturn findContainer(parent, match);\r\n\t}\r\n\telse\r\n\t\treturn component;\r\n}\r\n\r\nexport function isComponent(ref: Vue | Element | Vue[] | Element[]): ref is Vue {\r\n\t// TODO: What's the best way to detect that something is a component at runtime?\r\n\treturn (ref as any).$on && typeof (ref as any).$on === 'function';\r\n}\r\n","import api from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../node_modules/css-loader/index.js!../../node_modules/sass-loader/dist/cjs.js!../../node_modules/sass-resources-loader/lib/loader.js??ref--4-oneOf-1-3!./_slide-transition.scss\";\n\nvar options = {\"attributes\":{\"class\":\"cog-style\"}};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import scrollIntoView from 'src/util/scroll-into-view';\r\n\r\nexport default {\r\n\tinject: ['form'],\r\n\tprops: {\r\n\r\n\t\tduration: {\r\n\t\t\ttype: Number,\r\n\t\t\tdefault: 500\r\n\t\t},\r\n\t\tscroll: {\r\n\t\t\ttype: Boolean,\r\n\t\t\tdefault: false\r\n\t\t}\r\n\t},\r\n\tmethods: {\r\n\t\t// Initiates the show transition for the specified element\r\n\t\tbeforeEnter: function (el) {\r\n\t\t\tif (this.form.disableTransitions)\r\n\t\t\t\treturn;\r\n\t\t\t// For slow connections\r\n\t\t\t// 1. Moderately fast connections (~1MB/s) will never see the placeholder\r\n\t\t\t// 2. Slow connections (Fast 3G and worse) will see the placeholder pop in and then transition to the field when it loads\r\n\r\n\t\t\t// We could hide the placeholder altogether to avoid the jarring pop-in, but the long wait will make it seem like something is broken.\r\n\r\n\t\t\t// Without this, moderately fast connections transition the placeholder partly in, then transition the real component again.\r\n\t\t\t// It happens very quickly and it just looks jumpy.\r\n\t\t\tif (el.getAttribute('data-placeholder')) {\r\n\t\t\t\t// Will be removed in @after-enter=\"clearStyles\"\r\n\t\t\t\tel.style.display = 'none';\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches)\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t// Force the browser to apply CSS changes\r\n\t\t\trequestAnimationFrame(() => {\r\n\t\t\t\t// Force the element to appear invisibly so the size can be measured\r\n\t\t\t\t// You would think you'd need position absolute here, but you don't and that messes with dimensions.\r\n\t\t\t\tel.style.removeProperty('display');\r\n\t\t\t\tel.style.visibility = 'hidden';\r\n\r\n\t\t\t\t// Trigger resize on conditionally hidden components that responsively render children\r\n\t\t\t\tif (this.$children[0] && this.$children[0].handleResize instanceof Function)\r\n\t\t\t\t\tthis.$children[0].handleResize();\r\n\r\n\t\t\t\t// Fix the width of child elements to prevent them from reflowing during the transition\r\n\t\t\t\tfor (let c = 0; c < el.children.length; c++) {\r\n\t\t\t\t\tconst child = el.children[c];\r\n\t\t\t\t\tchild.style.width = child.clientWidth + 'px';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Measure and store the width and height\r\n\t\t\t\tconst width = el.clientWidth;\r\n\t\t\t\tconst height = el.clientHeight;\r\n\r\n\t\t\t\t// A short lag before the scroll starts makes this look a bit better.\r\n\t\t\t\tif (this.scroll) {\r\n\t\t\t\t\tsetTimeout(()=> { scrollIntoView(el, { time: this.duration }); }, 200);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Display block and hide overflow during transitions\r\n\t\t\t\t// (display: table does not support overflow: hidden)\r\n\t\t\t\tel.style.display = 'block';\r\n\t\t\t\tel.style.overflow = 'hidden';\r\n\r\n\t\t\t\t// Set transition start values to hide the element\r\n\t\t\t\tel.classList.add('cog-slide-transition');\r\n\r\n\t\t\t\t// Force the browser to apply CSS changes\r\n\t\t\t\trequestAnimationFrame(() => {\r\n\t\t\t\t\t// Restore visibility\r\n\t\t\t\t\tel.style.removeProperty('visibility');\r\n\t\t\t\t\t// Set the CSS transition duration\r\n\t\t\t\t\tel.style.transition = `${this.duration}ms ease`;\r\n\r\n\t\t\t\t\t// Force the browser to apply CSS changes\r\n\t\t\t\t\trequestAnimationFrame(() => {\r\n\t\t\t\t\t\t// Set the transition end values to show the element\r\n\t\t\t\t\t\tel.style.maxWidth = width + 'px';\r\n\t\t\t\t\t\tel.style.maxHeight = height + 'px';\r\n\t\t\t\t\t\tel.classList.remove('cog-slide-transition');\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\t// Initiates the hide transition for the specified element\r\n\t\tbeforeLeave: function (el) {\r\n\t\t\tif (this.form.disableTransitions) {\r\n\t\t\t\tel.style.display = 'none';\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tthis.$emit('before-leave');\r\n\t\t\tif (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches)\r\n\t\t\t\treturn false;\r\n\t\t\t// Set transition start values before hiding the element\r\n\t\t\tel.style.maxWidth = el.clientWidth + 'px';\r\n\t\t\tel.style.maxHeight = el.clientHeight + 'px';\r\n\r\n\t\t\t// Fix the width of child elements to prevent them from reflowing during the transition\r\n\t\t\tfor (let c = 0; c < el.children.length; c++) {\r\n\t\t\t\tconst child = el.children[c];\r\n\t\t\t\tchild.style.width = child.clientWidth + 'px';\r\n\t\t\t}\r\n\r\n\t\t\t// Force the browser to apply CSS changes\r\n\t\t\trequestAnimationFrame(() => {\r\n\t\t\t\t// Set the CSS transition duration\r\n\t\t\t\tel.style.transition = `${this.duration}ms ease`;\r\n\r\n\t\t\t\t// Force the browser to apply CSS changes\r\n\t\t\t\trequestAnimationFrame(() => {\r\n\t\t\t\t\t// Set the transition end values to hide the element\r\n\t\t\t\t\tel.classList.add('cog-slide-transition');\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\t// Removes all inline styles applied by the transition\r\n\t\tclearStyles: function (el) {\r\n\t\t\tif (this.form.disableTransitions)\r\n\t\t\t\treturn;\r\n\t\t\t// Remove inline styles on the target element\r\n\t\t\tel.style.removeProperty('display');\r\n\t\t\tel.style.removeProperty('overflow');\r\n\t\t\tel.style.removeProperty('max-width');\r\n\t\t\tel.style.removeProperty('max-height');\r\n\t\t\tel.style.removeProperty('transition');\r\n\r\n\t\t\t// Remove inline widths applied to fix the width of child elements\r\n\t\t\tfor (let c = 0; c < el.children.length; c++) {\r\n\t\t\t\tconst child = el.children[c];\r\n\t\t\t\tchild.style.removeProperty('width');\r\n\t\t\t}\r\n\t\t},\r\n\t\tafterEnter(el) {\r\n\t\t\tif (this.form.disableTransitions)\r\n\t\t\t\treturn;\r\n\t\t\tthis.$emit('after-enter');\r\n\t\t\tthis.clearStyles(el);\r\n\t\t},\r\n\t\t// This is on for v-show transitions\r\n\t\tafterLeave(el) {\r\n\t\t\tif (this.form.disableTransitions)\r\n\t\t\t\treturn;\r\n\t\t\tthis.$emit('after-leave');\r\n\t\t\tthis.clearStyles(el);\r\n\t\t\tel.classList.remove('cog-slide-transition');\r\n\t\t\tel.style.display = 'none';\r\n\t\t}\r\n\t}\r\n};\r\n","var render = function() {\n var _obj\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"c-button\",\n {\n staticClass: \"cog-button--has-status\",\n class: ((_obj = {}),\n (_obj[\"is-\" + _vm.internalStatus] = _vm.internalStatus !== \"default\"),\n _obj),\n scopedSlots: _vm._u(\n [\n {\n key: \"icon\",\n fn: function() {\n return [_vm._t(\"icon\")]\n },\n proxy: true\n },\n {\n key: \"icon2\",\n fn: function() {\n return [_vm._t(\"icon2\")]\n },\n proxy: true\n },\n {\n key: \"status-icon\",\n fn: function() {\n return [\n _vm.internalStatus === \"validating\" ||\n _vm.internalStatus === \"authenticating\"\n ? _c(\"i-cog\", {\n staticClass: \"cog-button__status-icon is-validating\"\n })\n : _vm.internalStatus === \"success\"\n ? _c(\"i-check\", {\n staticClass: \"cog-button__status-icon is-success\"\n })\n : _vm.internalStatus === \"error\"\n ? _c(\"i-error\", {\n staticClass: \"cog-button__status-icon is-error\"\n })\n : _vm._e()\n ]\n },\n proxy: true\n }\n ],\n null,\n true\n )\n },\n [_vm._v(\" \"), _vm._t(\"default\")],\n 2\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import mod from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./StatusButton.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./StatusButton.vue?vue&type=script&lang=js&\"","\r\n\r\n\r\n\r\n","\n export default {\n functional: true,\n render: \n function render(_h, _vm) {\n var _c=_vm._c;return _c('svg',{staticClass:\"cog-icon cog-i-check-outline\",class:[_vm.data.class, _vm.data.staticClass],style:([_vm.data.style, _vm.data.staticStyle]),attrs:{\"viewBox\":\"0 0 18 18\",\"focusable\":\"false\"}},[_c('defs'),_c('g',[_c('circle',{staticClass:\"cog-i-check-outline__circle\",attrs:{\"cx\":\"9\",\"cy\":\"9\",\"r\":\"6.15\"}}),_c('path',{staticClass:\"cog-i-check-outline__core\",attrs:{\"d\":\"M6.13 9.26l2.15 1.94 3.3-3.84\"}})])])\n }\n \n }\n ","import api from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/sass-loader/dist/cjs.js!../../node_modules/sass-resources-loader/lib/loader.js??ref--4-oneOf-1-3!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./StatusButton.vue?vue&type=style&index=0&lang=scss&\";\n\nvar options = {\"attributes\":{\"class\":\"cog-style\"}};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import { render, staticRenderFns } from \"./StatusButton.vue?vue&type=template&id=01ae9018&\"\nimport script from \"./StatusButton.vue?vue&type=script&lang=js&\"\nexport * from \"./StatusButton.vue?vue&type=script&lang=js&\"\nimport style0 from \"./StatusButton.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"C:\\\\a\\\\1\\\\s\\\\Cognito.Services\\\\client\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('01ae9018')) {\n api.createRecord('01ae9018', component.options)\n } else {\n api.reload('01ae9018', component.options)\n }\n module.hot.accept(\"./StatusButton.vue?vue&type=template&id=01ae9018&\", function () {\n api.rerender('01ae9018', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"src/components/StatusButton.vue\"\nexport default component.exports","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"html .cog-cognito--styled .cog-header,:root:root:root:root:root .cog-cognito--styled .cog-header{background:var(--header__background-color, transparent);color:var(--header__color)}html .cog-cognito--styled .cog-header h1,:root:root:root:root:root .cog-cognito--styled .cog-header h1{font-family:var(--header__font-family, inherit);font-size:var(--header__font-size, inherit);font-weight:var(--header__font-weight, normal)}html .cog-header.cog-wrapper,:root:root:root:root:root .cog-header.cog-wrapper{padding-top:var(--form__margins--responsive);padding-bottom:var(--header__padding-bottom)}html .cog-header img,:root:root:root:root:root .cog-header img{display:inline-block}html .cog-header--center:not(.cog-header--row),:root:root:root:root:root .cog-header--center:not(.cog-header--row){text-align:center}html .cog-header--right,:root:root:root:root:root .cog-header--right{text-align:right}html .cog-header--row.cog-header--center,:root:root:root:root:root .cog-header--row.cog-header--center{justify-content:center}html .cog-header--row.cog-header--right,:root:root:root:root:root .cog-header--row.cog-header--right{flex-direction:row-reverse}html .cog-header--stretch .cog-header__text,:root:root:root:root:root .cog-header--stretch .cog-header__text{padding-top:var(--gutter);padding-bottom:var(--gutter)}html .cog-header--stretch img,:root:root:root:root:root .cog-header--stretch img{display:block;width:100%}html .cog-header--logo-only .cog-header__text,:root:root:root:root:root .cog-header--logo-only .cog-header__text{display:none}html .cog-header--column img+.cog-header__text,:root:root:root:root:root .cog-header--column img+.cog-header__text{padding-top:var(--gutter)}html .cog-header__description,:root:root:root:root:root .cog-header__description{margin-top:.5em}html .cog-header__description>*:last-child,:root:root:root:root:root .cog-header__description>*:last-child{margin-bottom:0}html .cog-form[data-width~=\\\"500\\\"] .cog-header--row,:root:root:root:root:root .cog-form[data-width~=\\\"500\\\"] .cog-header--row{display:flex;align-items:center}html .cog-form[data-width~=\\\"500\\\"] .cog-header--row.cog-header--center .cog-header__text,:root:root:root:root:root .cog-form[data-width~=\\\"500\\\"] .cog-header--row.cog-header--center .cog-header__text{max-width:55%}html .cog-form[data-width~=\\\"500\\\"] .cog-header--row img,:root:root:root:root:root .cog-form[data-width~=\\\"500\\\"] .cog-header--row img{-ms-flex-negative:0;max-width:25%}html .cog-form[data-width~=\\\"500\\\"] .cog-header--row img+.cog-header__text,:root:root:root:root:root .cog-form[data-width~=\\\"500\\\"] .cog-header--row img+.cog-header__text{padding-left:var(--gutter)}html .cog-form[data-width~=\\\"500\\\"] .cog-header--row.cog-header--right img+.cog-header__text,:root:root:root:root:root .cog-form[data-width~=\\\"500\\\"] .cog-header--row.cog-header--right img+.cog-header__text{padding-right:var(--gutter);padding-left:0}html .cog-form:not([data-width~=\\\"500\\\"]) .cog-header--center,:root:root:root:root:root .cog-form:not([data-width~=\\\"500\\\"]) .cog-header--center{text-align:center}html .cog-form:not([data-width~=\\\"500\\\"]) .cog-header--row img,:root:root:root:root:root .cog-form:not([data-width~=\\\"500\\\"]) .cog-header--row img{max-height:25vh}\", \"\"]);\n\n// exports\n","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"html .cog-button--no-style,:root:root:root:root:root .cog-button--no-style{background:transparent;border:0;padding:0;font-size:inherit}html .cog-button svg,:root:root:root:root:root .cog-button svg{transition:calc(var(--speed)/4)}html .cog-button,:root:root:root:root:root .cog-button{margin:0}html .cog-cognito--styled .cog-button--no-style,:root:root:root:root:root .cog-cognito--styled .cog-button--no-style{color:var(--color)}html .cog-cognito--styled .cog-button,:root:root:root:root:root .cog-cognito--styled .cog-button{position:relative;font-size:var(--button-primary__font-size, inherit);font-weight:var(--button-primary__font-weight, normal);line-height:calc(var(--line-height) - .1);transition:calc(var(--speed)/4)}html .cog-cognito--styled .cog-button:focus,:root:root:root:root:root .cog-cognito--styled .cog-button:focus{border-width:var(--border-width);border-style:solid;border-color:var(--form__background-color);box-shadow:0 0 0 var(--border-width) var(--highlight)}html .cog-cognito--styled .cog-button>span,:root:root:root:root:root .cog-cognito--styled .cog-button>span{display:flex;align-items:center;justify-content:center;text-align:center}html .cog-cognito--styled .cog-button__icon,html .cog-cognito--styled .cog-button__text,:root:root:root:root:root .cog-cognito--styled .cog-button__icon,:root:root:root:root:root .cog-cognito--styled .cog-button__text{padding:calc(var(--input__padding-v)*.25) calc(var(--input__padding-h)*.1)}html .cog-cognito--styled .cog-button__icon svg,:root:root:root:root:root .cog-cognito--styled .cog-button__icon svg{width:1.7em;height:1.7em;font-size:.8em;stroke-width:calc(var(--icon-weight)*1.1px)}html .cog-cognito--styled .cog-button--primary,:root:root:root:root:root .cog-cognito--styled .cog-button--primary{background:var(--button-primary__background-color, var(--primary));border:var(--button-primary__border-width) var(--button-primary__border-color, var(--primary)) solid;border-radius:var(--button-primary__border-radius);color:var(--button-primary__color, var(--primary-reverse));-webkit-print-color-adjust:exact;color-adjust:exact;font-family:var(--button-primary__font-family, inherit)}html .cog-cognito--styled .cog-button--primary:hover,:root:root:root:root:root .cog-cognito--styled .cog-button--primary:hover{border-color:var(--button-primary__color, var(--primary-reverse))}html .cog-cognito--styled .cog-button--primary,html .cog-cognito--styled .cog-page__navigation .cog-button,:root:root:root:root:root .cog-cognito--styled .cog-button--primary,:root:root:root:root:root .cog-cognito--styled .cog-page__navigation .cog-button{min-width:80px;padding:calc(var(--input__padding-v)*.75) calc(var(--input__padding-h)*.75)}html .cog-cognito--styled .cog-button--secondary,:root:root:root:root:root .cog-cognito--styled .cog-button--secondary{min-width:55px;background:var(--button-secondary__background-color, var(--primary-reverse));border:var(--button-secondary__border-width) var(--button-secondary__border-color, var(--primary)) solid;border-radius:var(--button-secondary__border-radius);padding:calc(var(--input__padding-v)*.5) calc(var(--input__padding-h)*.7);color:var(--button-secondary__color, var(--primary));font-family:var(--button-secondary__font-family, inherit)}html .cog-cognito--styled .cog-button--secondary:hover,:root:root:root:root:root .cog-cognito--styled .cog-button--secondary:hover{box-shadow:inset 0 0 0 1px var(--button-secondary__color, var(--primary))}html .cog-cognito--styled .cog-button--no-text,:root:root:root:root:root .cog-cognito--styled .cog-button--no-text{min-width:0}html .cog-cognito--styled .cog-button[disabled],html .cog-cognito--styled .cog-button--no-style[disabled],:root:root:root:root:root .cog-cognito--styled .cog-button[disabled],:root:root:root:root:root .cog-cognito--styled .cog-button--no-style[disabled]{cursor:not-allowed;opacity:.6}\", \"\"]);\n\n// exports\n","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"html .cog-cognito.el-select-dropdown,:root:root:root:root:root .cog-cognito.el-select-dropdown{transition:transform calc(var(--speed)/4),opacity calc(var(--speed)/4)}html .cog-cognito.el-zoom-in-top-enter-active,html .cog-cognito.el-zoom-in-top-leave-active,html .cog-cognito .el-zoom-in-top-enter-active,html .cog-cognito .el-zoom-in-top-leave-active,:root:root:root:root:root .cog-cognito.el-zoom-in-top-enter-active,:root:root:root:root:root .cog-cognito.el-zoom-in-top-leave-active,:root:root:root:root:root .cog-cognito .el-zoom-in-top-enter-active,:root:root:root:root:root .cog-cognito .el-zoom-in-top-leave-active{opacity:1;transform:scaleY(1);transform-origin:center top}html .cog-cognito.el-zoom-in-top-enter,html .cog-cognito.el-zoom-in-top-leave-active,html .cog-cognito .el-zoom-in-top-enter,html .cog-cognito .el-zoom-in-top-leave-active,:root:root:root:root:root .cog-cognito.el-zoom-in-top-enter,:root:root:root:root:root .cog-cognito.el-zoom-in-top-leave-active,:root:root:root:root:root .cog-cognito .el-zoom-in-top-enter,:root:root:root:root:root .cog-cognito .el-zoom-in-top-leave-active{opacity:0;transform:scaleY(0)}html .cog-cognito .slide-enter-active,:root:root:root:root:root .cog-cognito .slide-enter-active{animation:expand calc(var(--speed)/2)}html .cog-cognito .slide-leave-active,:root:root:root:root:root .cog-cognito .slide-leave-active{animation:cog-expand calc(var(--speed)/2) reverse}html .cog-fade-enter-active,html .cog-fade-leave-active,:root:root:root:root:root .cog-fade-enter-active,:root:root:root:root:root .cog-fade-leave-active{transition:opacity calc(var(--speed)/4)}html .cog-fade-enter,html .cog-fade-leave-to,:root:root:root:root:root .cog-fade-enter,:root:root:root:root:root .cog-fade-leave-to{opacity:0}@keyframes cog-expand{0%{transform:scaleY(0)}100%{transform:scaleY(1)}}@keyframes cog-fade-in{0%{opacity:0}100%{opacity:1}}@keyframes cog-fade-out{0%{opacity:1}100%{opacity:0}}@keyframes cog-spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}@keyframes cog-shake{from,to{transform:translate3d(0, 0, 0)}10%,30%,50%,70%,90%{transform:translate3d(-3px, 0, 0)}20%,40%,60%,80%{transform:translate3d(3px, 0, 0)}}@keyframes cog-tada{from{-webkit-transform:scale3d(1, 1, 1);transform:scale3d(1, 1, 1)}10%,20%{-webkit-transform:scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);transform:scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg)}30%,50%,70%,90%{-webkit-transform:scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);transform:scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)}40%,60%,80%{-webkit-transform:scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);transform:scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg)}to{-webkit-transform:scale3d(1, 1, 1);transform:scale3d(1, 1, 1)}}@keyframes cog-zoom{0%{opacity:0;transform:scale(1.1)}100%{opacity:1;transform:scale(1)}}\", \"\"]);\n\n// exports\n","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"html .cog-button__status-icon,:root:root:root:root:root .cog-button__status-icon{position:absolute;bottom:0;left:0;right:0;top:0;margin:auto}html .cog-button--has-status[class*=is-] .cog-button__text,html .cog-button--has-status[class*=is-] .cog-button__icon,:root:root:root:root:root .cog-button--has-status[class*=is-] .cog-button__text,:root:root:root:root:root .cog-button--has-status[class*=is-] .cog-button__icon{opacity:.3}html .cog-button__status-icon.is-validating,:root:root:root:root:root .cog-button__status-icon.is-validating{animation:cog-spin calc(var(--speed)*1.5) infinite linear;fill:currentcolor;stroke:transparent}html .cog-button__status-icon.is-success,:root:root:root:root:root .cog-button__status-icon.is-success{animation:cog-tada var(--speed)}html .cog-button.is-error,:root:root:root:root:root .cog-button.is-error{animation:cog-shake var(--speed)}html .cog-button__status-icon.is-error,:root:root:root:root:root .cog-button__status-icon.is-error{transform:scale(1.3)}\", \"\"]);\n\n// exports\n","var escape = require(\"../../node_modules/css-loader/lib/url/escape.js\");\nexports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"html .cog-form--show-all-pages .cog-page+.cog-page,:root:root:root:root:root .cog-form--show-all-pages .cog-page+.cog-page{margin-top:calc(var(--gutter) - calc(var(--gutter) / 4))}html .cog-page,:root:root:root:root:root .cog-page{width:100%}html .cog-page::after,:root:root:root:root:root .cog-page::after{display:block;clear:both;content:\\\"\\\"}html .cog-page[data-page]::after,:root:root:root:root:root .cog-page[data-page]::after{padding-top:calc(var(--gutter)/2);content:attr(data-page);font-size:var(--small-text);text-align:right}html .cog-page.cog-page-enter-active,html .cog-page.cog-page-leave-active,:root:root:root:root:root .cog-page.cog-page-enter-active,:root:root:root:root:root .cog-page.cog-page-leave-active{transition:all ease-in-out var(--speed)}html .cog-form:not(.is-success) .cog-page.cog-transition-enter-active,html .cog-form:not(.is-success) .cog-page-transition .cog-page,:root:root:root:root:root .cog-form:not(.is-success) .cog-page.cog-transition-enter-active,:root:root:root:root:root .cog-form:not(.is-success) .cog-page-transition .cog-page{position:absolute}html .cog-transition-ltr.cog-page-enter,:root:root:root:root:root .cog-transition-ltr.cog-page-enter{opacity:0;transform:translateX(-120%)}html .cog-transition-ltr.cog-page+.cog-transition-ltr.cog-page-leave-to,:root:root:root:root:root .cog-transition-ltr.cog-page+.cog-transition-ltr.cog-page-leave-to{transform:translateX(100%)}html .cog-transition-ltr.cog-page+.cog-transition-ltr.cog-page-enter,:root:root:root:root:root .cog-transition-ltr.cog-page+.cog-transition-ltr.cog-page-enter{transform:translateX(100%)}html .cog-transition-ltr.cog-page-leave-to,:root:root:root:root:root .cog-transition-ltr.cog-page-leave-to{opacity:0;transform:translateX(-120%)}html .is-validating .cog-page,:root:root:root:root:root .is-validating .cog-page{opacity:.4}html .is-success:not(.cog-form--confirmation-has-entry-details) .cog-page:not(.cog-confirmation),:root:root:root:root:root .is-success:not(.cog-form--confirmation-has-entry-details) .cog-page:not(.cog-confirmation){display:none}html .cog-form--confirmation-has-entry-details .cog-page,:root:root:root:root:root .cog-form--confirmation-has-entry-details .cog-page{opacity:0;animation-name:cog-fade-in;animation-duration:calc(var(--speed)/2);animation-fill-mode:forwards;transition:none}html .cog-form--confirmation-has-entry-details .cog-page[data-page]::after,:root:root:root:root:root .cog-form--confirmation-has-entry-details .cog-page[data-page]::after{content:none}html .cog-form--confirmation-has-entry-details .cog-page:not(.cog-confirmation),:root:root:root:root:root .cog-form--confirmation-has-entry-details .cog-page:not(.cog-confirmation){animation-delay:var(--speed)}html .grecaptcha-badge,:root:root:root:root:root .grecaptcha-badge{display:none}html .cog-page__navigation,:root:root:root:root:root .cog-page__navigation{display:flex;flex-wrap:wrap;justify-content:flex-start;padding-top:calc(var(--gutter)/2)}html .cog-page__navigation .cog-button,:root:root:root:root:root .cog-page__navigation .cog-button{margin-top:calc(var(--gutter)/2)}html .cog-page__navigation .cog-button:not(:last-child),:root:root:root:root .cog-page__navigation .cog-button:not(:last-child){margin-right:calc(var(--gutter)/2)}html .cog-page__navigation.is-being-measured .cog-button--navigation,:root:root:root:root:root .cog-page__navigation.is-being-measured .cog-button--navigation{transition:none}html .cog-button--save,:root:root:root:root:root .cog-button--save{margin-left:auto}html .cog-submission-warning,:root:root:root:root:root .cog-submission-warning{padding-top:calc(var(--gutter)/2);font-size:var(--small-text)}html .cog-form--paypal-button [type=submit],:root:root:root:root:root .cog-form--paypal-button [type=submit]{width:200px;height:35px;background:no-repeat url(\" + escape(require(\"../assets/graphics/paypal-logo.svg?external\")) + \") center center #ffc439;background-size:66px;border:0;border-radius:18px;transition:none}html .cog-form--paypal-button [type=submit]:hover,:root:root:root:root:root .cog-form--paypal-button [type=submit]:hover{background-color:#f2ba36}html .cog-form--paypal-button [type=submit] .cog-button__text,:root:root:root:root:root .cog-form--paypal-button [type=submit] .cog-button__text{opacity:0}html .cog-page__navigation--condensed .cog-button,:root:root:root:root:root .cog-page__navigation--condensed .cog-button{width:100%;margin-right:0}\", \"\"]);\n\n// exports\n","module.exports = __webpack_public_path__ + \"paypal-logo.svg?cde5e44ec811294e6300cf785e178c32\";","import { Type } from '@cognitoforms/model.js';\r\nimport { Entity, Property, isEntityType } from '@cognitoforms/vuemodel';\r\nimport { FORM_ENTRY_TYPE_NAME } from 'src/framework/forms-model';\r\n\r\n/**\r\n * Determine if the field is a lookup based off property name and type.\r\n * @param property\r\n * @returns boolean\r\n */\r\nexport function isLookupField(property: Property): boolean {\r\n\tconst type = isEntityType(property.propertyType) && property.propertyType.meta;\r\n\treturn property.name !== 'ParentSection' && property.name !== 'Form' && type && type.baseType && type.baseType.fullName === FORM_ENTRY_TYPE_NAME;\r\n}\r\n\r\n/**\r\n * Recursively visit all model properties of the provided entity.\r\n */\r\nexport function visitEntity(entity: Entity, callback: (entity: Entity, property: Property) => void, circular = false) {\r\n\tconst visited = new Set();\r\n\r\n\tfunction visit(entity: Entity) {\r\n\t\tif (entity === null || entity === undefined || visited.has(entity))\r\n\t\t\treturn;\r\n\r\n\t\tvisited.add(entity);\r\n\r\n\t\tfor (const p of entity.meta.type.properties) {\r\n\t\t\t// Don't visit circular properties\r\n\t\t\tif (!circular && (p.name === 'ParentSection' || (p.name === 'Form' && p.containingType.fullName !== FORM_ENTRY_TYPE_NAME) || isLookupField(p)))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tcallback(entity, p);\r\n\r\n\t\t\tif (isEntityType(p.propertyType)) {\r\n\t\t\t\tif (p.isList)\r\n\t\t\t\t\t(p.value(entity) as Entity[] || []).forEach(item => visit(item));\r\n\t\t\t\telse\r\n\t\t\t\t\tvisit(p.value(entity));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvisit(entity);\r\n}\r\n\r\nexport function visitType(type: Type, callback: (type: Type, path: string) => void) {\r\n\tconst visited = new Set();\r\n\tlet path = '';\r\n\tfunction visit(type: Type) {\r\n\t\tif (type === null || type === undefined || visited.has(type))\r\n\t\t\treturn;\r\n\r\n\t\tvisited.add(type);\r\n\t\tcallback(type, path);\r\n\r\n\t\tfor (const p of type.properties) {\r\n\t\t\tif (isEntityType(p.propertyType)) {\r\n\t\t\t\tif (path.length)\r\n\t\t\t\t\tpath += '.';\r\n\r\n\t\t\t\tpath += p.name;\r\n\t\t\t\tvisit(p.propertyType.meta);\r\n\t\t\t\tpath = path.substring(0, path.lastIndexOf('.'));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvisit(type);\r\n}","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"html .cog-field__placeholder-inner,:root:root:root:root:root .cog-field__placeholder-inner{margin:0;outline-width:var(--input__border-width, var(--border-width));padding-top:var(--input__padding-v);padding-bottom:var(--input__padding-v);font-family:var(--font-family, inherit);font-size:var(--input__font-size, inherit);font-weight:inherit;line-height:var(--input__line-height);background:var(--input__background-color);border-width:var(--input__border-width-top, var(--input__border-width)) var(--input__border-width-right, var(--input__border-width)) var(--input__border-width-bottom, var(--input__border-width)) var(--input__border-width-left, var(--input__border-width));border-style:var(--input__border-style);border-color:var(--input__border-color);box-shadow:var(--input__box-shadow);padding-right:var(--input__padding-h);padding-left:var(--input__padding-h);color:var(--input__color, inherit);transition:border-color .3s,box-shadow .3s;-webkit-appearance:none;border-radius:var(--input__border-radius);position:relative;background:hsla(var(--background-hsl), 0.2);border-color:transparent;overflow:hidden}html .cog-field__placeholder-inner::placeholder,:root:root:root:root:root .cog-field__placeholder-inner::placeholder{color:var(--placeholder__color)}html .cog-field__placeholder-inner::-ms-input-placeholder,:root:root:root:root:root .cog-field__placeholder-inner::-ms-input-placeholder{color:var(--placeholder__color)}html .cog-field__placeholder-inner:-ms-input-placeholder,:root:root:root:root:root .cog-field__placeholder-inner:-ms-input-placeholder{color:var(--placeholder__color) !important}html .cog-field__placeholder-inner::-moz-placeholder,:root:root:root:root:root .cog-field__placeholder-inner::-moz-placeholder{opacity:1}html .cog-field__placeholder-inner:focus,html .cog-field__placeholder-inner.is-focus,html .cog-field__placeholder-inner.StripeElement--focus,html .cog-field__placeholder-inner.c-square-input--focus,:root:root:root:root:root .cog-field__placeholder-inner:focus,:root:root:root:root:root .cog-field__placeholder-inner.is-focus,:root:root:root:root:root .cog-field__placeholder-inner.StripeElement--focus,:root:root:root:root:root .cog-field__placeholder-inner.c-square-input--focus{border-color:var(--highlight);box-shadow:var(--input-focus__box-shadow)}html .cog-file .cog-field__placeholder-inner,:root:root:root:root:root .cog-file .cog-field__placeholder-inner{min-height:calc(var(--input__line-height)*var(--button-primary__font-size) + var(--input__padding-v)*2 + var(--gutter)*1.125)}html .cog-signature .cog-field__placeholder-inner,:root:root:root:root:root .cog-signature .cog-field__placeholder-inner{padding-top:54.5%;padding-top:clamp(130px,54.5%,270px);line-height:0}html .cog-address .cog-field__placeholder-inner,:root:root:root:root:root .cog-address .cog-field__placeholder-inner{min-height:calc(var(--input__padding-v)*6 + var(--line-height)*var(--input__font-size)*3 + var(--input__border-width)*6 + var(--gutter))}html .cog-field__placeholder .cog-icon,:root:root:root:root:root .cog-field__placeholder .cog-icon{position:absolute;bottom:10%;left:0;top:10%;width:100%;height:80%;animation:cog-spin 2s linear infinite;fill:hsla(var(--background-hsl), 0.5)}html :not(:first-child)+.cog-field__placeholder,:root:root:root:root:root :not(:first-child)+.cog-field__placeholder{display:none}html .cog-section__placeholder,:root:root:root:root:root .cog-section__placeholder{width:100%;min-height:200px;background:hsla(var(--background-hsl), 0.2);margin-bottom:var(--gutter)}html .cog-section+.cog-section__placeholder,html .cog-table+.cog-section__placeholder,:root:root:root:root:root .cog-section+.cog-section__placeholder,:root:root:root:root:root .cog-table+.cog-section__placeholder{display:none}html .cog-table .cog-lookup--loading.is-read-only .cog-field__placeholder-inner,:root:root:root:root:root .cog-table .cog-lookup--loading.is-read-only .cog-field__placeholder-inner{background:transparent;padding:0;transform:scale(1.5)}html .cog-table .cog-lookup--loading.is-read-only .cog-icon,:root:root:root:root:root .cog-table .cog-lookup--loading.is-read-only .cog-icon{bottom:0;top:0;height:100%}\", \"\"]);\n\n// exports\n","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"html .cog-error-message,:root:root:root:root:root .cog-error-message{background:var(--negative);padding:calc(var(--gutter)/4);color:var(--negative-reverse);font-size:var(--small-text)}html .cog-error-message--container-footer,:root:root:root:root:root .cog-error-message--container-footer{border-radius:0 0 var(--border-radius) var(--border-radius)}html .cog-error-message--inline,:root:root:root:root:root .cog-error-message--inline{border-radius:calc(var(--border-radius)*.5);padding:.2em .4em;white-space:nowrap}html .cog-hidden-validation .cog-error-message--container-footer,:root:root:root:root:root .cog-hidden-validation .cog-error-message--container-footer{width:100%;margin-left:0}html .cog-col.is-required,:root:root:root:root:root .cog-col.is-required{transition:transform calc(var(--speed)/4)}html .cog-col.is-error:not(.cog-hidden-validation),:root:root:root:root:root .cog-col.is-error:not(.cog-hidden-validation){margin-top:calc(var(--gutter)/4);margin-bottom:calc(var(--gutter)/2 + 3px);transition:margin calc(var(--speed)/2)}html .cog-col.is-error:not(.cog-hidden-validation)::before,html .cog-col.is-error:not(.cog-hidden-validation)::after,:root:root:root:root:root .cog-col.is-error:not(.cog-hidden-validation)::before,:root:root:root:root:root .cog-col.is-error:not(.cog-hidden-validation)::after{display:block;position:absolute;bottom:0;left:0;right:0;top:0;z-index:-1;border-radius:var(--border-radius);content:\\\"\\\"}html .cog-form--light-background .cog-col.is-error::before,:root:root:root:root:root .cog-form--light-background .cog-col.is-error::before{background:#fff;outline:#fff calc(var(--gutter)/2 - 3px) solid;opacity:.8}html .cog-form--light-background .cog-col.is-error::after,:root:root:root:root:root .cog-form--light-background .cog-col.is-error::after{background:var(--negative);outline:var(--negative) calc(var(--gutter)/2 - 3px) solid;opacity:.1}html .cog-form--dark-background .cog-col.is-error::before,:root:root:root:root:root .cog-form--dark-background .cog-col.is-error::before{background:var(--negative);outline:var(--negative) calc(var(--gutter)/2 - 3px) solid;opacity:.5}html .cog-form--dark-background .cog-col.is-error::after,:root:root:root:root:root .cog-form--dark-background .cog-col.is-error::after{background:#000;outline:#000 calc(var(--gutter)/2 - 3px) solid;opacity:.1}html .cog-cognito--styled .cog-error-message--container-footer,:root:root:root:root:root .cog-cognito--styled .cog-error-message--container-footer{opacity:1;transition:calc(var(--speed)/2)}html .cog-cognito--styled .cog-error-message-enter-active,html .cog-cognito--styled .cog-error-message-leave-active,:root:root:root:root:root .cog-cognito--styled .cog-error-message-enter-active,:root:root:root:root:root .cog-cognito--styled .cog-error-message-leave-active{max-height:4em}html .cog-cognito--styled .cog-error-message-enter,html .cog-cognito--styled .cog-error-message-leave-to,:root:root:root:root:root .cog-cognito--styled .cog-error-message-enter,:root:root:root:root:root .cog-cognito--styled .cog-error-message-leave-to{max-height:0;margin-top:0 !important;margin-bottom:0 !important;padding-top:0;padding-bottom:0;opacity:0}html .cog-cognito--styled .cog-section.is-error:focus::before,html .cog-cognito--styled .cog-section.is-error:focus::after,:root:root:root:root:root .cog-cognito--styled .cog-section.is-error:focus::before,:root:root:root:root:root .cog-cognito--styled .cog-section.is-error:focus::after{outline-style:double}html .cog-cognito--styled .cog-field.is-error .el-input__inner:focus,html .cog-cognito--styled .cog-field.is-error .el-textarea__inner:focus,:root:root:root:root:root .cog-cognito--styled .cog-field.is-error .el-input__inner:focus,:root:root:root:root:root .cog-cognito--styled .cog-field.is-error .el-textarea__inner:focus{border-color:var(--negative)}\", \"\"]);\n\n// exports\n","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"html .cog-field,html .cog-section,:root:root:root:root:root .cog-field,:root:root:root:root:root .cog-section{position:relative;z-index:0}html .cog-field,:root:root:root:root:root .cog-field{min-width:5.2em}html .cog-input,:root:root:root:root:root .cog-input{margin-bottom:calc(var(--gutter)/4);padding-top:calc(var(--gutter)/4)}html [data-old-safari] .cog-input .cog-input,:root:root:root:root:root [data-old-safari] .cog-input .cog-input{margin:0 !important;padding:0 !important}html .cog-input .cog-input,:root:root:root:root:root .cog-input .cog-input{padding:0}html .cog-form:not([data-old-safari]) .cog-field .cog-row,:root:root:root:root:root .cog-form:not([data-old-safari]) .cog-field .cog-row{column-gap:calc(var(--gutter)/2)}html [data-old-safari] .cog-field .cog-row,:root:root:root:root:root [data-old-safari] .cog-field .cog-row{width:calc(100% + calc(var(--gutter) / 2));margin-left:calc(var(--gutter)*-0.25)}html [data-old-safari] .cog-field .cog-row .cog-input,:root:root:root:root:root [data-old-safari] .cog-field .cog-row .cog-input{padding-right:calc(var(--gutter)/4);padding-left:calc(var(--gutter)/4)}html .cog-input--full,:root:root:root:root:root .cog-input--full{flex:0 1 100%}html .cog-input--long,:root:root:root:root:root .cog-input--long{flex:3 1 12em}html .cog-input--medium,:root:root:root:root:root .cog-input--medium{flex:1 0 7em}html .cog-input--small,:root:root:root:root:root .cog-input--small{flex:1 0 5em}html .cog-input--tiny,:root:root:root:root:root .cog-input--tiny{flex:1 0 3.75em}html .cog-label,:root:root:root:root:root .cog-label{display:block;padding-top:calc(var(--gutter)/4);color:var(--label__color, inherit);font-family:var(--label__font-family, inherit);font-size:var(--label__font-size, inherit);font-weight:var(--label__font-weight, normal)}html .is-required .cog-label,:root:root:root:root:root .is-required .cog-label{padding-right:.6em}html .cog-asterisk,:root:root:root:root:root .cog-asterisk{position:absolute;margin-left:.2em;content:\\\"*\\\";color:var(--negative)}html .cog-helptext,:root:root:root:root:root .cog-helptext{margin-bottom:calc(var(--gutter)/4);font-size:var(--small-text)}html .cog-cognito--styled .cog-field,:root:root:root:root:root .cog-cognito--styled .cog-field{border-radius:var(--border-radius)}html .cog-form fieldset,:root:root:root:root:root .cog-form fieldset{border:0}html .cog-form fieldset,html .cog-form figure,:root:root:root:root:root .cog-form fieldset,:root:root:root:root:root .cog-form figure{margin:0;padding:0}html .cog-form legend,:root:root:root:root:root .cog-form legend{display:block;width:100%;float:left;padding-right:0;padding-left:0}html .cog-form legend+*,:root:root:root:root:root .cog-form legend+*{clear:both}\", \"\"]);\n\n// exports\n","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"html .cog-inner-col--no-css-columns>*,:root:root:root:root:root .cog-inner-col--no-css-columns>*{display:flex;flex-wrap:wrap;width:calc(100% + 1em)}html .cog-inner-col--no-css-columns.cog-inner-col--1 .cog-inner-col__item,:root:root:root:root:root .cog-inner-col--no-css-columns.cog-inner-col--1 .cog-inner-col__item{width:100%}html .cog-inner-col--no-css-columns.cog-inner-col--2 .cog-inner-col__item,:root:root:root:root:root .cog-inner-col--no-css-columns.cog-inner-col--2 .cog-inner-col__item{width:50%}html .cog-inner-col--no-css-columns.cog-inner-col--3 .cog-inner-col__item,:root:root:root:root:root .cog-inner-col--no-css-columns.cog-inner-col--3 .cog-inner-col__item{width:33.333%}html .cog-inner-col--no-css-columns.cog-inner-col--4 .cog-inner-col__item,:root:root:root:root:root .cog-inner-col--no-css-columns.cog-inner-col--4 .cog-inner-col__item{width:25%}html .cog-inner-col--css-columns.cog-inner-col--1,:root:root:root:root:root .cog-inner-col--css-columns.cog-inner-col--1{columns:1 130px}html .cog-inner-col--css-columns.cog-inner-col--2,:root:root:root:root:root .cog-inner-col--css-columns.cog-inner-col--2{columns:2 130px}html .cog-inner-col--css-columns.cog-inner-col--3,:root:root:root:root:root .cog-inner-col--css-columns.cog-inner-col--3{columns:3 130px}html .cog-inner-col--css-columns.cog-inner-col--4,:root:root:root:root:root .cog-inner-col--css-columns.cog-inner-col--4{columns:4 130px}html :not(:empty)+.cog-choice__placeholder,:root:root:root:root:root :not(:empty)+.cog-choice__placeholder{display:none}html .cog-inner-col .cog-choice__checkable-placeholder,:root:root:root:root:root .cog-inner-col .cog-choice__checkable-placeholder{width:100%}html .cog-choice__checkable-placeholder,:root:root:root:root:root .cog-choice__checkable-placeholder{margin-bottom:calc(var(--gutter)/2);padding-top:1px}html .cog-choice__checkable-placeholder span,:root:root:root:root:root .cog-choice__checkable-placeholder span{background:hsla(var(--background-hsl), 0.12);padding-left:calc(var(--checkable__scale)*1.5em);color:transparent}html .cog-choice__checkable-placeholder:not(:last-child),:root:root:root:root:root .cog-choice__checkable-placeholder:not(:last-child){margin-right:12px}html :not(.cog-inner-col)>.cog-choice__checkable-placeholder,:root:root:root:root:root :not(.cog-inner-col)>.cog-choice__checkable-placeholder{display:inline-block}html .cog-choice__allow-other-placeholder,:root:root:root:root:root .cog-choice__allow-other-placeholder{display:inline-block}html .cog-choice__allow-other-placeholder>div,:root:root:root:root:root .cog-choice__allow-other-placeholder>div{width:130px}\", \"\"]);\n\n// exports\n","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"html .cog-slide-transition,:root:root:root:root:root .cog-slide-transition{display:block !important;min-height:0 !important;max-height:0 !important;border-top:0 !important;border-bottom:0 !important;margin-top:0 !important;margin-bottom:0 !important;overflow:hidden !important;padding-top:0 !important;padding-bottom:0 !important;opacity:0 !important}html .cog-form[data-width~=\\\"800\\\"] .cog-slide-transition,:root:root:root:root:root .cog-form[data-width~=\\\"800\\\"] .cog-slide-transition{min-width:0 !important;max-width:0 !important;border-right:0 !important;border-left:0 !important;margin-right:0 !important;margin-left:0 !important;padding-right:0 !important;padding-left:0 !important}\", \"\"]);\n\n// exports\n","var map = {\n\t\"./af-ZA\": [\n\t\t337,\n\t\t48\n\t],\n\t\"./af-ZA.js\": [\n\t\t337,\n\t\t48\n\t],\n\t\"./ar\": [\n\t\t338,\n\t\t49\n\t],\n\t\"./ar.js\": [\n\t\t338,\n\t\t49\n\t],\n\t\"./bg\": [\n\t\t339,\n\t\t50,\n\t\t25\n\t],\n\t\"./bg.js\": [\n\t\t339,\n\t\t50,\n\t\t25\n\t],\n\t\"./ca\": [\n\t\t340,\n\t\t51\n\t],\n\t\"./ca.js\": [\n\t\t340,\n\t\t51\n\t],\n\t\"./cs-CZ\": [\n\t\t341,\n\t\t52\n\t],\n\t\"./cs-CZ.js\": [\n\t\t341,\n\t\t52\n\t],\n\t\"./da\": [\n\t\t342,\n\t\t53,\n\t\t26\n\t],\n\t\"./da.js\": [\n\t\t342,\n\t\t53,\n\t\t26\n\t],\n\t\"./de\": [\n\t\t343,\n\t\t54,\n\t\t27\n\t],\n\t\"./de.js\": [\n\t\t343,\n\t\t54,\n\t\t27\n\t],\n\t\"./ee\": [\n\t\t344,\n\t\t55\n\t],\n\t\"./ee.js\": [\n\t\t344,\n\t\t55\n\t],\n\t\"./el\": [\n\t\t345,\n\t\t56,\n\t\t28\n\t],\n\t\"./el.js\": [\n\t\t345,\n\t\t56,\n\t\t28\n\t],\n\t\"./en\": [\n\t\t346,\n\t\t57,\n\t\t29\n\t],\n\t\"./en.js\": [\n\t\t346,\n\t\t57,\n\t\t29\n\t],\n\t\"./eo\": [\n\t\t347,\n\t\t58\n\t],\n\t\"./eo.js\": [\n\t\t347,\n\t\t58\n\t],\n\t\"./es\": [\n\t\t348,\n\t\t59,\n\t\t30\n\t],\n\t\"./es.js\": [\n\t\t348,\n\t\t59,\n\t\t30\n\t],\n\t\"./eu\": [\n\t\t349,\n\t\t60\n\t],\n\t\"./eu.js\": [\n\t\t349,\n\t\t60\n\t],\n\t\"./fa\": [\n\t\t350,\n\t\t61\n\t],\n\t\"./fa.js\": [\n\t\t350,\n\t\t61\n\t],\n\t\"./fi\": [\n\t\t351,\n\t\t62,\n\t\t31\n\t],\n\t\"./fi.js\": [\n\t\t351,\n\t\t62,\n\t\t31\n\t],\n\t\"./fr\": [\n\t\t352,\n\t\t63,\n\t\t32\n\t],\n\t\"./fr.js\": [\n\t\t352,\n\t\t63,\n\t\t32\n\t],\n\t\"./he\": [\n\t\t353,\n\t\t64\n\t],\n\t\"./he.js\": [\n\t\t353,\n\t\t64\n\t],\n\t\"./hr\": [\n\t\t354,\n\t\t65,\n\t\t34\n\t],\n\t\"./hr.js\": [\n\t\t354,\n\t\t65,\n\t\t34\n\t],\n\t\"./hu\": [\n\t\t355,\n\t\t66,\n\t\t35\n\t],\n\t\"./hu.js\": [\n\t\t355,\n\t\t66,\n\t\t35\n\t],\n\t\"./hy-AM\": [\n\t\t356,\n\t\t67\n\t],\n\t\"./hy-AM.js\": [\n\t\t356,\n\t\t67\n\t],\n\t\"./id\": [\n\t\t357,\n\t\t68\n\t],\n\t\"./id.js\": [\n\t\t357,\n\t\t68\n\t],\n\t\"./it\": [\n\t\t358,\n\t\t69,\n\t\t37\n\t],\n\t\"./it.js\": [\n\t\t358,\n\t\t69,\n\t\t37\n\t],\n\t\"./ja\": [\n\t\t359,\n\t\t70,\n\t\t38\n\t],\n\t\"./ja.js\": [\n\t\t359,\n\t\t70,\n\t\t38\n\t],\n\t\"./kg\": [\n\t\t360,\n\t\t71\n\t],\n\t\"./kg.js\": [\n\t\t360,\n\t\t71\n\t],\n\t\"./km\": [\n\t\t361,\n\t\t72\n\t],\n\t\"./km.js\": [\n\t\t361,\n\t\t72\n\t],\n\t\"./ko\": [\n\t\t362,\n\t\t73\n\t],\n\t\"./ko.js\": [\n\t\t362,\n\t\t73\n\t],\n\t\"./ku\": [\n\t\t363,\n\t\t74\n\t],\n\t\"./ku.js\": [\n\t\t363,\n\t\t74\n\t],\n\t\"./kz\": [\n\t\t364,\n\t\t75\n\t],\n\t\"./kz.js\": [\n\t\t364,\n\t\t75\n\t],\n\t\"./lt\": [\n\t\t365,\n\t\t76\n\t],\n\t\"./lt.js\": [\n\t\t365,\n\t\t76\n\t],\n\t\"./lv\": [\n\t\t366,\n\t\t77\n\t],\n\t\"./lv.js\": [\n\t\t366,\n\t\t77\n\t],\n\t\"./mn\": [\n\t\t367,\n\t\t78\n\t],\n\t\"./mn.js\": [\n\t\t367,\n\t\t78\n\t],\n\t\"./nb-NO\": [\n\t\t368,\n\t\t79\n\t],\n\t\"./nb-NO.js\": [\n\t\t368,\n\t\t79\n\t],\n\t\"./nl\": [\n\t\t369,\n\t\t80,\n\t\t40\n\t],\n\t\"./nl.js\": [\n\t\t369,\n\t\t80,\n\t\t40\n\t],\n\t\"./pl\": [\n\t\t370,\n\t\t81,\n\t\t41\n\t],\n\t\"./pl.js\": [\n\t\t370,\n\t\t81,\n\t\t41\n\t],\n\t\"./pt\": [\n\t\t372,\n\t\t82,\n\t\t42\n\t],\n\t\"./pt-br\": [\n\t\t371,\n\t\t83\n\t],\n\t\"./pt-br.js\": [\n\t\t371,\n\t\t83\n\t],\n\t\"./pt.js\": [\n\t\t372,\n\t\t82,\n\t\t42\n\t],\n\t\"./ro\": [\n\t\t373,\n\t\t84\n\t],\n\t\"./ro.js\": [\n\t\t373,\n\t\t84\n\t],\n\t\"./ru-RU\": [\n\t\t374,\n\t\t85\n\t],\n\t\"./ru-RU.js\": [\n\t\t374,\n\t\t85\n\t],\n\t\"./sk\": [\n\t\t375,\n\t\t86\n\t],\n\t\"./sk.js\": [\n\t\t375,\n\t\t86\n\t],\n\t\"./sl\": [\n\t\t376,\n\t\t87\n\t],\n\t\"./sl.js\": [\n\t\t376,\n\t\t87\n\t],\n\t\"./sr\": [\n\t\t377,\n\t\t88\n\t],\n\t\"./sr.js\": [\n\t\t377,\n\t\t88\n\t],\n\t\"./sv-SE\": [\n\t\t378,\n\t\t89\n\t],\n\t\"./sv-SE.js\": [\n\t\t378,\n\t\t89\n\t],\n\t\"./ta\": [\n\t\t379,\n\t\t90\n\t],\n\t\"./ta.js\": [\n\t\t379,\n\t\t90\n\t],\n\t\"./th\": [\n\t\t380,\n\t\t91,\n\t\t44\n\t],\n\t\"./th.js\": [\n\t\t380,\n\t\t91,\n\t\t44\n\t],\n\t\"./tk\": [\n\t\t381,\n\t\t92\n\t],\n\t\"./tk.js\": [\n\t\t381,\n\t\t92\n\t],\n\t\"./tr-TR\": [\n\t\t382,\n\t\t93\n\t],\n\t\"./tr-TR.js\": [\n\t\t382,\n\t\t93\n\t],\n\t\"./ua\": [\n\t\t383,\n\t\t94\n\t],\n\t\"./ua.js\": [\n\t\t383,\n\t\t94\n\t],\n\t\"./ug-CN\": [\n\t\t384,\n\t\t95\n\t],\n\t\"./ug-CN.js\": [\n\t\t384,\n\t\t95\n\t],\n\t\"./uz-UZ\": [\n\t\t385,\n\t\t96\n\t],\n\t\"./uz-UZ.js\": [\n\t\t385,\n\t\t96\n\t],\n\t\"./vi\": [\n\t\t386,\n\t\t97\n\t],\n\t\"./vi.js\": [\n\t\t386,\n\t\t97\n\t],\n\t\"./zh-CN\": [\n\t\t304\n\t],\n\t\"./zh-CN.js\": [\n\t\t304\n\t],\n\t\"./zh-TW\": [\n\t\t387,\n\t\t98\n\t],\n\t\"./zh-TW.js\": [\n\t\t387,\n\t\t98\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn Promise.all(ids.slice(1).map(__webpack_require__.e)).then(function() {\n\t\treturn __webpack_require__.t(id, 7);\n\t});\n}\nwebpackAsyncContext.keys = function webpackAsyncContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackAsyncContext.id = 407;\nmodule.exports = webpackAsyncContext;","export function randomInt(max: number = 9) {\r\n\t// https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/generate-random-whole-numbers-with-javascript/\r\n\tconst scaleFactor = max + 1;\r\n\treturn Math.floor(Math.random() * scaleFactor);\r\n}\r\n\r\nexport function randomText(length: number = 1, includeDigits: boolean = false): string {\r\n\tlet str: string = '';\r\n\twhile (str.length < length) {\r\n\t\tconst remainingLength = length - str.length;\r\n\t\t// https://gist.github.com/6174/6062387\r\n\t\tlet chunk = Math.random().toString(36).substring(2);\r\n\t\tif (!includeDigits) chunk = chunk.replace(/[0-9]/g, '');\r\n\t\tconst chunkLength = Math.min(chunk.length, remainingLength);\r\n\t\tstr += chunk.substr(0, chunkLength);\r\n\t}\r\n\treturn str;\r\n}\r\n","import { LocalizedResources } from '@cognitoforms/model.js';\r\nimport { UserInfo } from 'src/server-types/forms/model/user-info';\r\nimport { PaymentProcessor } from 'src/server-types/payment/model/payment-processor';\r\n\r\nexport type BotChallengeData = {\r\n\tmap: number[];\r\n\tchars: string[];\r\n}\r\n\r\nexport enum BotValidationMethod {\r\n\tNoBots = 'X-NoBots',\r\n\tRecaptcha = 'X-Recaptcha'\r\n}\r\n\r\nexport type BotValidation = {\r\n\tmethod: BotValidationMethod;\r\n\ttoken: string;\r\n}\r\n\r\nexport type EntityStatus = 'Enabled' | 'Disabled' | 'AutoDisabled';\r\n\r\nexport type FormSessionData = {\r\n\tisReadonly?: boolean;\r\n\tformId?: string;\r\n\tapiKey?: string;\r\n\tformStatus: EntityStatus;\r\n\ttoken?: string;\r\n\tbotChallenge: BotChallengeData;\r\n\tpaymentProcessor: PaymentProcessor;\r\n\tpaymentTestMode?: boolean;\r\n\tpaymentApiKey?: string;\r\n\tpaymentLocationId?: string;\r\n\tpaymentLocationCurrencyCode?: string;\r\n\tpaymentSdkUrl?: string;\r\n\taccessToken?: string;\r\n\torganizationId?: string;\r\n\tflags?: FormSessionFlagsData;\r\n\tfileUploadLimit?: number;\r\n\tencryptionKey?: string;\r\n\tviewTokens?: { [key: string]: string };\r\n\tpublicRole?: string;\r\n\tpaymentIntentClientSecret?: string;\r\n\tuserInfo?: object;\r\n};\r\n\r\nexport type FormSessionFlagsData = {\r\n\tentryCaching?: boolean;\r\n\tembedded?: boolean;\r\n\tsaveAndResume?: boolean;\r\n\tlookupField?: boolean;\r\n\tsignatureField?: boolean;\r\n\ttableField?: boolean;\r\n\tpasswordField?: boolean;\r\n\tformTracking?: boolean;\r\n\tbranding?: boolean;\r\n\tminimalBranding?: boolean;\r\n\tabuseLink?: boolean;\r\n\thideHeader?: boolean;\r\n\tencrypt?: boolean;\r\n\tinternal?: boolean;\r\n\tmobile?: boolean;\r\n\thasLookups?: boolean;\r\n\thasQuantityLimits?: boolean;\r\n\tpayment?: boolean;\r\n\tavailable?: boolean;\r\n\tarchived?: boolean;\r\n\tsquare?: boolean;\r\n\tpaypal?: boolean;\r\n\tsaveCustomerCard?: boolean;\r\n\tlog?: boolean;\r\n\tredirect?: boolean;\r\n\tpaging?: boolean;\r\n\tsubmissionSettings?: boolean;\r\n\tshowSubmissionWarning?: boolean;\r\n\tblockSubmission?: boolean;\r\n\tconditionalVisibility?: boolean;\r\n\tworkflowEnabled?: boolean;\r\n\tconcurrentEditing?: boolean;\r\n\tuseSquareWebPaymentsSdk?: boolean;\r\n\tuseStripePaymentElement?: boolean;\r\n\tstripeApplePay?: boolean;\r\n\tdisableConfirmationLinks?: boolean;\r\n\tprocessPayment?: boolean;\r\n\tplaintextPasswords?: boolean,\r\n\tautoScroll?: boolean,\r\n\tforceHideOrder?: boolean,\r\n\tuseNativeScrolling?: boolean,\r\n\tdisableValidation?: boolean,\r\n\tauthenticatedFormsEnabled?: boolean,\r\n\tforceLightBackgroundClass?: boolean,\r\n\trequireAuthenticationEmbedded?: boolean\r\n};\r\n\r\nexport class FormSession {\r\n\tprivate _botChallenge: BotChallengeData;\r\n\tprivate resources: LocalizedResources;\r\n\treadonly token: string;\r\n\treadonly apiKey: string;\r\n\treadonly organizationId: string;\r\n\treadonly isReadonly: boolean;\r\n\taccessToken: string;\r\n\treadonly paymentProcessor: PaymentProcessor;\r\n\treadonly paymentTestMode: boolean;\r\n\treadonly paymentApiKey: string;\r\n\treadonly paymentLocationId: string;\r\n\treadonly paymentLocationCurrencyCode: string;\r\n\treadonly paymentSdkUrl: string;\r\n\treadonly formId: string;\r\n\treadonly formStatus: EntityStatus;\r\n\treadonly flags: FormSessionFlagsData;\r\n\treadonly fileUploadLimit: number;\r\n\treadonly viewTokens: Readonly>;\r\n\treadonly encryptionKey: string;\r\n\treadonly isAnonymous: boolean;\r\n\tbotValidation: BotValidation;\r\n\treadonly cognitoHostName: string;\r\n\tisValidSharedLink: boolean = true;\r\n\treadonly publicRole: string;\r\n\treadonly userInfo: UserInfo;\r\n\treadonly formUrl: string;\r\n\treadonly linkText: string;\r\n\r\n\tconstructor(sessionData: FormSessionData) {\r\n\t\t// Initialize mutable properties\r\n\t\tthis._botChallenge = sessionData.botChallenge;\r\n\t\tdelete sessionData.botChallenge;\r\n\r\n\t\tthis.accessToken = sessionData.accessToken;\r\n\t\tdelete sessionData.accessToken;\r\n\r\n\t\t// Initialize immutable properties\r\n\t\tfor (const p in sessionData) {\r\n\t\t\tconst value = sessionData[p];\r\n\t\t\tObject.defineProperty(this, p, {\r\n\t\t\t\tenumerable: true,\r\n\t\t\t\twritable: false,\r\n\t\t\t\tvalue: value && typeof value === 'object' ? Object.freeze(value) : value\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.isAnonymous = sessionData.apiKey === '00000000-0000-0000-0000-000000000000';\r\n\t}\r\n\r\n\tget botChallenge() {\r\n\t\treturn this._botChallenge.map.map(i => this._botChallenge.chars[i]).join('');\r\n\t}\r\n\r\n\tisHuman(evidence: BotValidation) {\r\n\t\tthis.botValidation = evidence;\r\n\t}\r\n\r\n\tregisterResources(resources: LocalizedResources) {\r\n\t\tthis.resources = resources;\r\n\t}\r\n\r\n\tgetResource(resource: string) {\r\n\t\treturn this.resources ? this.resources[resource] : '';\r\n\t}\r\n}\r\n","import { EntrySaveResult, EntryService, EntrySubmissionResult, parseStoreResult, ResumeEntryResult } from './entry-service';\r\nimport { FormEntry } from 'src/server-types/forms/model/form-entry';\r\n\r\nexport default class PublicEntryService extends EntryService {\r\n\tasync submit(entry: FormEntry, embedUrl: string, saveAndRedirect: boolean, entryToken: string): Promise {\r\n\t\tconst entryJson = entry.serialize();\r\n\t\tconst order = entry.Order;\r\n\t\tconst result = await this.serviceRequest({\r\n\t\t\tmethod: 'post',\r\n\t\t\tendpoint: `forms/public/${saveAndRedirect ? 'saveandredirectpayment' : 'entry'}`,\r\n\t\t\tisCognitoJson: true,\r\n\t\t\theaders: { [this.session.botValidation.method]: this.session.botValidation.token },\r\n\t\t\tdata: {\r\n\t\t\t\tEntry: entryJson,\r\n\t\t\t\tOrderAmount: order ? order.OrderAmount : null,\r\n\t\t\t\tAccessToken: this.session.accessToken,\r\n\t\t\t\tSaveAndResume_EmbedUrl: embedUrl,\r\n\t\t\t\tEntryToken: entryToken\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// TODO: Return data in the same shape it comes from the server?\r\n\r\n\t\tif (result.response && result.response.data) {\r\n\t\t\tconst data = result.response.data;\r\n\t\t\tconst submissionResult = parseStoreResult(data) as EntrySubmissionResult;\r\n\r\n\t\t\t// Add the session token to document links to support downloads\r\n\t\t\tif (data.entryDocuments) {\r\n\t\t\t\tsubmissionResult.documents = data.entryDocuments.map(doc => {\r\n\t\t\t\t\tdoc.link = doc.link + '&token=' + encodeURIComponent(this.sessionToken);\r\n\t\t\t\t\treturn doc;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\treturn submissionResult;\r\n\t\t}\r\n\r\n\t\tthrow this.parseError(result.error);\r\n\t}\r\n\r\n\tasync save(entry: FormEntry, embedUrl: string, entryToken: string, resumePage?: number): Promise {\r\n\t\tif (!this.session.flags.saveAndResume)\r\n\t\t\tthrow new Error('Entry saving is unsupported.');\r\n\r\n\t\tconst result = await this.serviceRequest({\r\n\t\t\tmethod: 'post',\r\n\t\t\tendpoint: 'forms/public/save',\r\n\t\t\tisCognitoJson: true,\r\n\t\t\theaders: { [this.session.botValidation.method]: this.session.botValidation.token },\r\n\t\t\tdata: {\r\n\t\t\t\tEntry: entry.serialize(),\r\n\t\t\t\tOrderAmount: entry.Order ? entry.Order.OrderAmount : null,\r\n\t\t\t\tAccessToken: this.session.accessToken,\r\n\t\t\t\tSaveAndResume_LastPageViewed: resumePage,\r\n\t\t\t\tSaveAndResume_EmbedUrl: embedUrl,\r\n\t\t\t\tEntryToken: entryToken\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (result.response && result.response.data) {\r\n\t\t\tconst data = result.response.data;\r\n\t\t\tconst saveResult = parseStoreResult(data) as unknown as EntrySaveResult;\r\n\t\t\tsaveResult.emailAddress = data.saveAndResumeRecipients;\r\n\t\t\tsaveResult.message = data.message;\r\n\t\t\tsaveResult.emailMessage = data.emailMessage;\r\n\t\t\tsaveResult.link = data.link;\r\n\r\n\t\t\treturn saveResult;\r\n\t\t}\r\n\r\n\t\tthrow this.parseError(result.error);\r\n\t}\r\n\r\n\tasync emailResumeLink(entryId: string, recipient: string, message: string, link: string) {\r\n\t\tconst result = await this.serviceRequest({\r\n\t\t\tmethod: 'post',\r\n\t\t\tendpoint: 'svc/save-resume/send-email',\r\n\t\t\tdata: { entryId, recipient, message, link }\r\n\t\t});\r\n\r\n\t\tif (result.error)\r\n\t\t\tthrow this.parseError(result.error);\r\n\t}\r\n\r\n\t// TODO: Handle entry token on resume\r\n\tasync resume(formId: string, entryToken: string, actionId: number): Promise {\r\n\t\tconst result = await this.serviceRequest({\r\n\t\t\tmethod: 'get',\r\n\t\t\tendpoint: 'forms/public/entry',\r\n\t\t\tparams: { formId, entryToken, actionId }\r\n\t\t});\r\n\r\n\t\tif (result.response && result.response.data)\r\n\t\t\treturn result.response.data;\r\n\r\n\t\tthrow this.parseError(result.error);\r\n\t}\r\n}","import { BaseService } from './base-service';\r\nimport { parseUrlHostname } from 'src/util';\r\nimport { FormSession, FormSessionData, FormSessionFlagsData } from './form-session';\r\nimport { EmbedContext } from 'src/framework/public/form-handle';\r\nimport { ObjectLookup } from '@cognitoforms/model.js/@types/helpers';\r\nimport { CustomResponseError } from './custom-response-error';\r\nimport { CognitoConfiguration } from 'src/util/clientside-configuration';\r\n\r\nfunction createSessionForDisabledForm(formStatus: 'Disabled' | 'AutoDisabled'): FormSessionData {\r\n\treturn {\r\n\t\tformStatus,\r\n\t\ttoken: null,\r\n\t\tbotChallenge: { chars: [], map: [] },\r\n\t\tpaymentApiKey: null,\r\n\t\tpaymentLocationId: null,\r\n\t\tpaymentLocationCurrencyCode: null,\r\n\t\tpaymentSdkUrl: null,\r\n\t\taccessToken: null,\r\n\t\torganizationId: null,\r\n\t\tflags: {},\r\n\t\tfileUploadLimit: 0,\r\n\t\tencryptionKey: '',\r\n\t\tviewTokens: null\r\n\t} as FormSessionData;\r\n}\r\n\r\nfunction pascalToCamelCase(pascalStr: string) {\r\n\tif (!pascalStr || !pascalStr.trim())\r\n\t\treturn '';\r\n\treturn pascalStr[0].toLowerCase() + pascalStr.substr(1);\r\n}\r\n\r\nfunction ensureCamelCaseFlags(flags: ObjectLookup): FormSessionFlagsData {\r\n\tconst camelCaseFlags: FormSessionFlagsData = {};\r\n\tfor (const flag in flags)\r\n\t\tcamelCaseFlags[pascalToCamelCase(flag)] = flags[flag];\r\n\treturn camelCaseFlags;\r\n}\r\n\r\nconst cognitoHostName = parseUrlHostname(CognitoConfiguration.SiteUrl);\r\n\r\nexport class SessionService extends BaseService {\r\n\t// readonly sessions = new Map();\r\n\r\n\tasync newSession(formId: string, embedContext: EmbedContext = EmbedContext.Public, formJson?: string, entryToken?: string): Promise {\r\n\t\tconst isAdminSession = embedContext === EmbedContext.Publish || embedContext === EmbedContext.Preview || embedContext === EmbedContext.Entries;\r\n\t\tconst request = embedContext === EmbedContext.Preview\r\n\t\t\t? this.serviceRequest({\r\n\t\t\t\tmethod: 'post',\r\n\t\t\t\tendpoint: 'svc/load-form/new-preview-session',\r\n\t\t\t\tdata: { formJson }\r\n\t\t\t})\r\n\t\t\t: this.serviceRequest({\r\n\t\t\t\tmethod: 'post',\r\n\t\t\t\tendpoint: isAdminSession\r\n\t\t\t\t\t? `svc/load-form/new-admin-session/${formId}`\r\n\t\t\t\t\t: `svc/load-form/new-session/${this.apiKey}/${formId}`,\r\n\t\t\t\tparams: { embedContext, entryToken }\r\n\t\t\t});\r\n\r\n\t\tconst sessionData = await request.then(res => {\r\n\t\t\tif (res.error) {\r\n\t\t\t\t// Check for a failure response that returns a partial/invalid session object (i.e. disabled form)\r\n\t\t\t\tif (res.error instanceof CustomResponseError && res.error.type === 'FormDisabled')\r\n\t\t\t\t\treturn createSessionForDisabledForm(res.error.data.FormStatus);\r\n\r\n\t\t\t\tthrow res.error;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn res.response.data;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tsessionData.flags = ensureCamelCaseFlags(sessionData.flags);\r\n\r\n\t\treturn new FormSession(Object.assign({ formId, apiKey: this.apiKey, cognitoHostName }, sessionData));\r\n\t}\r\n}","var render = function() {\n var _obj\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _vm.visible\n ? _c(\n \"header\",\n {\n staticClass: \"cog-header\",\n class: [\n ((_obj = {\n \"cog-wrapper\": _vm.layout !== \"stretch\"\n }),\n (_obj[\"cog-header--\" + _vm.layout] = _vm.logo),\n _obj),\n \"cog-header--\" + _vm.alignment\n ]\n },\n [\n _vm.logo\n ? _c(\"img\", { attrs: { src: _vm.logo, alt: _vm.alt || false } })\n : _vm._e(),\n _vm._v(\" \"),\n _vm.title\n ? _c(\n \"div\",\n {\n staticClass: \"cog-header__text\",\n class: {\n \"cog-wrapper\":\n _vm.layout === \"stretch\" || _vm.layout === \"logo-only\"\n }\n },\n [\n _c(\"h1\", { staticClass: \"cog-heading\" }, [\n _vm._v(_vm._s(_vm.title))\n ]),\n _vm._v(\" \"),\n _vm.description && !_vm.showConfirmation\n ? _c(\"div\", {\n staticClass: \"cog-header__description\",\n domProps: { innerHTML: _vm._s(_vm.description) }\n })\n : _vm._e()\n ]\n )\n : _vm._e()\n ]\n )\n : _vm._e()\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Header.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Header.vue?vue&type=script&lang=js&\"","import api from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/sass-loader/dist/cjs.js!../../node_modules/sass-resources-loader/lib/loader.js??ref--4-oneOf-1-3!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Header.vue?vue&type=style&index=0&lang=scss&\";\n\nvar options = {\"attributes\":{\"class\":\"cog-style\"}};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import { render, staticRenderFns } from \"./Header.vue?vue&type=template&id=61dd7a3d&\"\nimport script from \"./Header.vue?vue&type=script&lang=js&\"\nexport * from \"./Header.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Header.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"C:\\\\a\\\\1\\\\s\\\\Cognito.Services\\\\client\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('61dd7a3d')) {\n api.createRecord('61dd7a3d', component.options)\n } else {\n api.reload('61dd7a3d', component.options)\n }\n module.hot.accept(\"./Header.vue?vue&type=template&id=61dd7a3d&\", function () {\n api.rerender('61dd7a3d', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"src/components/Header.vue\"\nexport default component.exports","var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return !_vm.virtual\n ? _c(\n _vm.paging ? \"transition\" : \"visible-transition\",\n _vm._g(\n _vm._b(\n { tag: \"component\" },\n \"component\",\n _vm.paging\n ? {\n name: \"cog-page\",\n duration: _vm.isIE ? 1000 : undefined\n }\n : null,\n false\n ),\n _vm.paging\n ? {\n \"before-enter\": _vm.beforeEnter,\n enter: _vm.onEnter,\n \"after-enter\": _vm.afterEnter\n }\n : null\n ),\n [\n _vm.current && _vm.canRender\n ? _c(\n \"div\",\n {\n ref: \"page\",\n staticClass: \"cog-page cog-wrapper\",\n class: \"cog-transition-\" + _vm.transition,\n attrs: {\n \"data-page\":\n _vm.hideNumber ||\n (_vm.isSubmission && _vm.visibleNumber === 1)\n ? false\n : _vm.visibleNumber\n }\n },\n [\n _vm._t(\"default\"),\n _vm._v(\" \"),\n (_vm.isSubmission || _vm.showSaveButton) &&\n !_vm.session.botValidation &&\n _vm.session.botChallenge\n ? _c(\"Captcha\", {\n ref: \"captcha\",\n attrs: { \"bot-challenge\": _vm.session.botChallenge },\n on: { validated: _vm.captchaValidated }\n })\n : _vm._e(),\n _vm._v(\" \"),\n (_vm.showNavigation && _vm.hasButtons && _vm.paging) ||\n (_vm.showNavigation && _vm.hasButtons && _vm.isSubmission)\n ? _c(\n \"div\",\n {\n ref: \"navigation\",\n staticClass: \"cog-page__navigation\",\n class: {\n \"cog-page__navigation--condensed\":\n _vm.navIsCondensed,\n \"is-being-measured\": _vm.measuringIfNavIsCondensed\n }\n },\n [\n _vm.showBackButton\n ? _c(\n \"c-button\",\n {\n staticClass:\n \"cog-button--secondary cog-button--navigation cog-button--back\",\n nativeOn: {\n click: function($event) {\n return _vm.$emit(\"back\")\n }\n },\n scopedSlots: _vm._u(\n [\n {\n key: \"icon\",\n fn: function() {\n return [_c(\"i-back\")]\n },\n proxy: true\n }\n ],\n null,\n false,\n 1215831692\n )\n },\n [\n _vm._v(\n \"\\n\\t\\t\\t\\t\" +\n _vm._s(_vm.avoidOrphans(_vm.backButton)) +\n \"\\n\\t\\t\\t\"\n )\n ]\n )\n : _vm._e(),\n _vm._v(\" \"),\n _vm.isSubmission && _vm.flags.workflowEnabled\n ? _vm._l(_vm.allowedActions, function(action) {\n return _c(\n \"c-status-button\",\n {\n key: action.ActionName,\n staticClass:\n \"cog-button--primary cog-button--navigation cog-button--submit\",\n attrs: {\n \"data-next\": \"\",\n \"data-action-name\": action.ActionName,\n type: \"submit\",\n status: _vm.getActionStatus(action)\n },\n nativeOn: {\n click: function($event) {\n $event.preventDefault()\n return _vm.handleSubmitClick($event)\n }\n }\n },\n [\n _vm._v(\n \"\\n\\t\\t\\t\\t\\t\" +\n _vm._s(\n _vm.avoidOrphans(action.ButtonText)\n ) +\n \"\\n\\t\\t\\t\\t\"\n )\n ]\n )\n })\n : _c(\n \"c-status-button\",\n {\n staticClass:\n \"cog-button--primary cog-button--navigation\",\n class: {\n \"cog-button--submit\": _vm.isSubmission,\n \"cog-button--next\": !_vm.isSubmission\n },\n attrs: {\n \"data-next\": \"\",\n type: _vm.nextButtonType,\n status: _vm.submitStatus\n },\n nativeOn: {\n click: function($event) {\n $event.preventDefault()\n _vm.isSubmission\n ? _vm.handleSubmitClick($event)\n : _vm.handleNext()\n }\n },\n scopedSlots: _vm._u(\n [\n !_vm.isSubmission\n ? {\n key: \"icon2\",\n fn: function() {\n return [_c(\"i-next\")]\n },\n proxy: true\n }\n : null\n ],\n null,\n true\n )\n },\n [\n _vm._v(\n \"\\n\\t\\t\\t\\t\" +\n _vm._s(\n _vm.isSubmission\n ? _vm.avoidOrphans(\n _vm.submitButtonText\n )\n : _vm.avoidOrphans(_vm.nextButton)\n ) +\n \"\\n\\t\\t\\t\"\n )\n ]\n ),\n _vm._v(\" \"),\n _vm.showSaveButton\n ? _c(\n \"c-status-button\",\n {\n staticClass:\n \"cog-button--save cog-button--secondary cog-button--navigation\",\n attrs: { status: _vm.saveStatus },\n nativeOn: {\n click: function($event) {\n return _vm.handleSave($event)\n }\n }\n },\n [_vm._v(_vm._s(_vm.saveButtonText))]\n )\n : _vm._e()\n ],\n 2\n )\n : _vm._e(),\n _vm._v(\" \"),\n _vm.showSubmissionWarning && _vm.isSubmission\n ? _c(\"div\", { staticClass: \"cog-submission-warning\" }, [\n _vm._v(\n _vm._s(_vm.$resource(\"public-submission-warning\"))\n )\n ])\n : _vm._e()\n ],\n 2\n )\n : _vm._e()\n ]\n )\n : _c(\n \"div\",\n {\n directives: [\n {\n name: \"show\",\n rawName: \"v-show\",\n value: false,\n expression: \"false\"\n }\n ]\n },\n [_vm._t(\"default\", null, { virtual: _vm.virtual })],\n 2\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n {\n directives: [\n {\n name: \"show\",\n rawName: \"v-show\",\n value: _vm.toggleRecaptcha,\n expression: \"toggleRecaptcha\"\n }\n ],\n staticClass: \"cog-row\"\n },\n [\n _c(\n \"div\",\n { staticClass: \"cog-field cog-col cog-col--12\" },\n [\n _vm.toggleRecaptcha\n ? _c(\"vue-recaptcha\", {\n ref: \"recaptcha\",\n attrs: {\n id: \"cog-recaptcha\",\n sitekey: \"6Le2FjcUAAAAAEr2XptT-aju23v2AMoHOR18ixHA\",\n \"load-recaptcha-script\": _vm.loadRecaptchaScript\n }\n })\n : _vm._e()\n ],\n 1\n )\n ]\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n","import mod from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Captcha.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Captcha.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Captcha.vue?vue&type=template&id=53ca310c&\"\nimport script from \"./Captcha.vue?vue&type=script&lang=js&\"\nexport * from \"./Captcha.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"C:\\\\a\\\\1\\\\s\\\\Cognito.Services\\\\client\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('53ca310c')) {\n api.createRecord('53ca310c', component.options)\n } else {\n api.reload('53ca310c', component.options)\n }\n module.hot.accept(\"./Captcha.vue?vue&type=template&id=53ca310c&\", function () {\n api.rerender('53ca310c', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"src/components/Captcha.vue\"\nexport default component.exports","import mod from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Page.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Page.vue?vue&type=script&lang=js&\"","\r\n\r\n\r\n\r\n","\n export default {\n functional: true,\n render: \n function render(_h, _vm) {\n var _c=_vm._c;return _c('svg',{staticClass:\"cog-icon cog-i-back\",class:[_vm.data.class, _vm.data.staticClass],style:([_vm.data.style, _vm.data.staticStyle]),attrs:{\"viewBox\":\"0 0 18 18\",\"focusable\":\"false\"}},[_c('g',[_c('g',{staticClass:\"cog-i-chevron\"},[_c('path',{attrs:{\"stroke-linecap\":\"square\",\"d\":\"M11.18 3.59L5.77 9l5.42 5.42\"}})])])])\n }\n \n }\n ","\n export default {\n functional: true,\n render: \n function render(_h, _vm) {\n var _c=_vm._c;return _c('svg',{staticClass:\"cog-icon cog-i-next\",class:[_vm.data.class, _vm.data.staticClass],style:([_vm.data.style, _vm.data.staticStyle]),attrs:{\"viewBox\":\"0 0 18 18\",\"focusable\":\"false\"}},[_c('g',[_c('g',{staticClass:\"cog-i-chevron\"},[_c('path',{attrs:{\"stroke-linecap\":\"square\",\"d\":\"M6.58 14.42L12 9 6.59 3.59\"}})])])])\n }\n \n }\n ","import api from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/sass-loader/dist/cjs.js!../../node_modules/sass-resources-loader/lib/loader.js??ref--4-oneOf-1-3!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Page.vue?vue&type=style&index=0&lang=scss&\";\n\nvar options = {\"attributes\":{\"class\":\"cog-style\"}};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import { render, staticRenderFns } from \"./Page.vue?vue&type=template&id=09512f3f&\"\nimport script from \"./Page.vue?vue&type=script&lang=js&\"\nexport * from \"./Page.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Page.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"C:\\\\a\\\\1\\\\s\\\\Cognito.Services\\\\client\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('09512f3f')) {\n api.createRecord('09512f3f', component.options)\n } else {\n api.reload('09512f3f', component.options)\n }\n module.hot.accept(\"./Page.vue?vue&type=template&id=09512f3f&\", function () {\n api.rerender('09512f3f', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"src/components/Page.vue\"\nexport default component.exports","var render = function() {\n var _obj\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _vm.render\n ? _c(\n _vm.fieldContainerType,\n {\n ref: \"field\",\n tag: \"component\",\n class: ((_obj = {\n \"cog-field\": !_vm.isTable,\n \"is-focus\": _vm.isFocused\n }),\n (_obj[\"cog-field--\" + _vm.fieldIndex] = _vm.fieldIndex),\n (_obj[\"cog-col \" + _vm.colNumClass] = !_vm.isTable),\n (_obj[\"cog-\" + _vm.type] = _vm.type),\n (_obj[_vm.subtypeClass] = _vm.subtype),\n (_obj[_vm.customClass] = _vm.customClass),\n (_obj[\"is-error\"] = _vm.showValidation && !_vm.containerOnly),\n (_obj[\"is-required\"] = _vm.$source.required),\n (_obj[\"cog-hidden-validation\"] = _vm.validationOnly),\n (_obj[\"cog-force-shown\"] = _vm.forceShown),\n _obj),\n attrs: { \"aria-hidden\": _vm.containerOnly }\n },\n [\n !_vm.validationOnly && !_vm.containerOnly\n ? [\n !_vm.isTable\n ? _c(\n _vm.labelType,\n {\n tag: \"label\",\n staticClass: \"cog-label\",\n class: { \"cog-offscreen\": !_vm.showLabel },\n attrs: {\n id:\n _vm.labelType === \"label\"\n ? \"cog-\" + _vm.$source.id + \"-label\"\n : false,\n for:\n _vm.labelType === \"label\"\n ? \"cog-\" + _vm.$source.id\n : false\n }\n },\n [\n _vm._v(\n \"\\n\\t\\t\\t\" +\n _vm._s(_vm._f(\"breakWords\")(_vm.$source.label))\n ),\n _vm.showAsterisk\n ? _c(\n \"span\",\n {\n staticClass: \"cog-asterisk\",\n attrs: { \"aria-hidden\": \"true\" }\n },\n [_vm._v(\"*\")]\n )\n : _vm._e(),\n _vm._v(\" \"),\n _vm.showAsterisk && !_vm.showValidation\n ? _c(\"span\", { staticClass: \"cog-offscreen\" }, [\n _vm._v(\n \"(\" +\n _vm._s(_vm.$resource(\"required-asterisk\")) +\n \")\"\n )\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _vm.showValidation\n ? _c(\"span\", { staticClass: \"cog-offscreen\" }, [\n _vm._v(\"(\" + _vm._s(_vm.firstError.message) + \")\")\n ])\n : _vm._e()\n ]\n )\n : _vm._e(),\n _vm._v(\" \"),\n _vm._t(\"default\", null, {\n field: _vm.$source,\n isTable: _vm.isTable,\n focusLost: _vm.handleFocusLost\n }),\n _vm._v(\" \"),\n !_vm.isTable &&\n (_vm.subtype !== \"checkboxes\" || _vm.subtype !== \"radiobuttons\")\n ? _c(\n \"div\",\n { staticClass: \"cog-field__placeholder cog-input\" },\n [\n _c(\n \"div\",\n { staticClass: \"cog-field__placeholder-inner\" },\n [_vm._v(\"\\n\\t\\t\\t\\t \\n\\t\\t\\t\")]\n )\n ]\n )\n : _vm._e(),\n _vm._v(\" \"),\n !_vm.isTable && _vm.$source.helptext && !_vm.$source.readonly\n ? _c(\"div\", {\n staticClass: \"cog-helptext cog-html\",\n domProps: { innerHTML: _vm._s(_vm.$source.helptext) }\n })\n : _vm._e()\n ]\n : _vm._e(),\n _vm._v(\" \"),\n !_vm.containerOnly\n ? _c(\"transition\", { attrs: { name: \"cog-error-message\" } }, [\n !_vm.duplicateError && _vm.showValidation\n ? _c(\n \"div\",\n {\n staticClass:\n \"cog-error-message cog-error-message--container-footer\"\n },\n [_vm._v(_vm._s(_vm.firstError.message))]\n )\n : _vm._e()\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _vm.isTable &&\n _vm.showValidation &&\n !_vm.containerOnly &&\n (!_vm.$source.readonly || _vm.isQuantityLimitError(_vm.firstError))\n ? _c(\n \"span\",\n {\n staticClass: \"cog-error-message__icon-container\",\n attrs: { title: _vm.firstError && _vm.firstError.message }\n },\n [_c(\"i-error\", { staticClass: \"cog-error-message__icon\" })],\n 1\n )\n : _vm._e()\n ],\n 2\n )\n : _vm._e()\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import api from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../node_modules/css-loader/index.js!../../node_modules/sass-loader/dist/cjs.js!../../node_modules/sass-resources-loader/lib/loader.js??ref--4-oneOf-1-3!./_field-placeholders.scss\";\n\nvar options = {\"attributes\":{\"class\":\"cog-style\"}};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Field.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Field.vue?vue&type=script&lang=js&\"","import api from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/sass-loader/dist/cjs.js!../../node_modules/sass-resources-loader/lib/loader.js??ref--4-oneOf-1-3!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Field.vue?vue&type=style&index=0&lang=scss&\";\n\nvar options = {\"attributes\":{\"class\":\"cog-style\"}};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import { render, staticRenderFns } from \"./Field.vue?vue&type=template&id=3a2f7ffa&\"\nimport script from \"./Field.vue?vue&type=script&lang=js&\"\nexport * from \"./Field.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Field.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"C:\\\\a\\\\1\\\\s\\\\Cognito.Services\\\\client\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('3a2f7ffa')) {\n api.createRecord('3a2f7ffa', component.options)\n } else {\n api.reload('3a2f7ffa', component.options)\n }\n module.hot.accept(\"./Field.vue?vue&type=template&id=3a2f7ffa&\", function () {\n api.rerender('3a2f7ffa', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"src/components/Field.vue\"\nexport default component.exports","/**\r\n * Use to render \"nothing\" (results in an HTML comment node)\r\n */\r\nexport default {\r\n\tname: 'CVoid',\r\n\trender (h) {\r\n\t\treturn h();\r\n\t}\r\n};","var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n { staticClass: \"cog-choice\" },\n [\n _vm._t(\"default\", null, { options: _vm.options }),\n _vm._v(\" \"),\n !_vm.$parent.isTable\n ? _c(\n \"div\",\n {\n staticClass: \"cog-choice__placeholder\",\n class: [\n { \"cog-input\": !_vm.checkable },\n _vm.checkable && _vm.columns\n ? \"cog-inner-col cog-inner-col--css-columns cog-inner-col--\" +\n _vm.columns\n : null\n ]\n },\n [\n _vm.checkable\n ? _c(\n \"div\",\n [\n _vm._l(_vm.choices, function(choice, i) {\n return _c(\n \"div\",\n {\n key: i,\n staticClass: \"cog-choice__checkable-placeholder\",\n class: _vm.columns ? \"cog-inner-col__item\" : null\n },\n [_c(\"span\", [_vm._v(_vm._s(choice))])]\n )\n }),\n _vm._v(\" \"),\n _vm.allowOther\n ? _c(\n \"div\",\n {\n staticClass: \"cog-choice__allow-other-placeholder\"\n },\n [\n _c(\n \"div\",\n { staticClass: \"cog-field__placeholder-inner\" },\n [_vm._v(\" \")]\n )\n ]\n )\n : _vm._e()\n ],\n 2\n )\n : _c(\n \"div\",\n {\n staticClass: \"cog-field__placeholder-inner\",\n class: _vm.columns ? \"cog-inner-col__item\" : null\n },\n [_vm._v(\"\\n\\t\\t\\t \\n\\t\\t\")]\n )\n ]\n )\n : _vm._e()\n ],\n 2\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import mod from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Choice.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Choice.vue?vue&type=script&lang=js&\"","\r\n\r\n\r\n\r\n","import api from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/sass-loader/dist/cjs.js!../../node_modules/sass-resources-loader/lib/loader.js??ref--4-oneOf-1-3!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Choice.vue?vue&type=style&index=0&lang=scss&\";\n\nvar options = {\"attributes\":{\"class\":\"cog-style\"}};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import { render, staticRenderFns } from \"./Choice.vue?vue&type=template&id=0bea4b51&\"\nimport script from \"./Choice.vue?vue&type=script&lang=js&\"\nexport * from \"./Choice.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Choice.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"C:\\\\a\\\\1\\\\s\\\\Cognito.Services\\\\client\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('0bea4b51')) {\n api.createRecord('0bea4b51', component.options)\n } else {\n api.reload('0bea4b51', component.options)\n }\n module.hot.accept(\"./Choice.vue?vue&type=template&id=0bea4b51&\", function () {\n api.rerender('0bea4b51', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"src/components/Choice.vue\"\nexport default component.exports","var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", {\n staticClass: \"cog-section__placeholder\",\n attrs: { \"data-placeholder\": \"true\" }\n })\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./SectionPlaceholder.vue?vue&type=template&id=28c3887e&\"\nvar script = {}\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"C:\\\\a\\\\1\\\\s\\\\Cognito.Services\\\\client\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('28c3887e')) {\n api.createRecord('28c3887e', component.options)\n } else {\n api.reload('28c3887e', component.options)\n }\n module.hot.accept(\"./SectionPlaceholder.vue?vue&type=template&id=28c3887e&\", function () {\n api.rerender('28c3887e', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"src/components/SectionPlaceholder.vue\"\nexport default component.exports","let cssVars = null;\r\nlet ponyfill = null;\r\nconst callBacks = [];\r\nconst promise = (process.env.IS_LEGACY ? import(/* webpackChunkName: \"css-vars-polyfill\" */'css-vars-ponyfill').then(module => (ponyfill = module.default)) : null);\r\n\r\nfunction harvestCssVars() {\r\n\tif (!cssVars) {\r\n\t\t// Only grab the first instance of css vars since we do not support using this polyfill on multiple differently-styled forms.\r\n\t\t// Extract everything inside the top level selector block and construct an object map of the declarations.\r\n\t\tconst regex = /\\{(.+?)\\}/;\r\n\t\tcssVars = regex.exec(document.querySelector('.cog-css-variables').innerHTML.replace(/https:/g, 'https__COLON__'))[1] // 1 corresponds to the first match group\r\n\t\t\t.split(';')\r\n\t\t\t.slice(0, -1)\r\n\t\t\t.map(declaration => declaration.split(':').map(part => part.trim()))\r\n\t\t\t.reduce((map, [property, value]) => {\r\n\t\t\t\tmap[property] = value.replace('https__COLON__', 'https:');\r\n\t\t\t\treturn map;\r\n\t\t\t}, {});\r\n\t}\r\n}\r\n\r\nfunction undoPonyfill() {\r\n\tdocument.querySelectorAll('[data-cssvars=\"out\"]').forEach(style => style.parentElement.removeChild(style));\r\n\tdocument.querySelectorAll('[data-cssvars]').forEach(style => {\r\n\t\tstyle.removeAttribute('data-cssvars');\r\n\t\tstyle.removeAttribute('data-cssvars-job');\r\n\t\tstyle.removeAttribute('data-cssvars-group');\r\n\t\tstyle.removeAttribute('disabled');\r\n\t});\r\n}\r\n\r\nexport async function processCssVars({ cleanSlate }: { cleanSlate: boolean }) {\r\n\tif (!promise)\r\n\t\treturn;\r\n\r\n\tif (cleanSlate) {\r\n\t\tcssVars = null;\r\n\t\tundoPonyfill();\r\n\t}\r\n\r\n\t// Create JS object from CSS variables\r\n\tharvestCssVars();\r\n\r\n\tif (!ponyfill)\r\n\t\tawait promise;\r\n\r\n\tponyfill({\r\n\t\tinclude: '.cog-style',\r\n\t\tvariables: cssVars,\r\n\t\tonComplete: (_cssText, _styleNodes, _cssVariables) => {\r\n\t\t\t// in legacy browsers, we need to trigger resize after css vars are polyfilled since that affects size/layout\r\n\t\t\tconst evt = document.createEvent('UIEvents');\r\n\t\t\tevt.initUIEvent('resize', true, false, window, 0);\r\n\t\t\twindow.dispatchEvent(evt);\r\n\t\t\t// disable processed styles because of strange behavior in IE. Cf. 19849\r\n\t\t\tconst processedStyles = document.querySelectorAll('.cog-style[data-cssvars=\"src\"]:not([disabled])') as NodeListOf;\r\n\t\t\tfor (let i = 0; processedStyles.length > i; i++)\r\n\t\t\t\tprocessedStyles[i].disabled = true;\r\n\r\n\t\t\tcallBacks.forEach((cb) => cb());\r\n\t\t}\r\n\t});\r\n}\r\n\r\nexport default {\r\n\tmethods: {\r\n\t\tsetPolyFillCallBack(fn : Function) {\r\n\t\t\tcallBacks.push(fn);\r\n\t\t}\r\n\t},\r\n\tasync mounted() {\r\n\t\tif (promise && this.$el.classList && document.querySelector('.cog-style:not([data-cssvars])'))\r\n\t\t\tprocessCssVars({ cleanSlate: false });\r\n\t}\r\n};","export type LazyImport = () => Promise;\r\n\r\nexport async function importWithRetry(getImport: LazyImport): Promise {\r\n\tif (window.navigator.onLine) {\r\n\t\ttry {\r\n\t\t\treturn await getImport();\r\n\t\t}\r\n\t\tcatch {\r\n\t\t\treturn importWithRetry(getImport);\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\treturn new Promise(resolve => {\r\n\t\t\twindow.addEventListener('online', () => resolve(importWithRetry(getImport)), { once: true });\r\n\t\t});\r\n\t}\r\n}\r\n","import Vue from 'vue';\r\nimport VueModel, { CultureInfo } from '@cognitoforms/vuemodel';\r\nimport Header from './Header.vue';\r\nimport Row from './Row.vue';\r\nimport Col from './Col.vue';\r\nimport Page from './Page.vue';\r\nimport Field from './Field.vue';\r\nimport Void from './Void';\r\nimport Choice from './Choice.vue';\r\nimport SectionPlaceholder from './SectionPlaceholder.vue';\r\nimport scrollIntoView from 'src/util/scroll-into-view';\r\nimport cssVars from '../mixins/css-vars';\r\nimport VisibleTransition from './VisibleTransition.vue';\r\nimport Component, { mixins } from 'vue-class-component';\r\nimport { Prop, Provide, Watch } from 'vue-property-decorator';\r\nimport { FormEvents, NavigationDirection, BeforeNavigateEventData, AfterNavigateEventData, ReadyEventData, BeforeSubmitEventData, AfterSubmitEventData, UploadFileEventData, AllowedActionsChangedEventData, OrderUpdatedEventData, ActionChangedEventData } from '../framework/public/events';\r\nimport FileService from 'src/web-api/file-service';\r\nimport { ObjectLookup, parseUrlHash } from 'src/util';\r\nimport { FormEventScope } from 'src/framework/eventing/form-event-scope';\r\nimport { FormEvent } from 'src/framework/eventing/form-event';\r\nimport { EntryService, EntrySubmissionResult, SubmissionResultStatus } from 'src/web-api/entry-service';\r\nimport { FileDataRef } from 'src/server-types/model/file-data-ref';\r\nimport { FormStatus } from 'src/mixins/form-status';\r\nimport { FormsModel } from 'src/framework/forms-model';\r\n// Just importing the type\r\nimport EntryViewService from 'src/web-api/entry-views/entry-view-service';\r\nimport ToastMessage, { closeAllToastMessages, onToastMessageRequested } from './ToastMessage';\r\nimport { FormSession } from 'src/web-api/form-session';\r\nimport QuantityService from 'src/web-api/quantity-service';\r\nimport { binaryInsert } from 'src/util/array';\r\nimport { ElMessageOptions } from '@cognitoforms/element-ui/types/message';\r\nimport { Order } from 'src/server-types/payment/model/order';\r\nimport { FormEntry } from 'src/server-types/forms/model/form-entry';\r\nimport { PaymentToken } from 'src/server-types/payment/model/payment-token';\r\nimport { enableResizeDetection } from './form-resizing';\r\nimport { isDeviceType, isSafari, safariVersion } from 'src/util/user-agent';\r\nimport Log from '../framework/logging/log';\r\nimport { CaptchaError, InvalidSharedLinkError, PublicLinksDisabledError } from 'src/web-api/base-service';\r\nimport { AuthenticationCompleteEvent } from 'src/framework/payment/payment-types';\r\nimport { WorkflowAction } from 'src/server-types/forms/model/workflow-action';\r\nimport { ConcurrentEntryConflict } from 'src/web-api/concurrent-entry-service';\r\nimport { rebuildOrder } from 'src/framework/payment/order-builder';\r\nimport { LazyImport, importWithRetry } from 'src/util/retryable-import';\r\nimport ResizeObserver from 'resize-observer-polyfill';\r\n\r\nif (process.env.IS_LEGACY)\r\n\tVue.mixin(cssVars);\r\n\r\n// Used in all forms, safe to always include\r\nVue.component('CHeader', Header);\r\nVue.component('CRow', Row);\r\nVue.component('CCol', Col);\r\nVue.component('CPage', Page);\r\nVue.component('CField', Field);\r\nVue.component('CVoid', Void);\r\nVue.component('VisibleTransition', VisibleTransition);\r\n\r\n// Not in every form but small and including here\r\n// helps in determining loading placeholder height.\r\nVue.component('CChoice', Choice);\r\n\r\nconst _asyncComponentImports = new Set>();\r\nfunction registerAsyncComponent(getImport: LazyImport) {\r\n\tconst importPromise = importWithRetry(getImport);\r\n\t_asyncComponentImports.add(importPromise);\r\n\treturn importPromise;\r\n}\r\n\r\nexport type ThemeData = {\r\n\theaderLayout: string;\r\n\theaderAlignment: string;\r\n\tlogo: string;\r\n\tlogoAlt: string,\r\n\tisChameleon: boolean\r\n}\r\n\r\n@Component({\r\n\t// @ts-ignore\r\n\tname: 'CForm',\r\n\tcomponents: {\r\n\t\t/**\r\n\t\t * The components below represent what can/should appear in a form template generated by the server.\r\n\t\t **/\r\n\t\tCGoogleAnalytics: () => registerAsyncComponent(() => import(/* webpackChunkName: \"GoogleAnalytics\" */ './analytics/GoogleAnalytics')),\r\n\t\tCTrackingPixel: () => registerAsyncComponent(() => import(/* webpackChunkName: \"TrackingPixel\" */ './analytics/TrackingPixel')),\r\n\t\tCPageProgress: () => registerAsyncComponent(() => import(/* webpackChunkName: \"PageProgress\" */ './PageProgress.vue')),\r\n\t\tCRepeatingSection: () => ({\r\n\t\t\tcomponent: registerAsyncComponent(() => import(/* webpackChunkName: \"RepeatingSection\" */ './RepeatingSection.vue')),\r\n\t\t\tloading: SectionPlaceholder,\r\n\t\t\tdelay: 0\r\n\t\t}),\r\n\t\tCTable: () => ({\r\n\t\t\tcomponent: registerAsyncComponent(() => import(/* webpackChunkName: \"Table\" */ './Table.vue')),\r\n\t\t\tloading: SectionPlaceholder,\r\n\t\t\tdelay: 0\r\n\t\t}),\r\n\t\tCSection: () => ({\r\n\t\t\tcomponent: registerAsyncComponent(() => import(/* webpackChunkName: \"Section\" */ './Section.vue')),\r\n\t\t\tloading: SectionPlaceholder,\r\n\t\t\tdelay: 0\r\n\t\t}),\r\n\t\tCRatingScale: () => ({\r\n\t\t\tcomponent: registerAsyncComponent(() => import(/* webpackChunkName: \"RatingScale\" */ './RatingScale.vue')),\r\n\t\t\tloading: SectionPlaceholder,\r\n\t\t\tdelay: 0\r\n\t\t}),\r\n\t\tCContent: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Content\" */ './Content.vue')),\r\n\t\tCInput: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Input\" */ './Input.vue')),\r\n\t\tCInvalidForm: () => registerAsyncComponent(() => import(/* webpackChunkName: \"InvalidForm\" */ './InvalidForm.vue')),\r\n\t\tCNumberDropdown: () => registerAsyncComponent(() => import(/* webpackChunkName: \"NumberDropdown\" */ './NumberDropdown.vue')),\r\n\t\tCName: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Name\" */ './Name.vue')),\r\n\t\tCAddress: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Address\" */ './Address.vue')),\r\n\t\tCSpinner: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Spinner\" */ './Spinner.vue')),\r\n\t\tCSelect: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Select\" */ './Select.vue')),\r\n\t\tCDate: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Date\" */ './Date.vue')),\r\n\t\tCTime: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Time\" */ './Time.vue')),\r\n\t\tCCheckboxGroup: () => registerAsyncComponent(() => import(/* webpackChunkName: \"CheckboxGroup\" */ './CheckboxGroup.vue')),\r\n\t\tCCheckbox: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Checkbox\" */ './Checkbox.vue')),\r\n\t\tCRadioGroup: () => registerAsyncComponent(() => import(/* webpackChunkName: \"RadioGroup\" */ './RadioGroup.vue')),\r\n\t\tCOrder: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Order\" */ './Order/Order.vue')),\r\n\t\tCOrderDetails: () => registerAsyncComponent(() => import(/* webpackChunkName: \"OrderDetails\" */ './Order/OrderDetails.vue')),\r\n\t\tCPayment: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Payment\" */ './Payment/Payment.vue')),\r\n\t\tCBillingInfo: () => registerAsyncComponent(() => import(/* webpackChunkName: \"BillingInfo\" */ './Order/BillingInfo.vue')),\r\n\t\tCTransactionDetails: () => registerAsyncComponent(() => import(/* webpackChunkName: \"TransactionDetails\" */ './Order/TransactionDetails.vue')),\r\n\t\tCToggle: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Toggle\" */ './Toggle.vue')),\r\n\t\tCSignature: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Signature\" */ './Signature.vue')),\r\n\t\tCUpload: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Upload\" */ './Upload.vue')),\r\n\t\tCSaveResumeDialog: () => registerAsyncComponent(() => import(/* webpackChunkName: \"SaveResumeDialog\" */ './SaveResumeDialog.vue')),\r\n\t\tCBranding: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Branding\" */ './Branding.vue')),\r\n\t\tCAbuse: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Abuse\" */ './Abuse.vue')),\r\n\t\tCConfirmation: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Confirmation\" */ './Confirmation.vue')),\r\n\t\tCLookup: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Lookup\" */ './Lookup.vue')),\r\n\t\tCCascadeFilter: () => registerAsyncComponent(() => import(/* webpackChunkName: \"CascadeFilter\" */ './CascadeFilter.vue')),\r\n\t\tCWebsite: () => registerAsyncComponent(() => import(/* webpackChunkName: \"Website\" */ './Website.vue'))\r\n\t}\r\n})\r\nexport default class FormBase extends mixins(VueModel.mixins.SourceRoot) {\r\n\t@Provide()\r\n\tget form() {\r\n\t\treturn this;\r\n\t}\r\n\r\n\t@Prop()\r\n\tentry: FormEntry;\r\n\r\n\t@Provide()\r\n\tget flags() {\r\n\t\treturn this.session.flags;\r\n\t}\r\n\r\n\t@Provide('formEvents')\r\n\t@Prop({ default: () => new FormEventScope() })\r\n\tpublicEvents: FormEventScope;\r\n\r\n\t@Prop()\r\n\tfileService: FileService;\r\n\r\n\t@Prop()\r\n\tentryService: EntryService;\r\n\r\n\t@Prop()\r\n\t@Provide()\r\n\tlog: Log;\r\n\r\n\t@Prop()\r\n\t@Provide()\r\n\tformsModel: FormsModel;\r\n\r\n\t@Prop()\r\n\tentryToken: string;\r\n\r\n\t@Prop()\r\n\tchameleon: boolean;\r\n\r\n\t@Prop()\r\n\t@Provide()\r\n\tentryViewService: EntryViewService;\r\n\r\n\t@Prop()\r\n\t@Provide()\r\n\tquantityService: QuantityService;\r\n\r\n\t@Prop()\r\n\t@Provide()\r\n\tsession: FormSession;\r\n\r\n\t@Prop({ default: 1 })\r\n\tstartingPage: number;\r\n\r\n\t@Prop({ default: true })\r\n\tavailable: boolean;\r\n\r\n\t@Prop()\r\n\t@Provide()\r\n\t$resource: (name: string, params?: ObjectLookup) => string;\r\n\r\n\t@Prop()\r\n\t@Provide()\r\n\t$format: (value: number | Date, format: string) => string;\r\n\r\n\t@Prop()\r\n\t@Provide()\r\n\t$parse: (type: NumberConstructor | DateConstructor, value: string, format?: string) => number | Date;\r\n\r\n\t@Prop()\r\n\t@Provide()\r\n\t$culture: CultureInfo;\r\n\r\n\t@Prop()\r\n\t@Provide()\r\n\t$namespace: object;\r\n\r\n\t@Prop()\r\n\t@Provide()\r\n\t$expandDateFormat: (format: string) => string;\r\n\r\n\tinternalEntryToken: string;\r\n\tisTable = false;\r\n\tshowConfirmation = false;\r\n\tshowReceipt = false;\r\n\tentryDetailsVisible = false;\r\n\tshowNavigation = true;\r\n\tpages = [];\r\n\tfields = [];\r\n\tpageNumber = 1;\r\n\tsaveStatus: FormStatus = FormStatus.Default;\r\n\tsubmitStatus: FormStatus = FormStatus.Default;\r\n\thostingPageUrl = location.href;\r\n\tsaveResumeInfo = {\r\n\t\topen: false,\r\n\t\tmessage: '',\r\n\t\temailMessage: '',\r\n\t\tlink: '',\r\n\t\temailStatus: FormStatus.Default,\r\n\t\temailAddress: '',\r\n\t\tenableSend: true\r\n\t};\r\n\r\n\tpaymentError = '';\r\n\tdocuments = null;\r\n\r\n\tfocusPlace = null;\r\n\theaderRef: Vue;\r\n\tbodyRef: HTMLElement;\r\n\t_keydownListener = null;\r\n\tenforceValidation = true;\r\n\tpageTransitioning = false;\r\n\tthemeSettings: ThemeData = {\r\n\t\tlogo: null,\r\n\t\tlogoAlt: '',\r\n\t\theaderLayout: '',\r\n\t\theaderAlignment: '',\r\n\t\tisChameleon: null\r\n\t};\r\n\r\n\tdisableTransitions = false;\r\n\tresizeObserver = new ResizeObserver(() => this.handleResize());\r\n\r\n\tfieldsChanging = false;\r\n\tfieldsChangingTimeout;\r\n\r\n\twithTransitionsDisabled(cb: (form: FormBase) => Promise | void): Promise {\r\n\t\treturn new Promise(resolve => {\r\n\t\t\tthis.disableTransitions = true;\r\n\t\t\tthis.$nextTick(async () => {\r\n\t\t\t\tawait cb(this);\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\trequestAnimationFrame(() => {\r\n\t\t\t\t\t\tthis.disableTransitions = false;\r\n\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t});\r\n\t\t\t\t}, 1);\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tget actions(): WorkflowAction[] {\r\n\t\treturn this.entry.Workflow_Actions || [];\r\n\t}\r\n\r\n\tget allowedActions(): WorkflowAction[] {\r\n\t\treturn this.entry.Allowed_Actions || [];\r\n\t}\r\n\r\n\tget action(): WorkflowAction {\r\n\t\tif (this.entry.Entry.Action) {\r\n\t\t\treturn this.actions.find(a => a.ActionName === this.entry.Entry.Action);\r\n\t\t}\r\n\t}\r\n\r\n\t@Watch('submitStatus')\r\n\tsubmitStatusWatcher() {\r\n\t\tthis.entry.Action_IsLocked = this.submitStatus !== FormStatus.Default;\r\n\t}\r\n\r\n\t@Watch('allowedActions', { immediate: true })\r\n\tallowedActionWatcher() {\r\n\t\t// When allowed actions change, let the form handle know (for the entries page)\r\n\t\tthis.publicEvents.emit(new FormEvent(FormEvents.AllowedActionsChanged, {\r\n\t\t\tallowedActions: this.allowedActions.map(a => a.serialize())\r\n\t\t}));\r\n\t}\r\n\r\n\t@Watch('action')\r\n\tactionWatcher() {\r\n\t\t// When the action changes, let the form handle know (for the entries page)\r\n\t\tthis.publicEvents.emit(new FormEvent(FormEvents.ActionChanged, {\r\n\t\t\taction: this.action ? this.action.serialize() : null\r\n\t\t}));\r\n\t}\r\n\r\n\t@Watch('fields')\r\n\tfieldsWatcher() {\r\n\t\tthis.fieldsChanging = true;\r\n\t\tif (this.fieldsChangingTimeout)\r\n\t\t\tclearTimeout(this.fieldsChangingTimeout);\r\n\t\tthis.fieldsChangingTimeout = setTimeout(() => {this.fieldsChanging = false;}, 250);\r\n\t}\r\n\r\n\tget order() {\r\n\t\treturn this.entry.Order as Order;\r\n\t}\r\n\r\n\tget entity() {\r\n\t\treturn this.entry;\r\n\t}\r\n\r\n\tget showAllPages() {\r\n\t\treturn !this.showNavigation || (this.showNavigation && this.showConfirmation && this.entryDetailsVisible);\r\n\t}\r\n\r\n\tget visiblePages() {\r\n\t\treturn this.pages.filter(page => page && page.visible);\r\n\t}\r\n\r\n\tget visiblePageNumber() {\r\n\t\treturn Math.max(this.visiblePages.indexOf(this.currentPage) + 1, 1);\r\n\t}\r\n\r\n\tget lastVisiblePageNumber() {\r\n\t\tif (this.visiblePages[this.visiblePages.length - 1])\r\n\t\t\treturn this.visiblePages[this.visiblePages.length - 1].number;\r\n\t\telse\r\n\t\t\treturn 0;\r\n\t}\r\n\r\n\tget enablePaging() {\r\n\t\tthis.disableTransitions = true;\r\n\t\tsetTimeout(() => {\r\n\t\t\tthis.disableTransitions = false;\r\n\t\t}, 50);\r\n\r\n\t\treturn this.session.flags.paging && !this.isReadonly;\r\n\t}\r\n\r\n\tget currentPage() {\r\n\t\treturn this.pages.length && !this.showConfirmation\r\n\t\t\t? this.pages[this.pageNumber]\r\n\t\t\t: {};\r\n\t}\r\n\r\n\t// Pages is 1-based (so the first page is at index 1)\r\n\tget isMultiPage() {\r\n\t\treturn this.pages.length > 2;\r\n\t}\r\n\r\n\t/**\r\n\t * Will always be the very last page, visible or not.\r\n\t */\r\n\tget submissionPage() {\r\n\t\treturn this.pages[this.pages.length - 1];\r\n\t}\r\n\r\n\t/**\r\n\t * Are we on the last visible page?\r\n\t */\r\n\tget onLastPage() {\r\n\t\treturn this.pages.slice(this.pageNumber + 1).every(p => !p.visible) || !this.enablePaging;\r\n\t}\r\n\r\n\tget hasPreviousPage() {\r\n\t\treturn this.pages.slice(0, this.pageNumber).some(p => p.visible);\r\n\t}\r\n\r\n\tget nextButton() {\r\n\t\treturn this.onLastPage && this.submissionPage ? this.submissionPage.nextButton : this.currentPage.nextButton;\r\n\t}\r\n\r\n\tget paymentRedirectUrl() {\r\n\t\t// eslint-disable-next-line eqeqeq\r\n\t\tif (this.order && (!this.order.PaymentStatus || this.order.PaymentStatus == 'Unpaid') && this.order.PaymentURL)\r\n\t\t\treturn this.order.PaymentURL;\r\n\t\treturn '';\r\n\t}\r\n\r\n\tget isExistingEntry() {\r\n\t\treturn !!this.entry.Id;\r\n\t}\r\n\r\n\tget showOrder() {\r\n\t\t// For workflow forms, show the order when it is open or when it has just been paid or when the order has been paid and is readonly\r\n\t\tif (this.flags.workflowEnabled) {\r\n\t\t\tif (this.showConfirmation)\r\n\t\t\t\treturn this.showReceipt && !!this.order.LineItems.length;\r\n\t\t\telse {\r\n\t\t\t\tconst readonlyAndPaid = !this.order.IsOpen && this.readonly;\r\n\t\t\t\treturn !this.flags.forceHideOrder && this.order && (this.order.IsOpen || readonlyAndPaid || this.showReceipt);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// For non-workflow forms, the order should always be shown. Whether it's readonly or not will be determined by this.readonly\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Determines whether the order is in readonly mode or not\r\n\t */\r\n\tget orderInReadonlyMode() {\r\n\t\tif (this.flags.workflowEnabled)\r\n\t\t\t// Workflow forms should show the order in readonly mode when the order is closed\r\n\t\t\treturn !this.order.IsOpen;\r\n\t\telse\r\n\t\t\t// Non-WF forms should show the order in readonly mode when the form is readonly\r\n\t\t\treturn this.readonly;\r\n\t}\r\n\r\n\tget processPayment() {\r\n\t\tconst orderExists = this.order && this.order.IsOpen;\r\n\t\tconst shouldSaveCard = this.flags.saveCustomerCard && this.entry.Save_Customer_Card && !!this.entry.Billing_Email_Field;\r\n\t\tconst shouldCollectPayment = this.entry.Require_Payment && this.order.AmountPaid === 0 && this.order.OrderAmount > 0 && this.isActionPayable(this.action);\r\n\r\n\t\treturn Boolean(orderExists && (shouldSaveCard || shouldCollectPayment));\r\n\t}\r\n\r\n\t/**\r\n\t * An action is not considered payable if the entry is incomplete and the action does not change the status.\r\n\t */\r\n\tprivate isActionPayable(action) {\r\n\t\treturn !this.flags.workflowEnabled || (this.flags.workflowEnabled && action && action.NewStatus !== 0 && !(action.NewStatus == null && this.entry.Entry.Status === 'Incomplete'));\r\n\t}\r\n\r\n\tget hasPayableAction() {\r\n\t\treturn !this.showConfirmation && (this.flags.workflowEnabled ? this.allowedActions.some(a => this.isActionPayable(a)) : true);\r\n\t}\r\n\r\n\tget shouldSaveAndRedirectPayment() {\r\n\t\treturn Boolean(this.processPayment && this.flags.paypal && this.entry.Payment_Processor_Name === 'PayPal');\r\n\t}\r\n\r\n\tget isChameleon() {\r\n\t\tif (typeof this.themeSettings.isChameleon === 'boolean')\r\n\t\t\treturn this.themeSettings.isChameleon;\r\n\t\treturn this.chameleon;\r\n\t}\r\n\r\n\t@Watch('isReadonly')\r\n\treadonlyChangedTemp() {\r\n\t\tif (this.readonly !== this.isReadonly)\r\n\t\t\tthis.readonly = this.isReadonly;\r\n\t}\r\n\r\n\t@Watch('$source')\r\n\tsourceRootChanged() {\r\n\t\tthis.$source.readonly = this.session.isReadonly || this.readonly || this.showConfirmation || this.entry.Form_ReadOnly;\r\n\t\tthis.showReceipt = false;\r\n\t}\r\n\r\n\t@Watch('order.Rebuild_Count')\r\n\torderModified() {\r\n\t\tif (this.order)\r\n\t\t\tthis.publicEvents.emit(new FormEvent(FormEvents.OrderUpdated, {\r\n\t\t\t\torder: this.order.serialize()\r\n\t\t\t}));\r\n\t}\r\n\r\n\t/**\r\n\t * Returns true if the form is effectively readonly.\r\n\t */\r\n\tget isReadonly() {\r\n\t\treturn this.session.isReadonly || this.$source.readonly;\r\n\t}\r\n\r\n\t// Make the source readonly when either the readonly or showConfirmation properties are true\r\n\t@Watch('readonly')\r\n\treadonlyChanged() {\r\n\t\tthis.$source.readonly = this.session.isReadonly || this.readonly || this.showConfirmation;\r\n\r\n\t\tif (!this.flags.workflowEnabled)\r\n\t\t\tthis.showNavigation = !this.$source.readonly;\r\n\t}\r\n\r\n\t// Make the source readonly when either the readonly or showConfirmation properties are true\r\n\t@Watch('showConfirmation')\r\n\tshowConfirmationChanged() {\r\n\t\tthis.$source.readonly = this.session.isReadonly || this.readonly || this.showConfirmation;\r\n\t\tthis.readonly = this.session.isReadonly || this.$source.readonly;\r\n\t}\r\n\r\n\t@Watch('pageNumber')\r\n\tpageNumberChanged(newNumber, oldNumber) {\r\n\t\tcloseAllToastMessages();\r\n\t\t// auto save after page navigation\r\n\t\tthis.autoSave();\r\n\r\n\t\tthis.publicEvents.emit(new FormEvent(FormEvents.AfterNavigate, {\r\n\t\t\tentry: this.entry.serialize(),\r\n\t\t\tdirection: newNumber > oldNumber ? NavigationDirection.Forward : NavigationDirection.Backward,\r\n\t\t\tsourcePage: {\r\n\t\t\t\ttitle: this.pages[oldNumber].title,\r\n\t\t\t\tnumber: oldNumber,\r\n\t\t\t\tname: 'page' + oldNumber\r\n\t\t\t},\r\n\t\t\tdestinationPage: {\r\n\t\t\t\ttitle: this.currentPage.title,\r\n\t\t\t\tnumber: newNumber,\r\n\t\t\t\tname: 'page' + newNumber\r\n\t\t\t}\r\n\t\t}));\r\n\t}\r\n\r\n\t@Watch('entry.Form_ReadOnly', { immediate: true })\r\n\tcheckFormReadOnly() {\r\n\t\tif (this.flags.workflowEnabled && this.entry.Form_ReadOnly !== undefined)\r\n\t\t\tthis.$source.readonly = this.readonly = this.session.isReadonly || this.entry.Form_ReadOnly;\r\n\t}\r\n\r\n\thandleEntryDetailsVisibility(entryDetailsVisible: boolean) {\r\n\t\tthis.entryDetailsVisible = entryDetailsVisible;\r\n\t}\r\n\r\n\thandleSubmit(event: Event) {\r\n\t\tconst submitButton = (event.target as HTMLElement).closest('[type=\"submit\"]');\r\n\t\tconst onLastField = document.activeElement === this.getLastFieldElement();\r\n\t\tconst onSubmitButton = submitButton.contains(document.activeElement) || (isSafari(window.navigator) && document.activeElement === this.$el);\r\n\r\n\t\tif (onLastField || onSubmitButton) {\r\n\t\t\tconst actionName = this.flags.workflowEnabled ? submitButton.getAttribute('data-action-name') : null;\r\n\t\t\tthis.navigate({ forward: true, validateCaptcha: this.currentPage.getCaptchaValidator(), action: actionName });\r\n\t\t}\r\n\t}\r\n\r\n\tregisterPage(page) {\r\n\t\tVue.set(this.pages, page.number, page);\r\n\t}\r\n\r\n\tunregisterPage(page) {\r\n\t\tVue.set(this.pages, page.number, null);\r\n\t}\r\n\r\n\tregisterField(field) {\r\n\t\tbinaryInsert(this.fields, field, f => f.pageNumber);\r\n\t}\r\n\r\n\tunregisterField(field) {\r\n\t\tconst index = this.fields.indexOf(field);\r\n\t\tthis.fields.splice(index, 1);\r\n\t}\r\n\r\n\tunsubscribeFromToastRequests: Function;\r\n\tcreated() {\r\n\t\tthis.enforceValidation = !this.flags.disableValidation;\r\n\t\tthis.disableTransitions = true;\r\n\t\tthis.readonlyChanged();\r\n\t\twindow.addEventListener('beforeprint', this.handlePrint);\r\n\t\twindow.addEventListener('offline', this.handleOffline);\r\n\r\n\t\tthis.unsubscribeFromToastRequests = onToastMessageRequested((formId, _message) => {\r\n\t\t\tif (formId === this.session.formId)\r\n\t\t\t\tthis.publicEvents.emit(new FormEvent(FormEvents.ScrollToTop));\r\n\t\t});\r\n\t}\r\n\r\n\tmounted() {\r\n\t\tthis.log && this.log.pageLoad();\r\n\t\tif (safariVersion(window.navigator) && safariVersion(window.navigator) < 14.5)\r\n\t\t\tthis.$el.setAttribute('data-old-safari', 'true');\r\n\r\n\t\t// These refs are resolvable immediately because they are not async components\r\n\t\tthis.headerRef = this.$refs.header as Vue;\r\n\t\tthis.bodyRef = this.$refs.body as HTMLElement;\r\n\r\n\t\tthis.resizeObserver.observe(this.$el);\r\n\r\n\t\tif (this.flags.embedded) {\r\n\t\t\tthis.hostingPageUrl = window.location.href;\r\n\t\t\tthis.publicEvents.once(FormEvents.CaptureHost, e => (this.hostingPageUrl = e.data.url));\r\n\t\t\tenableResizeDetection(this);\r\n\t\t}\r\n\r\n\t\t// When the form has been completely rendered, emit the ready event\r\n\t\tthis.$nextTick(async () => {\r\n\t\t\tawait this.waitForFieldsToUpdate();\r\n\t\t\tthis.disableTransitions = false;\r\n\t\t\tthis.publicEvents.emit(new FormEvent(FormEvents.Ready, { entry: this.entry.serialize() }));\r\n\t\t\tif (this.startingPage > 1)\r\n\t\t\t\tthis.navigateTo(this.startingPage);\r\n\t\t});\r\n\r\n\t\t// The keydown event must be on the document as opposed to the form because\r\n\t\t// when an element is removed IE/Edge removes focus from the form entirely and the\r\n\t\t// next tab is not on the form but on the body.\r\n\t\tthis._keydownListener = (e) => {this.handleTab(e); this.handleLastFieldEnter(e);};\r\n\t\tdocument.addEventListener('keydown', this._keydownListener);\r\n\r\n\t\tif (this.entryToken)\r\n\t\t\tthis.internalEntryToken = decodeURIComponent(this.entryToken.slice(0, -1));\r\n\r\n\t\tif (isSafari(window.navigator))\r\n\t\t\tthis.$el.setAttribute('data-browser', 'safari');\r\n\r\n\t\tif (this.processPayment)\r\n\t\t\trebuildOrder(this.entry, this.order);\r\n\t}\r\n\r\n\tdestroyed() {\r\n\t\tdocument.removeEventListener('keydown', this._keydownListener);\r\n\t\twindow.removeEventListener('beforeprint', this.handlePrint);\r\n\t\twindow.removeEventListener('offline', this.handleOffline);\r\n\t\tthis.unsubscribeFromToastRequests();\r\n\t\tthis.resizeObserver.unobserve(this.$el);\r\n\t}\r\n\r\n\tisDeviceType(query: string): boolean {\r\n\t\treturn isDeviceType(window.navigator, query);\r\n\t}\r\n\r\n\thandleLastFieldEnter(e: KeyboardEvent) {\r\n\t\tconst isSafariOrMobile = this.flags.mobile || isSafari(window.navigator);\r\n\t\tif (e.key.toLowerCase() === 'enter' && !this.onLastPage && isSafariOrMobile && this.getLastFieldElement() === e.target)\r\n\t\t\tthis.navigate({ forward: true, validateCaptcha: this.currentPage.getCaptchaValidator() });\r\n\t}\r\n\r\n\thandleTab(e) {\r\n\t\tif (false || e.which !== 9 || !this.focusPlace)\r\n\t\t\treturn false;\r\n\r\n\t\t// Browsers that don't handle focus of removed elements will place focus on body, thus if\r\n\t\t// the focus isn't on the body the recorded focus has become obsolete and should be nulled out.\r\n\t\tif (document.activeElement !== document.body) {\r\n\t\t\tthis.focusPlace = null;\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Find the index of the nearest element that still exists. Then focus that element.\r\n\t\tconst tabDirection = e.shiftKey ? -1 : 1;\r\n\t\tlet indexToTry = this.focusPlace.focusIndex + tabDirection;\r\n\r\n\t\twhile (!this.$el.contains(this.focusPlace.elements[indexToTry]) && indexToTry >= 0 && indexToTry < this.focusPlace.elements.length) {\r\n\t\t\tindexToTry = indexToTry + tabDirection;\r\n\t\t}\r\n\r\n\t\tif (indexToTry >= 0) {\r\n\t\t\te.preventDefault();\r\n\t\t\tthis.focusPlace.elements[indexToTry].focus();\r\n\t\t}\r\n\r\n\t\t// Remove record of focus placement\r\n\t\tthis.focusPlace = null;\r\n\t}\r\n\r\n\thandlePrint(e) {\r\n\t\t// Mark the sufficiently short rows so we can avoid page breaks inside of them.\r\n\t\tdocument.querySelectorAll('.cog-row, .cog-payment').forEach(row => {\r\n\t\t\trow.clientHeight < 500 ? row.classList.add('cog-row--short') : row.classList.remove('cog-row--short');\r\n\t\t});\r\n\t}\r\n\r\n\trecordFocusPlace(focusPlace) {\r\n\t\tthis.focusPlace = {\r\n\t\t\tfocusIndex: focusPlace.focusIndex,\r\n\t\t\telements: focusPlace.elements\r\n\t\t};\r\n\t}\r\n\r\n\thandleResize() {\r\n\t\trequestAnimationFrame(()=>{\r\n\t\t\tconst formContainerEl = this.$el.querySelector('.cog-form__container');\r\n\t\t\tif (!formContainerEl)\r\n\t\t\t\treturn;\r\n\t\t\tconst width = Math.ceil(this.$el.querySelector('.cog-form__container').clientWidth / 25) * 25;\r\n\t\t\tconst widths = [];\r\n\t\t\tfor (let size = width; size >= 200; size = size - 25) {\r\n\t\t\t\tif (size <= 650 || size % 100 === 0) widths.push(size);\r\n\t\t\t}\r\n\t\t\tthis.$el.setAttribute('data-width', widths.join(' '));\r\n\t\t});\r\n\t}\r\n\r\n\thandleOffline() {\r\n\t\tconst offlineMessage = this.createToastMessage({ type: 'error', showClose: false, message: this.$resource('network-unavailable-message') });\r\n\t\tconst handleOnline = () => {\r\n\t\t\tofflineMessage.close();\r\n\t\t\twindow.removeEventListener('online', handleOnline);\r\n\t\t};\r\n\t\twindow.addEventListener('online', handleOnline);\r\n\t}\r\n\r\n\t/**\r\n\t *\t1. Measure the leaving page's height\r\n\t *\t2. Set the leaving page's height to the form body\r\n\t *\t3. Set the leaving page to position: absolute (with the class cog-page-transition)\r\n\t *\t4. Wait a tick to give CSS a chance to notice the difference (and apply transition)\r\n\t *\t5. Set the height of the entering page to the form body\r\n\t */\r\n\tpageBeforeEnter() {\r\n\t\tthis.pageTransitioning = true;\r\n\t\tthis.bodyRef.style.minHeight = this.bodyRef.clientHeight + 'px';\r\n\t}\r\n\r\n\tpageEntering(height) {\r\n\t\tthis.publicEvents.emit(new FormEvent(FormEvents.ScrollToTop));\r\n\t\trequestAnimationFrame(()=>{\r\n\t\t\tconst currentHeight = this.bodyRef.clientHeight;\r\n\t\t\tconst pageSpeed = +getComputedStyle(document.querySelector('.cog-page')).transitionDuration.replace('s', '') * 1000;\r\n\t\t\tthis.bodyRef.style.minHeight = currentHeight + 'px';\r\n\r\n\t\t\tthis.bodyRef.classList.add('cog-page-transition');\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis.bodyRef.style.minHeight = height + 'px';\r\n\t\t\t});\r\n\r\n\t\t\t// If the top of the page is above the top of the viewport (thus requiring scroll),\r\n\t\t\t// add a delay to the sideways scroll so the animations (scroll up and page slide in) happen in stages.\r\n\t\t\tconst scrollToEl = this.$root.$el.querySelector('.cog-page-progress') || this.bodyRef;\r\n\t\t\tif (scrollToEl.getBoundingClientRect().top < 0) {\r\n\t\t\t\tconst head = document.head;\r\n\t\t\t\tconst style = document.createElement('style');\r\n\t\t\t\tstyle.setAttribute('id', 'cog-page-conditional-transition-styles');\r\n\t\t\t\tstyle.innerHTML = `.cog-page.cog-page-enter-active,\r\n\t\t\t.cog-page.cog-page-leave-active {\r\n\t\t\t\ttransition: min-height linear ${pageSpeed}ms, opacity linear ${pageSpeed * 1.2}ms, transform ease-in-out ${pageSpeed}ms ${pageSpeed * .3}ms;\r\n\t\t\t}`;\r\n\t\t\t\thead.appendChild(style);\r\n\t\t\t}\r\n\r\n\t\t\t/**\r\n\t\t * Because the height of the incoming page can change while it is in transition,\r\n\t\t * adjust the height of the body while pages are in transition.\r\n\t\t * For example, if a tall field loads during the transition.\r\n\t\t */\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tconst activePage = document.querySelector('.cog-page-enter-active');\r\n\t\t\t\tif (activePage)\r\n\t\t\t\t\tthis.bodyRef.style.minHeight = activePage.clientHeight + 'px';\r\n\t\t\t}, pageSpeed / 4);\r\n\r\n\t\t\tif (!this.getFirstInvalidFieldElement())\r\n\t\t\t\tscrollIntoView(this.$refs.formContainer as HTMLElement, { time: pageSpeed, align: { top: 0 } }, null, this.flags.useNativeScrolling);\r\n\t\t});\r\n\t}\r\n\r\n\tpageEntered() {\r\n\t\trequestAnimationFrame(() => {\r\n\t\t\tthis.bodyRef.classList.remove('cog-page-transition');\r\n\r\n\t\t\t// Delay removing min-height to prevent slight jump in some cases. See comment on #16340.\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis.bodyRef.style.minHeight = null;\r\n\t\t\t}, 200);\r\n\r\n\t\t\tconst transitionStyles = document.getElementById('cog-page-conditional-transition-styles');\r\n\t\t\tif (transitionStyles)\r\n\t\t\t\ttransitionStyles.parentNode.removeChild(transitionStyles);\r\n\r\n\t\t\t// Do not reset scroll if an error is showing upon reaching the page\r\n\t\t\tif (!this.getFirstInvalidFieldElement()) {\r\n\t\t\t\t// Set focus to the first element without scrolling\r\n\t\t\t\tconst firstInput = this.$el.querySelector('input,textarea,select') as HTMLElement;\r\n\t\t\t\tif (firstInput)\r\n\t\t\t\t\tfirstInput.focus({ preventScroll: true });\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.pageTransitioning = false;\r\n\t}\r\n\r\n\tconfirmationEntered() {\r\n\t\tthis.publicEvents.emit(new FormEvent(FormEvents.ScrollToTop));\r\n\t\tif (this.headerRef.$props.visible)\r\n\t\t\tscrollIntoView(this.headerRef.$el as HTMLElement, { time: 0 }, null, this.flags.useNativeScrolling);\r\n\t\telse\r\n\t\t\tscrollIntoView(this.getFirstFieldElement(), { time: 0 }, null, this.flags.useNativeScrolling);\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the element within the given given component (optional, the form is searched by default)\r\n\t * @param context The component to search for errors (optional)\r\n\t * @returns The first element that represents an error\r\n\t */\r\n\tgetFirstFieldElement();\r\n\tgetFirstFieldElement(context: Vue);\r\n\tgetFirstFieldElement(context: Vue = null) {\r\n\t\treturn (context || this).$el.querySelector('input,textarea,select') as HTMLElement;\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the last form element within the given component\r\n\t * @param context The component to search for errors (optional)\r\n\t * @param getTextArea Whether or not to include textarea in your query search (optional)\r\n\t * @returns The last field element within the context\r\n\t */\r\n\tgetLastFieldElement();\r\n\tgetLastFieldElement(context: Vue);\r\n\tgetLastFieldElement(context: Vue = null, getTextArea = false) {\r\n\t\tconst base = (context || this);\r\n\t\tif (base.$el.nodeName === '#comment') {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tconst fields = base.$el.querySelectorAll('input,select' + (getTextArea ? ',textarea' : ''));\r\n\t\treturn fields[fields.length - 1];\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the first error element within the given given component (optional, the form is searched by default)\r\n\t * @param context The component to search for errors (optional)\r\n\t * @returns The first element that represents an error\r\n\t */\r\n\tgetFirstInvalidFieldElement();\r\n\tgetFirstInvalidFieldElement(context: Vue);\r\n\tgetFirstInvalidFieldElement(context: Vue = null) {\r\n\t\treturn (context || this).$el.querySelector('.is-error, .cog-error-message') as HTMLElement;\r\n\t}\r\n\r\n\t/**\r\n\t * Scrolls to and focuses into (if it is an input) the first error element\r\n\t * @param context The compoent to search for an error to highlight (optional)\r\n\t */\r\n\tscrollToAndFocusFirstInvalidFieldElement();\r\n\tscrollToAndFocusFirstInvalidFieldElement(context: Vue);\r\n\tscrollToAndFocusFirstInvalidFieldElement(context: Vue = null) {\r\n\t\trequestAnimationFrame(()=>{\r\n\t\t\tconst firstError = this.getFirstInvalidFieldElement(context);\r\n\t\t\tif (firstError) {\r\n\t\t\t\tscrollIntoView(firstError, null, null, this.flags.useNativeScrolling);\r\n\t\t\t\t// According to Evan You, `__vue__` is probably safe to use since vue-dev-tools relies on it - https://github.com/vuejs/vue/issues/5621\r\n\t\t\t\t// We could also use the form's `fields` list, but this would require traversing all of the fields, or maintaining a lookup which would be a mem leak risk, and we also wouldn't be aware of other components (like section/table)\r\n\t\t\t\tconst firstErrorComponent = firstError['__vue__'] as Vue;\r\n\t\t\t\tif (firstErrorComponent) {\r\n\t\t\t\t// If the first error is on a field with an input focus the first input.\r\n\t\t\t\t// Failing that, focus the container of the item in error.\r\n\t\t\t\t// Requirement 10207\r\n\t\t\t\t\tconst input = firstError.querySelector('input');\r\n\t\t\t\t\tif (firstErrorComponent.$options.name === 'CField' && input)\r\n\t\t\t\t\t\tinput.focus({ preventScroll: true });\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tfirstError.focus({ preventScroll: true });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Detects whether or not the current page is valid. If it is not valid, any errors will be forced to\r\n\t * display unless otherwise specified.\r\n\t * @param showErrors Force fields to display validation as if they had been interacted with.\r\n\t */\r\n\tassertValidation(showErrors = true) {\r\n\t\tif (!this.enforceValidation)\r\n\t\t\treturn true;\r\n\r\n\t\tconst fields = this.fields.filter(f => f.pageNumber === this.pageNumber || !this.flags.paging);\r\n\t\tif (showErrors) {\r\n\t\t\t// Force all fields to display validation\r\n\t\t\tfields.forEach(f => f.forceValidation());\r\n\t\t\t// Scroll to and focus in the first error element\r\n\t\t\tthis.$nextTick().then(() => this.scrollToAndFocusFirstInvalidFieldElement());\r\n\t\t}\r\n\r\n\t\tconst hasErrors = fields.filter(f => f.hasError).length !== 0;\r\n\r\n\t\tif (hasErrors)\r\n\t\t\tthis.publicEvents.emit(new FormEvent(FormEvents.FailedValidation));\r\n\r\n\t\treturn !hasErrors;\r\n\t}\r\n\r\n\tcreateToastMessage(options: ElMessageOptions) {\r\n\t\treturn ToastMessage(this.session.formId, options);\r\n\t}\r\n\r\n\tfileServiceBusy() {\r\n\t\tif (this.fileService && this.fileService.busy) {\r\n\t\t\tthis.createToastMessage({ type: 'error', message: this.$resource('fileupload-upload-inprogress-message') });\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tasync authorizeNavigation(targetPage) {\r\n\t\tif (this.fileServiceBusy())\r\n\t\t\treturn false;\r\n\r\n\t\treturn this.publicEvents.emit(new FormEvent(FormEvents.BeforeNavigate, {\r\n\t\t\tentry: this.entry.serialize(),\r\n\t\t\tdirection: targetPage.number > this.pageNumber ? NavigationDirection.Forward : NavigationDirection.Backward,\r\n\t\t\tsourcePage: {\r\n\t\t\t\ttitle: this.currentPage.title,\r\n\t\t\t\tnumber: this.pageNumber,\r\n\t\t\t\tname: 'page' + this.pageNumber\r\n\t\t\t},\r\n\t\t\tdestinationPage: {\r\n\t\t\t\ttitle: targetPage.title,\r\n\t\t\t\tnumber: targetPage.number,\r\n\t\t\t\tname: 'page' + targetPage.number\r\n\t\t\t}\r\n\t\t}));\r\n\t}\r\n\r\n\t/**\r\n\t * Validates all visible pages between first and last, inclusive.\r\n\t * @param firstPage the first page to validate\r\n\t * @param lastPage the last page to validate\r\n\t */\r\n\tasync validatePageRange(firstPage: number, lastPage: number) {\r\n\t\tif (!this.enforceValidation)\r\n\t\t\treturn true;\r\n\r\n\t\t// Only check visible pages\r\n\t\tconst pages = this.pages.slice(firstPage, lastPage + 1).filter(p => p && p.visible);\r\n\t\tfor (let i = 0; i < pages.length; i++) {\r\n\t\t\tconst page = pages[i];\r\n\r\n\t\t\tif (!page.current)\r\n\t\t\t\tpage.virtual = true;\r\n\r\n\t\t\tawait this.waitForFieldsToUpdate();\r\n\r\n\t\t\tconst errorExists = this.fields.some(f => f.pageNumber === page.number && f.hasError);\r\n\t\t\tpage.virtual = false;\r\n\r\n\t\t\tif (errorExists) {\r\n\t\t\t\tthis.pageNumber = page.number;\r\n\r\n\t\t\t\t// Allow page change to take effect\r\n\t\t\t\tawait this.$nextTick();\r\n\r\n\t\t\t\tthis.assertValidation();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\tasync navigateTo(pageNumber: number) {\r\n\t\tconst targetPage = this.pages[pageNumber];\r\n\t\tconst forward = targetPage.number > this.pageNumber;\r\n\t\tif (pageNumber === this.pageNumber || !targetPage.visible)\r\n\t\t\treturn;\r\n\r\n\t\tif (forward && !window.navigator.onLine)\r\n\t\t\treturn;\r\n\r\n\t\t// See if page navigation was externally prevented\r\n\t\tif (!(await this.authorizeNavigation(targetPage)))\r\n\t\t\treturn;\r\n\r\n\t\tif (pageNumber > this.pageNumber) {\r\n\t\t\t// Check for errors on the current page\r\n\t\t\tif (!this.assertValidation())\r\n\t\t\t\treturn;\r\n\r\n\t\t\t// Check for errors on intermediate pages, don't validate the target page\r\n\t\t\tif (!(await this.validatePageRange(this.pageNumber + 1, pageNumber - 1)))\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t\t// Prevent backward navigation if back button is disabled on current or intermediate pages\r\n\t\telse if (this.pages.slice(targetPage.number + 1, this.pageNumber + 1).some(p => !p.backButton))\r\n\t\t\treturn;\r\n\r\n\t\tthis.pageNumber = pageNumber;\r\n\t}\r\n\r\n\tasync navigate({ forward, validateCaptcha = null, action = null }: { forward: boolean, validateCaptcha?: Function | null, action?: string | null }) {\r\n\t\tif (this.pageTransitioning)\r\n\t\t\treturn;\r\n\r\n\t\tif (forward && !window.navigator.onLine && !this.onLastPage) {\r\n\t\t\tthis.publicEvents.emit(new FormEvent(FormEvents.ScrollToTop));\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (forward && this.onLastPage) {\r\n\t\t\t// Set the current action that is being performed (if this call is a result of an action being performed)\r\n\t\t\treturn this.submit({ action, validateCaptcha });\r\n\t\t}\r\n\r\n\t\t// Attempt to leave the current page (check validation)\r\n\t\tif (forward && !this.assertValidation())\r\n\t\t\treturn;\r\n\r\n\t\t// Find the next visible page\r\n\t\tconst direction = forward ? 1 : -1;\r\n\t\tfor (let i = this.pageNumber + direction; i >= 0 && i < this.pages.length; i += direction) {\r\n\t\t\tconst targetPage = this.pages[i];\r\n\t\t\tif (targetPage && targetPage.visible) {\r\n\t\t\t\tif (await this.authorizeNavigation(targetPage))\r\n\t\t\t\t\tthis.pageNumber = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfileUploaded(file: FileDataRef) {\r\n\t\tthis.publicEvents.emit(new FormEvent(FormEvents.UploadFile, { file: { id: file.Id, name: file.Name, size: file.Size } }));\r\n\t}\r\n\r\n\tasync handleConcurrentEntryConflict(error: ConcurrentEntryConflict) {\r\n\t\tthis.entry.markPersisted();\r\n\t\tawait this.entry.update(error.entry);\r\n\t\tif (error.order) {\r\n\t\t\tthis.entry.Order = await this.formsModel.constructAsync('Payment.Order', error.order);\r\n\t\t\tthis.showReceipt = false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Update the form state on completion of authentication. Try to resubmit\r\n\t * the form upon authentication success.\r\n\t */\r\n\tasync authenticationComplete(event: AuthenticationCompleteEvent) {\r\n\t\tif (event.success || event.forceResubmit)\r\n\t\t\tawait this.submit();\r\n\t\telse\r\n\t\t\tthis.submitStatus = FormStatus.Error;\r\n\t}\r\n\r\n\tasync canSubmit(validateCaptcha?: Function) {\r\n\t\ttry {\r\n\t\t\tif (this.fieldsChanging) return false;\r\n\r\n\t\t\t// If a WorkflowAction is being performed on a workflow form, validate that it is allowed\r\n\t\t\tif (this.flags.workflowEnabled && this.action) {\r\n\t\t\t\tif (!(this.action as any).IsAllowed)\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.flags.blockSubmission)\r\n\t\t\t\treturn false;\r\n\r\n\t\t\tif (this.fileServiceBusy())\r\n\t\t\t\treturn false;\r\n\r\n\t\t\tif (this.quantityService)\r\n\t\t\t\tawait this.quantityService.refresh();\r\n\r\n\t\t\tif (this.flags.paging) {\r\n\t\t\t\tif (!(await this.validatePageRange(this.pageNumber, this.pageNumber)))\r\n\t\t\t\t\treturn false;\r\n\r\n\t\t\t\tconst firstAccessiblePage = (() => {\r\n\t\t\t\t\tlet tempPage = null;\r\n\t\t\t\t\tfor (const p of this.visiblePages.slice().reverse()) {\r\n\t\t\t\t\t\tif (p.backButton)\r\n\t\t\t\t\t\t\ttempPage = p;\r\n\t\t\t\t\t\telse if (p === this.visiblePages[0])\r\n\t\t\t\t\t\t\treturn p;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\treturn tempPage;\r\n\t\t\t\t\t}\r\n\t\t\t\t})();\r\n\r\n\t\t\t\tif (firstAccessiblePage && !(await this.validatePageRange(firstAccessiblePage.number, this.pageNumber - 1)))\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse if (!(await this.validatePageRange(0, this.pages.length)))\r\n\t\t\t\treturn false;\r\n\r\n\t\t\tif (validateCaptcha && !validateCaptcha())\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\tcatch {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\tasync submit({ validateCaptcha = null, action = null }: { validateCaptcha?: Function | null, action?: string | null } = {}): Promise {\r\n\t\tif (this.submitStatus === FormStatus.InProgress)\r\n\t\t\treturn;\r\n\r\n\t\tcloseAllToastMessages();\r\n\r\n\t\tconst wasAuthenticating = this.submitStatus === FormStatus.Authenticating;\r\n\t\tthis.submitStatus = FormStatus.InProgress;\r\n\r\n\t\t// ensure submitStatus watcher executes before moving forward\r\n\t\tawait this.$nextTick();\r\n\r\n\t\tif (action) {\r\n\t\t\tthis.entry.Attempted_Action = action;\r\n\t\t\tthis.entry.Entry.Action = action;\r\n\r\n\t\t\t// Wait for fields to update after setting the action, since it can trigger validation rules or cause changes to conditional visibility\r\n\t\t\tawait this.waitForFieldsToUpdate();\r\n\t\t}\r\n\r\n\t\tif (!await this.canSubmit(validateCaptcha)) {\r\n\t\t\tthis.submitStatus = FormStatus.Default;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Raise submit event\r\n\t\tconst entry = this.entry.serialize();\r\n\r\n\t\t// beforeSubmitEvent.preventDefault() prevents submission of the form\r\n\t\tconst submissionAllowed = await this.publicEvents.emit(new FormEvent(FormEvents.BeforeSubmit, { entry, hasErrors: false }));\r\n\t\tif (!submissionAllowed) {\r\n\t\t\tthis.submitStatus = FormStatus.Error;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst orderComponent = this.$refs.orderComponent as any;\r\n\t\tconst paymentComponent = this.$refs.paymentComponent as any;\r\n\r\n\t\tif (!wasAuthenticating && orderComponent) {\r\n\t\t\tif (this.processPayment && paymentComponent) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconst token = await paymentComponent.getPaymentToken(orderComponent.getOrderInfo(this.entry));\r\n\t\t\t\t\tif (token) {\r\n\t\t\t\t\t\tthis.entry.Entry.PaymentToken = this.formsModel.construct('Payment.PaymentToken', token);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tif (this.enforceValidation) {\r\n\t\t\t\t\t\t\tthis.submitStatus = FormStatus.Error;\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcatch (err) {\r\n\t\t\t\t\tif (this.enforceValidation) {\r\n\t\t\t\t\t\tthis.log && this.log.error(err);\r\n\t\t\t\t\t\tthis.paymentError = (err.message || err) + '';\r\n\t\t\t\t\t\tthis.submitStatus = FormStatus.Error;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// If the order is currently open before submitting, show the receipt on the confirmation page\r\n\t\tif (this.flags.workflowEnabled && this.order && this.order.IsOpen)\r\n\t\t\tthis.showReceipt = true;\r\n\r\n\t\ttry {\r\n\t\t\tlet entryReset = false;\r\n\t\t\tconst setEntryResetTrue = () => {\r\n\t\t\t\tentryReset = true;\r\n\t\t\t\tthis.submitStatus = FormStatus.Default;\r\n\t\t\t};\r\n\r\n\t\t\tthis.publicEvents.once(FormEvents.ResetEntry, setEntryResetTrue);\r\n\r\n\t\t\tconst result = await this.entryService.submit(this.entry, this.hostingPageUrl, this.shouldSaveAndRedirectPayment, this.internalEntryToken);\r\n\r\n\t\t\tif (entryReset)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tthis.publicEvents.off(FormEvents.ResetEntry, setEntryResetTrue);\r\n\r\n\t\t\tconst { entry: finalEntry, order: finalOrder, status, documents, entryToken, message } = result;\r\n\r\n\t\t\tthis.internalEntryToken = entryToken;\r\n\r\n\t\t\tif (finalOrder)\r\n\t\t\t\tthis.entry.Order = await this.formsModel.constructAsync('Payment.Order', finalOrder);\r\n\r\n\t\t\tthis.entry.Id = finalEntry.Id;\r\n\t\t\tthis.entry.markPersisted();\r\n\t\t\tawait this.entry.update(finalEntry);\r\n\r\n\t\t\tif (this.quantityService && result.status === SubmissionResultStatus.Success)\r\n\t\t\t\tthis.quantityService.reset({ hasInitialState: true, root: this.entry });\r\n\r\n\t\t\tthis.afterSubmit(status, documents, message);\r\n\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\tcatch (error) {\r\n\t\t\tthis.log && this.log.error(error);\r\n\t\t\tif (error instanceof CaptchaError)\r\n\t\t\t\tthis.submitStatus = FormStatus.Captcha;\r\n\t\t\telse if (error instanceof ConcurrentEntryConflict) {\r\n\t\t\t\tthis.submitStatus = FormStatus.Default;\r\n\t\t\t\tconst onlyShowToast = this.processPayment;\r\n\t\t\t\tawait this.handleConcurrentEntryConflict(error);\r\n\r\n\t\t\t\t// If the order is open before submitting show a toast and do not resubmit\r\n\t\t\t\tif (onlyShowToast) {\r\n\t\t\t\t\tthis.createToastMessage({ type: 'error', message: this.$resource('concurrent-conflict-toast-message') });\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tconst result = await this.submit({ action, validateCaptcha });\r\n\t\t\t\t\tif (result)\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tthis.createToastMessage({ type: 'error', message: this.$resource('concurrent-conflict-toast-message') });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.submitStatus = FormStatus.Error;\r\n\t\t\t\tif (error instanceof InvalidSharedLinkError)\r\n\t\t\t\t\tthis.createToastMessage({ type: 'error', message: this.$resource('invalid-shared-link') });\r\n\t\t\t\telse if (error instanceof PublicLinksDisabledError)\r\n\t\t\t\t\tthis.createToastMessage({ type: 'error', message: this.$resource('form-not-available-message') });\r\n\t\t\t\telse if (window.navigator.onLine)\r\n\t\t\t\t\tthis.createToastMessage({ type: 'error', message: this.$resource('entry-submission-error-heading') });\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tasync afterSubmit(status: SubmissionResultStatus, documents, message: string | null | undefined) {\r\n\t\tif (status === SubmissionResultStatus.Success) {\r\n\t\t\tawait this.publicEvents.emit(new FormEvent(FormEvents.AfterSubmit, { entry: this.entry.serialize(), documents }));\r\n\t\t\tthis.entry.Attempted_Action = null;\r\n\t\t}\r\n\r\n\t\tconst redirectOrShowConfirmationPage = (documents) => {\r\n\t\t\tif (this.flags.submissionSettings) {\r\n\t\t\t\t// Redirect the form\r\n\t\t\t\tif (this.paymentRedirectUrl)\r\n\t\t\t\t\tthis.redirect(this.paymentRedirectUrl);\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.showConfirmationPage(documents);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tthis.submitStatus = FormStatus.Default;\r\n\t\t};\r\n\r\n\t\tif (!this.enforceValidation)\r\n\t\t\tredirectOrShowConfirmationPage(documents);\r\n\t\telse if (status === SubmissionResultStatus.Success) {\r\n\t\t\tconst paymentComponent = this.$refs.paymentComponent as any;\r\n\t\t\t// eslint-disable-next-line eqeqeq\r\n\t\t\tif (this.entry.Entry && this.entry.Entry.PaymentToken && this.entry.Entry.PaymentToken.Status == 'PendingAction') {\r\n\t\t\t\tthis.submitStatus = FormStatus.Authenticating;\r\n\t\t\t\tpaymentComponent.authenticate(this.entry.Entry.PaymentToken);\r\n\t\t\t}\r\n\t\t\t// eslint-disable-next-line eqeqeq\r\n\t\t\telse if (this.entry.Entry && this.entry.Entry.PaymentToken && this.entry.Entry.PaymentToken.Status == 'AuthenticationFailed') {\r\n\t\t\t\tthis.submitStatus = FormStatus.Error;\r\n\t\t\t}\r\n\t\t\t// eslint-disable-next-line\r\n\t\t\telse if (this.order && this.order.PaymentStatus == 'Declined' && paymentComponent) {\r\n\t\t\t\tif (this.processPayment)\r\n\t\t\t\t\tthis.paymentDeclined();\r\n\t\t\t\tthis.submitStatus = FormStatus.Error;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tredirectOrShowConfirmationPage(documents);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.submitStatus = FormStatus.Error;\r\n\t\t\tswitch (status) {\r\n\t\t\t\tcase SubmissionResultStatus.AlreadyPaid: {\r\n\t\t\t\t\tthis.paymentError = this.$resource('order-exception-order-already-paid');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase SubmissionResultStatus.CardDeclined: {\r\n\t\t\t\t\tthis.paymentError = this.$resource('card-declined') + ': ' + this.$resource('credit-card-invalid');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase SubmissionResultStatus.PaymentDeclined:\r\n\t\t\t\tcase SubmissionResultStatus.OrderMismatch: {\r\n\t\t\t\t\tthis.paymentError = this.$resource('order-exception-default-message');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase SubmissionResultStatus.QuantityLimitExceeded: {\r\n\t\t\t\t\tthis.quantityService.refresh();\r\n\r\n\t\t\t\t\t// scroll to quantity limit validation errors\r\n\t\t\t\t\tthis.validatePageRange(0, this.visiblePages.length);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase SubmissionResultStatus.AlreadySubmitted:\r\n\t\t\t\tcase SubmissionResultStatus.Error:\r\n\t\t\t\tcase SubmissionResultStatus.Unknown: {\r\n\t\t\t\t\tthis.createToastMessage({ type: 'error', message: this.$resource('entry-submission-error-heading') });\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprivate async redirect(url: string) {\r\n\t\tif (!url.trim())\r\n\t\t\treturn;\r\n\r\n\t\tawait this.publicEvents.emit(new FormEvent(FormEvents.Redirect, { url }));\r\n\t\twindow.location.href = url;\r\n\t}\r\n\r\n\tasync resumeAfterPaymentRedirect(documents, actionId: number = null) {\r\n\t\t// eslint-disable-next-line eqeqeq\r\n\t\tif (!this.order)\r\n\t\t\treturn;\r\n\r\n\t\tif (!isNaN(actionId))\r\n\t\t\tthis.entry.Entry.Action = this.actions.find(a => a.Id === actionId).ActionName;\r\n\t\t// eslint-disable-next-line eqeqeq\r\n\t\tif (this.order.PaymentStatus == 'Declined') {\r\n\t\t\tthis.paymentDeclined();\r\n\t\t\tthis.assertValidation(true);\r\n\t\t\t// clear the payment error when the order changes\r\n\t\t\tthis.$nextTick(()=>{\r\n\t\t\t\tthis.order.changed.subscribeOne(() => (this.paymentError = ''));\r\n\t\t\t});\r\n\t\t}\r\n\t\t// eslint-disable-next-line eqeqeq\r\n\t\telse if (this.order.PaymentStatus == 'Paid' || this.order.PaymentStatus == 'Pending') {\r\n\t\t\tthis.showReceipt = true;\r\n\t\t\tthis.showConfirmationPage(documents);\r\n\t\t}\r\n\t}\r\n\r\n\tisValidUrl(url: string) {\r\n\t\ttry {\r\n\t\t\t// eslint-disable-next-line no-new\r\n\t\t\tnew URL(url);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch (e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tresetPaymentError() {\r\n\t\tthis.paymentError = null;\r\n\t}\r\n\r\n\tprivate paymentDeclined() {\r\n\t\tthis.paymentError = this.$resource('payment-declined') + ': ' + (this.order ? this.order.PaymentMessage : '');\r\n\t}\r\n\r\n\tasync showConfirmationPage(documents: { link: string; title: string; type: string; }[]) {\r\n\t\tthis.documents = documents;\r\n\t\tthis.showConfirmation = true;\r\n\t\tthis.submitStatus = FormStatus.Success;\r\n\t}\r\n\r\n\tautoSave() {\r\n\t\tif (this.flags.saveAndResume && this.isExistingEntry && this.entry.Entry.Status === 'Incomplete' && this.session.botValidation)\r\n\t\t\tthis.save({ showDialog: false, reportStatus: false });\r\n\t}\r\n\r\n\tasync save({ showDialog = true, reportStatus = true, validateCaptcha = null }: { showDialog? : boolean, reportStatus? : boolean, validateCaptcha? : Function } = {}) {\r\n\t\t// prevent the form from submitting if the user has not been verified\r\n\t\tif (validateCaptcha && !validateCaptcha())\r\n\t\t\treturn;\r\n\r\n\t\tcloseAllToastMessages();\r\n\t\tif (this.flags.blockSubmission || this.fileServiceBusy() || this.saveStatus === FormStatus.InProgress)\r\n\t\t\treturn;\r\n\r\n\t\tconst setStatus = status => reportStatus && (this.saveStatus = status);\r\n\t\tsetStatus(FormStatus.InProgress);\r\n\r\n\t\ttry {\r\n\t\t\tlet entryReset = false;\r\n\t\t\tconst setEntryResetTrue = () => {\r\n\t\t\t\tentryReset = true;\r\n\t\t\t\tthis.submitStatus = FormStatus.Default;\r\n\t\t\t};\r\n\t\t\tthis.publicEvents.once(FormEvents.ResetEntry, setEntryResetTrue);\r\n\r\n\t\t\tconst result = await this.entryService.save(this.entry, this.hostingPageUrl, this.internalEntryToken, this.pageNumber);\r\n\r\n\t\t\tif (entryReset)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tthis.publicEvents.off(FormEvents.ResetEntry, setEntryResetTrue);\r\n\r\n\t\t\tconst entry = result.entry;\r\n\t\t\tif (entry) {\r\n\t\t\t\tthis.entry.Id = entry.Id;\r\n\t\t\t\tthis.entry.markPersisted();\r\n\t\t\t\tawait this.entry.update(entry);\r\n\t\t\t}\r\n\r\n\t\t\tthis.internalEntryToken = result.entryToken;\r\n\r\n\t\t\tif (this.flags.submissionSettings && this.isValidUrl(result.link))\r\n\t\t\t\tlocation.hash = parseUrlHash(result.link);\r\n\r\n\t\t\tsetStatus(FormStatus.Success);\r\n\t\t\tthis.saveResumeInfo = {\r\n\t\t\t\topen: showDialog,\r\n\t\t\t\tmessage: result.message,\r\n\t\t\t\temailMessage: result.emailMessage,\r\n\t\t\t\tlink: result.link,\r\n\t\t\t\temailAddress: result.emailAddress,\r\n\t\t\t\temailStatus: FormStatus.Default,\r\n\t\t\t\tenableSend: result.enableSend\r\n\t\t\t};\r\n\t\t\tthis.publicEvents.emit(new FormEvent(FormEvents.AfterSave, {\r\n\t\t\t\tlink: result.link,\r\n\t\t\t\tentry: entry\r\n\t\t\t}));\r\n\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\tcatch (error) {\r\n\t\t\tthis.log && this.log.error(error);\r\n\t\t\tif (error instanceof CaptchaError)\r\n\t\t\t\tsetStatus(FormStatus.Captcha);\r\n\t\t\telse if (error instanceof ConcurrentEntryConflict) {\r\n\t\t\t\tsetStatus(FormStatus.Default);\r\n\t\t\t\tawait this.handleConcurrentEntryConflict(error);\r\n\r\n\t\t\t\treturn this.save({ showDialog, reportStatus });\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tsetStatus(FormStatus.Error);\r\n\t\t\t\tif (error instanceof InvalidSharedLinkError)\r\n\t\t\t\t\tthis.createToastMessage({ type: 'error', message: this.$resource('invalid-shared-link') });\r\n\t\t\t\telse if (error instanceof PublicLinksDisabledError)\r\n\t\t\t\t\tthis.createToastMessage({ type: 'error', message: this.$resource('form-not-available-message') });\r\n\t\t\t\telse if (window.navigator.onLine)\r\n\t\t\t\t\tthis.createToastMessage({ type: 'error', message: this.$resource('entry-submission-error-heading') });\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tasync closeSaveResumeDialog() {\r\n\t\tthis.saveResumeInfo.open = false;\r\n\t}\r\n\r\n\tasync emailResumeLink(email) {\r\n\t\tthis.saveResumeInfo.emailStatus = FormStatus.InProgress;\r\n\t\ttry {\r\n\t\t\tawait this.entryService.emailResumeLink(this.entry.Id, email, this.saveResumeInfo.emailMessage, this.hostingPageUrl);\r\n\t\t\tthis.saveResumeInfo.emailStatus = FormStatus.Success;\r\n\t\t\tthis.createToastMessage({ type: 'success', message: this.$resource('save-and-resume-email-sent-message') });\r\n\t\t}\r\n\t\tcatch (error) {\r\n\t\t\tthis.log && this.log.error(error);\r\n\t\t\tthis.saveResumeInfo.emailStatus = FormStatus.Error;\r\n\t\t\tthis.createToastMessage({ type: 'error', message: this.$resource('save-and-resume-email-not-sent-message') });\r\n\t\t}\r\n\t}\r\n\r\n\tasync waitForFieldsToUpdate() {\r\n\t\t// Initial field count and wait\r\n\t\tlet fieldCount;\r\n\t\tawait this.$nextTick();\r\n\r\n\t\t// Wait until the field count is no longer changing\r\n\t\tdo {\r\n\t\t\tfieldCount = this.fields.length;\r\n\r\n\t\t\tawait Promise.all(_asyncComponentImports);\r\n\t\t\tawait this.$nextTick();\r\n\t\t}\r\n\t\twhile (this.fields.length !== fieldCount);\r\n\t}\r\n};","// Adapted from https://github.com/darkskyapp/binary-search\r\n/**\r\n * Insert a value into an array, using a key function and sort order to determine the insertion position.\r\n * @returns The position at which the item was inserted.\r\n */\r\nexport function binaryInsert(arr: T[], incoming: T, getKey: (item: T) => number, ascending = true): number {\r\n\tconst incomingKey = getKey(incoming);\r\n\tconst comparator = (a: number, b: number) => (ascending ? a - b : b - a);\r\n\r\n\tlet mid, cmp;\r\n\tlet low = 0;\r\n\tlet high = arr.length - 1;\r\n\r\n\twhile (low <= high) {\r\n\t\t// The naive `low + high >>> 1` could fail for array lengths > 2**31\r\n\t\t// because `>>>` converts its operands to int32. `low + (high - low >>> 1)`\r\n\t\t// works for array lengths <= 2**32-1 which is also Javascript's max array\r\n\t\t// length.\r\n\t\tmid = low + ((high - low) >>> 1);\r\n\t\tcmp = comparator(getKey(arr[mid]), incomingKey);\r\n\r\n\t\t// Too low.\r\n\t\tif (cmp < 0.0)\r\n\t\t\tlow = mid + 1;\r\n\t\t// Too high.\r\n\t\telse if (cmp > 0.0)\r\n\t\t\thigh = mid - 1;\r\n\t\t// Key found.\r\n\t\telse\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tlet insertPosition = ascending ? Math.min(low, high) : Math.max(low, high);\r\n\r\n\tif (low > high)\r\n\t\tinsertPosition = low;\r\n\r\n\tinsertPosition = Math.min(arr.length, Math.max(0, insertPosition));\r\n\tarr.splice(insertPosition, 0, incoming);\r\n\treturn insertPosition;\r\n};","import { processCssVars } from 'src/mixins/css-vars';\r\nimport { FormDefinitionTheme } from './form-definition';\r\n\r\nfunction createThemeStyle(formId: string, css: string, className: string = 'cog-css-variables'): HTMLStyleElement {\r\n\tconst style = document.createElement('style');\r\n\tstyle.innerHTML = css;\r\n\tstyle.setAttribute('data-form-id', formId);\r\n\tif (className)\r\n\t\tstyle.setAttribute('class', className);\r\n\tdocument.head.appendChild(style);\r\n\treturn style;\r\n}\r\n\r\nfunction updateStyleRules(style: HTMLStyleElement, css: string): void {\r\n\tif (style.innerHTML !== css) {\r\n\t\tstyle.innerHTML = css;\r\n\t\tprocessCssVars({ cleanSlate: true });\r\n\t}\r\n}\r\n\r\nfunction createThemeStylesheet(formId: string, url: string, className: string = 'cog-theme-link'): HTMLLinkElement {\r\n\tconst link = document.createElement('link');\r\n\tlink.rel = 'stylesheet';\r\n\tlink.href = url;\r\n\tlink.setAttribute('data-form-id', formId);\r\n\tif (className)\r\n\t\tlink.setAttribute('class', className);\r\n\tdocument.head.appendChild(link);\r\n\treturn link;\r\n}\r\n\r\nfunction removeElement(element: HTMLElement): void {\r\n\telement.parentElement.removeChild(element);\r\n}\r\n\r\nexport default class FormTheme {\r\n\tformId: string;\r\n\tstyle: HTMLStyleElement;\r\n\tlinks: HTMLLinkElement[];\r\n\tisChameleon: boolean;\r\n\r\n\tprivate constructor() {}\r\n\r\n\tstatic create(formId: string, themeData: FormDefinitionTheme): FormTheme {\r\n\t\t// Create the style tag for theme variables\r\n\t\tconst style = createThemeStyle(formId, themeData.css);\r\n\r\n\t\t// Inject stylesheet links\r\n\t\tconst links = themeData.links.map(url => createThemeStylesheet(formId, url));\r\n\r\n\t\tconst theme = new FormTheme();\r\n\t\tObject.assign(theme, {\r\n\t\t\tformId,\r\n\t\t\tlinks,\r\n\t\t\tstyle,\r\n\t\t\tisChameleon: themeData.isChameleon\r\n\t\t});\r\n\t\treturn theme;\r\n\t}\r\n\r\n\tupdateStyles(css: string, linkUrls: string[]): void {\r\n\t\tupdateStyleRules(this.style, css);\r\n\t\tthis.links.forEach(link => removeElement(link));\r\n\t\tthis.links = linkUrls.map(url => createThemeStylesheet(this.formId, url));\r\n\t}\r\n}\r\n","import Vue, { VueConstructor } from 'vue';\r\nimport FormBase from 'src/components/FormBase';\r\nimport { FormsModelOptions, importOptionalModule, FormsModel, FORM_ENTRY_TYPE_NAME } from './forms-model';\r\nimport * as core from 'src/framework/model/core';\r\nimport FormTheme from './form-theme';\r\n\r\nexport type FormDefinitionTheme = {\r\n\tisChameleon: boolean;\r\n\tcss: string;\r\n\tlinks: string[];\r\n};\r\n\r\nexport type FormsModelOptionsGeneratorFunction =\r\n\t(core: any, getModule: ((name: string) => Promise)) => FormsModelOptions;\r\n\r\nexport async function prepareModelOptions(modelOptionsFn: FormsModelOptionsGeneratorFunction): Promise {\r\n\tconst pendingModules: Promise[] = [];\r\n\tconst modelOptions = modelOptionsFn(core, m => importOptionalModule(m, pendingModules));\r\n\treturn Promise.all(pendingModules).then(() => modelOptions);\r\n}\r\n\r\nexport class FormDefinitionBuilder {\r\n\treadonly formId: string;\r\n\treadonly template: string;\r\n\treadonly modelOptions: FormsModelOptions;\r\n\treadonly formInternalName: string;\r\n\tprivate _component: VueConstructor;\r\n\tprivate _modelPromise: Promise;\r\n\tprivate _theme: FormTheme;\r\n\r\n\tconstructor(formId: string, formInternalName: string, template: string, modelOptions: FormsModelOptions) {\r\n\t\tthis.formId = formId;\r\n\t\tthis.formInternalName = formInternalName;\r\n\t\tthis.template = template;\r\n\t\tthis.modelOptions = modelOptions;\r\n\t}\r\n\r\n\tcompileComponent(): VueConstructor {\r\n\t\tif (!this._component) {\r\n\t\t\tthis._component = Vue.extend(FormBase).extend({\r\n\t\t\t\ttemplate: this.template\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn this._component;\r\n\t}\r\n\r\n\tcreateModel(): Promise {\r\n\t\tif (!this._modelPromise) {\r\n\t\t\tthis._modelPromise = new Promise(resolve => {\r\n\t\t\t\t// Find the type definition for the form by it's \"$id\" key\r\n\t\t\t\tlet entryTypeName = this.formInternalName && this.modelOptions[FORM_ENTRY_TYPE_NAME + '.' + this.formInternalName]\r\n\t\t\t\t\t? FORM_ENTRY_TYPE_NAME + '.' + this.formInternalName\r\n\t\t\t\t\t: Object.keys(this.modelOptions).find(key => !key.startsWith('$') && this.modelOptions[key]['$id'] === this.formId);\r\n\r\n\t\t\t\tif (entryTypeName)\r\n\t\t\t\t\tdelete this.modelOptions[entryTypeName]['$id'];\r\n\t\t\t\telse {\r\n\t\t\t\t\t// Fall back to finding a type in the options to extend FormEntry base type\r\n\t\t\t\t\tconst formTypeNames = Object.keys(this.modelOptions).filter(key => !key.startsWith('$') && this.modelOptions[key]['$extends'] === FORM_ENTRY_TYPE_NAME);\r\n\t\t\t\t\tif (formTypeNames.length === 1)\r\n\t\t\t\t\t\tentryTypeName = formTypeNames[0];\r\n\t\t\t\t\telse if (process.env.NODE_ENV === 'development')\r\n\t\t\t\t\t\tconsole.warn('Could not find type definition for form \\'' + this.formId + '\\'.');\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (entryTypeName) {\r\n\t\t\t\t\tresolve(FormsModel.createModel(entryTypeName, this.modelOptions));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn this._modelPromise;\r\n\t}\r\n\r\n\tcreateTheme(theme: FormDefinitionTheme): FormTheme {\r\n\t\tif (!this._theme) {\r\n\t\t\tthis._theme = FormTheme.create(this.formId, theme);\r\n\t\t}\r\n\r\n\t\treturn this._theme;\r\n\t}\r\n}\r\n\r\nexport default class FormDefinition {\r\n\treadonly formId: string;\r\n\treadonly component: VueConstructor;\r\n\treadonly model: FormsModel;\r\n\treadonly theme: FormTheme;\r\n\r\n\tconstructor(formId: string, component: VueConstructor, model: FormsModel, theme: FormTheme) {\r\n\t\tthis.formId = formId;\r\n\t\tthis.component = component;\r\n\t\tthis.model = model;\r\n\t\tthis.theme = theme;\r\n\t}\r\n\r\n\tstatic async create(formId: string, formInternalName: string, template: string, modelOptionsFn: FormsModelOptionsGeneratorFunction, theme: FormDefinitionTheme): Promise;\r\n\tstatic async create(formId: string, formInternalName: string, template: string, modelOptions: FormsModelOptions, theme: FormDefinitionTheme): Promise;\r\n\tstatic async create(formId: string, formInternalName: string, template: string, modelOptions: FormsModelOptionsGeneratorFunction | FormsModelOptions, themeDef: FormDefinitionTheme): Promise {\r\n\t\tif (typeof modelOptions === 'function') {\r\n\t\t\tmodelOptions = await prepareModelOptions(modelOptions);\r\n\t\t}\r\n\r\n\t\tconst builder = new FormDefinitionBuilder(formId, formInternalName, template, modelOptions);\r\n\t\tconst model = await builder.createModel();\r\n\t\tconst component = builder.compileComponent();\r\n\t\tconst theme = builder.createTheme(themeDef);\r\n\r\n\t\treturn new FormDefinition(formId, component, model, theme);\r\n\t}\r\n}\r\n","import { ServiceWithSession } from './base-service';\r\nimport FormDefinition, { FormsModelOptionsGeneratorFunction, FormDefinitionTheme } from 'src/framework/form-definition';\r\nimport { EmbedContext } from 'src/framework/public/form-handle';\r\n\r\nimport EntryThemeCssString from '../../serve/themes/entries.txt';\r\n\r\nexport type FormScriptDefinition = {\r\n\ttemplate: string;\r\n\tmodelOptions: FormsModelOptionsGeneratorFunction;\r\n\ttheme: FormDefinitionTheme;\r\n\tid?: string;\r\n};\r\n\r\nexport class FormService extends ServiceWithSession {\r\n\tget formId(): string {\r\n\t\treturn this.session.formId;\r\n\t}\r\n\r\n\t/**\r\n\t * Loads the information defining a form by injecting a script tag, which, when executed\r\n\t * will place the form definition object on the script's DOM node. If the form definition\r\n\t * script has already been loaded, a web request is not made.\r\n\t * @param formId The form for which to fetch the definition.\r\n\t */\r\n\tasync getDefinition(embedContext: EmbedContext): Promise {\r\n\t\t// AxiosInstance has a getUri method that is supposed to do this, but it is bugged\r\n\t\tconst src = this.getUri({ url: `svc/load-form/form-def/${this.apiKey}/${this.formId}` });\r\n\t\tconst query = embedContext === EmbedContext.Preview ? 'script.preview-form-definition' : `script[src='${src}']`;\r\n\t\tlet formDef: FormScriptDefinition = null;\r\n\t\tlet script = null;\r\n\r\n\t\ttry {\r\n\t\t\tscript = document.querySelector(query) as HTMLScriptElement;\r\n\t\t\tconst getFormDef = (script: HTMLScriptElement) => script['formDefinition'] as FormScriptDefinition;\r\n\t\t\tif (script)\r\n\t\t\t\tformDef = getFormDef(script);\r\n\t\t\telse {\r\n\t\t\t\tformDef = await (new Promise((resolve, reject) => {\r\n\t\t\t\t\tscript = document.createElement('script');\r\n\t\t\t\t\tscript.src = src;\r\n\t\t\t\t\tscript.onload = () => resolve(getFormDef(script));\r\n\t\t\t\t\tscript.onerror = e => reject(new Error(e.toString()));\r\n\t\t\t\t\tdocument.head.appendChild(script);\r\n\t\t\t\t}));\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (e) {\r\n\t\t\tif (!formDef)\r\n\t\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst formInternalName = script ? script.getAttribute('data-form-internal-name') : null;\r\n\r\n\t\tif (embedContext === EmbedContext.Entries)\r\n\t\t\tformDef.theme = {\r\n\t\t\t\tcss: `.cog-cognito {${EntryThemeCssString.replace(/\\r?\\n|\\r/g, '')}}`,\r\n\t\t\t\tlinks: [],\r\n\t\t\t\tisChameleon: false\r\n\t\t\t};\r\n\r\n\t\treturn FormDefinition.create(this.formId, formInternalName, formDef.template, formDef.modelOptions, formDef.theme);\r\n\t}\r\n\r\n\treportLoadingError(formId: string) {\r\n\t\treturn this.serviceRequest({\r\n\t\t\tendpoint: `svc/load-form/error/${this.apiKey}/${formId}`,\r\n\t\t\tmethod: 'post'\r\n\t\t});\r\n\t}\r\n}","export default \"--background-hsl: 0, 0%, 80%;\\r\\n--border-radius: 0px;\\r\\n--border-width: 1px;\\r\\n--color: #444;\\r\\n--font-family: Arial,Helvetica,sans-serif;\\r\\n--font-size: 13px;\\r\\n--font-weight: normal;\\r\\n--label__color: black;\\r\\n--gutter: 25px;\\r\\n--input-highlight: #AED136;\\r\\n--input-highlight-reverse: white;\\r\\n--highlight: #AED136;\\r\\n--highlight-reverse: white;\\r\\n--icon-weight: .9;\\r\\n--line-height: 1.4;\\r\\n--negative: #A3340D;\\r\\n--negative-reverse: white;\\r\\n--primary: #C24B23;\\r\\n--primary-reverse: #FFFFFF;\\r\\n--small-text: .85em;\\r\\n--speed: 1s;\\r\\n--a__color: #C24B23;\\r\\n--a__font-weight: normal;\\r\\n--checkbox__border-radius: calc(var(--input__border-radius) * .2);\\r\\n--checkable__scale: 1;\\r\\n--checkable-checked__scale: 1.1;\\r\\n--button-primary__font-size: 14px;\\r\\n--button-primary__font-weight: bold;\\r\\n--button-secondary__background-color: #aed136;\\r\\n--button-secondary__color: white;\\r\\n--button-secondary__border-radius: 0;\\r\\n--button-secondary__border-width: var(--border-width);\\r\\n--button-secondary__border-color: #aed136;\\r\\n--button-secondary__font-family: 'Open Sans Condensed',Helvetica,sans-serif;\\r\\n--form__background-color: transparent;\\r\\n--form__margins: 8px;\\r\\n--form__margins--responsive: 8px;\\r\\n--form__opacity: 1;\\r\\n--form__width: none;\\r\\n--h2__font-size: calc(1.54em);\\r\\n--heading__font-family: 'Open Sans Condensed',Helvetica,sans-serif;\\r\\n--heading__font-weight: bold;\\r\\n--heading__color: #666;\\r\\n--input__background-color: white;\\r\\n--input__border-color: #ccc;\\r\\n--input__border-radius: calc(var(--border-radius) * .75);\\r\\n--input__border-style: solid;\\r\\n--input__border-width: var(--border-width);\\r\\n--input__box-shadow: none;\\r\\n--input__color: #444;\\r\\n--input__padding-h: 10px;\\r\\n--input__padding-v: 8px;\\r\\n--input-focus__box-shadow: 0 0 1px 2px var(--input__background-color);\\r\\n--label__color: #666;\\r\\n--label__font-family: 'Open Sans Condensed',Helvetica,sans-serif;\\r\\n--label__font-size: 1.08em;\\r\\n--label__font-weight: bold;\\r\\n--page__background-color: white;\\r\\n--page__background-image: none;\\r\\n--placeholder__color: #cccccc;\\r\\n--toggle__border-radius: var(--input__border-radius);\"","import { ServiceWithSession } from './base-service';\r\nimport { FileDataRef } from 'src/server-types/model/file-data-ref';\r\nimport { FormsModel } from 'src/framework/forms-model';\r\nimport { FormSession } from './form-session';\r\nimport axios from 'axios';\r\n\r\ninterface ProgressEvent {\r\n\tloaded: number;\r\n\ttotal: number;\r\n\tpercent: number;\r\n}\r\n\r\ndeclare type ProgressHandler = (event: ProgressEvent) => void;\r\n\r\ninterface UploadOptions {\r\n\tonProgress?: ProgressHandler;\r\n\tencrypt?: boolean;\r\n\tcancelPromise?: Promise;\r\n}\r\n\r\nexport default class FileService extends ServiceWithSession {\r\n\tprivate inProgress = 0;\r\n\tprivate deserializeFileDataRef: (state: any) => FileDataRef;\r\n\r\n\tconstructor(model: FormsModel, session: FormSession) {\r\n\t\tsuper(session);\r\n\t\tthis.deserializeFileDataRef = state => model.construct('FileDataRef', state);\r\n\t}\r\n\r\n\t/**\r\n\t * @returns true if there is at least one upload request in progress.\r\n\t */\r\n\tget busy() {\r\n\t\treturn this.inProgress > 0;\r\n\t}\r\n\r\n\tasync upload(file: File, { onProgress, encrypt, cancelPromise }: UploadOptions) {\r\n\t\tconst params = {};\r\n\t\tif (encrypt)\r\n\t\t\tparams['encrypt'] = '';\r\n\r\n\t\tconst cancel = axios.CancelToken.source();\r\n\t\tcancelPromise.then(cancel.cancel);\r\n\r\n\t\tconst data = new FormData();\r\n\t\tdata.append('file', file);\r\n\r\n\t\tthis.inProgress++;\r\n\t\tconst res = await this.serviceRequest({\r\n\t\t\tmethod: 'post',\r\n\t\t\tendpoint: 'forms/public/file',\r\n\t\t\tparams,\r\n\t\t\tdata,\r\n\t\t\tcancelToken: cancel.token,\r\n\t\t\tonUploadProgress: e => {\r\n\t\t\t\tif (e.total > 0)\r\n\t\t\t\t\te.percent = e.loaded / e.total * 100;\r\n\t\t\t\tonProgress(e);\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.inProgress--;\r\n\r\n\t\tif (res.error)\r\n\t\t\tthrow res.error;\r\n\r\n\t\treturn this.deserializeFileDataRef(res.response.data);\r\n\t}\r\n\r\n\tgetDownloadUrl(file: FileDataRef) {\r\n\t\treturn this.getUri({\r\n\t\t\turl: 'forms/public/file',\r\n\t\t\tparams: {\r\n\t\t\t\tid: file.Id,\r\n\t\t\t\tct: file.ContentType,\r\n\t\t\t\ttoken: this.sessionToken\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetThumbnailUrl(file: FileDataRef) {\r\n\t\tif (!file.Id)\r\n\t\t\treturn null;\r\n\r\n\t\treturn this.getUri({\r\n\t\t\turl: 'forms/public/thumbnail',\r\n\t\t\tparams: {\r\n\t\t\t\tid: file.Id,\r\n\t\t\t\ttoken: this.sessionToken\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","// NOTE: Generated by `generate-localizations.ps1`\r\n\r\nconst productSupportedLocales: { [code: string]: string } = {\r\n\ten: 'English',\r\n\thu: 'Hungarian',\r\n\tth: 'Thai',\r\n\tsv: 'Swedish',\r\n\tes: 'Spanish',\r\n\thi: 'Hindi',\r\n\tnl: 'Dutch',\r\n\tfi: 'Finnish',\r\n\tbg: 'Bulgarian',\r\n\tzh: 'Chinese',\r\n\tit: 'Italian',\r\n\tpt: 'Portuguese',\r\n\tnb: 'Norwegian (Bokmål)',\r\n\tpl: 'Polish',\r\n\tfr: 'French',\r\n\tja: 'Japanese',\r\n\tel: 'Greek',\r\n\tda: 'Danish',\r\n\ttr: 'Turkish',\r\n\tde: 'German',\r\n\thr: 'Croatian'\r\n};\r\n\r\nexport default productSupportedLocales;\r\n","// NOTE: Generated by `generate-localizations.ps1`\r\n\r\n// SEE: https://element.eleme.io/?ref=madewithvuejs.com#/en-US/component/i18n\r\n\r\nconst elementSupportedLanguages: { [code: string]: string } = {\r\n\t'af-ZA': 'Afrikaans (South Africa)',\r\n\t'ar': 'Arabic',\r\n\t'bg': 'Bulgarian',\r\n\t'ca': 'Catalunya',\r\n\t'cs-CZ': 'Czech (Czech Republic)',\r\n\t'da': 'Danish',\r\n\t'de': 'German',\r\n\t'ee': 'Estonian',\r\n\t'el': 'Greek',\r\n\t'en': 'English',\r\n\t'eo': 'Esperanto',\r\n\t'es': 'Spanish',\r\n\t'eu': 'Basque',\r\n\t'fa': 'Farsi',\r\n\t'fi': 'Finnish',\r\n\t'fr': 'French',\r\n\t'he': 'Hebrew',\r\n\t'hr': 'Croatian',\r\n\t'hu': 'Hungarian',\r\n\t'hy-AM': 'Armenian (Armenia)',\r\n\t'id': 'Indonesian',\r\n\t'it': 'Italian',\r\n\t'ja': 'Japanese',\r\n\t'kg': 'Kyrgyz',\r\n\t'km': 'Khmer',\r\n\t'ko': 'Korean',\r\n\t'ku': 'Central Kurdish',\r\n\t'kz': 'Kazakh',\r\n\t'lt': 'Lithuanian',\r\n\t'lv': 'Latvian',\r\n\t'mn': 'Mongolian',\r\n\t'nb-NO': 'Norwegian, Bokmål (Norway)',\r\n\t'nl': 'Dutch',\r\n\t'pl': 'Polish',\r\n\t'pt-br': 'Portuguese (Brazil)',\r\n\t'pt': 'Portuguese',\r\n\t'ro': 'Romanian',\r\n\t'ru-RU': 'Russian (Russia)',\r\n\t'sk': 'Slovak',\r\n\t'sl': 'Slovenian',\r\n\t'sr': 'Serbian',\r\n\t'sv-SE': 'Swedish (Sweden)',\r\n\t'ta': 'Tamil',\r\n\t'th': 'Thai',\r\n\t'tk': 'Turkmen',\r\n\t'tr-TR': 'Turkish (Turkey)',\r\n\t'ua': 'Ukrainian',\r\n\t'ug-CN': 'Uighur',\r\n\t'uz-UZ': 'Uzbek',\r\n\t'vi': 'Vietnamese',\r\n\t'zh-CN': 'Chinese (Simplified, PRC)',\r\n\t'zh-TW': 'Chinese (Traditional, Taiwan)'\r\n};\r\n\r\nexport default elementSupportedLanguages;\r\n","import productSupportedLocales from './product-supported-locales.generated';\r\nimport elementSupportedLanguages from './element-supported-languages.generated';\r\nimport { CultureInfo, LocalizedResources } from '@cognitoforms/model.js';\r\n\r\n/**\r\n * Type definition for the element localization module (i.e. \"/element-ui/lib/locale\")\r\n */\r\nexport type ElementLocalizationModule = {\r\n\tuse(lang: any): void;\r\n\tt(path: string, options: any): string;\r\n\ti18n(fn: (path: string, options: any) => string | null | void): void;\r\n};\r\n\r\n/**\r\n* Override the element language code to use for some locales when the two don't match or are not a 1:1 mapping\r\n*/\r\nconst productLocaleToElementLangOverrides: { [code: string]: string } = {\r\n\t// Chinese => Simplified Chinese\r\n\t'zh': 'zh-CN',\r\n\r\n\t// Norwegian\r\n\t'nb': 'nb-NO',\r\n\r\n\t// Swedish\r\n\t'sv': 'sv-SE',\r\n\r\n\t// Turkish\r\n\t'tr': 'tr-TR'\r\n};\r\n\r\n/**\r\n * Gets the element language code to use for the given locale code\r\n * @param locale The locale code (i.e. product language code, based on .NET cultures)\r\n */\r\nexport function getElementLanguageCode(locale: string): string {\r\n\tif (!productSupportedLocales.hasOwnProperty(locale)) {\r\n\t\tthrow new Error(`Locale ${locale} is not supported, options: ${Object.keys(productSupportedLocales).join(',')}.`);\r\n\t}\r\n\r\n\tconst localeName = productSupportedLocales[locale];\r\n\r\n\tconst overrideElementLangCode = productLocaleToElementLangOverrides.hasOwnProperty(locale) ? productLocaleToElementLangOverrides[locale] : null;\r\n\r\n\tif (elementSupportedLanguages.hasOwnProperty(overrideElementLangCode || locale)) {\r\n\t\treturn overrideElementLangCode || locale;\r\n\t}\r\n\r\n\tif (overrideElementLangCode) {\r\n\t\tthrow new Error(`Locale '${locale}' (${localeName}) has an override of '${overrideElementLangCode}', which is not a valid language supported by Element, options: ${Object.keys(elementSupportedLanguages).join(',')}.`);\r\n\t}\r\n\r\n\tthrow new Error(`Locale '${locale}' (${localeName}) does not map to a language supported by Element, options: ${Object.keys(elementSupportedLanguages).join(',')}.`);\r\n}\r\n\r\n/**\r\n * Imports an element language module for the given locale\r\n * @param locale The locale code of the language module to import\r\n */\r\nexport function importElementLanguage(locale: string): Promise {\r\n\tif (locale === 'hi') {\r\n\t\treturn import(/* webpackChunkName: '[request]' */ './element/hi').then(m => m.default);\r\n\t}\r\n\r\n\tconst langCode = getElementLanguageCode(locale);\r\n\treturn import(/* webpackChunkName: '[request]' */ `@cognitoforms/element-ui/lib/locale/lang/${langCode}`).then(m => m.default);\r\n}\r\n\r\n/**\r\n * Override the given resource path it the resource module, and track that it has been overridden\r\n * NOTE: Loosely based on the `t` function in element (see: src\\locale\\index.js)\r\n * @param obj The target object\r\n * @param path The path to set\r\n * @param newValue The new value to set\r\n */\r\nexport function overrideResourcePath(lang: any, path: string, newValue: string, createMissing: boolean = false): boolean | void {\r\n\tconst array = path.split('.');\r\n\tlet current = lang;\r\n\tlet missing = false;\r\n\tfor (let i = 0, j = array.length; i < j; i++) {\r\n\t\tconst property = array[i];\r\n\t\tlet value = current[property];\r\n\t\tconst isLeafProp = i === j - 1;\r\n\t\tif (isLeafProp) {\r\n\t\t\tif (!current.hasOwnProperty(property) && !createMissing) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tlet changed = false;\r\n\t\t\tif (missing || !value || value !== newValue) {\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t\tcurrent[property] = newValue;\r\n\t\t\treturn changed;\r\n\t\t}\r\n\t\telse if (!value) {\r\n\t\t\tif (createMissing) {\r\n\t\t\t\tif (!missing) {\r\n\t\t\t\t\tmissing = true;\r\n\t\t\t\t}\r\n\t\t\t\tvalue = current[property] = {};\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcurrent = value;\r\n\t}\r\n}\r\n\r\n/**\r\n * Update the given element language module using product localized resources and culture info\r\n * @param lang The language module to update\r\n * @param localizedResources The \"dictionary\" of localized resources\r\n * @param cultureInfo The current culture info object\r\n * @returns The list of resources that have been overridden\r\n */\r\nexport function updateElementLanguageModule(lang: any, localizedResources: LocalizedResources, cultureInfo: CultureInfo): string[] {\r\n\t// Keep track of language module paths that have been overridden\r\n\tconst overriddenResourcePaths: string[] = [];\r\n\r\n\t// Defines the intended language module overrides\r\n\tconst overrides = {\r\n\t\t'el.datepicker.now': localizedResources['field-datepicker-now'],\r\n\t\t'el.datepicker.today': localizedResources['today'],\r\n\t\t// 'el.datepicker.cancel': ???, // Only used by `time` and `time-range` components (which we don't use)\r\n\t\t'el.datepicker.clear': localizedResources['clear'],\r\n\t\t'el.datepicker.confirm': localizedResources['field-datepicker-confirm'],\r\n\t\t// 'el.datepicker.selectDate': ???, // Only used if `showTime` is true\r\n\t\t// 'el.datepicker.selectTime': ???, // Only used if `showTime` is true\r\n\t\t// 'el.datepicker.startDate': ???, // Only used by the `date-range` and `time-range` components\r\n\t\t// 'el.datepicker.startTime': ???, // Only used by the `time-range` component\r\n\t\t// 'el.datepicker.endDate': ???, // Only used by the `date-range` and `time-range` components\r\n\t\t// 'el.datepicker.endTime': ???, // Only used by the `time-range` component\r\n\t\t'el.datepicker.prevYear': localizedResources['field-datepicker-prev-year'],\r\n\t\t'el.datepicker.nextYear': localizedResources['field-datepicker-next-year'],\r\n\t\t'el.datepicker.prevMonth': localizedResources['field-datepicker-prev-month'],\r\n\t\t'el.datepicker.nextMonth': localizedResources['field-datepicker-next-month'],\r\n\t\t'el.datepicker.year': localizedResources['field-datepicker-year'],\r\n\t\t'el.datepicker.month1': cultureInfo.dateTimeFormat.MonthNames[0],\r\n\t\t'el.datepicker.month2': cultureInfo.dateTimeFormat.MonthNames[1],\r\n\t\t'el.datepicker.month3': cultureInfo.dateTimeFormat.MonthNames[2],\r\n\t\t'el.datepicker.month4': cultureInfo.dateTimeFormat.MonthNames[3],\r\n\t\t'el.datepicker.month5': cultureInfo.dateTimeFormat.MonthNames[4],\r\n\t\t'el.datepicker.month6': cultureInfo.dateTimeFormat.MonthNames[5],\r\n\t\t'el.datepicker.month7': cultureInfo.dateTimeFormat.MonthNames[6],\r\n\t\t'el.datepicker.month8': cultureInfo.dateTimeFormat.MonthNames[7],\r\n\t\t'el.datepicker.month9': cultureInfo.dateTimeFormat.MonthNames[8],\r\n\t\t'el.datepicker.month10': cultureInfo.dateTimeFormat.MonthNames[9],\r\n\t\t'el.datepicker.month11': cultureInfo.dateTimeFormat.MonthNames[10],\r\n\t\t'el.datepicker.month12': cultureInfo.dateTimeFormat.MonthNames[11],\r\n\t\t// 'el.datepicker.week': ???, // Only used if `showWeekNumber` prop is set (default is false)\r\n\t\t'el.datepicker.weeks.sun': cultureInfo.dateTimeFormat.AbbreviatedDayNames[0],\r\n\t\t'el.datepicker.weeks.mon': cultureInfo.dateTimeFormat.AbbreviatedDayNames[1],\r\n\t\t'el.datepicker.weeks.tue': cultureInfo.dateTimeFormat.AbbreviatedDayNames[2],\r\n\t\t'el.datepicker.weeks.wed': cultureInfo.dateTimeFormat.AbbreviatedDayNames[3],\r\n\t\t'el.datepicker.weeks.thu': cultureInfo.dateTimeFormat.AbbreviatedDayNames[4],\r\n\t\t'el.datepicker.weeks.fri': cultureInfo.dateTimeFormat.AbbreviatedDayNames[5],\r\n\t\t'el.datepicker.weeks.sat': cultureInfo.dateTimeFormat.AbbreviatedDayNames[6],\r\n\t\t'el.datepicker.months.jan': cultureInfo.dateTimeFormat.AbbreviatedMonthNames[0],\r\n\t\t'el.datepicker.months.feb': cultureInfo.dateTimeFormat.AbbreviatedMonthNames[1],\r\n\t\t'el.datepicker.months.mar': cultureInfo.dateTimeFormat.AbbreviatedMonthNames[2],\r\n\t\t'el.datepicker.months.apr': cultureInfo.dateTimeFormat.AbbreviatedMonthNames[3],\r\n\t\t'el.datepicker.months.may': cultureInfo.dateTimeFormat.AbbreviatedMonthNames[4],\r\n\t\t'el.datepicker.months.jun': cultureInfo.dateTimeFormat.AbbreviatedMonthNames[5],\r\n\t\t'el.datepicker.months.jul': cultureInfo.dateTimeFormat.AbbreviatedMonthNames[6],\r\n\t\t'el.datepicker.months.aug': cultureInfo.dateTimeFormat.AbbreviatedMonthNames[7],\r\n\t\t'el.datepicker.months.sep': cultureInfo.dateTimeFormat.AbbreviatedMonthNames[8],\r\n\t\t'el.datepicker.months.oct': cultureInfo.dateTimeFormat.AbbreviatedMonthNames[9],\r\n\t\t'el.datepicker.months.nov': cultureInfo.dateTimeFormat.AbbreviatedMonthNames[10],\r\n\t\t'el.datepicker.months.dec': cultureInfo.dateTimeFormat.AbbreviatedMonthNames[11],\r\n\t\t// 'el.select.loading': ???, // Option \"loading\" is not implemented\r\n\t\t'el.select.noMatch': localizedResources['field-choice-no-match'],\r\n\t\t// 'el.select.noData': ???, // The `no-data-text` prop is explicitly set to blank string\r\n\t\t// 'el.select.placeholder': ???, // Dictates default placeholder, but we bind the prop explicitly\r\n\t\t// 'el.cascader.noMatch': ???, // Component is not used\r\n\t\t// 'el.cascader.loading': ???, // Component is not used\r\n\t\t// 'el.cascader.placeholder': ???, // Component is not used\r\n\t\t// 'el.cascader.noData': ???, // Component is not used\r\n\t\t// 'el.pagination.goto': ???, // Component is not used\r\n\t\t// 'el.pagination.pagesize': ???, // Component is not used\r\n\t\t// 'el.pagination.total': ???, // Component is not used\r\n\t\t// 'el.pagination.pageClassifier': ???, // Component is not used\r\n\t\t// 'el.messagebox.title': ???, // Component is not used\r\n\t\t// 'el.messagebox.confirm': ???, // Component is not used\r\n\t\t// 'el.messagebox.cancel': ???, // Component is not used\r\n\t\t// 'el.messagebox.error': ???, // Component is not used\r\n\t\t// 'el.upload.deleteTip': ???, // Not used since we set `show-file-list` to false\r\n\t\t// 'el.upload.delete': ???, // Resource does not appear to be used in the element codebase\r\n\t\t// 'el.upload.preview': ???, // Resource does not appear to be used in the element codebase\r\n\t\t// 'el.upload.continue': ???, // Resource does not appear to be used in the element codebase\r\n\t\t// 'el.table.emptyText': ???, // Component is not used\r\n\t\t// 'el.table.confirmFilter': ???, // Component is not used\r\n\t\t// 'el.table.resetFilter': ???, // Component is not used\r\n\t\t// 'el.table.clearFilter': ???, // Component is not used\r\n\t\t// 'el.table.sumText': ???, // Component is not used\r\n\t\t// 'el.tree.emptyText': ???, // Component is not used\r\n\t\t// 'el.transfer.noMatch': ???, // Component is not used\r\n\t\t// 'el.transfer.noData': ???, // Component is not used\r\n\t\t// 'el.transfer.titles': ???, // Component is not used\r\n\t\t// 'el.transfer.filterPlaceholder': ???, // Component is not used\r\n\t\t// 'el.transfer.noCheckedFormat': ???, // Component is not used\r\n\t\t// 'el.transfer.hasCheckedFormat': ???, // Component is not used\r\n\t\t// 'el.image.error': ???, // Component is not used\r\n\t\t// 'el.pageHeader.title': ???, // Component is not used\r\n\t\t// 'el.popconfirm.confirmButtonText': ???, // Component is not used\r\n\t\t// 'el.popconfirm.cancelButtonText': ???, // Component is not used\r\n\t\t'el.spinner.increase': localizedResources['field-spinner-increase'],\r\n\t\t'el.spinner.decrease': localizedResources['field-spinner-decrease']\r\n\t};\r\n\r\n\t// Override the resources paths\r\n\tObject.keys(overrides).forEach(path => {\r\n\t\tconst newValue = overrides[path];\r\n\t\tconst overrideResult = overrideResourcePath(lang, path, newValue);\r\n\t\tif (typeof overrideResult === 'boolean')\r\n\t\t\toverriddenResourcePaths.push(path);\r\n\t\telse if (process.env.NODE_ENV === 'development')\r\n\t\t\tconsole.warn(`Resource path '${path}' could not be overridden.`);\r\n\t});\r\n\r\n\treturn overriddenResourcePaths;\r\n}\r\n\r\n/**\r\n * Configure element localization for the given locale\r\n * @param elementLocalization The element localization module\r\n * @param locale The locale to configure\r\n * @param localizedResources The \"dictionary\" of localized resources for the target locale\r\n * @param cultureInfo The culture info object for the target locale\r\n */\r\nexport function configureElementLocalization(elementLocalization: ElementLocalizationModule, locale: string, localizedResources: LocalizedResources, cultureInfo: CultureInfo): Promise {\r\n\t// Import the appropriate element language module for the given locale\r\n\treturn importElementLanguage(locale).then(lang => {\r\n\t\t// Update the element language module to use Cognito resources and cultures, and record the resources that have been overridden\r\n\t\tconst overriddenResourcePaths = updateElementLanguageModule(lang, localizedResources, cultureInfo);\r\n\r\n\t\tif (process.env.NODE_ENV === 'development') {\r\n\t\t\t// In development, override the i18n behavior to warn about resources that are not defined by Cognito localized resources and cultures\r\n\t\t\telementLocalization.i18n((path: string) => {\r\n\t\t\t\tif (overriddenResourcePaths.indexOf(path) < 0) {\r\n\t\t\t\t\tconsole.warn(`Element resource '${path}' is not mapped to product resources, falling back to out of box language module...`);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// Set the appropriate language module as a fallback\r\n\t\telementLocalization.use(lang);\r\n\t});\r\n}\r\n","import { ApplicationInsights as ApplicationInsightsInitializer, IExceptionTelemetry, ITelemetryItem } from '@microsoft/applicationinsights-web';\r\nimport { ApplicationInsights } from '@microsoft/applicationinsights-analytics-js/types/applicationinsights-analytics-js';\r\nimport { Initialization } from '@microsoft/applicationinsights-web/dist-esm/Initialization';\r\nimport { ObjectLookup } from 'src/util';\r\n\r\nexport default class AppInsights {\r\n\tconstructor(key: string, endpointUrl: string) {\r\n\t\tconst initializer = new ApplicationInsightsInitializer({\r\n\t\t\tconfig: {\r\n\t\t\t\tisCookieUseDisabled: true,\r\n\t\t\t\tinstrumentationKey: key,\r\n\t\t\t\tendpointUrl: endpointUrl,\r\n\t\t\t\tenableUnhandledPromiseRejectionTracking: true,\r\n\t\t\t\tmaxBatchInterval: 10000\r\n\t\t\t}\r\n\t\t}) as Initialization;\r\n\r\n\t\tinitializer.loadAppInsights();\r\n\r\n\t\tthis.appInsights = initializer.appInsights;\r\n\t}\r\n\r\n\tprivate appInsights : ApplicationInsights;\r\n\r\n\t// ---------Methods----------\r\n\tlog(error: Error, additionalProperties: ObjectLookup = null) {\r\n\t\tconst exception = {\r\n\t\t\tid: '',\r\n\t\t\texception: error\r\n\t\t} as IExceptionTelemetry;\r\n\r\n\t\tthis.appInsights.trackException(exception, additionalProperties);\r\n\t}\r\n\r\n\tpageView(additionalProperties: {[key: string]: any;} = null) {\r\n\t\tthis.appInsights.trackPageView(null, additionalProperties);\r\n\t}\r\n\r\n\taddTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void) {\r\n\t\tthis.appInsights.addTelemetryInitializer(telemetryInitializer);\r\n\t}\r\n\r\n\tlogCustomEvent(eventName: string, additionalProperties: ObjectLookup = null) {\r\n\t\tconst event = {\r\n\t\t\tname: eventName\r\n\t\t};\r\n\r\n\t\tthis.appInsights.trackEvent(event, additionalProperties);\r\n\t}\r\n}\r\n","import AppInsights from './app-insights';\r\nimport Vue from 'vue';\r\nimport { CError } from './error';\r\nimport FormBase from 'src/components/FormBase';\r\nimport { FormSession } from 'src/web-api/form-session';\r\nimport { FormEntry } from 'src/server-types/forms/model/form-entry';\r\nimport { ObjectLookup } from '@cognitoforms/model.js/@types/helpers';\r\n\r\nconst ignoredExceptions = new Set([\r\n\t'ResizeObserver loop limit exceeded',\r\n\t'ResizeObserver loop completed with undelivered notifications.'\r\n]);\r\n\r\nexport default class Log {\r\n\tconstructor(session: FormSession) {\r\n\t\tthis.session = session;\r\n\t\tif (!this.isEnabled)\r\n\t\t\treturn;\r\n\r\n\t\tif (!Log.appInsights) {\r\n\t\t\tLog.appInsights = new AppInsights('faux-key', '/svc/log');\r\n\r\n\t\t\tLog.appInsights.addTelemetryInitializer(function ignoreUselessErrors(item) {\r\n\t\t\t\tif (item.baseType === 'ExceptionData' && ignoredExceptions.has(item.data.message))\r\n\t\t\t\t\treturn false;\r\n\t\t\t\telse\r\n\t\t\t\t\treturn true;\r\n\t\t\t});\r\n\r\n\t\t\t// append metadata to telemetry\r\n\t\t\tLog.appInsights.addTelemetryInitializer(item => {\r\n\t\t\t\tif (item.baseData) {\r\n\t\t\t\t\titem.baseData.properties = item.baseData.properties || {};\r\n\t\t\t\t\tObject.assign(item.baseData.properties, this.metadata);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// eslint-disable-line no-use-before-define\r\n\t\tVue.config.errorHandler = Log.onError;\r\n\t\tVue.config.warnHandler = Log.onWarning;\r\n\t}\r\n\r\n\t// -------------- Properties --------------\r\n\tprivate entry: FormEntry;\r\n\tprivate session: FormSession;\r\n\tprivate static appInsights: AppInsights;\r\n\r\n\t// -------------- Computed --------------\r\n\tget isEnabled(): boolean {\r\n\t\treturn this.session.flags.log;\r\n\t}\r\n\r\n\tget organizationId(): string {\r\n\t\treturn this.session.organizationId;\r\n\t}\r\n\r\n\tget formName(): string {\r\n\t\treturn this.entry && this.entry.Form ? this.entry.Form.InternalName : null;\r\n\t}\r\n\r\n\tget formId(): string {\r\n\t\treturn this.session.formId;\r\n\t}\r\n\r\n\tget entryId(): string {\r\n\t\treturn this.entry ? this.entry.Id : null;\r\n\t}\r\n\r\n\t// -------------- Methods --------------\r\n\terror(error: CError | Error, additionalProperties?: ObjectLookup) : void {\r\n\t\tconst cError = error as CError;\r\n\t\tif (additionalProperties) {\r\n\t\t\tcError.additionalProperties = {\r\n\t\t\t\t...cError.additionalProperties,\r\n\t\t\t\t...additionalProperties\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tLog.error(error as CError, this);\r\n\t}\r\n\r\n\twarn(message: string, trace?: string): void {\r\n\t\tLog.warn(message, this, trace);\r\n\t}\r\n\r\n\tpageLoad(): void {\r\n\t\tif (!this.isEnabled)\r\n\t\t\treturn;\r\n\r\n\t\tLog.appInsights.pageView();\r\n\t}\r\n\r\n\tregisterEntry(entry: FormEntry) {\r\n\t\tthis.entry = entry;\r\n\t}\r\n\r\n\tcustomEvent(eventName: string, additionalProperties?: ObjectLookup) {\r\n\t\tLog.customEvent(eventName, this, additionalProperties);\r\n\t}\r\n\r\n\tprivate static error(error: CError, log: Log): void {\r\n\t\tconsole.error(error.message, error);\r\n\r\n\t\t// Some errors are only for the end-user. A more detailed error was probably already logged\r\n\t\tif (!log.isEnabled || error.log === false)\r\n\t\t\treturn;\r\n\r\n\t\tLog.appInsights.log(error, error.additionalProperties);\r\n\r\n\t\t// Prevent the error from being logged again by additional throws or subsequent calls to `logError`\r\n\t\terror.log = false;\r\n\t}\r\n\r\n\tprivate static warn(message: string, log: Log, trace?: string): void {\r\n\t\tif (!log || !log.isEnabled)\r\n\t\t\treturn;\r\n\r\n\t\tconst error = new CError(message);\r\n\t\terror.stack = trace;\r\n\r\n\t\tLog.appInsights.log(error, { isWarning: 'true' });\r\n\r\n\t\tconsole.warn(error.message, error);\r\n\t}\r\n\r\n\tprivate static customEvent(eventName: string, log: Log, additionalProperties: ObjectLookup): void {\r\n\t\tif (!log || !log.isEnabled)\r\n\t\t\treturn;\r\n\r\n\t\tLog.appInsights.logCustomEvent(eventName, additionalProperties);\r\n\t}\r\n\r\n\tprivate get metadata() {\r\n\t\treturn {\r\n\t\t\t'organizationId': this.organizationId,\r\n\t\t\t'formName': this.formName,\r\n\t\t\t'formId': this.formId,\r\n\t\t\t'entryId': this.entryId,\r\n\t\t\t'formVersion': '2'\r\n\t\t};\r\n\t}\r\n\r\n\tprivate static getInstance(obj: Vue | FormBase): Log {\r\n\t\treturn obj ? (obj.$root as FormBase).log as Log : null;\r\n\t}\r\n\r\n\tprivate static onError(error: Error, $vm: Vue): void {\r\n\t\tif (ignoredExceptions.has(error.message))\r\n\t\t\treturn;\r\n\r\n\t\tLog.error(error, Log.getInstance($vm));\r\n\t}\r\n\r\n\tprivate static onWarning(message: string, $vm: Vue, trace: string): void {\r\n\t\tLog.warn(message, Log.getInstance($vm), trace);\r\n\t}\r\n}","import { Deferred } from './deferred';\r\n\r\nexport interface Reference {\r\n\tvalue: T;\r\n\tvaluePromise: Promise;\r\n};\r\n\r\nexport class WriteableReference implements Reference {\r\n\tprivate _value: T;\r\n\r\n\tprivate _setValueTask = new Deferred();\r\n\r\n\tget value(): T {\r\n\t\treturn this._value;\r\n\t}\r\n\r\n\tset value(value: T) {\r\n\t\tthis._value = value;\r\n\t\tthis._setValueTask.resolve();\r\n\t}\r\n\r\n\tget valuePromise(): Promise {\r\n\t\treturn this._setValueTask.promise.then(() => this.value);\r\n\t}\r\n}\r\n","import { EntrySaveResult, EntryService, ResumeEntryResult, EntrySubmissionResult, parseStoreResult } from './entry-service';\r\nimport { NotificationAddress } from 'src/server-types/model/notification-address';\r\nimport { FormEntry } from 'src/server-types/forms/model/form-entry';\r\nimport { FormSession } from './form-session';\r\nimport { Order } from 'src/server-types/payment/model/order';\r\n\r\nexport class PreviewEntryService extends EntryService {\r\n\treadonly formJson: string;\r\n\r\n\tconstructor(session: FormSession, formJson: string) {\r\n\t\tsuper(session);\r\n\t\tthis.formJson = formJson;\r\n\t}\r\n\r\n\tasync submit(entry: FormEntry, embedUrl: string, saveAndRedirect: boolean, entryToken: string): Promise {\r\n\t\tconst entryJson = entry.serialize();\r\n\t\tconst order = entry.Order as Order;\r\n\t\tconst result = await this.serviceRequest({\r\n\t\t\tmethod: 'post',\r\n\t\t\tendpoint: `forms/${this.session.isAnonymous ? 'anonymous' : 'admin'}/submitpreviewentry`,\r\n\t\t\theaders: { [this.session.botValidation.method]: this.session.botValidation.token },\r\n\t\t\tdata: {\r\n\t\t\t\tformJSON: encodeURIComponent(this.formJson),\r\n\t\t\t\tentryJSON: JSON.stringify(entryJson),\r\n\t\t\t\torderJSON: order ? JSON.stringify(order.serialize()) : null\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (result.response && result.response.data) {\r\n\t\t\tconst data = result.response.data;\r\n\t\t\tconst submissionResult = parseStoreResult(data) as EntrySubmissionResult;\r\n\r\n\t\t\t// Add the session token to document links to support downloads\r\n\t\t\tif (data.entryDocuments) {\r\n\t\t\t\tsubmissionResult.documents = data.entryDocuments.map(doc => {\r\n\t\t\t\t\tdoc.link = doc.link + '&token=' + encodeURIComponent(this.sessionToken);\r\n\t\t\t\t\treturn doc;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\treturn submissionResult;\r\n\t\t}\r\n\r\n\t\tthrow this.parseError(result.error);\r\n\t}\r\n\r\n\tasync save(entry: FormEntry, embedUrl: string, entryToken: string, resumePage?: number): Promise {\r\n\t\tconst saveAndResumeAddresses = [];\r\n\r\n\t\ttry {\r\n\t\t\tconst saveAndResumeRecipients = JSON.parse(this.formJson).SaveAndResumeNotification.Recipients as NotificationAddress[];\r\n\t\t\tsaveAndResumeRecipients\r\n\t\t\t\t.map(email => email.Address)\r\n\t\t\t\t.forEach(emailAddress => {\r\n\t\t\t\t\t// Retrieve the email address from the entry if the reference is a token\r\n\t\t\t\t\tif (emailAddress && emailAddress.indexOf('@') < 0)\r\n\t\t\t\t\t\temailAddress = entry.toString(emailAddress);\r\n\r\n\t\t\t\t\tif (emailAddress)\r\n\t\t\t\t\t\tsaveAndResumeAddresses.push(emailAddress);\r\n\t\t\t\t});\r\n\t\t}\r\n\t\tcatch (e) { }\r\n\r\n\t\tconst data = {\r\n\t\t\temailAddress: saveAndResumeAddresses.join('; '),\r\n\t\t\temailMessage: '',\r\n\t\t\tlink: 'This is where your link will go.'\r\n\t\t} as EntrySaveResult;\r\n\r\n\t\tconst saveResult = parseStoreResult(data) as unknown as EntrySaveResult;\r\n\t\tsaveResult.emailAddress = data.emailAddress;\r\n\t\tsaveResult.emailMessage = data.emailMessage;\r\n\t\tsaveResult.link = data.link;\r\n\t\tsaveResult.enableSend = false;\r\n\r\n\t\treturn saveResult;\r\n\t}\r\n\r\n\temailResumeLink(entryId: string, recipient: string, message: string, link: string) {\r\n\t\t// noop\r\n\t}\r\n\r\n\tasync resume(formId: string, entryToken: string): Promise {\r\n\t\tthrow new Error('Resuming an entry is not applicable in preview.');\r\n\t}\r\n}","import { EntrySubmissionResult, EntrySaveResult, ResumeEntryResult, EntryService, parseStoreResult } from './entry-service';\r\nimport { FormEntry } from './../server-types/forms/model/form-entry';\r\nimport { Order } from './../server-types/payment/model/order';\r\n\r\nexport class EntriesEntryService extends EntryService {\r\n\tasync submit(entry: FormEntry, embedUrl: string, saveAndRedirect: boolean): Promise {\r\n\t\tconst entryJson = entry.serialize();\r\n\t\tconst order = entry.Order as Order;\r\n\t\tconst result = await this.serviceRequest({\r\n\t\t\tmethod: 'post',\r\n\t\t\tendpoint: 'forms/admin/entry',\r\n\t\t\tisCognitoJson: true,\r\n\t\t\tdata: {\r\n\t\t\t\tEntry: entryJson,\r\n\t\t\t\tOrderAmount: order ? order.OrderAmount : null,\r\n\t\t\t\tAccessToken: this.session.accessToken,\r\n\t\t\t\tSaveAndResume_EmbedUrl: embedUrl\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// TODO: Return data in the same shape it comes from the server?\r\n\t\tif (result.response && result.response.data) {\r\n\t\t\tconst data = result.response.data;\r\n\t\t\treturn parseStoreResult(data) as EntrySubmissionResult;\r\n\t\t}\r\n\r\n\t\tthrow this.parseError(result.error);\r\n\t}\r\n\r\n\tasync save(entry: FormEntry, embedUrl: string, entryToken: string, resumePage?: number): Promise {\r\n\t\tconst data = await this.serviceRequest({\r\n\t\t\tmethod: 'post',\r\n\t\t\tendpoint: 'forms/admin/saveincompleteentry',\r\n\t\t\tisCognitoJson: true,\r\n\t\t\tdata: {\r\n\t\t\t\tEntry: entry.serialize(),\r\n\t\t\t\tOrderAmount: entry.Order ? entry.Order.OrderAmount : null,\r\n\t\t\t\tAccessToken: this.session.accessToken\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn parseStoreResult(data.response.data) as unknown as EntrySaveResult;\r\n\t}\r\n\r\n\tasync emailResumeLink(entryId: string, recipient: string, message: string, link: string) {\r\n\t\tthrow new Error('Can not email a save & resume link on the entries page.');\r\n\t}\r\n\r\n\tasync resume(formId: string, entryToken: string): Promise {\r\n\t\tthrow new Error('Can not resume an entry on the entries page.');\r\n\t}\r\n\r\n\tasync getEntry(entryId: string) {\r\n\t\tconst result = await this.serviceRequest({\r\n\t\t\tmethod: 'GET',\r\n\t\t\tendpoint: 'forms/admin/entry',\r\n\t\t\tparams: { id: entryId }\r\n\t\t});\r\n\r\n\t\treturn result.response.data as FormEntry;\r\n\t}\r\n}","import Vue from 'vue';\r\nimport { preventVueObservability } from '@cognitoforms/vuemodel';\r\nimport FormBase from 'src/components/FormBase';\r\nimport { ResumeMode, ResumeEntryResult, tryParseEntryToken } from '../web-api/entry-service';\r\nimport PublicEntryService from '../web-api/public-entry-service';\r\nimport { FormsModel } from './forms-model';\r\nimport { SessionService } from '../web-api/session-service';\r\nimport { FormService } from 'src/web-api/form-service';\r\nimport { EmbedContext, FormHandle } from './public/form-handle';\r\nimport { Deferred } from 'src/util/deferred';\r\nimport FileService from 'src/web-api/file-service';\r\nimport { FormEvents } from './public/events';\r\nimport EntryViewService from 'src/web-api/entry-views/entry-view-service';\r\nimport { FormSession } from 'src/web-api/form-session';\r\nimport QuantityService from 'src/web-api/quantity-service';\r\nimport elementLocalization from '@cognitoforms/element-ui/lib/locale';\r\nimport { configureElementLocalization } from 'src/localization/element-localization';\r\nimport Log from 'src/framework/logging/log';\r\nimport { FormEntry } from 'src/server-types/forms/model/form-entry';\r\nimport { CombinedVueInstance } from 'vue/types/vue';\r\nimport { defineBreakWordsFilter } from './break-words-filter';\r\nimport FormDefinition from './form-definition';\r\nimport { Reference, WriteableReference } from 'src/util/reference';\r\nimport { PreviewEntryService } from 'src/web-api/preview-entry-service';\r\nimport { EntriesEntryService } from 'src/web-api/entries-entry-service';\r\nimport { ObjectLookup } from 'src/util';\r\nimport { capitalizeKeys } from 'src/util/helpers';\r\nimport ConcurrentEntryService from 'src/web-api/concurrent-entry-service';\r\nimport { UserInfo } from 'src/server-types/forms/model/user-info';\r\nimport JSON5 from 'json5';\r\nimport { findLookupManagers } from './model/extensions/lookup-field/lookup-manager';\r\n\r\ndefineBreakWordsFilter(Vue);\r\n\r\nfunction preventObservability(...objects) {\r\n\tobjects.forEach(preventVueObservability);\r\n}\r\n\r\nfunction getEntryService(embedContext: EmbedContext, session: FormSession, formJson: string) {\r\n\tif (embedContext === EmbedContext.Preview)\r\n\t\treturn new PreviewEntryService(session, formJson);\r\n\telse if (embedContext === EmbedContext.Entries) {\r\n\t\tif (session.flags.concurrentEditing)\r\n\t\t\treturn new ConcurrentEntryService(session, true);\r\n\t\telse\r\n\t\t\treturn new EntriesEntryService(session);\r\n\t}\r\n\telse if (session.flags.concurrentEditing)\r\n\t\treturn new ConcurrentEntryService(session, false);\r\n\r\n\treturn new PublicEntryService(session);\r\n}\r\n\r\nasync function getEntryViewServiceIfNeeded(session: FormSession, model: FormsModel, log: Log) {\r\n\tlet entryViewService: EntryViewService;\r\n\tif (session.flags.hasLookups) {\r\n\t\tentryViewService = await (async () => {\r\n\t\t\tconst EntryViewService = await import(\r\n\t\t\t\t/* webpackChunkName: \"entry-view-service\" */\r\n\t\t\t\t'src/web-api/entry-views/entry-view-service').then(m => m.default);\r\n\t\t\treturn new EntryViewService(model, session, log);\r\n\t\t})();\r\n\t}\r\n\treturn entryViewService;\r\n}\r\n\r\nasync function getQuantityServiceIfNeeded(session: FormSession, hasInitialState: boolean) {\r\n\tlet quantityService: QuantityService;\r\n\tif (session.flags.hasQuantityLimits) {\r\n\t\tquantityService = await (async () => {\r\n\t\t\tconst QuantityService = await import(\r\n\t\t\t\t/* webpackChunkName: \"quantity-service\" */\r\n\t\t\t\t'src/web-api/quantity-service').then(m => m.default);\r\n\t\t\treturn new QuantityService(hasInitialState, session);\r\n\t\t})();\r\n\t}\r\n\treturn quantityService;\r\n}\r\n\r\n/**\r\n\t * Mounts invalid form view\r\n\t * @param el The element to mount to\r\n\t * @param type The type of invalid form to render\r\n\t * @param $resource The resource for the component to use\r\n\t */\r\nasync function mountInvalidFormView(el: HTMLElement | string, type: 'suspicious-content' | 'invalid-share-link' | 'form-not-found', $resource: (name: string, params?: ObjectLookup) => string) {\r\n\tconst CInvalidForm = await import('src/components/InvalidForm.vue').then(m => m.default);\r\n\tconst invalidForm = new Vue({\r\n\t\tname: 'InvalidForm',\r\n\t\tcomponents: { CInvalidForm },\r\n\t\tprovide: {\r\n\t\t\t$resource: $resource\r\n\t\t},\r\n\t\ttemplate: ``\r\n\t});\r\n\tinvalidForm.$mount(el);\r\n}\r\n\r\n/**\r\n\t * Mounts require authentication embedded view\r\n\t * @param el The element to mount to\r\n\t * @param data The props needed for view\r\n\t */\r\nasync function mountRequireAuthenticationView(el: HTMLElement | string, formUrl: string, linkText: string, entryToken: string) {\r\n\tconst CRequireAuthenticationEmbed = await import('src/components/RequireAuthenticationEmbed.vue').then(m => m.default);\r\n\r\n\tlet targetElement;\r\n\tif (typeof el === 'string')\r\n\t\ttargetElement = document.querySelector(el);\r\n\telse\r\n\t\ttargetElement = el;\r\n\r\n\tif (targetElement) {\r\n\t\t// Get token if applicable\r\n\t\tif (entryToken)\r\n\t\t\tformUrl = formUrl + '#' + entryToken;\r\n\t\telse if (window.location.href.includes('#'))\r\n\t\t\tformUrl = formUrl + window.location.href.substring(window.location.href.indexOf('#'));\r\n\r\n\t\t// Remove cog loader\r\n\t\tconst loader = document.getElementsByClassName('cog-loader');\r\n\t\tif (loader.length > 0)\r\n\t\t\tloader[0].parentNode.removeChild(loader[0]);\r\n\r\n\t\tconst requireAuth = new Vue({\r\n\t\t\tname: 'RequireAuthenticationEmbed',\r\n\t\t\tcomponents: { CRequireAuthenticationEmbed },\r\n\t\t\ttemplate: ``\r\n\t\t});\r\n\t\trequireAuth.$mount(el);\r\n\t}\r\n}\r\n\r\nexport default class InternalApi {\r\n\tprivate readonly forms = new Map>();\r\n\tprivate readonly sessionService: SessionService;\r\n\tprivate static readonly instances = new Map();\r\n\r\n\tprivate constructor(apiKey: string) {\r\n\t\tthis.sessionService = new SessionService(apiKey);\r\n\t\tInternalApi.instances.set(apiKey, this);\r\n\t}\r\n\r\n\tstatic get(apiKey: string): InternalApi {\r\n\t\tlet instance = InternalApi.instances.get(apiKey);\r\n\t\tif (!instance)\r\n\t\t\tinstance = new InternalApi(apiKey);\r\n\t\treturn instance;\r\n\t}\r\n\r\n\testablishSession(formId: string, embedContext: EmbedContext, formJson?: string): Promise {\r\n\t\tconst { entryToken } = tryParseEntryToken(location.hash);\r\n\t\treturn this.sessionService.newSession(formId, embedContext, formJson, entryToken);\r\n\t}\r\n\r\n\tasync getFormDefinition(session: FormSession, embedContext: EmbedContext): Promise {\r\n\t\tconst formId = session.formId;\r\n\r\n\t\t// Return the existing promise if it exists to avoid duplicate loading\r\n\t\tif (embedContext !== EmbedContext.Preview && this.forms.has(formId))\r\n\t\t\treturn this.forms.get(formId);\r\n\r\n\t\tif (session.formStatus === 'Disabled') {\r\n\t\t\t// Throw an error to signal to the caller that the form definition is not available\r\n\t\t\tthrow new Error(`Form ${formId} is disabled.`);\r\n\t\t}\r\n\r\n\t\t// Add the promise to our collection to prevent duplicate loading\r\n\t\tconst promise = new Deferred();\r\n\t\tif (embedContext !== EmbedContext.Preview)\r\n\t\t\tthis.forms.set(formId, promise.promise);\r\n\r\n\t\tconst formService = new FormService(session);\r\n\r\n\t\t// Fetch the form definition and resolve when it completes\r\n\t\tformService.getDefinition(embedContext)\r\n\t\t\t.then(formDef => promise.resolve(formDef))\r\n\t\t\t.catch(e => {\r\n\t\t\t\tconsole.error(e);\r\n\t\t\t\tformService.reportLoadingError(formId);\r\n\t\t\t});\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync performAction(session: FormSession, entryId: string, action: string, roleName: string, userInfo: UserInfo) {\r\n\t\tconst formDef = await this.getFormDefinition(session, EmbedContext.Entries);\r\n\t\tconst entriesEntryService = new EntriesEntryService(session);\r\n\t\tawait getEntryViewServiceIfNeeded(session, formDef.model, new Log(session));\r\n\r\n\t\tconst entryState = await entriesEntryService.getEntry(entryId);\r\n\t\tentryState.Entry.User = userInfo;\r\n\r\n\t\tconst entry = await formDef.model.constructEntry(entryState);\r\n\t\tentry.Entry.Role = roleName;\r\n\t\tentry.Entry.Action = action;\r\n\r\n\t\tif (await entriesEntryService.validateEntry(entry, null)) {\r\n\t\t\treturn entriesEntryService.submit(entry, undefined, undefined);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tasync mount(el: HTMLElement | string, handle: FormHandle, session: FormSession, formDef: FormDefinition, embedContext: EmbedContext, formJson?: string): Promise> {\r\n\t\tconst formId = handle.formId;\r\n\t\tlet handleIsReady = false;\r\n\r\n\t\tif (session.formStatus === 'AutoDisabled') {\r\n\t\t\t// Render the invalid/suspicious form component, completely independent from the actual form (i.e `FormBase`)\r\n\t\t\tawait mountInvalidFormView(el, 'suspicious-content', null);\r\n\r\n\t\t\t// Throw an error to signal to the caller that the form was not mounted successfully\r\n\t\t\tthrow new Error(`Form ${handle.formId} is disabled.`);\r\n\t\t}\r\n\r\n\t\tif (!formDef) {\r\n\t\t\tawait mountInvalidFormView(el, 'form-not-found', null);\r\n\t\t\tthrow new Error(`No form with id ${formId} has been defined.`);\r\n\t\t}\r\n\r\n\t\tconst log = new Log(session);\r\n\t\tconst entryService = getEntryService(embedContext, session, formJson);\r\n\r\n\t\tlet entryState: any = {};\r\n\t\tlet entryHash: any;\r\n\t\tlet resume: ResumeEntryResult;\r\n\t\t// Check the url for entry resume token and download the state for the token\r\n\r\n\t\thandle.once(FormEvents.EntryToken, async e => {\r\n\t\t\tif (handleIsReady)\r\n\t\t\t\tconsole.warn('entryToken() must be called immediately after mount(). The following prefill data was not used:', e.data);\r\n\t\t\telse\r\n\t\t\t\tentryHash = e.data.entryToken;\r\n\t\t});\r\n\r\n\t\thandle.on(FormEvents.OverrideText, e => {\r\n\t\t\tif (handleIsReady)\r\n\t\t\t\tconsole.warn('overrideText() must be called immediately after mount(). The following resource data was not used:', e.data);\r\n\t\t\telse\r\n\t\t\t\tformDef.model.overrideResource(e.data.resourceName, e.data.value);\r\n\t\t});\r\n\r\n\t\t// Listen for prefill\r\n\t\thandle.once(FormEvents.Prefill, async e => {\r\n\t\t\tif (handleIsReady)\r\n\t\t\t\tconsole.warn('prefill() must be called immediately after mount(). The following prefill data was not used:', e.data);\r\n\t\t\telse {\r\n\t\t\t\tconst { json } = e.data;\r\n\t\t\t\tconst data = JSON5.parse(json);\r\n\t\t\t\tentryState = capitalizeKeys(data);\r\n\t\t\t\tdelete entryState['Id'];\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tlet form: CombinedVueInstance>;\r\n\r\n\t\tconst formRef: WriteableReference = new WriteableReference();\r\n\r\n\t\tconst formsModel = formDef.model;\r\n\r\n\t\tconst FormComponent = formDef.component;\r\n\r\n\t\t// do not construct the entry or mount the form until the form handle is ready, allowing the user to prefill the entry state\r\n\t\thandle.ready.then(async () => {\r\n\t\t\tconst entryViewService = await getEntryViewServiceIfNeeded(session, formsModel, log);\r\n\t\t\tconst fileService = new FileService(formsModel, session);\r\n\r\n\t\t\thandleIsReady = true;\r\n\r\n\t\t\tconst { success: couldParseEntryToken, entryToken, actionId } = tryParseEntryToken(entryHash || location.hash);\r\n\t\t\tif (couldParseEntryToken) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tresume = await entryService.resume(formId, entryToken, actionId);\r\n\t\t\t\t\tentryState = resume.entry;\r\n\r\n\t\t\t\t\tif (resume.userEmail)\r\n\t\t\t\t\t\tentryState.Entry.User = { Email: resume.userEmail };\r\n\r\n\t\t\t\t\tif (resume.order)\r\n\t\t\t\t\t\tentryState.Order = resume.order;\r\n\t\t\t\t}\r\n\t\t\t\tcatch (e) {\r\n\t\t\t\t\tconsole.error(new Error('Invalid share link.'));\r\n\t\t\t\t\tsession.isValidSharedLink = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (session.flags.requireAuthenticationEmbedded) {\r\n\t\t\t\t// Render the require authentication on embedded form component, completely independent from the actual form (i.e `FormBase`)\r\n\t\t\t\tawait mountRequireAuthenticationView(el, session.formUrl, session.linkText, entryToken);\r\n\r\n\t\t\t\t// Throw an error to signal to the caller that the form was not mounted successfully\r\n\t\t\t\tthrow new Error(`Form ${handle.formId} requires authentication to access.`);\r\n\t\t\t}\r\n\r\n\t\t\tlet entry: FormEntry;\r\n\t\t\tif (entryState.Entry == null)\r\n\t\t\t\tentryState.Entry = {};\r\n\r\n\t\t\tif (!entryState.Entry.Role)\r\n\t\t\t\tentryState.Entry.Role = session.publicRole;\r\n\r\n\t\t\t// Overwrite resumed entry's userInfo if session's userInfo has a value\r\n\t\t\tif (session.userInfo && session.userInfo.Email)\r\n\t\t\t\tentryState.Entry.User = session.userInfo;\r\n\r\n\t\t\ttry {\r\n\t\t\t\tentry = await formsModel.constructEntry(entryState);\r\n\t\t\t}\r\n\t\t\tcatch (err) {\r\n\t\t\t\tentry = await formsModel.constructEntry();\r\n\t\t\t\tconsole.warn('Unable to construct entry with state:', entryState, err);\r\n\t\t\t}\r\n\r\n\t\t\tif (session.flags.useStripePaymentElement)\r\n\t\t\t\tentry.Use_Stripe_Payment_Element = true;\r\n\r\n\t\t\tconst quantityService = await getQuantityServiceIfNeeded(session, !entry.meta.isNew && entry.Entry.Status !== 'Incomplete');\r\n\r\n\t\t\tlog.registerEntry(entry);\r\n\r\n\t\t\t// Get locale, localized resources, and culture from model options\r\n\t\t\tconst cultureInfo = formDef.model.model.$culture;\r\n\t\t\tconst locale = formDef.model.model.$locale;\r\n\t\t\tconst localizedResources = formDef.model.model.$resources[locale];\r\n\r\n\t\t\t// Configure Element to use the locale defined for the form\r\n\t\t\t// https://element.eleme.io/?ref=madewithvuejs.com#/en-US/component/i18n\r\n\t\t\tconfigureElementLocalization(elementLocalization, locale, localizedResources, cultureInfo);\r\n\r\n\t\t\tsession.registerResources(localizedResources);\r\n\r\n\t\t\t// Prevent Vue obserability of things that shouldn't be made observable (not entities and aren't used in templates and shouldn't be reactive)\r\n\t\t\tpreventObservability(handle, formDef, formDef.model, formDef.model.model.$namespace, formDef.model.model.$resources, formDef.model.model.$culture, session, log, entryService, entryViewService, quantityService, fileService);\r\n\r\n\t\t\tconst formOptions = {\r\n\t\t\t\tpropsData: {\r\n\t\t\t\t\tentry,\r\n\t\t\t\t\treadonly: (resume && resume.mode === ResumeMode.View) || session.isReadonly,\r\n\t\t\t\t\tstartingPage: entry.Entry ? (resume && parseInt(resume.lastPageViewed)) || 1 : 1,\r\n\t\t\t\t\tpublicEvents: handle,\r\n\t\t\t\t\tformsModel: formsModel,\r\n\t\t\t\t\tsession,\r\n\t\t\t\t\tlog,\r\n\t\t\t\t\tentryToken,\r\n\t\t\t\t\tentryService,\r\n\t\t\t\t\tentryViewService,\r\n\t\t\t\t\tquantityService,\r\n\t\t\t\t\tfileService,\r\n\t\t\t\t\tchameleon: formDef.theme.isChameleon,\r\n\t\t\t\t\t$resource: formDef.model.model.getResource.bind(formDef.model.model),\r\n\t\t\t\t\t$culture: formsModel.model.$culture,\r\n\t\t\t\t\t$format: formsModel.format.bind(formsModel),\r\n\t\t\t\t\t$parse: formsModel.parse.bind(formsModel),\r\n\t\t\t\t\t$expandDateFormat: formsModel.expandDateFormat.bind(formsModel),\r\n\t\t\t\t\t$namespace: formsModel.model.$namespace\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tform = new FormComponent(formOptions);\r\n\t\t\tif (quantityService)\r\n\t\t\t\tquantityService.initialize(entry);\r\n\r\n\t\t\t// Calculate form availablility for new entries in public contexts\r\n\t\t\tconst publicContexts = [\r\n\t\t\t\tEmbedContext.Public,\r\n\t\t\t\tEmbedContext.Iframe,\r\n\t\t\t\tEmbedContext.Seamless\r\n\t\t\t];\r\n\r\n\t\t\tif (publicContexts.includes(embedContext) && entry.Id === null) {\r\n\t\t\t\tconst formAvailableProp = entry.meta.type.properties.find(prop => prop.name === 'Form_Available');\r\n\t\t\t\tform.available = session.flags.available;\r\n\r\n\t\t\t\t// Only delay form load if form availability is conditional\r\n\t\t\t\tif (formAvailableProp) {\r\n\t\t\t\t\tif (formAvailableProp.isCalculated) {\r\n\t\t\t\t\t\t// If this form has lookups, wait until the defaults are set\r\n\t\t\t\t\t\tif (session.flags.hasLookups) {\r\n\t\t\t\t\t\t\tconst managers = findLookupManagers(entry);\r\n\t\t\t\t\t\t\tawait Promise.all(managers.map(m => m.defaultsSet));\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Wait until all quantities have loaded\r\n\t\t\t\t\t\tif (quantityService)\r\n\t\t\t\t\t\t\tawait quantityService.ready;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tform.available = form.available && entry.Form_Available;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tform.$mount(el);\r\n\r\n\t\t\tif (resume && (!isNaN(actionId) || resume.mode === ResumeMode.PaymentRedirect))\r\n\t\t\t\tform.resumeAfterPaymentRedirect(resume.entryDocuments, actionId);\r\n\r\n\t\t\tformRef.value = form;\r\n\t\t}).catch(err => {\r\n\t\t\tlog.error(err);\r\n\t\t});\r\n\r\n\t\treturn formRef;\r\n\t}\r\n}\r\n","import Vue, { VueConstructor } from 'vue';\r\nexport function defineBreakWordsFilter(vue: VueConstructor) {\r\n\tvue.filter('breakWords', value => {\r\n\t// https://cognitoforms.visualstudio.com/Cognito%20Forms/_workitems/edit/16130\r\n\t\tif (!value) return '';\r\n\t\treturn value\r\n\t\t\t.replace(/(\\/)/g, '$1\\u200B')\r\n\t\t\t.replace(/(\\\\)/g, '$1\\u200B')\r\n\t\t\t.replace(/(@)/g, '$1\\u200B')\r\n\t\t\t.replace(/(_)/g, '$1\\u200B');\r\n\t});\r\n}","export class CustomResponseError extends Error {\r\n\ttype: string;\r\n\tdata: any;\r\n\tconstructor(errorInfo: JsonErrorInfo) {\r\n\t\tsuper(errorInfo.Message);\r\n\t\tthis.type = errorInfo.Type;\r\n\t\tthis.data = errorInfo.Data;\r\n\t}\r\n}\r\n\r\nexport type JsonErrorInfo = {\r\n\tType?: string;\r\n\tMessage?: string;\r\n\tData?: any;\r\n}","import { PropertyConverter, Property, PropertySerializationResult, Entity } from '@cognitoforms/vuemodel';\r\n\r\nexport default class DateConverter extends PropertyConverter {\r\n\tshouldConvert(context: Entity, prop: Property): boolean {\r\n\t\treturn prop.propertyType === Date && prop.format.specifier === 'd';\r\n\t}\r\n\r\n\tserialize(context: Entity, value: any, prop: Property): PropertySerializationResult {\r\n\t\treturn {\r\n\t\t\tkey: prop.name,\r\n\t\t\tvalue: value ? ((value.getFullYear())\r\n\t\t\t\t+ (value.getMonth() < 9 ? '-0' : '-') + (value.getMonth() + 1)\r\n\t\t\t\t+ (value.getDate() < 10 ? '-0' : '-') + value.getDate())\r\n\t\t\t\t: null\r\n\t\t};\r\n\t}\r\n\r\n\tdeserialize(context: Entity, value: any, prop: Property) {\r\n\t\tif (typeof value === 'string')\r\n\t\t\treturn this.parseDate(value);\r\n\t\treturn value;\r\n\t}\r\n\r\n\tprivate parseDate(date: string) {\r\n\t\tconst parts = date.split('-').map(Number);\r\n\t\treturn new Date(parts[0], parts[1] - 1, parts[2]);\r\n\t}\r\n}","import { PropertyConverter, Property, PropertySerializationResult, Entity } from '@cognitoforms/vuemodel';\r\n\r\nexport default class TimeConverter extends PropertyConverter {\r\n\tshouldConvert(context: Entity, prop: Property): boolean {\r\n\t\treturn prop.propertyType === Date && prop.format.specifier === 't';\r\n\t}\r\n\r\n\tserialize(context: Entity, value: any, prop: Property): PropertySerializationResult {\r\n\t\treturn {\r\n\t\t\tkey: prop.name,\r\n\t\t\tvalue: value ? ((value.getHours() < 10 ? '0' : '') + value.getHours()\r\n\t\t\t\t+ (value.getMinutes() < 10 ? ':0' : ':') + value.getMinutes()\r\n\t\t\t\t+ (value.getSeconds() < 10 ? ':0' : ':') + value.getSeconds())\r\n\t\t\t\t: null\r\n\t\t};\r\n\t}\r\n\r\n\tdeserialize(context: Entity, value: any, prop: Property) {\r\n\t\tif (typeof value === 'string') {\r\n\t\t\tconst fullDate = new Date(value);\r\n\r\n\t\t\t// if a date could not be created from the time data provided, then assume the value is only the time component and\r\n\t\t\t// deserialize to a common date\r\n\t\t\tif (isNaN(fullDate.getDate()))\r\n\t\t\t\treturn new Date(1970, 0, 1, Number(value.substr(0, 2)), Number(value.substr(3, 2)), Number(value.substr(6, 2)));\r\n\t\t\telse\r\n\t\t\t\treturn fullDate;\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n}","import { PropertyConverter, Property, PropertySerializationResult, IgnoreProperty, Entity, isEntityType } from '@cognitoforms/vuemodel';\r\nimport { ORDER_TYPE_NAME } from 'src/framework/forms-model';\r\n\r\n/**\r\n * Prevents the order off the entry from being serialized or deserialized.\r\n */\r\nexport default class OrderConverter extends PropertyConverter {\r\n\tshouldConvert(context: Entity, prop: Property): boolean {\r\n\t\treturn prop.name === 'Order' && isEntityType(prop.propertyType) && prop.propertyType.meta.fullName === ORDER_TYPE_NAME;\r\n\t}\r\n\r\n\tserialize(): PropertySerializationResult {\r\n\t\treturn IgnoreProperty;\r\n\t}\r\n\r\n\tdeserialize(context: Entity, value: any, property: Property): any {\r\n\t\treturn super.deserialize(context, value, property);\r\n\t}\r\n}","import { PropertyConverter, Property, Entity, PropertySerializationResult } from '@cognitoforms/vuemodel';\r\nimport { getEnumInstanceById, getEnumInstanceByName } from '../../core';\r\n\r\n/**\r\n * Handles serialization/deserialization of enum values\r\n */\r\nexport default class EnumConverter extends PropertyConverter {\r\n\tshouldConvert(context: Entity, prop: Property): boolean {\r\n\t\tconst propModelType = prop.propertyType && prop.propertyType['meta'];\r\n\r\n\t\t// Not a model type\r\n\t\tif (!propModelType)\r\n\t\t\treturn false;\r\n\r\n\t\t// Convert if the model type is an enum\r\n\t\treturn propModelType.enum != null;\r\n\t}\r\n\r\n\tserialize(context: Entity, value: any, prop: Property): PropertySerializationResult {\r\n\t\tif (value) {\r\n\t\t\tconst propModelType = prop.propertyType && prop.propertyType['meta'];\r\n\t\t\treturn {\r\n\t\t\t\tkey: prop.name,\r\n\t\t\t\tvalue: Array.isArray(propModelType.enum) ? value.Name : value.Id\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\r\n\tdeserialize(context: Entity, value: any, prop: Property) {\r\n\t\tif (value) {\r\n\t\t\tif (typeof value === 'string') {\r\n\t\t\t\treturn getEnumInstanceById(prop.propertyType['meta'], value) || getEnumInstanceByName(prop.propertyType['meta'], value);\r\n\t\t\t}\r\n\t\t\telse if (typeof value === 'object') {\r\n\t\t\t\tif (value.Id) {\r\n\t\t\t\t\treturn getEnumInstanceById(prop.propertyType['meta'], value.Id);\r\n\t\t\t\t}\r\n\t\t\t\telse if (value.Name) {\r\n\t\t\t\t\treturn getEnumInstanceByName(prop.propertyType['meta'], value.Name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n}\r\n","import { PropertyConverter, Property, PropertySerializationResult, IgnoreProperty, Entity } from '@cognitoforms/vuemodel';\r\nimport { FORM_ENTRY_TYPE_NAME } from 'src/framework/forms-model';\r\n\r\n/**\r\n * Excludes certain properties from serialization because they represent circular references.\r\n */\r\nexport default class IgnoreCircularReferenceConverter extends PropertyConverter {\r\n\tshouldConvert(context: Entity, prop: Property): boolean {\r\n\t\tif (prop.name === 'ParentSection')\r\n\t\t\treturn true;\r\n\t\t// Convert any 'Form' property that is not the FormEntry's FormRef property\r\n\t\tif (prop.name === 'Form' && prop.containingType.fullName !== FORM_ENTRY_TYPE_NAME)\r\n\t\t\treturn true;\r\n\t}\r\n\r\n\tserialize(): PropertySerializationResult {\r\n\t\treturn IgnoreProperty;\r\n\t}\r\n}","import { PropertyConverter, Property, Entity, isEntityType } from '@cognitoforms/vuemodel';\r\nimport { FORM_ENTRY_TYPE_NAME } from 'src/framework/forms-model';\r\n\r\nexport default class InitializeBackReferencesConverter extends PropertyConverter {\r\n\tshouldConvert(context: Entity, prop: Property): boolean {\r\n\t\tconst shouldConvert = prop.name !== 'ParentSection' && prop.name !== 'Form'\r\n\t\t\t&& isEntityType(prop.propertyType)\r\n\t\t\t&& (!!prop.propertyType.meta.getProperty('ParentSection') || !!prop.propertyType.meta.getProperty('Form'));\r\n\r\n\t\treturn shouldConvert;\r\n\t}\r\n\r\n\tdeserialize(context: Entity, value: any, prop: Property) {\r\n\t\tconst type = isEntityType(prop.propertyType) && prop.propertyType.meta;\r\n\t\tif (value) {\r\n\t\t\tif (Array.isArray(value))\r\n\t\t\t\tvalue = value.map(item => this.deserialize(context, item, prop));\r\n\t\t\telse {\r\n\t\t\t\t// avoid modifying the provided object\r\n\t\t\t\tvalue = Object.assign({}, value);\r\n\r\n\t\t\t\tif (type.getProperty('ParentSection'))\r\n\t\t\t\t\tvalue.ParentSection = context;\r\n\t\t\t\tif (type.getProperty('Form'))\r\n\t\t\t\t\tvalue.Form = context.meta.type.baseType.fullName === FORM_ENTRY_TYPE_NAME\r\n\t\t\t\t\t\t? context\r\n\t\t\t\t\t\t: context.Form;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n}\r\n","import { PropertyInjector, PropertySerializationResult, Entity } from '@cognitoforms/vuemodel';\r\n/**\r\n * Adds properties specific to Cognito storage layer.\r\n */\r\nexport default class StoragePropertyInjector implements PropertyInjector {\r\n\tinject(entity: Entity): PropertySerializationResult[] {\r\n\t\tconst results = [];\r\n\t\tif (entity.meta.type.baseType)\r\n\t\t\tresults.push({ key: '$type', value: 'Cognito.' + entity.meta.type.fullName });\r\n\t\tif (entity['$version'])\r\n\t\t\tresults.push({ key: '$version', value: entity['$version'] });\r\n\t\tif (entity['$etag'])\r\n\t\t\tresults.push({ key: '$etag', value: entity['$etag'] });\r\n\t\treturn results;\r\n\t}\r\n}","import countries from 'i18n-iso-countries';\r\n\r\nconst countryNameWithParensExpr = /^([^(]+)\\s+[((]([^)]+)[))]\\s*$/g;\r\nconst countryNameWithCommaExpr = /^([^,]+),\\s+([^)]+)\\s*$/g;\r\n\r\nexport function getCountryCode(name: string, locale: string): string {\r\n\tlet countryCode = countries.getAlpha2Code(name, locale);\r\n\tif (countryCode)\r\n\t\treturn countryCode;\r\n\r\n\t// If the country name has an alternative name or some other text in parentheses,\r\n\t// then remove the parenthesized value and try again.\r\n\tif (countryNameWithParensExpr.test(name)) {\r\n\t\tconst cleansedName = name.replace(countryNameWithParensExpr, '$1');\r\n\t\tcountryCode = countries.getAlpha2Code(cleansedName, locale);\r\n\t\tif (countryCode)\r\n\t\t\treturn countryCode;\r\n\t}\r\n\r\n\t// If the country name has an alternative name after a comma,\r\n\t// then exclude the portion after the comma and try again.\r\n\tif (countryNameWithCommaExpr.test(name)) {\r\n\t\tconst cleansedName = name.replace(countryNameWithCommaExpr, '$1');\r\n\t\tcountryCode = countries.getAlpha2Code(cleansedName, locale);\r\n\t\tif (countryCode)\r\n\t\t\treturn countryCode;\r\n\t}\r\n\r\n\t// Try to find the country by replacing spaces with dashes\r\n\tif (name.includes(' ')) {\r\n\t\tconst nameWithoutSpaces = name.replaceAll(' ', '-');\r\n\t\tcountryCode = countries.getAlpha2Code(nameWithoutSpaces, locale);\r\n\t\tif (countryCode)\r\n\t\t\treturn countryCode;\r\n\t}\r\n\r\n\treturn null;\r\n}\r\n","import { TypeExtensionOptions } from '@cognitoforms/vuemodel';\r\nimport { hasValue, $format } from '../../../util/helpers';\r\nimport { Address } from '../../../server-types/model/address';\r\nimport { getCountryCode } from '../countries';\r\n\r\nexport interface AddressExtensions extends TypeExtensionOptions
{\r\n\tvalidateRequiredAddress(this: Address & AddressExtensions, enforceableFields: string[]): string;\r\n\tvalidateZipCode(this: Address & AddressExtensions): string;\r\n}\r\n\r\nexport const AddressExtensions: AddressExtensions = {\r\n\tCountry: {\r\n\t\tset: function(this: Address, country: string) {\r\n\t\t\tconst model = this.meta.type.model;\r\n\t\t\tif (country)\r\n\t\t\t\tthis.CountryCode = getCountryCode(country.trim(), model.$locale || 'en');\r\n\t\t\telse\r\n\t\t\t\tthis.CountryCode = null;\r\n\t\t}\r\n\t},\r\n\tvalidateRequiredAddress: function(enforceableFields: string[]): string {\r\n\t\t// Store the model to use for localization when building the error message\r\n\t\tconst model = this.meta.type.model;\r\n\r\n\t\tconst countryLabelUS = model.getResource('united-states');\r\n\r\n\t\tlet error = '';\r\n\t\tlet errorCount = 0;\r\n\r\n\t\t// NOTE: Iterate through the list in reverse in order to avoid an Oxford comma in the error message...\r\n\t\tfor (let f = enforceableFields.length - 1; f >= 0; f--) {\r\n\t\t\tconst field = enforceableFields[f];\r\n\r\n\t\t\t// Skip this field if it has a value\r\n\t\t\tconst value = this.get(field);\r\n\t\t\tif (hasValue(value)) continue;\r\n\r\n\t\t\t// Rename Postal Code to Zip Code if US Address\r\n\t\t\tlet label = model.getResource('address-' + field.toLowerCase());\r\n\t\t\tif (field === 'PostalCode' && this.Country === countryLabelUS) label = model.getResource('address-zip-code');\r\n\r\n\t\t\tif (errorCount === 0) error = label;\r\n\t\t\telse if (errorCount === 1) error = $format(model.getResource('this-and-that'), label, error);\r\n\t\t\telse error = $format(model.getResource('this-comma-that'), label, error);\r\n\r\n\t\t\terrorCount++;\r\n\t\t}\r\n\r\n\t\tif (errorCount > 0)\r\n\t\t\terror = $format(errorCount === 1 ? model.getResource('required-one') : model.getResource('required-many'), error);\r\n\r\n\t\treturn error;\r\n\t},\r\n\tvalidateZipCode: function(): string {\r\n\t\t// Store the model to use for localization when building the error message\r\n\t\tconst model = this.meta.type.model;\r\n\r\n\t\tconst countryLabelUS = model.getResource('united-states');\r\n\r\n\t\tif (this.Country === countryLabelUS) {\r\n\t\t\t// Make sure that a US zip code is used if United States is chosen as the country\r\n\t\t\tif (hasValue(this.PostalCode) && !/^\\s*(\\d{5})(-\\d{4})?\\s*$/.test(this.PostalCode)) {\r\n\t\t\t\treturn model.getResource('address-zip-code-invalid');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n","import { TypeExtensionOptions } from '@cognitoforms/vuemodel';\r\nimport { hasValue } from '../../../util/helpers';\r\nimport { Name } from '../../../server-types/model/name';\r\n\r\nexport interface NameExtensions extends TypeExtensionOptions {\r\n\tvalidateRequiredName(this: Name & NameExtensions): string;\r\n}\r\n\r\nexport const NameExtensions: NameExtensions = {\r\n\tvalidateRequiredName: function() {\r\n\t\t// Store the model to use for localization when building the error message\r\n\t\tconst model = this.meta.type.model;\r\n\r\n\t\tlet error = '';\r\n\r\n\t\tconst firstIsMissing = !hasValue(this.First);\r\n\t\tconst lastIsMissing = !hasValue(this.Last);\r\n\t\tif (firstIsMissing && lastIsMissing) {\r\n\t\t\terror = model.getResource('required-name-first-and-last');\r\n\t\t}\r\n\t\telse if (firstIsMissing) {\r\n\t\t\terror = model.getResource('required-name-first');\r\n\t\t}\r\n\t\telse if (lastIsMissing) {\r\n\t\t\terror = model.getResource('required-name-last');\r\n\t\t}\r\n\r\n\t\treturn error;\r\n\t}\r\n};\r\n","import { TypeExtensionOptions } from '@cognitoforms/vuemodel';\r\nimport { hasValue } from '../../../util/helpers';\r\nimport { Signature } from '../../../server-types/model/signature';\r\n\r\nexport interface SignatureExtensions extends TypeExtensionOptions {\r\n\tvalidateRequiredSignature(this: Signature & SignatureExtensions): string;\r\n}\r\n\r\nexport const SignatureExtensions: SignatureExtensions = {\r\n\tvalidateRequiredSignature: function() {\r\n\t\t// Store the model to use for localization when building the error message\r\n\t\tconst model = this.meta.type.model;\r\n\r\n\t\tlet error = '';\r\n\r\n\t\tif (!hasValue(this.Svg)) {\r\n\t\t\terror = model.getResource('required');\r\n\t\t}\r\n\r\n\t\treturn error;\r\n\t}\r\n};\r\n","import { PropertyConverter, Property, PropertySerializationResult, IgnoreProperty, Entity } from '@cognitoforms/vuemodel';\r\n\r\n/**\r\n * Prevents calculated properties from being serialized or deserialized.\r\n */\r\nexport default class CalculationConverter extends PropertyConverter {\r\n\tshouldConvert(context: Entity, prop: Property): boolean {\r\n\t\treturn prop.isCalculated;\r\n\t}\r\n\r\n\tserialize(): PropertySerializationResult {\r\n\t\t// no need to serialize calculated properties\r\n\t\treturn IgnoreProperty;\r\n\t}\r\n\r\n\tdeserialize() {\r\n\t\t// disallow deserializing calculated properties\r\n\t\treturn IgnoreProperty;\r\n\t}\r\n}","import { PropertyConverter, Property, Entity } from '@cognitoforms/vuemodel';\r\n\r\n/**\r\n * Handles deserialization of JSON date strings\r\n */\r\nexport default class DateTimeConverter extends PropertyConverter {\r\n\tshouldConvert(context: Entity, prop: Property): boolean {\r\n\t\treturn prop.propertyType === Date && !['d', 't'].includes(prop.format.specifier);\r\n\t}\r\n\r\n\tdeserialize(context: Entity, value: any, prop: Property) {\r\n\t\tif (typeof value === 'string')\r\n\t\t\treturn new Date(value);\r\n\t\treturn value;\r\n\t}\r\n}","import { PropertyConverter, Property, PropertySerializationResult, Entity } from '@cognitoforms/vuemodel';\r\nimport { FormEntry } from 'src/server-types/forms/model/form-entry';\r\nimport { isLookupField } from 'src/util/model';\r\n\r\n/**\r\n * Prevents calculated properties from being serialized or deserialized.\r\n */\r\nexport default class LookupConverter extends PropertyConverter {\r\n\tshouldConvert(context: Entity, prop: Property): boolean {\r\n\t\treturn isLookupField(prop);\r\n\t}\r\n\r\n\tserialize(context: Entity, value: any, property: Property): PropertySerializationResult {\r\n\t\tif (Array.isArray(value)) {\r\n\t\t\tconst lookupValue = value as FormEntry[];\r\n\t\t\treturn { key: property.name, value: lookupValue.map(e => e.Id) };\r\n\t\t}\r\n\t\telse if (value) {\r\n\t\t\tconst lookupValue = value as FormEntry;\r\n\t\t\treturn { key: property.name, value: lookupValue.Id };\r\n\t\t}\r\n\t\treturn { key: property.name, value: null };\r\n\t}\r\n\r\n\tdeserialize(context: Entity, value: any, property: Property): any {\r\n\t\treturn value;\r\n\t}\r\n}","import { PropertyConverter, Property, Entity } from '@cognitoforms/vuemodel';\r\n\r\n/**\r\n * Preserves legacy prefill options for Yes/No fields\r\n */\r\nexport default class YesNoConverter extends PropertyConverter {\r\n\tshouldConvert(context: Entity, prop: Property): boolean {\r\n\t\treturn prop.propertyType === Boolean;\r\n\t}\r\n\r\n\tdeserialize(context: Entity, value: any, prop: Property) {\r\n\t\t// Needed to handle legacy string \"true\" and \"false\" variants\r\n\t\tif (typeof value === 'string') {\r\n\t\t\tif (value.toLowerCase() === 'true')\r\n\t\t\t\tvalue = true;\r\n\t\t\telse if (value.toLowerCase() === 'false')\r\n\t\t\t\tvalue = false;\r\n\t\t\telse if (prop.defaultValue !== undefined) {\r\n\t\t\t\tvalue = prop.format.convertFromString(value);\r\n\t\t\t\tif (value === null)\r\n\t\t\t\t\tvalue = prop.defaultValue;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n}","import { PropertyConverter, Property, PropertySerializationResult, IgnoreProperty, Entity } from '@cognitoforms/vuemodel';\r\n\r\n// Certain properties are \"extensions\" but still need to be persisted/deserialized.\r\nconst exceptionRegex = /(_QuantityLimit)|(_QuantityUsed)$/i;\r\n\r\n/**\r\n * Prevents entry pseudo-properties from being serialized/deserialized.\r\n */\r\nexport default class EntryExtensionConverter extends PropertyConverter {\r\n\tshouldConvert(context: Entity, prop: Property): boolean {\r\n\t\t// do not filter properties on entry index types\r\n\t\tif (prop.containingType.fullName === 'Forms.FormEntryIndex'\r\n\t\t|| (prop.containingType.baseType && prop.containingType.baseType.fullName === 'Forms.FormEntryIndex'))\r\n\t\t\treturn false;\r\n\t\telse if (!context || !context.meta.type.model)\r\n\t\t\treturn false;\r\n\t\t// Property name must look like 'SomeProperty_PseudoProperty'\r\n\t\telse\r\n\t\t\treturn /([A-Z][a-z]+_)[A-Z][a-z]+/g.test(prop.name) && !exceptionRegex.test(prop.name);\r\n\t}\r\n\r\n\tserialize(): PropertySerializationResult {\r\n\t\treturn IgnoreProperty;\r\n\t}\r\n\r\n\tdeserialize() {\r\n\t\treturn IgnoreProperty;\r\n\t}\r\n}","import { Entity, isEntityType, Property } from '@cognitoforms/model.js';\r\nimport { FormsModel } from 'src/framework/forms-model';\r\n\r\nfunction ensurePropertyInitialized(property: Property, entity: Entity) {\r\n\tif (!property.value(entity))\r\n\t\tentity.update(property.name, {});\r\n}\r\n\r\nfunction isDynamicEntity(property: Property) {\r\n\treturn isEntityType(property.propertyType)\r\n\t\t&& property.propertyType.meta.baseType\r\n\t\t&& property.propertyType.meta.baseType.fullName === 'DynamicEntity';\r\n}\r\n\r\nfunction isName(property: Property) {\r\n\treturn isEntityType(property.propertyType)\r\n\t\t&& property.propertyType.meta.fullName === 'Name';\r\n}\r\n\r\nfunction isAddress(property: Property) {\r\n\treturn isEntityType(property.propertyType)\r\n\t\t&& property.propertyType.meta.fullName === 'Address';\r\n}\r\n\r\n/**\r\n * Ensures properties of type Name, Address, and DynamicEntity subtypes are initialized for existing entities.\r\n * These properties are initialized using default value rules for new entities.\r\n */\r\nexport function applyEntityInitExtensions(model: FormsModel) {\r\n\tfor (const type of Object.values(model.model.types)) {\r\n\t\tconst referenceProperties = type.properties.filter(p => !p.isList && (isDynamicEntity(p) || isName(p) || isAddress(p)));\r\n\t\tif (referenceProperties.length)\r\n\t\t\ttype.initExisting.subscribe(e => referenceProperties.forEach(property => ensurePropertyInitialized(property, e.entity)));\r\n\t}\r\n}","import { Property, Entity, isEntityType, AsyncValueResolver, RuleOrMethodOptions } from '@cognitoforms/model.js';\r\nimport { FormsModel, FormsModelOptions } from 'src/framework/forms-model';\r\nimport { ObjectLookup } from 'src/util';\r\nimport EntryViewService from 'src/web-api/entry-views/entry-view-service';\r\nimport CascadeFilterManager, { CascadeFilterInfo, CascadeFilterManagerFactory } from './cascade-filter-manager';\r\nimport LookupManager, { LookupIndexInfo, LookupManagerFactory } from './lookup-manager';\r\n\r\nfunction isRootLookupProperty(propDef: any) {\r\n\treturn typeof propDef === 'object' && propDef['$lookupFieldInfo'];\r\n}\r\n\r\nfunction isNestedLookupProperty(propDef: any) {\r\n\treturn typeof propDef === 'object' && propDef['$lookupViewId'];\r\n}\r\n\r\nfunction isCascadeFilterProperty(propDef: any) {\r\n\treturn typeof propDef === 'object' && propDef['$cascadeFilterInfo'];\r\n}\r\n\r\nfunction getManagerPropName(lookupProperty: Property) {\r\n\treturn `${lookupProperty.name}_LookupManager`;\r\n}\r\n\r\n/**\r\n * Adds a rule to the specified type which ensures a lookup manager's default indexes are kept up to date as dependent model properties change.\r\n */\r\nfunction getLookupDefaultUpdateRule(lookupProperty: Property, lookupInfo: LookupIndexInfo): ObjectLookup> {\r\n\treturn {\r\n\t\t[lookupProperty.name + '_Default']: {\r\n\t\t\tfunction() {\r\n\t\t\t\tconst manager = this[getManagerPropName(lookupProperty)];\r\n\t\t\t\tif (manager)\r\n\t\t\t\t\tmanager.ready.then(() => manager.updateDefaultIndexes());\r\n\t\t\t},\r\n\t\t\tdependsOn: `{${lookupInfo.defaultPaths.join(',')}}`\r\n\t\t}\r\n\t};\r\n}\r\n\r\n/**\r\n * Adds a rule to the specified type which ensures a lookup manager's filtered indexes are kept up to date as dependent model properties change.\r\n */\r\nfunction getLookupFilterUpdateRule(lookupProperty: Property, lookupInfo: LookupIndexInfo): ObjectLookup> {\r\n\treturn {\r\n\t\t[lookupProperty.name + '_Filter']: {\r\n\t\t\tfunction() {\r\n\t\t\t\tif (this[getManagerPropName(lookupProperty)])\r\n\t\t\t\t\tthis[getManagerPropName(lookupProperty)].updateFilteredIndexes();\r\n\t\t\t},\r\n\t\t\tdependsOn: `{${lookupInfo.filterPaths.join(',')}}`\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport function extendModelWithLookups(\r\n\tmodel: FormsModel,\r\n\toptions: FormsModelOptions,\r\n\tentryViewService: EntryViewService,\r\n\tgetLookupManager: LookupManagerFactory,\r\n\tgetCascadeFilterManager: CascadeFilterManagerFactory\r\n): AsyncValueResolver {\r\n\t/**\r\n\t * Adds the LookupManger property to the lookup manager's containingType.\r\n\t */\r\n\tfunction addLookupManagerProperty(lookupProperty: Property, lookupInfo: LookupIndexInfo, entryViewService: EntryViewService, getLookupManager: LookupManagerFactory) {\r\n\t\tlookupProperty.containingType.extend({\r\n\t\t\t[getManagerPropName(lookupProperty)]: {\r\n\t\t\t\tget: function() {\r\n\t\t\t\t\treturn getLookupManager({\r\n\t\t\t\t\t\tlookupInfo,\r\n\t\t\t\t\t\tindexType: model.resolveType(lookupInfo.indexTypeName),\r\n\t\t\t\t\t\tentryViewService,\r\n\t\t\t\t\t\tlookupProperty,\r\n\t\t\t\t\t\tcontainer: this\r\n\t\t\t\t\t});\r\n\t\t\t\t},\r\n\t\t\t\ttype: LookupManager as any\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tlookupProperty.containingType.addRule(function(this: Entity) {\r\n\t\t\t// force the manager to be created by accessing the property\r\n\t\t\tthis.get(getManagerPropName(lookupProperty));\r\n\t\t}).onInit().register();\r\n\t}\r\n\r\n\t/**\r\n\t * Adds the CascadeFilterManager property to the cascade filter manager's containingType.\r\n\t */\r\n\tfunction addCascadeFilterManagerProperty(cascadeProperty: Property, filterInfo: CascadeFilterInfo, getCascadeFilterManager: CascadeFilterManagerFactory) {\r\n\t\tconst cascadeManagerProp = `${cascadeProperty.name}_CascadeFilterManager`;\r\n\t\tcascadeProperty.containingType.extend({\r\n\t\t\t[cascadeManagerProp]: {\r\n\t\t\t\tget: {\r\n\t\t\t\t\tfunction() {\r\n\t\t\t\t\t\treturn getCascadeFilterManager({\r\n\t\t\t\t\t\t\tlookupManager: this[`${filterInfo.lookupPropertyName}_LookupManager`],\r\n\t\t\t\t\t\t\tcascadeProperty,\r\n\t\t\t\t\t\t\tindexProperty: model.resolveType(filterInfo.indexTypeName).getProperty(filterInfo.indexPropertyName),\r\n\t\t\t\t\t\t\tpriorFilters: filterInfo.priorFilters\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t},\r\n\t\t\t\t\tdependsOn: `${filterInfo.lookupPropertyName}_LookupManager`\r\n\t\t\t\t},\r\n\t\t\t\ttype: CascadeFilterManager as any\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcascadeProperty.containingType.addRule(function() {\r\n\t\t\t// force the manager to be created by accessing the property\r\n\t\t\tthis.get(cascadeManagerProp);\r\n\t\t}).onInit().register();\r\n\t}\r\n\r\n\tconst lookupViews = new Map();\r\n\r\n\t/**\r\n\t * Traverse the model definition and do the following:\r\n\t * - harvest lookup view ids for all lookup fields\r\n\t * - create rules to update filtered/default options for lookup fields\r\n\t * - create rules to initialize lookup/cascade filter managers for any type containing a lookup field\r\n\t */\r\n\tfor (const [typeName, typeDef] of Object.entries(options)) {\r\n\t\tif (!typeName.startsWith('$')) {\r\n\t\t\tconst currentType = model.resolveType(typeName);\r\n\t\t\tconst cascadeManagersToInitialize = [];\r\n\t\t\tfor (const [propName, propDef] of Object.entries(typeDef)) {\r\n\t\t\t\tconst currentProperty = currentType.getProperty(propName);\r\n\r\n\t\t\t\t// lookups on secondary forms (not the root) only need the viewId to load entries\r\n\t\t\t\tif (isNestedLookupProperty(propDef))\r\n\t\t\t\t\tlookupViews.set(currentProperty, propDef['$lookupViewId']);\r\n\t\t\t\telse if (isCascadeFilterProperty(propDef))\r\n\t\t\t\t\tcascadeManagersToInitialize.push(() => addCascadeFilterManagerProperty(currentProperty, propDef['$cascadeFilterInfo'] as CascadeFilterInfo, getCascadeFilterManager));\r\n\t\t\t\t// lookups on the root form need more metadata to describe the index type for displaying options\r\n\t\t\t\telse if (isRootLookupProperty(propDef)) {\r\n\t\t\t\t\tconst lookupInfo = propDef['$lookupFieldInfo'] as LookupIndexInfo;\r\n\r\n\t\t\t\t\tlookupViews.set(currentProperty, lookupInfo.viewId);\r\n\r\n\t\t\t\t\taddLookupManagerProperty(currentProperty, lookupInfo, entryViewService, getLookupManager);\r\n\r\n\t\t\t\t\tif (lookupInfo.filterPaths)\r\n\t\t\t\t\t\tcurrentType.extend(getLookupFilterUpdateRule(currentProperty, lookupInfo));\r\n\r\n\t\t\t\t\tif (lookupInfo.defaultPaths)\r\n\t\t\t\t\t\tcurrentType.extend(getLookupDefaultUpdateRule(currentProperty, lookupInfo));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (cascadeManagersToInitialize.length)\r\n\t\t\t\tcascadeManagersToInitialize.forEach(addCascadeFilterManager => addCascadeFilterManager());\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Attempts to load form entries for lookup properties with a corresponding lookup view using the configured EntryViewService.\r\n\t */\r\n\tfunction lookupEntryResolver(instance: Entity, property: Property, value: any): Promise | null {\r\n\t\tconst viewId = lookupViews.get(property);\r\n\t\tconst isList = Array.isArray(value);\r\n\t\tif (viewId && value && isEntityType(property.propertyType)) {\r\n\t\t\tconst ids = isList ? value as any[] : [value];\r\n\t\t\tconst loaded: ObjectLookup = {};\r\n\r\n\t\t\t// determine which entries are already in memory\r\n\t\t\tfor (const id of ids) {\r\n\t\t\t\tconst entry = property.propertyType.meta.get(id);\r\n\t\t\t\tif (entry)\r\n\t\t\t\t\tloaded[id] = entry;\r\n\t\t\t}\r\n\r\n\t\t\tconst unloadedIds = ids.filter(id => !loaded[id]);\r\n\t\t\tlet dataLoaded: Promise = Promise.resolve();\r\n\r\n\t\t\t// load remote entry data if necessary\r\n\t\t\tif (unloadedIds.length)\r\n\t\t\t\tdataLoaded = entryViewService.lookupEntries(viewId, unloadedIds)\r\n\t\t\t\t\t.then(entryData => entryData.forEach(data => (loaded[data.Id] = data)))\r\n\t\t\t\t\t.catch(reason => console.warn('Unable to resolve lookup value:', value, reason));\r\n\r\n\t\t\t// return all entries in order based on provided value\r\n\t\t\treturn dataLoaded\r\n\t\t\t\t.then(() => ids.map(id => loaded[id]))\r\n\t\t\t\t.then(entries => isList ? entries : entries[0]);\r\n\t\t}\r\n\r\n\t\t// return null so the framework knows there is no async resolution for this value\r\n\t\telse\r\n\t\t\treturn null;\r\n\t}\r\n\r\n\treturn lookupEntryResolver;\r\n}\r\n","import { PropertyConverter, Property, Entity, IgnoreProperty } from '@cognitoforms/vuemodel';\r\n\r\n/**\r\n * Prevents Signature and FileData properties from being deserialized into new entries.\r\n */\r\nexport default class IgnoreSignatureFileConverter extends PropertyConverter {\r\n\tprivate entryTypeName: string;\r\n\r\n\tconstructor(entryTypeName: string) {\r\n\t\tsuper();\r\n\t\tthis.entryTypeName = entryTypeName;\r\n\t}\r\n\r\n\tshouldConvert(context: Entity, prop: Property): boolean {\r\n\t\tif (!context || !['Signature', 'FileDataRef'].includes(prop.propertyType.name))\r\n\t\t\treturn false;\r\n\r\n\t\tconst entry = context.meta.type.fullName === this.entryTypeName ? context : context.Form;\r\n\t\treturn entry && entry.meta.isNew;\r\n\t}\r\n\r\n\tdeserialize() {\r\n\t\treturn IgnoreProperty;\r\n\t}\r\n}","import { EntityType, isEntityType, Type } from '@cognitoforms/model.js';\r\nimport { FormsModel } from 'src/framework/forms-model';\r\nimport { FormEntry } from 'src/server-types/forms/model/form-entry';\r\nimport { WorkflowAction, WorkflowActionData } from 'src/server-types/forms/model/workflow-action';\r\n\r\nfunction addWorkflowActionsProperty(entryType: Type, actionDataMap: { [type: string]: WorkflowActionData; }, formsModel: FormsModel) {\r\n\tentryType.extend({\r\n\t\tWorkflow_Actions: 'Forms.WorkflowAction[]',\r\n\t\tAction_IsLocked: Boolean,\r\n\t\tAttempted_Action: String,\r\n\t\tAllowed_Actions: {\r\n\t\t\ttype: 'Forms.WorkflowAction[]',\r\n\t\t\tget: {\r\n\t\t\t\tfunction() {\r\n\t\t\t\t\treturn this.Workflow_Actions.filter(a => a.IsAllowed && !a.IsArchived);\r\n\t\t\t\t},\r\n\t\t\t\tdependsOn: 'Workflow_Actions{IsAllowed,IsArchived}'\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tentryType.addRule({\r\n\t\tname: 'InitializeWorkflowActions',\r\n\t\texecute(this: FormEntry) {\r\n\t\t\tthis.Workflow_Actions.push(...Object.keys(actionDataMap)\r\n\t\t\t\t.map(actionType => {\r\n\t\t\t\t\tconst actionData = actionDataMap[actionType];\r\n\t\t\t\t\tif (actionData)\r\n\t\t\t\t\t\treturn formsModel.construct(actionType, { ...actionData, Form: this });\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t})\r\n\t\t\t\t.filter(a => a !== null));\r\n\t\t}\r\n\t}).onInit().register();\r\n\r\n\tconst entryMetaType = entryType.getProperty('Entry').propertyType as EntityType;\r\n\tif (isEntityType(entryMetaType) && entryMetaType.meta.getProperty('Action')) {\r\n\t\tentryType.addRule({\r\n\t\t\tname: 'InitDefaultAction',\r\n\t\t\texecute(this: FormEntry) {\r\n\t\t\t\tconst firstAllowedAction = this['Allowed_Actions'][0];\r\n\t\t\t\tif (firstAllowedAction)\r\n\t\t\t\t\tthis.Entry.Action = firstAllowedAction.ActionName;\r\n\t\t\t}\r\n\t\t}).onInit().register();\r\n\r\n\t\tentryType.addRule({\r\n\t\t\tname: 'UpdateDefaultAction',\r\n\t\t\texecute(this: FormEntry) {\r\n\t\t\t\tconst firstAllowedAction = this['Allowed_Actions'][0];\r\n\t\t\t\tif (!this.Action_IsLocked && !this.Form_ReadOnly) {\r\n\t\t\t\t\tif (this.Attempted_Action && !this.Allowed_Actions.find(a => a.ActionName === this.Attempted_Action))\r\n\t\t\t\t\t\tthis.Attempted_Action = null;\r\n\r\n\t\t\t\t\tif (!this.Attempted_Action) {\r\n\t\t\t\t\t\tif (firstAllowedAction)\r\n\t\t\t\t\t\t\tthis.Entry.Action = firstAllowedAction.ActionName;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthis.Entry.Action = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t// this rule intentionally only runs in response to allowed actions changing\r\n\t\t\tonChangeOf: entryType.getPaths('{Allowed_Actions}')\r\n\t\t}).register();\r\n\t}\r\n}\r\n\r\nfunction getActiveEntryStatus(entry: FormEntry, statusIdOrName) {\r\n\tconst newStatus = entry.Entry_Statuses.find(s => s.Id === Number(statusIdOrName) || s.Name === statusIdOrName);\r\n\tif (newStatus == null || newStatus.ReplacementId == null)\r\n\t\treturn newStatus;\r\n\telse\r\n\t\treturn getActiveEntryStatus(entry, newStatus.ReplacementId);\r\n}\r\n\r\nfunction addWorkflowNextStatusProperty(entryType: Type) {\r\n\tentryType.extend({\r\n\t\tNext_Status: {\r\n\t\t\ttype: String,\r\n\t\t\tget: {\r\n\t\t\t\tfunction() {\r\n\t\t\t\t\tconst entry = this as FormEntry;\r\n\t\t\t\t\tconst entryMeta = entry.Entry;\r\n\t\t\t\t\tconst action = entry.Workflow_Actions.find(a => a.ActionName === entryMeta.Action) as WorkflowAction;\r\n\t\t\t\t\tlet nextStatus = entryMeta.Status;\r\n\r\n\t\t\t\t\tif (typeof nextStatus !== 'string')\r\n\t\t\t\t\t\tnextStatus = getActiveEntryStatus(entry, nextStatus).Name;\r\n\r\n\t\t\t\t\tif (action && action.NewStatus !== null)\r\n\t\t\t\t\t\tnextStatus = getActiveEntryStatus(entry, action.NewStatus).Name || nextStatus;\r\n\r\n\t\t\t\t\treturn nextStatus;\r\n\t\t\t\t},\r\n\t\t\t\tdependsOn: '{Entry{Action,Status}, Workflow_Actions{NewStatus}, Entry_Statuses}'\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}\r\n\r\nexport function applyWorkflowActionExtensions(formsModel: FormsModel, entryType: Type, actionDataMap: { [type: string]: WorkflowActionData }) {\r\n\tif (formsModel.resolveType('Forms.WorkflowAction')) {\r\n\t\taddWorkflowActionsProperty(entryType, actionDataMap, formsModel);\r\n\r\n\t\tif (entryType.getProperty('Entry_Statuses')) {\r\n\t\t\taddWorkflowNextStatusProperty(entryType);\r\n\t\t}\r\n\t}\r\n}","import { Entity, isEntityType } from '@cognitoforms/model.js';\r\nimport { PropertyConverter, Property } from '@cognitoforms/vuemodel';\r\nimport { FormEntryStatus } from 'src/server-types/forms/model/form-entry-status';\r\n\r\nfunction getActiveEntryStatus(statuses: FormEntryStatus[], statusIdOrName) {\r\n\tconst newStatus = statuses.find(s => s.Id === Number(statusIdOrName) || s.Name === statusIdOrName);\r\n\tif (newStatus == null || newStatus.ReplacementId == null)\r\n\t\treturn newStatus;\r\n\telse\r\n\t\treturn getActiveEntryStatus(statuses, newStatus.ReplacementId);\r\n}\r\n\r\nconst INCOMPLETE_STATUS_ID = 0;\r\n\r\n// If the status list is missing the entry's status for some reason, pick either the incomplete status, or the first non-incomplete status\r\n// based on whether or not the entry is incomplete.\r\nfunction getDefaultStatus(statuses: FormEntryStatus[], isEntryIncomplete: boolean): any {\r\n\treturn statuses.find(s => isEntryIncomplete ? s.Id === INCOMPLETE_STATUS_ID : s.Id !== INCOMPLETE_STATUS_ID && !s.IsArchived);\r\n}\r\n\r\n/**\r\n * Handles deserialization of entry status ids into status names.\r\n */\r\nexport default class EntryMetaConverter extends PropertyConverter {\r\n\tshouldConvert(context: Entity, prop: Property): boolean {\r\n\t\treturn prop.name === 'Entry'\r\n\t\t\t&& isEntityType(prop.propertyType)\r\n\t\t\t&& (prop.propertyType.meta.baseType || prop.propertyType.meta).fullName === 'Forms.EntryMeta';\r\n\t}\r\n\r\n\tdeserialize(context: Entity, value: any, prop: Property) {\r\n\t\tconst entryMeta = value;\r\n\t\tconst statuses = context['Entry_Statuses'];\r\n\t\t// if the EntryMeta object is already an entity instance, its status will already be correct\r\n\t\tif (statuses && entryMeta && !(entryMeta instanceof Entity)) {\r\n\t\t\tconst isEntryIncomplete = !entryMeta.DateSubmitted;\r\n\r\n\t\t\tlet status = null;\r\n\t\t\tif (entryMeta.Status !== null && entryMeta.Status !== undefined)\r\n\t\t\t\tstatus = getActiveEntryStatus(statuses, entryMeta.Status);\r\n\r\n\t\t\tstatus = status || getDefaultStatus(statuses, isEntryIncomplete);\r\n\r\n\t\t\tentryMeta.Status = status.Name;\r\n\t\t}\r\n\r\n\t\treturn super.deserialize(context, value, prop);\r\n\t}\r\n}","import Vue from 'vue';\r\nimport VueModel, { Entity, TypeExtensionOptions, CultureInfo, ModelOptions, ModelLocalizationOptions, preventVueObservability } from '@cognitoforms/vuemodel';\r\nimport DateConverter from './model/serialization/converters/date-converter';\r\nimport TimeConverter from './model/serialization/converters/time-converter';\r\nimport OrderConverter from './model/serialization/converters/order-converter';\r\nimport EnumConverter from './model/serialization/converters/enum-converter';\r\nimport IgnoreCircularReferenceConverter from './model/serialization/converters/ignore-circular-reference-converter';\r\nimport InitializeBackReferencesConverter from './model/serialization/converters/initialize-back-references-converter';\r\nimport StoragePropertyInjector from './model/serialization/injectors/storage-property-injector';\r\nimport { AddressExtensions } from './model/extensions/address-extensions';\r\nimport { NameExtensions } from './model/extensions/name-extensions';\r\nimport { SignatureExtensions } from './model/extensions/signature-extensions';\r\nimport CalculationConverter from './model/serialization/converters/calculation-converter';\r\nimport DateTimeConverter from './model/serialization/converters/date-time-converter';\r\nimport { ObjectLookup } from 'src/util';\r\nimport LookupConverter from './model/serialization/converters/lookup-converter';\r\nimport EntryViewService from 'src/web-api/entry-views/entry-view-service';\r\nimport { AsyncValueResolver, Property, getIdFromState } from '@cognitoforms/model.js';\r\nimport { FormEntry } from 'src/server-types/forms/model/form-entry';\r\nimport { WorkflowActionData } from 'src/server-types/forms/model/workflow-action';\r\nimport YesNoConverter from './model/serialization/converters/yesno-converter';\r\nimport EntryExtensionConverter from './model/serialization/converters/entry-extension-converter';\r\nimport { getEnumInstance } from './model/core';\r\nimport { applyPaymentExtensions } from './model/extensions/payment-extensions';\r\nimport { LookupManagerFactory } from './model/extensions/lookup-field/lookup-manager';\r\nimport { CascadeFilterManagerFactory } from './model/extensions/lookup-field/cascade-filter-manager';\r\nimport { applyEntityInitExtensions } from './model/extensions/entity-init-extensions';\r\nimport { extendModelWithLookups } from './model/extensions/lookup-field/lookup-model-extension';\r\nimport IgnoreSignatureFileConverter from './model/serialization/converters/ignore-signature-file-converter';\r\nimport { applyWorkflowActionExtensions } from './model/extensions/workflow-action-extensions';\r\nimport EntryMetaConverter from './model/serialization/converters/entry-meta-converter';\r\nimport countries from 'i18n-iso-countries';\r\n\r\nexport const FORM_ENTRY_TYPE_NAME = 'Forms.FormEntry';\r\nexport const ORDER_TYPE_NAME = 'Payment.Order';\r\n\r\ntype PropertyLookupViewMapping = {\r\n\ttypeName: string;\r\n\tpropName: string;\r\n\tviewId: string;\r\n}\r\n\r\ntype EnumIntegerValues = { [key: number]: string };\r\ntype EnumStringValues = string[];\r\ntype EnumValuesLookup = ObjectLookup;\r\n\r\nexport type FormsModelOptions = ModelOptions & {\r\n\t$locale?: string;\r\n\t$culture?: string | CultureInfo;\r\n\t$namespace: object;\r\n\t$version: number;\r\n}\r\n\r\nexport class FormsModel {\r\n\treadonly entryTypeName: string;\r\n\tprivate modelOptions: FormsModelOptions;\r\n\tprivate lookupValueResolver: AsyncValueResolver;\r\n\tmodel: VueModel;\r\n\r\n\tprivate static definedLocales = new Set();\r\n\r\n\tprivate constructor(entryTypeName: string, modelOptions: FormsModelOptions, locale: string, localeResources: ObjectLookup, cultureInfo: any) {\r\n\t\t// Prevent Vue from making the model options observable, since it will have a cascading effect\r\n\t\tif (modelOptions)\r\n\t\t\tpreventVueObservability(modelOptions);\r\n\t\tthis.entryTypeName = entryTypeName;\r\n\t\tthis.modelOptions = modelOptions;\r\n\t\tconst enumValues = FormsModel.captureEnumValues(modelOptions);\r\n\t\tconst model = this.model = new VueModel(FormsModel.preprocessOptions(modelOptions, locale, localeResources, cultureInfo), {\r\n\t\t\tautogeneratePropertyLabels: false,\r\n\t\t\tmaxEventScopeDepth: 100,\r\n\t\t\tmaxExitingEventScopeTransferCount: 500\r\n\t\t});\r\n\t\tthis.configureSerialization(modelOptions);\r\n\t\tFormsModel.applyCustomTypeExtensions(model, { Address: AddressExtensions, Name: NameExtensions, Signature: SignatureExtensions });\r\n\t\tapplyWorkflowActionExtensions(this, this.resolveType(this.entryTypeName), FormsModel.captureActionData(modelOptions));\r\n\t\tapplyPaymentExtensions(this, this.resolveType(this.entryTypeName));\r\n\t\tapplyEntityInitExtensions(this);\r\n\t\tthis.model.ready(() => FormsModel.postprocessModel(model, enumValues));\r\n\t}\r\n\r\n\t/**\r\n\t * The global config object shared by form models\r\n\t * NOTE: This is currently only needed to provide the `serverTimeOffset` required by the `Cognito_now` export used in model extensions\r\n\t */\r\n\tstatic config: any = {};\r\n\r\n\t/**\r\n\t * Detect model options that are types that appear to be enums and capture their enum values\r\n\t */\r\n\tprivate static captureEnumValues(modelOptions: FormsModelOptions): EnumValuesLookup {\r\n\t\treturn Object.keys(modelOptions).reduce((lookup, key) => {\r\n\t\t\tconst value = modelOptions[key];\r\n\t\t\tif (typeof value === 'object' && value.$enum)\r\n\t\t\t\tlookup[key] = value.$enum as EnumIntegerValues | EnumStringValues;\r\n\t\t\treturn lookup;\r\n\t\t}, {});\r\n\t}\r\n\r\n\t/**\r\n\t * Capture the workflow actions configuration for the form from the '$data' field on each WorkflowAction sub-type\r\n\t */\r\n\tprivate static captureActionData(modelOptions: FormsModelOptions): { [type: string]: WorkflowActionData } {\r\n\t\treturn Object.keys(modelOptions).reduce((lookup, key) => {\r\n\t\t\tconst value = modelOptions[key];\r\n\t\t\tif (typeof value === 'object' && value.$extends && value.$extends === 'Forms.WorkflowAction') {\r\n\t\t\t\tlookup[key] = value.$data;\r\n\t\t\t}\r\n\t\t\treturn lookup;\r\n\t\t}, {});\r\n\t}\r\n\r\n\t/**\r\n\t * Preprocess model options before passing them to the model constructor\r\n\t */\r\n\tprivate static preprocessOptions(options: FormsModelOptions, locale: string, localeResources: { [name: string]: string }, cultureInfo: CultureInfo): ModelOptions & ModelLocalizationOptions {\r\n\t\tconst modelOptions: ModelOptions & ModelLocalizationOptions = options;\r\n\t\t// Set the 'Cognito.config' reference to a shared config object\r\n\t\tmodelOptions.$namespace['config'] = FormsModel.config;\r\n\r\n\t\t// Copy the resources object for internal use by the model\r\n\t\tmodelOptions.$resources = { [locale]: Object.assign({}, localeResources) };\r\n\r\n\t\t// Parse the culture object\r\n\t\tif (cultureInfo)\r\n\t\t\tmodelOptions.$culture = VueModel.CultureInfo.parse(cultureInfo);\r\n\r\n\t\treturn modelOptions;\r\n\t}\r\n\r\n\t/**\r\n\t * Configures the given model's serializer\r\n\t * @param model The model to configure\r\n\t */\r\n\tprivate configureSerialization(modelOptions: ObjectLookup): void {\r\n\t\tconst model = this.model;\r\n\t\tconst lookupMappings: PropertyLookupViewMapping[] = [];\r\n\t\tfor (const [typeName, typeDef] of Object.entries(modelOptions)) {\r\n\t\t\tif (!typeName.startsWith('$')) {\r\n\t\t\t\tif (typeDef.$storageProperties) {\r\n\t\t\t\t\tfor (const alias in typeDef.$storageProperties)\r\n\t\t\t\t\t\tmodel.serializer.registerPropertyAlias(typeName, alias, typeDef.$storageProperties[alias]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (const [propName, propDef] of Object.entries(modelOptions)) {\r\n\t\t\t\t\tif (typeof propDef === 'object' && propDef.$lookupFieldInfo)\r\n\t\t\t\t\t\tlookupMappings.push({ typeName, propName, viewId: propDef.$lookupFieldInfo.viewId });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tmodel.serializer.registerValueResolver(this.initialValueResolver.bind(this));\r\n\r\n\t\t// Order matters\r\n\t\tmodel.serializer.registerPropertyConverter(new EntryMetaConverter());\r\n\t\tmodel.serializer.registerPropertyConverter(new IgnoreSignatureFileConverter(this.entryTypeName));\r\n\t\tmodel.serializer.registerPropertyConverter(new DateConverter());\r\n\t\tmodel.serializer.registerPropertyConverter(new YesNoConverter());\r\n\t\tmodel.serializer.registerPropertyConverter(new TimeConverter());\r\n\t\tmodel.serializer.registerPropertyConverter(new DateTimeConverter());\r\n\t\tmodel.serializer.registerPropertyConverter(new CalculationConverter());\r\n\t\tmodel.serializer.registerPropertyConverter(new IgnoreCircularReferenceConverter());\r\n\t\tmodel.serializer.registerPropertyConverter(new InitializeBackReferencesConverter());\r\n\t\tmodel.serializer.registerPropertyConverter(new LookupConverter());\r\n\t\tmodel.serializer.registerPropertyConverter(new OrderConverter());\r\n\t\tmodel.serializer.registerPropertyConverter(new EntryExtensionConverter());\r\n\t\tmodel.serializer.registerPropertyConverter(new EnumConverter());\r\n\r\n\t\tmodel.serializer.registerPropertyInjector(FORM_ENTRY_TYPE_NAME, new StoragePropertyInjector());\r\n\t}\r\n\r\n\t/**\r\n\t * Applies custom type extensions for any of the given types that are in the given model\r\n\t * @param model The model to extend\r\n\t * @param typeExtensions The custom type extensions to apply\r\n\t */\r\n\tprivate static applyCustomTypeExtensions(model: VueModel, typeExtensions: { [typeName: string]: TypeExtensionOptions }): void {\r\n\t\t// Apply custom type extensions for types that are included in the model\r\n\t\tObject.keys(typeExtensions).forEach((typeName) => {\r\n\t\t\tconst type = model.types[typeName];\r\n\t\t\tif (type) {\r\n\t\t\t\tconst typeExtension = typeExtensions[typeName];\r\n\t\t\t\ttype.extend(typeExtension);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Perform post-processing logic on the model after it has been created and is ready\r\n\t */\r\n\tprivate static postprocessModel(model: VueModel, enumValues: EnumValuesLookup): void {\r\n\t\t// Preprocess enum types\r\n\t\tObject.keys(enumValues).forEach(enumTypeName => {\r\n\t\t\tconst enumJsType = model.getJsType(enumTypeName);\r\n\t\t\tif (enumJsType && enumJsType['meta']) {\r\n\t\t\t\tconst enumType = enumJsType['meta'];\r\n\t\t\t\t// Store the enum lookup on the type\r\n\t\t\t\tenumType.enum = enumValues[enumTypeName];\r\n\t\t\t\t// Override the enum's get function to ensure that enums are created\r\n\t\t\t\tconst originalGet = enumType.get;\r\n\t\t\t\tenumType.get = getEnumInstance.bind(null, enumType, originalGet);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a new forms model using the given entry type and model options\r\n\t * @param entryTypeName The full type name of the root entry type\r\n\t * @param options The model options object\r\n\t */\r\n\tstatic async createModel(entryTypeName: string, options: FormsModelOptions): Promise {\r\n\t\t// Ensure VueModel is installed\r\n\t\tVue.use(VueModel);\r\n\r\n\t\toptions.$locale = options.$locale || 'en';\r\n\t\tconst locale = options.$locale;\r\n\t\tconst cultureInfo = options.$culture as CultureInfo;\r\n\t\tlet localeResources: { [name: string]: string } = options.$locale as any;\r\n\r\n\t\t// Load resources\r\n\t\tif (typeof options.$locale !== 'object')\r\n\t\t\tlocaleResources = (await import(/* webpackChunkName: '[request]' */ `../localization/resources/${locale}`)).default;\r\n\r\n\t\tif (Object.keys(options).includes('Address')) {\r\n\t\t\tconst countriesModule = (await import(/* webpackChunkName: '[request]' */ `../localization/countries/${locale}.json`)).default;\r\n\t\t\tcountries.registerLocale(countriesModule);\r\n\t\t}\r\n\r\n\t\t// Globally define resources for the model's locale\r\n\t\tif (locale && localeResources && !FormsModel.definedLocales.has(locale)) {\r\n\t\t\tVueModel.defineResources(locale, localeResources);\r\n\t\t\tFormsModel.definedLocales.add(locale);\r\n\t\t}\r\n\r\n\t\treturn new FormsModel(entryTypeName, options, locale, localeResources, cultureInfo);\r\n\t}\r\n\r\n\t/**\r\n\t * Creates an instance of the model's root form entry type\r\n\t * @param state The property values to initialize the object with\r\n\t */\r\n\tconstructEntry(state: any = {}) {\r\n\t\treturn this.constructAsync(this.entryTypeName, state);\r\n\t}\r\n\r\n\t/**\r\n\t * Constructs a new entity of the given type asynchronously\r\n\t * Can be used to create entities with lookup references.\r\n\t * @param type The type of entity to construct\r\n\t * @param state The optional state to assign to the entity\r\n\t */\r\n\tasync constructAsync(type: string, state: any = {}): Promise {\r\n\t\t// Get the model type with the given name\r\n\t\tconst modelType = this.resolveType(type);\r\n\r\n\t\tif (!modelType)\r\n\t\t\tthrow new Error(`Could not construct instance of type '${type}'. Type not found.`);\r\n\r\n\t\tconst id = getIdFromState(modelType, state);\r\n\t\tif (id) {\r\n\t\t\tconst instance = modelType.get(id) as T;\r\n\t\t\tif (instance) {\r\n\t\t\t\tawait instance.update(state);\r\n\t\t\t\treturn Promise.resolve(instance);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn modelType.create(state) as Promise;\r\n\t}\r\n\r\n\tresolveType(type: string) {\r\n\t\treturn this.model.types[type];\r\n\t}\r\n\r\n\t/**\r\n\t * Constructs a new entity of the given type\r\n\t * Should only be used if you know the entity in question has no lookup references.\r\n\t * @param type The type of entity to construct\r\n\t * @param state The optional state to assign to the entity\r\n\t * @deprecated This method should only be used if it is not possible to use `constructAsync`\r\n\t */\r\n\tconstruct(type: string, state: any = {}): T {\r\n\t\t// Get the model type with the given name\r\n\t\tconst modelType = this.model.types[type];\r\n\t\tif (!modelType)\r\n\t\t\tthrow new Error(`Could not construct instance of type '${type}'. Type not found.`);\r\n\r\n\t\tconst id = getIdFromState(modelType, state);\r\n\t\tif (id) {\r\n\t\t\tconst instance = modelType.get(id) as T;\r\n\t\t\tif (instance)\r\n\t\t\t\treturn instance;\r\n\t\t}\r\n\r\n\t\t// Call the type's `createSync()` factory method\r\n\t\treturn modelType.createSync(state) as T;\r\n\t}\r\n\r\n\tinitialValueResolver(instance: Entity, property: Property, value: any): Promise | void {\r\n\t\t// Resolve lookup data\r\n\t\tif (this.lookupValueResolver)\r\n\t\t\treturn this.lookupValueResolver(instance, property, value);\r\n\t}\r\n\r\n\tformat(value: number | Date, format: string) {\r\n\t\treturn typeof (value) === 'number'\r\n\t\t\t? this.model.formatNumber(value, format)\r\n\t\t\t: this.model.formatDate(value, format);\r\n\t}\r\n\r\n\tparse(type: NumberConstructor | DateConstructor, value: string, format?: string): number | Date {\r\n\t\tif (type === Number) {\r\n\t\t\treturn this.model.parseNumber(value, format);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this.model.parseDate(value, format ? [format] : null);\r\n\t\t}\r\n\t}\r\n\r\n\texpandDateFormat(format: string): string {\r\n\t\treturn this.model.expandDateFormat(format);\r\n\t}\r\n\r\n\tget version() {\r\n\t\treturn this.modelOptions.$version;\r\n\t}\r\n\r\n\tenableLookups(entryViewService: EntryViewService, getLookupManager: LookupManagerFactory, getCascadeFilterManager: CascadeFilterManagerFactory) {\r\n\t\tif (!this.lookupValueResolver)\r\n\t\t\tthis.lookupValueResolver = extendModelWithLookups(this, this.modelOptions, entryViewService, getLookupManager, getCascadeFilterManager);\r\n\t}\r\n\r\n\toverrideResource(resourceName: string, value: string) {\r\n\t\tthis.model.$resources[this.model.$locale][resourceName] = value;\r\n\t}\r\n}\r\n\r\n/**\r\n * Provide optional modules available to the form's model definition\r\n * @param name The name of the module to import\r\n * @param pendingModules The list of modules that are currently pending\r\n */\r\nexport async function importOptionalModule(name: string, pendingModules: Promise[] = null): Promise {\r\n\t// Async load the module\r\n\tlet modulePromise: Promise;\r\n\tswitch (name) {\r\n\t\tcase 'time-span':\r\n\t\t\tmodulePromise = import(/* webpackChunkName: \"time-span\" */ './model/time-span');\r\n\t\t\tbreak;\r\n\t\tcase 'order-builder':\r\n\t\t\tmodulePromise = import(/* webpackChunkName: \"order-builder\" */ './payment/order-builder');\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tthrow new Error('Cannot dynamically load module \\'' + name + '\\'.');\r\n\t}\r\n\r\n\tif (pendingModules) {\r\n\t\t// Store the requested module promise so that we can detect when it has loaded\r\n\t\tpendingModules.push(modulePromise);\r\n\t}\r\n\r\n\t// Return the module promise to the caller\r\n\treturn modulePromise;\r\n}\r\n","import { Order } from 'src/server-types/payment/model/order';\r\nimport { FormsModel } from 'src/framework/forms-model';\r\nimport { Type } from '@cognitoforms/model.js';\r\n\r\nexport function applyPaymentExtensions(model: FormsModel, entryType: Type) {\r\n\t// If the entry does not have an Order property, no payment extensions should be applied\r\n\tif (entryType.getProperty('Order')) {\r\n\t\tif (entryType.getProperty('Next_Status')) {\r\n\t\t\tentryType.extend({\r\n\t\t\t\t// For workflow forms, payment is only truly required if the next status is not Incomplete\r\n\t\t\t\tRequire_Payment: {\r\n\t\t\t\t\ttype: Boolean,\r\n\t\t\t\t\tget: {\r\n\t\t\t\t\t\tfunction() {\r\n\t\t\t\t\t\t\treturn this.Require_Payment_Expression && this.Next_Status !== 'Incomplete';\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tdependsOn: '{Require_Payment_Expression, Next_Status}'\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\tentryType.extend({\r\n\t\t\t\tRequire_Payment: {\r\n\t\t\t\t\ttype: Boolean,\r\n\t\t\t\t\tget: {\r\n\t\t\t\t\t\tfunction() {\r\n\t\t\t\t\t\t\treturn this.Require_Payment_Expression;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tdependsOn: 'Require_Payment_Expression'\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// conditionally add Save_Card_Agreement property for checkbox\r\n\t\tif (entryType.getProperty('Save_Customer_Card')) {\r\n\t\t\tentryType.extend({\r\n\t\t\t\tSave_Card_Agreement: {\r\n\t\t\t\t\ttype: Boolean,\r\n\t\t\t\t\trequired: {\r\n\t\t\t\t\t\tmessage: model.model.getResource('card-on-file-agreement-validation'),\r\n\t\t\t\t\t\tfunction() { return true; }\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// default the order property if present\r\n\t\tconst newOrderState = {\r\n\t\t\tIsOpen: true,\r\n\t\t\tAdditionalFees: 0,\r\n\t\t\tAmountDue: 0,\r\n\t\t\tOrderAmount: 0,\r\n\t\t\tSubTotal: 0\r\n\t\t};\r\n\r\n\t\tentryType.initExisting.subscribeOne(e => {\r\n\t\t\tif (!e.entity['Order'])\r\n\t\t\t\te.entity.update('Order', newOrderState);\r\n\t\t});\r\n\r\n\t\tentryType.extend({\r\n\t\t\tOrder: {\r\n\t\t\t\tdefault() {\r\n\t\t\t\t\treturn model.construct('Payment.Order', newOrderState);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst orderType = model.model.types['Payment.Order'];\r\n\r\n\t\tif (orderType)\r\n\t\t\torderType.extend({\r\n\t\t\t\tRebuild_Count: {\r\n\t\t\t\t\ttype: Number,\r\n\t\t\t\t\tdefault: 0\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\tentryType.extend({\r\n\t\t\tUse_Stripe_Payment_Element: {\r\n\t\t\t\ttype: Boolean\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","import api from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../node_modules/css-loader/index.js!../../node_modules/sass-loader/dist/cjs.js!../../node_modules/sass-resources-loader/lib/loader.js??ref--4-oneOf-1-3!./_toast-message.scss\";\n\nvar options = {\"attributes\":{\"class\":\"cog-style\"}};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"i-ex\")\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import mod from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ToastMessageEx.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js??ref--2!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ToastMessageEx.vue?vue&type=script&lang=js&\"","\r\n\r\n","import { render, staticRenderFns } from \"./ToastMessageEx.vue?vue&type=template&id=602ba563&\"\nimport script from \"./ToastMessageEx.vue?vue&type=script&lang=js&\"\nexport * from \"./ToastMessageEx.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"C:\\\\a\\\\1\\\\s\\\\Cognito.Services\\\\client\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('602ba563')) {\n api.createRecord('602ba563', component.options)\n } else {\n api.reload('602ba563', component.options)\n }\n module.hot.accept(\"./ToastMessageEx.vue?vue&type=template&id=602ba563&\", function () {\n api.rerender('602ba563', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"src/components/ToastMessageEx.vue\"\nexport default component.exports","import 'src/style/_toast-message.scss';\r\n\r\nimport { Message } from '@cognitoforms/element-ui';\r\nimport { ElMessageComponent, ElMessageOptions } from '@cognitoforms/element-ui/types/message';\r\nimport IEx from './ToastMessageEx.vue';\r\nimport Vue, { VNode } from 'vue';\r\n\r\nconst ExClass = Vue.extend(IEx);\r\ninterface ElMessageComponentInternals extends ElMessageComponent\r\n{\r\n\tmessage: '';\r\n\tcloseAll: () => void;\r\n}\r\n\r\ntype MessageComponent = ElMessageComponentInternals & ElMessageComponent;\r\n\r\ntype ToastListener = (formId: string, message: string | VNode) => void;\r\nconst toastListeners: ToastListener[] = [];\r\nconst messagesDisplayed = new Set();\r\nexport default function(formId: string, options: ElMessageOptions) {\r\n\tfor (const callback of toastListeners)\r\n\t\tcallback(formId, options.message);\r\n\r\n\tif (typeof options.message === 'string') {\r\n\t\tfor (const messageInstance of messagesDisplayed) {\r\n\t\t\tif (messageInstance.message === options.message)\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t\toptions.onClose = (messageInstance: MessageComponent) => {\r\n\t\t\tmessagesDisplayed.delete(messageInstance);\r\n\t\t};\r\n\t}\r\n\r\n\toptions.customClass = `cog-cognito cog-${formId} ` + (options.customClass || '');\r\n\tconst messageInstance = Message({ duration: options.type === 'success' ? 3000 : 0, showClose: true, ...options });\r\n\r\n\tif (messageInstance.showClose) {\r\n\t\tconst exInstance = new ExClass();\r\n\t\texInstance.$mount();\r\n\t\tdocument.querySelector('.el-message:last-child .el-message__closeBtn').appendChild(exInstance.$el);\r\n\t}\r\n\r\n\tif (typeof options.message === 'string')\r\n\t\tmessagesDisplayed.add(messageInstance);\r\n\r\n\treturn messageInstance;\r\n};\r\n\r\nexport function onToastMessageRequested(callback: ToastListener) {\r\n\tconst unsubscribe = () => {\r\n\t\tconst index = toastListeners.indexOf(callback);\r\n\t\tif (index >= 0)\r\n\t\t\ttoastListeners.splice(index, 1);\r\n\t};\r\n\ttoastListeners.push(callback);\r\n\treturn unsubscribe;\r\n}\r\n\r\nexport function closeAllToastMessages() {\r\n\tmessagesDisplayed.forEach((message: MessageComponent) => {\r\n\t\tif (message.showClose)\r\n\t\t\tmessage.close();\r\n\t});\r\n}","export interface CognitoConfiguration {\r\n\tClientAssetsUrl: string;\r\n\tGoogleAnalyticsId : string;\r\n\tPendoApiKey : string;\r\n\tSpaAssetsUrl : string;\r\n\tContentUrl : string;\r\n\tSiteUrl : string;\r\n\tAppInsightsKey: string;\r\n}\r\n\r\n// @ts-ignore\r\nif (!window.CognitoConfiguration)\r\n\tconsole.error('CognitoConfiguration object not found.');\r\n// @ts-ignore\r\nexport const CognitoConfiguration = window.CognitoConfiguration as CognitoConfiguration;","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"html .cog-cognito.el-message,:root:root:root:root:root .cog-cognito.el-message{display:flex;position:fixed;left:50%;top:20px;align-items:center;justify-content:space-between;width:95%;min-width:280px;max-width:500px;border-width:var(--input__border-width);border-style:solid;border-color:#fff;border-radius:var(--border-radius);box-shadow:1px 1px 1px 0 rgba(0,0,0,.1),1px 1px 6px 0 rgba(0,0,0,.15);box-sizing:border-box;overflow:hidden;padding-right:calc(var(--gutter)/2);padding-left:calc(var(--gutter)/2);transform:translateX(-50%);transition:opacity calc(var(--speed)/4),transform calc(var(--speed)/2)}html .cog-cognito.el-message--info,:root:root:root:root:root .cog-cognito.el-message--info{background-image:linear-gradient(to top, hsla(var(--background-hsl), 0.12), hsla(var(--background-hsl), 0.12) 100%),linear-gradient(to top, var(--form__background-color), var(--form__background-color) 100%),linear-gradient(to top, white, white 100%)}html .cog-cognito.el-message--success,:root:root:root:root:root .cog-cognito.el-message--success{background-color:var(--success, #e7f9d2);color:var(--success-reverse, #314d00)}html .cog-cognito.el-message--warning,:root:root:root:root:root .cog-cognito.el-message--warning{background-color:var(--warning, yellow);color:var(--warning-reverse, black)}html .cog-cognito.el-message--error,:root:root:root:root:root .cog-cognito.el-message--error{background-color:var(--negative);border-color:var(--negative-reverse);color:var(--negative-reverse)}html .cog-cognito.el-message-fade-enter,html .cog-cognito.el-message-fade-leave-to,:root:root:root:root:root .cog-cognito.el-message-fade-enter,:root:root:root:root:root .cog-cognito.el-message-fade-leave-to{opacity:0;transform:translate(-50%, -100%)}html .cog-cognito .el-message__icon,:root:root:root:root:root .cog-cognito .el-message__icon{display:none}html .cog-cognito .el-message__closeBtn,:root:root:root:root:root .cog-cognito .el-message__closeBtn{margin-right:-0.8em;padding:.8em;cursor:pointer}html .cog-cognito .el-message__content,:root:root:root:root:root .cog-cognito .el-message__content{margin:1em 0}\", \"\"]);\n\n// exports\n","import axios, { AxiosInstance, AxiosRequestConfig, AxiosError, AxiosResponse } from 'axios';\r\nimport VueModel from '@cognitoforms/vuemodel';\r\nimport { FormsModel } from '../framework/forms-model';\r\nimport combineUrls from 'axios/lib/helpers/combineURLs';\r\nimport buildURL from 'axios/lib/helpers/buildURL';\r\nimport isAbsoluteURL from 'axios/lib/helpers/isAbsoluteURL';\r\nimport { FormSession } from './form-session';\r\nimport { CustomResponseError, JsonErrorInfo } from './custom-response-error';\r\nimport ToastMessage from '../components/ToastMessage';\r\nimport { CognitoConfiguration } from 'src/util/clientside-configuration';\r\n\r\nexport interface ServiceRequestOptions extends AxiosRequestConfig {\r\n\tendpoint: string;\r\n\tdata?: any;\r\n\tisCognitoJson?: boolean;\r\n\tpassive?: boolean;\r\n}\r\n\r\nexport type ServiceRequestError = Error | AxiosError | RequestCancelledError | CustomResponseError;\r\n\r\nexport type ServiceRequestResult = {\r\n\tresponse?: AxiosResponse;\r\n\terror?: ServiceRequestError;\r\n};\r\n\r\nexport class RequestCancelledError extends Error {\r\n\tconstructor() {\r\n\t\tsuper('cancelled');\r\n\t}\r\n}\r\n\r\nexport class CaptchaError extends Error {\r\n\tconstructor() {\r\n\t\tsuper('Captcha validation required.');\r\n\t}\r\n}\r\n\r\nexport class InvalidSharedLinkError extends Error {\r\n\tconstructor() {\r\n\t\tsuper('Invalid Shared Link');\r\n\t}\r\n}\r\n\r\nexport class PublicLinksDisabledError extends Error {\r\n\tconstructor() {\r\n\t\tsuper('Public Links Disabled');\r\n\t}\r\n}\r\n\r\nexport class StripePaymentIntentError extends Error {\r\n\tconstructor() {\r\n\t\tsuper('Stripe PaymentIntent Failure');\r\n\t}\r\n}\r\n\r\nexport class InternalServerError extends Error {\r\n\tconstructor() {\r\n\t\tsuper('Internal server error.');\r\n\t}\r\n}\r\n\r\nfunction isJsonErrorInfo(data: any): data is JsonErrorInfo {\r\n\treturn typeof data === 'object' && data.hasOwnProperty('Type') && data.hasOwnProperty('Message') && data.hasOwnProperty('Data');\r\n}\r\n\r\nexport function isAxiosError(error: ServiceRequestError): error is AxiosError {\r\n\treturn error instanceof Error && (error as any).isAxiosError;\r\n}\r\n\r\nexport class BaseService {\r\n\tprotected readonly apiKey: string;\r\n\tprotected sessionToken: string;\r\n\tprotected readonly client: AxiosInstance;\r\n\r\n\tconstructor(apiKey: string, sessionToken?: string, baseUrl?: string) {\r\n\t\tthis.apiKey = apiKey;\r\n\t\tthis.sessionToken = sessionToken;\r\n\r\n\t\tthis.client = axios.create({\r\n\t\t\tbaseURL: baseUrl || CognitoConfiguration.SiteUrl || window.location.origin,\r\n\t\t\tmethod: 'GET',\r\n\t\t\txsrfCookieName: null\t// prevent axios from reading document.cookies (https://github.com/axios/axios/pull/406)\r\n\t\t});\r\n\r\n\t\tthis.client.defaults.headers.post['Content-Type'] = 'application/json; charset=utf-8';\r\n\t\tthis.client.defaults.headers.common['X-Requested-With'] = 'XmlHttpRequest';\r\n\t\tthis.client.interceptors.request.use(BaseService.modelSerialization);\r\n\t\tthis.client.interceptors.response.use(this.receiveServerTime.bind(this));\r\n\t\tif (location.href.startsWith(CognitoConfiguration.SiteUrl))\r\n\t\t\tthis.client.interceptors.response.use(this.receiveSessionToken.bind(this));\r\n\t}\r\n\r\n\t/**\r\n\t * Generates the URI that the service would use to make a request with the provided configuration.\r\n\t * @param config request configuration used to generate a URI.\r\n\t */\r\n\tprotected getUri(config: AxiosRequestConfig) {\r\n\t\tconfig = Object.assign({}, this.client.defaults, config);\r\n\r\n\t\tif (config.baseURL && !isAbsoluteURL(config.url))\r\n\t\t\tconfig.url = combineUrls(config.baseURL, config.url);\r\n\r\n\t\treturn buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\r\n\t}\r\n\r\n\t/**\r\n\t * Use custom serialization on model instances\r\n\t */\r\n\tprivate static modelSerialization(config: AxiosRequestConfig) {\r\n\t\tif (config.data instanceof VueModel.Entity) {\r\n\t\t\tconfig.headers['Content-Type'] = 'application/json+cognito; charset=utf-8';\r\n\t\t\tconfig.data = config.data.serialize();\r\n\t\t}\r\n\t\treturn config;\r\n\t}\r\n\r\n\tprivate async transformServiceRequestOptions(options: ServiceRequestOptions) {\r\n\t\tconst config = options;\r\n\t\tconfig.url = options.endpoint;\r\n\t\tconfig.params = config.params || {};\r\n\t\tconfig.headers = config.headers || {};\r\n\r\n\t\tif (this.sessionToken)\r\n\t\t\tconfig.headers['X-SessionToken'] = this.sessionToken;\r\n\r\n\t\tif (options.isCognitoJson)\r\n\t\t\tconfig.headers['Content-Type'] = 'application/json+cognito, charset=utf-8';\r\n\r\n\t\tif (options.passive === true)\r\n\t\t\tconfig.headers['X-Passive-Request'] = 1;\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\tasync serviceRequest(options: ServiceRequestOptions | string): Promise {\r\n\t\tconst config = await this.transformServiceRequestOptions(typeof options === 'string'\r\n\t\t\t? { endpoint: options, method: 'get' }\r\n\t\t\t: options);\r\n\r\n\t\tconst result: ServiceRequestResult = { response: null, error: null };\r\n\r\n\t\t// Handle the response\r\n\t\ttry {\r\n\t\t\tresult.response = await this.client.request(config);\r\n\t\t}\r\n\t\t// Handle the error\r\n\t\tcatch (err) {\r\n\t\t\tif (isAxiosError(err) || axios.isCancel(err)) {\r\n\t\t\t\tresult.error = this.transformErrorFromResponse(err);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tresult.error = err;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\tprivate transformErrorFromResponse(err: AxiosError): ServiceRequestError {\r\n\t\tif (axios.isCancel(err))\r\n\t\t\treturn new RequestCancelledError();\r\n\r\n\t\t// Check for a failure that returns a response of type object, i.e. 'JsonErrorInfo'\r\n\t\tif (err.response && err.response.data && isJsonErrorInfo(err.response.data))\r\n\t\t\treturn new CustomResponseError(err.response.data);\r\n\r\n\t\treturn err;\r\n\t}\r\n\r\n\t/**\r\n\t * Determine the server time offset relative to the client time during posts\r\n\t */\r\n\tprivate receiveServerTime(res: AxiosResponse) {\r\n\t\tconst serverTime = res.headers['x-server-time'];\r\n\t\tif (serverTime) {\r\n\t\t\ttry {\r\n\t\t\t\tFormsModel.config.serverTimeOffset = new Date(serverTime).getTime() - new Date().getTime();\r\n\t\t\t}\r\n\t\t\tcatch (e) { }\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\r\n\tprivate receiveSessionToken(res: AxiosResponse) {\r\n\t\tconst sessionToken = res.headers['x-sessiontoken'];\r\n\t\tif (sessionToken) {\r\n\t\t\ttry {\r\n\t\t\t\tconst event = new CustomEvent('received-session-token');\r\n\t\t\t\tevent['token'] = sessionToken;\r\n\t\t\t\tdocument.dispatchEvent(event);\r\n\t\t\t}\r\n\t\t\tcatch (e) { }\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n}\r\n\r\nexport class ServiceWithSession extends BaseService {\r\n\tsession: FormSession;\r\n\r\n\tconstructor(session: FormSession) {\r\n\t\tsuper(session.apiKey, session.token);\r\n\t\tthis.session = session;\r\n\t\tthis.client.interceptors.response.use(this.receiveAccessToken.bind(this));\r\n\t}\r\n\r\n\tprivate receiveAccessToken(res: AxiosResponse) {\r\n\t\t// capture fresh accessToken\r\n\t\tif (res.data && res.data['accessToken'])\r\n\t\t\tthis.session.accessToken = res.data['accessToken'];\r\n\t\treturn res;\r\n\t}\r\n\r\n\tparseError(error: ServiceRequestError): Error {\r\n\t\tif (isAxiosError(error) && error.response && error.response.data === 'captcha')\r\n\t\t\treturn new CaptchaError();\r\n\t\telse if (isAxiosError(error) && error.response && error.response.data.error === 'Invalid Shared Link')\r\n\t\t\treturn new InvalidSharedLinkError();\r\n\t\telse if (isAxiosError(error) && error.response && error.response.data.error === 'Public Links Disabled')\r\n\t\t\treturn new PublicLinksDisabledError();\r\n\t\telse if (isAxiosError(error) && error.response && error.response.data.error === 'Stripe PaymentIntent Failure')\r\n\t\t\treturn new StripePaymentIntentError();\r\n\t\telse if (isAxiosError(error) && error.response && error.response.status === 500) {\r\n\t\t\tconst errorHeading = this.session.getResource('entry-submission-error-heading');\r\n\t\t\tToastMessage(this.session.formId, {\r\n\t\t\t\ttype: 'error',\r\n\t\t\t\tmessage: errorHeading || 'Internal server error'\r\n\t\t\t});\r\n\t\t\treturn new InternalServerError();\r\n\t\t}\r\n\t\telse if (this.session.flags.concurrentEditing)\r\n\t\t\treturn this.parseSvcError(error);\r\n\r\n\t\treturn error;\r\n\t}\r\n\r\n\tparseSvcError(error: ServiceRequestError): Error {\r\n\t\tif (error instanceof CustomResponseError) {\r\n\t\t\tif (error.data.error === 'Invalid Shared Link')\r\n\t\t\t\treturn new InvalidSharedLinkError();\r\n\t\t\telse if (error.data.error === 'Public Links Disabled')\r\n\t\t\t\treturn new PublicLinksDisabledError();\r\n\t\t\telse if (error.data.error === 'Stripe PaymentIntent Failure')\r\n\t\t\t\treturn new StripePaymentIntentError();\r\n\t\t}\r\n\t\treturn error;\r\n\t}\r\n}\r\n","export enum FormStatus {\r\n\tDefault = 'default',\r\n\tSuccess = 'success',\r\n\tInProgress = 'validating',\r\n\tError = 'error',\r\n\tCaptcha = 'captcha',\r\n\tAuthenticating = 'authenticating'\r\n}\r\n\r\nexport const FormStatusProp = {\r\n\ttype: String,\r\n\tdefault: FormStatus.Default,\r\n\tvalidator: value => {\r\n\t\treturn Object.values(FormStatus).includes(value);\r\n\t}\r\n};","import scroll from 'scroll-into-view';\r\nconst scrollIntoView = (target: HTMLElement, settings?: __ScrollIntoView.Settings, callback?: __ScrollIntoView.Callback, useNativeScrolling: boolean = false) => {\r\n\tconst rect = target.getBoundingClientRect();\r\n\tif (useNativeScrolling)\r\n\t\ttarget.scrollIntoView({ behavior: 'smooth' });\r\n\telse if (rect.top < 0 || rect.bottom > (window.innerHeight || document.documentElement.clientHeight))\r\n\t\tscroll(target, settings, callback);\r\n};\r\nexport default scrollIntoView;"],"sourceRoot":""}