\n
\n
0\"\n v-tooltip=\"\n licensedCount === licenseableCount\n ? 'You\\'ve unlocked everything'\n : 'Data available to unlock'\n \"\n class=\"text-sm text-white font-semibold\"\n >\n {{ licensedCount }} / {{ licenseableCount }}\n
\n
\n Nothing to unlock\n
\n
0 ? 'white' : '#D4D4D8'\"\n />\n \n
0\"\n class=\"absolute h-full bg-indigo-500\"\n :style=\"`z-index: 2; width: ${licensedWidth}%;`\"\n />\n
\n
\n\n\n\n","
\n\n \n\n\n\n","
\n \n
\n
\n
{{ bundle.name }}
\n
{{ bundle.description }}
\n
\n
\n
0\"\n :all-fields-data=\"displayableData\"\n tooltip=\"Your unlockable collection\"\n class=\"w-full\"\n style=\"height: 20px\"\n />\n \n \n
\n
0\"\n :context=\"context\"\n :calculation-name=\"calculationName\"\n :data-field=\"dataField\"\n :bundle-api-param=\"bundle.apiParam\"\n :bundle-pricing-data=\"displayableData\"\n :user-store=\"userStore\"\n :modal-store=\"modalStore\"\n :unlocker-store=\"unlockerStore\"\n :analyze=\"analyze\"\n @unlocked=\"unlocked\"\n @reset-displayable=\"resetDisplayable\"\n />\n \n
\n \n \n 100% unlocked\n
\n \n \n\n\n","
\n \n \n \n \n \n \n \n \n\n \n \n
\n\n
\n
\n
\n
Individual field
\n
\n {{\n _.startCase(\n dataField?.fieldName ||\n dataField?.fieldContentType ||\n \"Unlockable field\",\n )\n }}\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
{{ overrideRecords.length }} Datapoints
\n
\n
\n
\n
\n
\n \n \n \n\n\n\n\n","
\n \n \n
\n \n {{ $filters.initials(attribution.name) }}\n \n \n
\n
\n \n \n \n\n\n","
\n \n
\n
\n
\n Or, input correctly and earn $ \n
\n
\n
\n
\n \n\n\n","
\n \n
\n Unlock datapoints\n
\n
\n Filtered Datapoints\n
\n
\n Updates fetching... \n Updates pending... \n \n
\n
\n \n \n \n \n
\n {{ combinedDataGrade }}x Base\n {{ rawFree ? \"Credits of $0.001\" : \"Pricing of $0.005\" }} \n \n \n \n
\n
\n
\n \n \n
\n
\n
\n {{ variable.name }}:\n {{ gradeLabelFor(variable) }} — {{\n variableGradeFor(variable.name)\n }}x\n
\n
\n
\n \n \n
\n
\n \n \n \n 0\n ? 'Click to see the types of users earning money and credits from this data.'\n : ''\n \"\n :class=\"displayPricingContext || calculationName ? 'px-2' : ''\"\n class=\"w-full text-gray-700 group flex items-center py-1 text-xs hover:bg-gray-100 hover:text-gray-900\"\n data-test=\"add-task-button\"\n >\n \n \n
{{ attributionCount }}
\n
0\" class=\"\">All fields
\n
\n \n \n \n \n \n \n
\n 0 && fieldTypesLabel === 'cost'\"\n v-tooltip=\"'Field pricing tier'\"\n class=\"text-gray-400 w-4 h-4\"\n />\n 0 && fieldTypesLabel === 'visibility'\"\n v-tooltip=\"'Field visibility'\"\n class=\"text-gray-400 w-4 h-4\"\n />\n 0\"\n v-tooltip=\"unlockTooltip\"\n class=\"text-gray-400 w-4 h-4\"\n />\n \n
\n
\n
0\"\n :all-fields-data=\"actionableAllFieldsData\"\n :field-types-label=\"fieldTypesLabel\"\n class=\"w-full\"\n style=\"height: 20px\"\n @set-field-types-label=\"setFieldTypesLabel\"\n />\n 0\"\n :all-fields-data=\"actionableAllFieldsData\"\n class=\"w-full\"\n style=\"height: 20px\"\n />\n \n \n\n
\n
\n \n \n
\n \n\n\n","
\n \n
\n
\n \n
\n \n \n\n
\n \n \n \n \n \n \n \n
\n \n
\n \n\n\n","
\n \n
\n \n {{ option.name }}\n \n \n
\n \n
\n \n \n\n
\n \n \n \n \n \n \n \n
\n \n
\n \n\n\n","
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n\n \n
\n \n \n \n \n \n \n \n \n \n \n Set to\n {{ milestoneObject.statusLabel || \"Unknown state\" }} \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n\n\n","
\n \n
\n \n {{ editingState ? \"Current Milestone\" : \"Milestones\" }}\n \n \n \n \n \n \n \n \n
\n \n\n\n","
\n \n
\n
\n \n
State \n \n \n \n \n \n
\n \n\n\n","
\n \n
\n
\n \n \n \n \n \n \n \n \n \n Link to {{ advisorField.fieldContent?.name }} \n \n {{\n advisorField.advisorRoles\n ?.map(({ fieldContent }) => fieldContent.name)\n ?.join(\", \")\n }} \n 0\n \"\n >\n · \n {{\n advisorField.advisorContacts\n ?.map(({ fieldContent }) => fieldContent.name)\n ?.join(\", \")\n }} \n \n
\n \n \n \n \n \n
\n \n \n \n\n \n \n \n \n \n \n \n \n \n
\n
\n \n\n\n","
\n \n
{{ roleLabel }}Advisors \n
0\" class=\"mt-1 space-y-2\">\n \n \n
\n
0\n \"\n class=\"\"\n >\n \n
\n
\n \n
\n
\n
\n \n \n\n
\n \n \n \n \n \n \n \n
\n
\n
0\"\n class=\"mt-1 flex flex-wrap\"\n >\n \n {{ company.name }}\n \n \n
\n \n \n \n \n \n \n \n \n \n \n Add companies \n \n \n \n \n \n
\n
\n \n\n\n","
\n \n \n
\n \n \n \n
\n
\n
\n
\n
\n {{ _.capitalize(role) }}\n
\n
\n
\n
\n \n
\n \n \n \n\n \n \n \n \n
\n \n \n\n\n","
\n \n \n\n \n\n \n\n \n
\n \n
\n
\n
\n \n \n\n
\n \n \n \n \n \n \n \n
\n
\n\n \n
\n \n
\n
\n
\n \n \n\n
\n \n \n \n \n \n \n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n Add a company \n \n \n \n \n \n
\n\n \n
\n \n \n \n \n \n \n \n \n \n Add a standalone contact \n \n \n \n \n \n
\n \n \n\n\n","
\n \n
\n Bidders & Prospects\n \n
0\"\n :class=\"\n workspaceLayout === 'topAndBottom'\n ? 'grid-cols-4 grid-flow-row-dense'\n : 'grid-cols-2'\n \"\n class=\"mt-1 grid gap-2\"\n >\n \n
\n
\n
\n Advisors & Capital Sources \n \n \n \n
\n \n
\n
\n \n
\n
\n
\n \n \n\n
\n \n \n \n \n \n \n \n
\n
\n
0\" class=\"mt-1 flex flex-wrap\">\n \n {{ company.name }}\n \n \n
\n \n \n \n \n \n \n \n \n \n \n Add companies \n \n \n \n \n \n
\n
\n \n\n\n","
\n \n \n \n
\n {{ supplySideLabel }}\n \n
0\" class=\"mt-1 space-y-2\">\n \n \n
\n
\n \n \n
\n No {{ supplySideLabel }}\n \n
\n Rewind the timeline and add older deals.\n
\n
\n
Or, link to an older deal:
\n
\n \n \n
\n
\n
\n
\n \n \n
Timing unknown \n
\n This investment needs a date and status.\n
\n
\n
\n \n\n \n \n
\n {{ supplySideLabel }}\n \n
0\" class=\"mt-1 space-y-2\">\n \n \n \n \n \n \n \n
\n
\n \n \n
\n No {{ supplySideLabel }}\n \n
Add an owner in the Deal Hub.
\n
\n
\n
\n \n \n
Timing unknown \n
\n This availability needs a date and status.\n
\n
\n
\n \n\n \n \n \n
\n \n {{ demandSideLabel }}\n
\n \n \n \n \n\n \n \n \n \n \n
0\" class=\"mt-1 space-y-2\">\n \n \n
0\" class=\"mt-1 space-y-2\">\n \n \n
\n
\n \n
\n
\n
\n \n \n\n
\n \n \n \n \n \n \n \n
\n
\n
0\"\n class=\"mt-1 flex flex-wrap\"\n >\n \n {{ company.name || company }}\n \n \n
\n \n \n \n \n \n \n \n \n \n \n Add companies \n \n \n \n \n \n
\n
\n \n\n \n \n
\n \n {{ demandSideLabel }}\n
\n \n \n \n \n\n \n \n \n \n \n
0\" class=\"mt-1 space-y-2\">\n \n \n
0\" class=\"mt-1 space-y-2\">\n \n \n
\n
\n \n
\n
\n
\n \n \n\n
\n \n \n \n \n \n \n \n
\n
\n
0\"\n class=\"mt-1 flex flex-wrap\"\n >\n \n {{ company.name || company }}\n \n \n
\n \n \n \n \n \n \n \n \n \n \n Add companies \n \n \n \n \n \n
\n
\n \n \n\n\n","
\n \n
\n
\n \n \n \n \n \n \n \n
\n
\n \n\n\n","
\n \n
\n
\n Availability belongs to Group {{ portfolioId }}\n \n
\n \n \n Open Group\n \n \n
\n\n \n
\n
\n \n \n
No group \n
\n Create a new group containing this and other availabilities.\n
\n
\n
0\">\n \n \n Add to...\n \n\n \n \n \n \n\n
\n \n \n \n New Group\n \n \n \n
\n
\n
\n \n\n\n","
\n \n \n
\n \n \n\n
\n \n
\n
\n \n\n\n","
\n \n
\n
\n \n \n \n \n \n \n \n
\n
\n \n\n\n","
\n \n
\n
\n Transaction belongs to Portfolio {{ portfolioId }}\n \n
\n \n \n Open Portfolio\n \n \n
\n\n \n
\n
\n \n \n
No portfolio \n
\n Create a new portfolio containing this and other deals.\n
\n
\n
0\">\n \n \n Add to...\n \n\n \n \n \n \n\n
\n \n \n \n New Portfolio\n \n \n \n
\n
\n
\n \n\n\n","
\n \n
\n
\n \n
State \n \n \n \n \n \n
\n \n\n\n","
\n \n
\n \n \n Add contact \n \n \n \n \n\n
\n \n
\n
\n\n \n
\n \n
\n
\n
\n \n \n\n
\n \n \n \n \n \n \n \n
\n
\n \n\n\n","
\n \n \n Players \n Link contacts, partners, and advisors to this\n {{ _.startCase(dataField.fieldContentType) }}. \n \n \n
\n
\n \n
\n {{ companyLabel ? `${companyLabel} ` : \"\" }}Contacts\n \n \n \n \n \n \n \n
\n
\n \n \n\n\n","
\n \n \n
\n \n \n\n
\n \n
\n
\n \n\n\n","
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n\n","
\n \n \n\n\n","
\n \n
\n
\n {{\n fieldContentType === \"InvestmentGroup\" ? \"Portfolio \" : \"Asset \"\n }}Loan\n \n \n
\n
\n
0\" class=\"overflow-x-auto\">\n
\n
\n
\n \n \n \n Expand \n \n \n Amount\n \n \n Term\n \n \n Maturity Date\n \n \n Rate\n \n \n \n \n
\n
\n
\n
\n
\n
\n \n \n
\n Unsaved {{ fieldContentType }}\n \n
\n Once you save, loan details may be added here.\n
\n
\n \n
\n
\n
\n No portfolio loan\n \n
\n Treat the portfolio assets as collateral for a single loan.\n
\n
\n
\n \n \n \n \n \n Add Portfolio Loan\n \n \n \n \n
\n
\n
\n
\n \n\n\n","import { currencyBelowThreshold } from \"@/assets/numberHelpers\";\nimport _ from \"lodash\";\n\nfunction operableFloorAreas(calculationData, calculationOptions) {\n const floorAreaDataFields = _.get(\n calculationData,\n \"sizesUses.floorAreaDataFields\",\n [],\n );\n const includeAirRights = calculationOptions.sizesUses.includeAirRights;\n\n if (includeAirRights) {\n return floorAreaDataFields;\n } else {\n return floorAreaDataFields.filter(\n (df) => df.decoratingContentSubType !== \"Unused Development Rights\",\n );\n }\n}\n\nfunction areaSum(areaDataFields, calcFieldName = \"standardized_area\") {\n let numericAreas = [];\n if (_.includes([\"standardized_area\", \"use_based_area\"], calcFieldName)) {\n numericAreas = areaDataFields\n .filter(({ fieldName }) => fieldName === calcFieldName)\n .map((df) => _.toNumber(df.fieldValue));\n } else if (calcFieldName === \"minimum_subdivision_standardized_area\") {\n const grouped = _.groupBy(areaDataFields, \"decoratingContentId\");\n const areaFields = _.map(grouped, function (dfs) {\n return (\n _.find(dfs, { fieldName: calcFieldName }) ||\n _.find(dfs, { fieldName: \"standardized_area\" })\n );\n });\n numericAreas = areaFields.map((df) => _.toNumber(df.fieldValue));\n }\n return _.sum(numericAreas);\n}\n\nfunction standardizedArea(calculationData, calculationOptions) {\n const floorAreaIds = includedFloorAreas(\n calculationData,\n calculationOptions,\n ).map((df) => df.fieldContentId);\n const standardizedAreaDataFields = _.get(\n calculationData,\n \"sizesUses.standardizedAreaDataFields\",\n [],\n );\n const operableStandardizedAreas = standardizedAreaDataFields.filter((df) => {\n return _.includes(floorAreaIds, df.decoratingContentId);\n });\n\n return areaSum(operableStandardizedAreas);\n}\n\nfunction standardizedAreaString(calculationData, calculationOptions) {\n return `${currencyBelowThreshold(\n standardizedArea(calculationData, calculationOptions),\n )} SF`;\n}\n\nfunction multiUseAreas(calculationData, calculationOptions) {\n return operableFloorAreas(calculationData, calculationOptions).filter(\n (df) => {\n return _.get(df, \"fieldContent.useTypes\", []).length > 1;\n },\n );\n}\n\nfunction multiCoveringAreas(calculationData, calculationOptions) {\n return operableFloorAreas(calculationData, calculationOptions).filter(\n (df) => {\n return _.get(df, \"fieldContent.landCoveringCount\") > 1;\n },\n );\n}\n\nfunction noStandardizedArea(calculationData, calculationOptions) {\n const standardizedAreaDataFields = _.get(\n calculationData,\n \"sizesUses.standardizedAreaDataFields\",\n [],\n );\n return operableFloorAreas(calculationData, calculationOptions).filter(\n (df) => {\n return !_.find(standardizedAreaDataFields, {\n decoratingContentId: df.fieldContentId,\n });\n },\n );\n}\n\nfunction noUseBasedArea(calculationData, calculationOptions) {\n const useBasedAreaDataFields = _.get(\n calculationData,\n \"sizesUses.useBasedAreaDataFields\",\n [],\n );\n return operableFloorAreas(calculationData, calculationOptions)\n .filter((df) => {\n return _.some(df.fieldContent?.useTypes, function (useType) {\n return useBasedAreaType(useType);\n });\n })\n .filter((df) => {\n return !_.find(useBasedAreaDataFields, {\n decoratingContentId: df.fieldContentId,\n });\n });\n}\n\nfunction missingUseAreas(calculationData, calculationOptions) {\n const standardizedAreaDataFields = _.get(\n calculationData,\n \"sizesUses.standardizedAreaDataFields\",\n [],\n );\n const useBasedAreaDataFields = _.get(\n calculationData,\n \"sizesUses.useBasedAreaDataFields\",\n [],\n );\n return operableFloorAreas(calculationData, calculationOptions).filter(\n (df) => {\n return (\n _.isEmpty(_.get(df, \"fieldContent.useTypes\", [])) &&\n (_.find(standardizedAreaDataFields, {\n decoratingContentId: df.fieldContentId,\n }) ||\n _.find(useBasedAreaDataFields, {\n decoratingContentId: df.fieldContentId,\n }))\n );\n },\n );\n}\n\nfunction useTypes(calculationData, calculationOptions) {\n const floorAreaIds = operableFloorAreas(\n calculationData,\n calculationOptions,\n ).map((df) => df.fieldContentId);\n return _.uniq(\n calculationData.sizesUses.propertyUseDataFields\n .filter((df) => _.includes(floorAreaIds, df.decoratingContentId))\n .map((df) => {\n return _.get(df, \"fieldContent.name\");\n }),\n );\n}\n\nfunction includedFloorAreas(calculationData, calculationOptions) {\n const excludedUseTypes = calculationOptions.excludedUses.useTypes;\n return operableFloorAreas(calculationData, calculationOptions).filter(\n (df) => {\n const useTypes = _.get(df, \"fieldContent.useTypes\", []);\n return _.isEmpty(_.intersection(excludedUseTypes, useTypes));\n },\n );\n}\n\nfunction typedFloorAreas(useType, calculationData, calculationOptions) {\n return operableFloorAreas(calculationData, calculationOptions).filter(\n (df) => {\n return _.includes(_.get(df, \"fieldContent.useTypes\", []), useType);\n },\n );\n}\n\nfunction unitFor(useType) {\n switch (useType) {\n case \"Office\":\n case \"Retail\":\n case \"Industrial\":\n case \"R&D\":\n case \"Research & Development\":\n case \"Healthcare\":\n case \"Casino\":\n case \"Common Area\":\n case \"Mechanical\":\n return \"SF\";\n case \"Residential\":\n case \"Multifamily\":\n case \"Senior Housing\":\n case \"Student Housing\":\n return \"Doors\";\n case \"Hotel\":\n return \"Keys\";\n case \"Self-Storage\":\n return \"Units\";\n case \"Data Center\":\n return \"MW\";\n case \"Parking\":\n return \"Spaces\";\n }\n}\n\nfunction perAreaFor(useType) {\n switch (useType) {\n case \"Office\":\n case \"Retail\":\n case \"Industrial\":\n case \"R&D\":\n case \"Research & Development\":\n case \"Healthcare\":\n case \"Casino\":\n case \"Common Area\":\n case \"Mechanical\":\n return \"SF\";\n case \"Residential\":\n case \"Multifamily\":\n case \"Senior Housing\":\n case \"Student Housing\":\n return \"Door\";\n case \"Hotel\":\n return \"Key\";\n case \"Self-Storage\":\n return \"Unit\";\n case \"Data Center\":\n return \"MW\";\n case \"Parking\":\n return \"Space\";\n }\n}\n\nfunction minimumSubdivisionAreaFor(\n useType,\n calculationData,\n calculationOptions,\n) {\n const floorAreaIds = typedFloorAreas(\n useType,\n calculationData,\n calculationOptions,\n ).map((df) => df.fieldContentId);\n const standardizedAreaDataFields = _.get(\n calculationData,\n \"sizesUses.standardizedAreaDataFields\",\n [],\n );\n const operableStandardizedAreas = standardizedAreaDataFields.filter((df) => {\n return _.includes(floorAreaIds, df.decoratingContentId);\n });\n\n return areaSum(\n operableStandardizedAreas,\n \"minimum_subdivision_standardized_area\",\n );\n}\n\nfunction minimumSubdivisionAreaStringFor(\n useType,\n calculationData,\n calculationOptions,\n) {\n return `${currencyBelowThreshold(\n minimumSubdivisionAreaFor(useType, calculationData, calculationOptions),\n )} SF`;\n}\n\nfunction standardizedAreaFor(useType, calculationData, calculationOptions) {\n const floorAreaIds = typedFloorAreas(\n useType,\n calculationData,\n calculationOptions,\n ).map((df) => df.fieldContentId);\n const standardizedAreaDataFields = _.get(\n calculationData,\n \"sizesUses.standardizedAreaDataFields\",\n [],\n );\n const operableStandardizedAreas = standardizedAreaDataFields.filter((df) => {\n return _.includes(floorAreaIds, df.decoratingContentId);\n });\n\n return areaSum(operableStandardizedAreas);\n}\n\nfunction standardizedAreaStringFor(\n useType,\n calculationData,\n calculationOptions,\n) {\n return `${currencyBelowThreshold(\n standardizedAreaFor(useType, calculationData, calculationOptions),\n )} SF`;\n}\n\nfunction useBasedAreaFor(useType, calculationData, calculationOptions) {\n const floorAreaIds = typedFloorAreas(\n useType,\n calculationData,\n calculationOptions,\n ).map((df) => df.fieldContentId);\n const useBasedAreaDataFields = _.get(\n calculationData,\n \"sizesUses.useBasedAreaDataFields\",\n [],\n );\n const operableUseBasedAreas = useBasedAreaDataFields.filter((df) => {\n return _.includes(floorAreaIds, df.decoratingContentId);\n });\n\n return areaSum(operableUseBasedAreas, \"use_based_area\");\n}\n\nfunction useBasedAreaStringFor(useType, calculationData, calculationOptions) {\n return `${currencyBelowThreshold(\n useBasedAreaFor(useType, calculationData, calculationOptions),\n )} ${unitFor(useType)}`;\n}\n\nfunction bundleFieldIdsFor(\n useType,\n calculationData,\n calculationOptions,\n calculationName = null,\n) {\n const floorAreaIds = typedFloorAreas(\n useType,\n calculationData,\n calculationOptions,\n ).map((df) => df.fieldContentId);\n const floorAreaFieldIds = typedFloorAreas(\n useType,\n calculationData,\n calculationOptions,\n ).map((df) => df.localId);\n let areaDataFields = [];\n\n switch (calculationName) {\n case \"standardized\": {\n const standardizedAreaDataFields = _.get(\n calculationData,\n \"sizesUses.standardizedAreaDataFields\",\n [],\n );\n areaDataFields = standardizedAreaDataFields.filter((df) => {\n return (\n _.includes(floorAreaIds, df.decoratingContentId) &&\n df.fieldName === \"standardized_area\"\n );\n });\n break;\n }\n case \"minimum_subdivision_standardized\": {\n const standardizedAreaDataFields = _.get(\n calculationData,\n \"sizesUses.standardizedAreaDataFields\",\n [],\n );\n areaDataFields = standardizedAreaDataFields.filter((df) => {\n return _.includes(floorAreaIds, df.decoratingContentId);\n });\n break;\n }\n case \"useBased\": {\n const useBasedAreaDataFields = _.get(\n calculationData,\n \"sizesUses.useBasedAreaDataFields\",\n [],\n );\n areaDataFields = useBasedAreaDataFields.filter((df) => {\n return _.includes(floorAreaIds, df.decoratingContentId);\n });\n break;\n }\n }\n\n return _.concat(\n floorAreaFieldIds,\n areaDataFields.map((df) => df.localId),\n );\n}\nfunction useBasedAreaType(useType) {\n return _.includes(\n [\n \"Residential\",\n \"Multifamily\",\n \"Senior Housing\",\n \"Student Housing\",\n \"Hotel\",\n \"Self-Storage\",\n \"Data Center\",\n \"Parking\",\n ],\n useType,\n );\n}\n\n// WARNINGS\n\nfunction warningsForTopLevelAreas(calculationData, calculationOptions) {\n const missingUseAreaFields = missingUseAreas(\n calculationData,\n calculationOptions,\n );\n let missingUseAreaWarning;\n\n if (_.size(missingUseAreaFields) > 0) {\n missingUseAreaWarning = {\n id: \"missing_use\",\n description: \"Floor areas with sizes but no uses.\",\n extendedDescription:\n \"Fix this by adding a property use to the floor area.\",\n rawFields: missingUseAreaFields,\n };\n }\n\n return _.compact([missingUseAreaWarning]);\n}\n\nfunction warningsForUseType(\n useType,\n calculationContentType,\n calculationData,\n calculationOptions,\n) {\n const multiUseAreaFields = multiUseAreas(\n calculationData,\n calculationOptions,\n ).filter((floorAreaField) => {\n return _.includes(floorAreaField.fieldContent.useTypes, useType);\n });\n let multiUseWarning;\n\n if (_.size(multiUseAreaFields) > 0) {\n multiUseWarning = {\n id: \"multi_use\",\n description: \"Floor areas with multiple uses.\",\n extendedDescription:\n \"Fix this by splitting each use into its own floor area with a specific size.\",\n rawFields: multiUseAreaFields,\n };\n }\n\n const multiCoveringAreaFields = multiCoveringAreas(\n calculationData,\n calculationOptions,\n ).filter((floorAreaField) => {\n return _.includes(floorAreaField.fieldContent.useTypes, useType);\n });\n let multiCoveringWarning;\n\n if (\n calculationContentType === \"LandCovering\" &&\n _.size(multiCoveringAreaFields) > 0\n ) {\n multiUseWarning = {\n id: \"multi_covering\",\n description: \"Multi-building floor areas.\",\n extendedDescription:\n \"Fix this by placing each floor area within a single building.\",\n rawFields: multiCoveringAreaFields,\n };\n }\n\n const noStandardizedAreaFields = noStandardizedArea(\n calculationData,\n calculationOptions,\n ).filter((floorAreaField) => {\n return _.includes(floorAreaField.fieldContent.useTypes, useType);\n });\n let noStandardizedAreaWarning;\n if (_.size(noStandardizedAreaFields) > 0) {\n noStandardizedAreaWarning = {\n id: \"no_standardized_area\",\n description: \"Floor areas without standardized area.\",\n extendedDescription: \"Fix this by adding a size to the floor area.\",\n rawFields: noStandardizedAreaFields,\n };\n }\n\n const noUseBasedAreaFields = noUseBasedArea(\n calculationData,\n calculationOptions,\n ).filter((floorAreaField) => {\n return _.includes(floorAreaField.fieldContent.useTypes, useType);\n });\n let noUseBasedAreaWarning;\n if (_.size(noUseBasedAreaFields) > 0) {\n noUseBasedAreaWarning = {\n id: \"no_use_based_area\",\n description: \"Floor areas without use-based area.\",\n extendedDescription:\n \"Fix this by adding use-based units to the floor area.\",\n rawFields: noUseBasedAreaFields,\n };\n }\n\n return _.compact([\n multiUseWarning,\n multiCoveringWarning,\n noStandardizedAreaWarning,\n noUseBasedAreaWarning,\n ]);\n}\n\nfunction useTypeOutputs(\n calculationContentType,\n calculationData,\n calculationOptions,\n) {\n const rawTypes = useTypes(calculationData, calculationOptions).map(\n (useType) => {\n const excludedUseTypes = calculationOptions.excludedUses.useTypes;\n return {\n name: useType,\n excluded: _.includes(excludedUseTypes, useType),\n useBasedAreaType: useBasedAreaType(useType),\n numericUseBasedArea: useBasedAreaFor(\n useType,\n calculationData,\n calculationOptions,\n ),\n useBasedArea: useBasedAreaStringFor(\n useType,\n calculationData,\n calculationOptions,\n ),\n useBasedBundleFieldIds: bundleFieldIdsFor(\n useType,\n calculationData,\n calculationOptions,\n \"useBased\",\n ),\n unitName: unitFor(useType),\n perAreaName: perAreaFor(useType),\n numericStandardizedArea: standardizedAreaFor(\n useType,\n calculationData,\n calculationOptions,\n ),\n standardizedArea: standardizedAreaStringFor(\n useType,\n calculationData,\n calculationOptions,\n ),\n standardizedBundleFieldIds: bundleFieldIdsFor(\n useType,\n calculationData,\n calculationOptions,\n \"standardized\",\n ),\n numericMinimumSubdivisionArea: minimumSubdivisionAreaFor(\n useType,\n calculationData,\n calculationOptions,\n ),\n minimumSubdivisionArea: minimumSubdivisionAreaStringFor(\n useType,\n calculationData,\n calculationOptions,\n ),\n minimumSubdivisionBundleFieldIds: bundleFieldIdsFor(\n useType,\n calculationData,\n calculationOptions,\n \"minimum_subdivision_standardized\",\n ),\n warnings: warningsForUseType(\n useType,\n calculationContentType,\n calculationData,\n calculationOptions,\n ),\n };\n },\n );\n\n return _.orderBy(rawTypes, [\"numericStandardizedArea\"], [\"desc\"]);\n}\n\nexport default function sizeUseOutputs(\n calculationContentType,\n calculationData,\n calculationOptions,\n) {\n return {\n numericStandardizedArea: standardizedArea(\n calculationData,\n calculationOptions,\n ),\n standardizedArea: standardizedAreaString(\n calculationData,\n calculationOptions,\n ),\n warnings: warningsForTopLevelAreas(calculationData, calculationOptions),\n useTypes: useTypeOutputs(\n calculationContentType,\n calculationData,\n calculationOptions,\n ),\n };\n}\n","import { currencyBelowThreshold } from \"@/assets/numberHelpers\";\nimport sizeUseOutputs from \"@/components/analyze/calculations/sizesUses\";\nimport _ from \"lodash\";\n\nexport default function pricePerAreaCalc(calculationData, calculationOptions) {\n // VALUE\n const valueDataFields = calculationData?.valueDataFields;\n const numericDollarValues = valueDataFields.map((df) => {\n return _.toNumber(df.fieldValue);\n });\n const totalValue = _.sum(numericDollarValues);\n\n // SIZE & USE\n const sizeUseInputs = {\n sizesUses: calculationData,\n };\n const sizeUseData = sizeUseOutputs(null, sizeUseInputs, calculationOptions);\n const topLevelArea = sizeUseData?.numericStandardizedArea;\n\n const sizeRankedUses = _.orderBy(\n sizeUseData.useTypes,\n [\"numericStandardizedArea\"],\n [\"desc\"],\n );\n\n // OPTIONS\n const denominator = calculationOptions.pricePerArea?.denominator;\n\n let perArea, perAreaString;\n\n switch (denominator) {\n case \"topLevel\":\n if (topLevelArea > 0) {\n perArea = totalValue / topLevelArea;\n\n perAreaString = `$${currencyBelowThreshold(perArea)}/SF`;\n }\n break;\n case null:\n case undefined:\n break;\n default: {\n const denominatorData = _.split(denominator, \"_\");\n const denominatorUseType = _.head(denominatorData);\n const denominatorUnit = _.last(denominatorData);\n const useObject = _.find(sizeRankedUses, { name: denominatorUseType });\n const area =\n denominatorUnit === \"standardized\"\n ? useObject?.numericStandardizedArea\n : useObject?.numericUseBasedArea;\n\n if (area > 0) {\n perArea = totalValue / area;\n perAreaString =\n denominatorUnit === \"standardized\"\n ? currencyBelowThreshold(perArea, 1_000_000, 1)\n : currencyBelowThreshold(perArea, 1_000, 1);\n const unit =\n denominatorUnit === \"standardized\" ? \"SF\" : useObject?.perAreaName;\n\n perAreaString = `$${perAreaString}/${unit}`;\n }\n break;\n }\n }\n\n // console.log(\n // \"price per area calc\",\n // denominator,\n // totalValue,\n // topLevelArea,\n // perArea,\n // perAreaString,\n // sizeUseData,\n // calculationData,\n // calculationOptions,\n // );\n\n return {\n perArea,\n perAreaString,\n topLevelAreaString: sizeUseData?.standardizedArea,\n sizeRankedUses,\n topLevelWarnings: sizeUseData.warnings,\n calculationOptions,\n };\n}\n","
\n \n \n\n\n","
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n Coming Soon \n \n \n \n\n\n","
\n \n
\n
\n {{\n fieldContentType === \"InvestmentGroup\" ? \"Portfolio \" : \"Asset \"\n }}Valuations\n \n
\n
\n
\n \n \n\n
\n \n \n \n \n \n \n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n Add a valuation \n \n \n \n \n \n
\n
\n
\n
\n
0\" class=\"overflow-x-auto\">\n
\n
\n
\n \n \n \n Expand \n \n \n Type\n \n \n Value\n \n \n $/Unit\n \n \n \n \n
\n
\n
\n
\n
\n
\n \n \n
No valuations \n
\n Add one to track key investment metrics.\n
\n
\n
\n
\n \n \n
\n Unsaved investment\n \n
\n Once you save, valuations will appear here.\n
\n
\n
\n
\n \n\n\n","
\n \n \n
\n \n \n\n
\n \n
\n
\n \n\n\n","
\n \n
\n \n\n\n","/* global L */\nimport { mount } from \"mount-vue-component\";\nimport app from \"@/entrypoints/application\";\nimport LocationMarker from \"@/components/maps/LocationMarker.vue\";\n\nexport default function locationMarker({\n classes,\n tooltip,\n interactive,\n propertyId,\n landCoveringId,\n mapStore,\n propertyFieldsStore,\n}) {\n let markerVueEl;\n\n const { el } = mount(LocationMarker, {\n props: {\n classes,\n tooltip,\n interactive,\n propertyId,\n landCoveringId,\n mapStore,\n propertyFieldsStore,\n },\n app,\n });\n\n markerVueEl = el;\n\n if (markerVueEl) {\n return L.divIcon({\n className: \"workspace-marker\",\n html: markerVueEl,\n });\n } else {\n return null;\n }\n}\n","
\n \n
\n
\n
Land Parcel
\n
\n \n \n
\n
\n
\n
\n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n \n\n\n\n\n","/* global L */\nimport { mount } from \"mount-vue-component\";\nimport app from \"@/entrypoints/application\";\nimport ParcelPopup from \"@/components/property-diagram/ParcelPopup.vue\";\n\nexport default function parcelPopup({\n parcelDataField,\n propertyFieldsStore,\n propertyDiagramStore,\n changeGroupStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n layoutStore,\n secondaryPanelStore,\n documentationStore,\n}) {\n const { el } = mount(ParcelPopup, {\n props: {\n propertyFieldsStore,\n propertyDiagramStore,\n changeGroupStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n layoutStore,\n secondaryPanelStore,\n documentationStore,\n parcelDataField,\n },\n app,\n });\n return L.responsivePopup({ offset: [0, 50] }).setContent(el); // Offset popup from center of parcel\n}\n","import { storeToRefs } from \"pinia\";\nimport parcelPopup from \"@/components/property-diagram/parcelPopup\";\nimport _ from \"lodash\";\n\nexport async function addPolygonToMap({\n mode = \"store\",\n dataField,\n mapStore,\n featureGroup,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n layoutStore,\n secondaryPanelStore,\n documentationStore,\n analyzePanelStore,\n horizontalIsAnalyze,\n}) {\n const { map } = storeToRefs(mapStore);\n const { propertyDiagramSelected, propertyIdParam } =\n storeToRefs(propertyDiagramStore);\n const {\n investmentsChecked,\n loansChecked,\n spaceAvailabilitiesChecked,\n spaceUsagesChecked,\n checkedCategories,\n combinedFilteredPropertyIds,\n datedInvestmentPropertyIds,\n datedAvailabilityPropertyIds,\n } = storeToRefs(analyzePanelStore);\n\n const propertyRightType = _.get(\n propertyDiagramSelected.value,\n \"dataField.fieldContentSubType\",\n null,\n );\n const idComparisonPath =\n propertyRightType && propertyRightType === \"fee_simple\"\n ? \"dataField.fieldContentId\"\n : \"dataField.decoratingContentId\";\n const fieldContentType = _.get(\n propertyDiagramSelected.value,\n \"dataField.fieldContentType\",\n null,\n );\n const decoratingContentType = _.get(\n propertyDiagramSelected.value,\n \"dataField.decoratingContentType\",\n null,\n );\n const typeMatch =\n fieldContentType === \"PropertyRight\" ||\n decoratingContentType === \"PropertyRight\";\n\n let canDisplay = false;\n\n if (mode === \"store\") {\n const { minimapSize } = storeToRefs(mapStore);\n canDisplay = !propertyIdParam.value || minimapSize?.value === \"compact\";\n }\n\n const parcel = dataField.fieldContent;\n const idMatch =\n dataField.decoratingContentId ===\n _.get(propertyDiagramSelected.value, idComparisonPath, null);\n const excludedProperty =\n checkedCategories.value.length > 0 &&\n !_.includes(combinedFilteredPropertyIds.value, dataField.joiningContentId);\n\n const excludedInvestment =\n (investmentsChecked.value || loansChecked.value) &&\n !_.includes(datedInvestmentPropertyIds.value, dataField.joiningContentId);\n const excludedAvailability =\n (spaceAvailabilitiesChecked.value || spaceUsagesChecked.value) &&\n !_.includes(datedAvailabilityPropertyIds.value, dataField.joiningContentId);\n const visuallyExcluded =\n horizontalIsAnalyze &&\n (excludedProperty || (excludedInvestment && excludedAvailability));\n\n const color = typeMatch && idMatch ? \"#FDBA74\" : \"#99F6E4\"; // orange-300 : teal-200\n const polygon = L.polygon(parcel.coordinates, {\n interactive: mode === \"store\" && canDisplay,\n color: visuallyExcluded ? \"#9ca3af\" : color, // excluded: gray-400\n stroke: true,\n weight: map.value.getZoom() > 15 ? 3 : 1.5,\n fill: true,\n });\n\n featureGroup.addLayer(polygon);\n parcel.mapInternalId = featureGroup.getLayerId(polygon);\n if (mode === \"store\") {\n mapStore.setNearbyDataField({\n dataField,\n locationType: \"ContentPolygon\",\n });\n\n polygon.on(\"click\", () => {\n const responsivePopup = parcelPopup({\n mapStore,\n propertyFieldsStore,\n propertyDiagramStore,\n changeGroupStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n layoutStore,\n secondaryPanelStore,\n documentationStore,\n parcelDataField: dataField,\n });\n\n if (idMatch && typeMatch) {\n console.log(\"no_op\");\n } else {\n polygon.setStyle({\n color: visuallyExcluded ? \"#6b7280\" : \"#2DD4BF\", // gray-600 : teal-400\n });\n }\n\n polygon\n .unbindPopup()\n .bindPopup(responsivePopup, { minWidth: 230 })\n .openPopup();\n });\n\n polygon.on(\"popupclose\", () => {\n if (idMatch && typeMatch) {\n return;\n } else {\n polygon.setStyle({\n color: visuallyExcluded ? \"#9ca3af\" : \"#99F6E4\", // gray-400 : teal-200\n });\n }\n });\n }\n}\n","export const defaultBoundaryMeta = {\n zoom: 10,\n};\n","import api from \"@/router/api\";\nimport moment from \"moment\";\nimport propertyLandCoveringMapMarker from \"@/components/property-diagram/propertyLandCoveringMapMarker\";\nimport locationMarker from \"@/components/maps/locationMarker\";\nimport { storeToRefs } from \"pinia\";\nimport { addLocationToMap } from \"@/components/maps/addLocationToMap\";\nimport { addPolygonToMap } from \"@/components/maps/addPolygonToMap\";\nimport { defaultBoundaryMeta } from \"@/components/maps/defaultBoundaryMeta\";\nimport _ from \"lodash\";\n/* global L */\n\nexport async function fetchNearbyValidationParcels({\n map,\n mapStore,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n secondaryPanelStore,\n documentationStore,\n analyzePanelStore,\n layoutStore,\n parcelFeatureGroup,\n asOfMilliseconds,\n activeChangeGroupId,\n}) {\n const zoom = map.getZoom();\n const bounds = map.getBounds();\n const southwest = bounds.getSouthWest();\n const northeast = bounds.getNorthEast();\n const northeastLatLng = [northeast.lat, northeast.lng];\n const southwestLatLng = [southwest.lat, southwest.lng];\n\n await Promise.all(\n _.compact([\n fetchParcels({\n mode: \"validation\",\n propertyFieldsStore,\n mapStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n layoutStore,\n secondaryPanelStore,\n documentationStore,\n analyzePanelStore,\n featureGroup: parcelFeatureGroup,\n southwestLatLng,\n northeastLatLng,\n asOfMilliseconds,\n activeChangeGroupId,\n horizontalIsAnalyze: false,\n zoom,\n }),\n ]),\n );\n}\n\nexport async function fetchNearbyValidationProperties({\n nearbyType,\n map,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n documentationStore,\n layoutStore,\n propertyFeatureGroup,\n landCoveringFeatureGroup,\n asOfMilliseconds,\n activeChangeGroupId,\n}) {\n const zoom = map.getZoom();\n const bounds = map.getBounds();\n const southwest = bounds.getSouthWest();\n const northeast = bounds.getNorthEast();\n const northeastLatLng = [northeast.lat, northeast.lng];\n const southwestLatLng = [southwest.lat, southwest.lng];\n\n await Promise.all(\n _.compact([\n nearbyType === \"Property\"\n ? fetchProperties({\n mode: \"validation\",\n mapStore: null,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n documentationStore,\n layoutStore,\n featureGroup: propertyFeatureGroup,\n southwestLatLng,\n northeastLatLng,\n asOfMilliseconds,\n activeChangeGroupId,\n zoom,\n propertyZoomTrigger: 16,\n horizontalIsAnalyze: false,\n companyIdParam: null,\n companyDetailStore: null,\n contactIdParam: null,\n contactDetailStore: null,\n })\n : null,\n nearbyType === \"LandCovering\"\n ? fetchLandCoverings({\n mode: \"validation\",\n mapStore: null,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n documentationStore,\n featureGroup: landCoveringFeatureGroup,\n southwestLatLng,\n northeastLatLng,\n asOfMilliseconds,\n activeChangeGroupId,\n horizontalIsAnalyze: false,\n zoom,\n })\n : null,\n ]),\n );\n}\n\nexport async function pingUsers({\n mapStore,\n userStore,\n userGeographiesStore,\n documentationStore,\n userFeatureGroup,\n}) {\n const { map } = storeToRefs(mapStore);\n const { currentUser } = storeToRefs(userStore);\n const sessionFetchedAt = _.get(currentUser.value, \"sessionFetchedAt\");\n const bounds = map.value.getBounds();\n const southwest = bounds.getSouthWest();\n const northeast = bounds.getNorthEast();\n const northeastLatLng = [northeast.lat, northeast.lng];\n const southwestLatLng = [southwest.lat, southwest.lng];\n\n const zoom = map.value.getZoom();\n\n if (\n sessionFetchedAt &&\n moment(sessionFetchedAt).isAfter(moment().subtract(5, \"minutes\"))\n ) {\n await fetchUsers({\n zoom,\n mapStore,\n featureGroup: userFeatureGroup,\n southwestLatLng,\n northeastLatLng,\n userGeographiesStore,\n documentationStore,\n });\n }\n}\n\nexport async function exploreMap({\n mapStore,\n userStore,\n guestProfileStore,\n polygonDrawer,\n fullSize,\n navigationType,\n}) {\n const { map, minimapSize, newOriginOverride } = storeToRefs(mapStore);\n const { signedIn } = storeToRefs(userStore);\n const bounds = map.value.getBounds();\n const southwest = bounds.getSouthWest();\n const northeast = bounds.getNorthEast();\n const northeastLatLng = [northeast.lat, northeast.lng];\n const southwestLatLng = [southwest.lat, southwest.lng];\n\n const zoom = map.value.getZoom();\n const eligibleMode = fullSize || minimapSize.value === \"compact\";\n\n if (zoom >= 16.5 && eligibleMode) {\n const { lat, lng } = map.value.getCenter();\n const payload = {\n lat,\n lng,\n navigationType: newOriginOverride.value ? \"origin\" : navigationType.value,\n createdAt: new Date(),\n };\n\n if (signedIn.value) {\n const { sessionGeographyIntents } = storeToRefs(userStore);\n\n if (sessionGeographyIntents.value === 0) {\n payload.navigationType = \"origin\";\n }\n\n await api.post(`user_geography_intents`, payload).then(() => {\n navigationType.value = null;\n newOriginOverride.value = false;\n sessionGeographyIntents.value = sessionGeographyIntents.value + 1;\n });\n } else {\n const { geographyIntents } = storeToRefs(guestProfileStore);\n\n if (geographyIntents.value.length === 0) {\n payload.navigationType = \"origin\";\n }\n\n await geographyIntents.value.push(payload);\n navigationType.value = null;\n newOriginOverride.value = false;\n }\n } else if (zoom < 16.5 || newOriginOverride.value) {\n navigationType.value = \"origin\";\n }\n\n await fetchFog({\n zoom,\n polygonDrawer,\n southwestLatLng,\n northeastLatLng,\n signedIn: signedIn.value,\n guestProfileStore,\n userStore,\n });\n}\n\nexport async function fetchBoundingBoxProperties({\n mapStore,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n userGeographiesStore,\n propertyDiagramStore,\n companyDetailStore,\n contactDetailStore,\n changeGroupStore,\n documentationStore,\n analyzePanelStore,\n layoutStore,\n secondaryPanelStore,\n userFeatureGroup,\n propertyFeatureGroup,\n landCoveringFeatureGroup,\n parcelFeatureGroup,\n asOfMilliseconds,\n activeChangeGroupId,\n routeName,\n}) {\n const {\n map,\n propertyZoomTrigger,\n horizontalIsAnalyze,\n minimapSize,\n fetchingMapData,\n } = storeToRefs(mapStore);\n const { signedIn } = storeToRefs(userStore);\n const { companyIdParam } = storeToRefs(companyDetailStore);\n const { contactIdParam } = storeToRefs(contactDetailStore);\n const bounds = map.value.getBounds();\n const southwest = bounds.getSouthWest();\n const northeast = bounds.getNorthEast();\n const northeastLatLng = [northeast.lat, northeast.lng];\n const southwestLatLng = [southwest.lat, southwest.lng];\n\n const zoom = map.value.getZoom();\n\n fetchingMapData.value = true;\n\n await Promise.all([\n fetchUsers({\n zoom,\n mapStore,\n featureGroup: userFeatureGroup,\n southwestLatLng,\n northeastLatLng,\n userGeographiesStore,\n documentationStore,\n }),\n fetchProperties({\n mode: \"store\",\n mapStore,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n documentationStore,\n analyzePanelStore,\n layoutStore,\n secondaryPanelStore,\n featureGroup: propertyFeatureGroup,\n southwestLatLng,\n northeastLatLng,\n asOfMilliseconds,\n activeChangeGroupId,\n zoom,\n minimapSize: minimapSize.value,\n propertyZoomTrigger: propertyZoomTrigger.value,\n horizontalIsAnalyze: horizontalIsAnalyze.value,\n companyIdParam: companyIdParam.value,\n companyDetailStore,\n contactIdParam: contactIdParam.value,\n contactDetailStore,\n }),\n fetchTaskPriorities({\n signedIn: signedIn.value,\n tasksStore,\n southwestLatLng,\n northeastLatLng,\n zoom,\n propertyZoomTrigger: propertyZoomTrigger.value,\n }),\n fetchLandCoverings({\n mode: \"store\",\n mapStore,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n secondaryPanelStore,\n documentationStore,\n analyzePanelStore,\n featureGroup: landCoveringFeatureGroup,\n southwestLatLng,\n northeastLatLng,\n asOfMilliseconds,\n activeChangeGroupId,\n horizontalIsAnalyze: horizontalIsAnalyze.value,\n zoom,\n }),\n fetchParcels({\n mode: \"store\",\n propertyFieldsStore,\n mapStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n documentationStore,\n analyzePanelStore,\n layoutStore,\n secondaryPanelStore,\n featureGroup: parcelFeatureGroup,\n southwestLatLng,\n northeastLatLng,\n asOfMilliseconds,\n activeChangeGroupId,\n horizontalIsAnalyze: horizontalIsAnalyze.value,\n zoom,\n }),\n fetchDetailPageHuntBoundaries({\n mapStore,\n companyDetailStore,\n contactDetailStore,\n featureGroup: parcelFeatureGroup,\n asOfMilliseconds,\n }),\n fetchNearbyHunts({\n mapStore,\n southwestLatLng,\n northeastLatLng,\n asOfMilliseconds,\n zoom,\n routeName,\n }),\n ]);\n\n fetchingMapData.value = false;\n}\n\nfunction fetchFog({\n zoom,\n polygonDrawer,\n southwestLatLng,\n northeastLatLng,\n signedIn,\n userStore,\n guestProfileStore,\n}) {\n return new Promise((resolve) => {\n if (signedIn && zoom >= defaultBoundaryMeta.zoom) {\n const { userGeographyIntents } = storeToRefs(userStore);\n api\n .get(`my_map_fog/${southwestLatLng}/${northeastLatLng}`)\n .then((response) => {\n const intents = response.data;\n userGeographyIntents.value = intents;\n if (intents.length > 0) polygonDrawer.consolidateIntents(intents);\n resolve();\n });\n } else {\n const { geographyIntents } = storeToRefs(guestProfileStore);\n const geocodedIntents = geographyIntents.value.filter((intent) => {\n return !!intent.lat && !!intent.lng;\n });\n\n if (geocodedIntents.length > 0)\n polygonDrawer.consolidateIntents(_.reverse(geocodedIntents));\n\n resolve();\n }\n });\n}\n\nfunction fetchUsers({\n zoom,\n mapStore,\n featureGroup,\n southwestLatLng,\n northeastLatLng,\n userGeographiesStore,\n documentationStore,\n}) {\n return new Promise((resolve) => {\n if (zoom >= defaultBoundaryMeta.zoom) {\n api\n .get(`user_geography_intents/${southwestLatLng}/${northeastLatLng}`)\n .then((response) => {\n const intents = response.data;\n userGeographiesStore.updateUsers(\n intents,\n mapStore,\n featureGroup,\n documentationStore,\n );\n resolve();\n });\n } else {\n resolve();\n }\n });\n}\n\nfunction fetchProperties({\n mode,\n mapStore,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n documentationStore,\n analyzePanelStore,\n layoutStore,\n secondaryPanelStore,\n featureGroup,\n southwestLatLng,\n northeastLatLng,\n asOfMilliseconds,\n activeChangeGroupId,\n zoom,\n minimapSize,\n propertyZoomTrigger,\n horizontalIsAnalyze,\n companyIdParam,\n companyDetailStore,\n contactIdParam,\n contactDetailStore,\n}) {\n return new Promise((resolve) => {\n if (companyIdParam || contactIdParam) {\n const { companyFetchedLocationDataFields } =\n storeToRefs(companyDetailStore);\n const { contactFetchedLocationDataFields } =\n storeToRefs(contactDetailStore);\n const requestKey = companyIdParam\n ? `Company${companyIdParam}Locations`\n : `Contact${contactIdParam}Locations`;\n const needsFetch = companyIdParam\n ? _.isEmpty(companyFetchedLocationDataFields.value)\n : _.isEmpty(contactFetchedLocationDataFields.value);\n const endpoint = companyIdParam\n ? `company_properties/${companyIdParam}`\n : `contact_properties/${contactIdParam}`;\n const contextStore = companyIdParam\n ? companyDetailStore\n : contactDetailStore;\n const contextLocations = companyIdParam\n ? companyFetchedLocationDataFields\n : contactFetchedLocationDataFields;\n const displayLocation = (dataField) => {\n const location = dataField.fieldContent;\n const workspaceMarker = propertyLandCoveringMapMarker({\n dataField,\n location,\n mapStore,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n layoutStore,\n secondaryPanelStore,\n documentationStore,\n analyzePanelStore,\n playerMinimap: minimapSize === \"micro\",\n });\n\n if (workspaceMarker) {\n featureGroup.addLayer(workspaceMarker);\n location.mapInternalId = featureGroup.getLayerId(workspaceMarker);\n }\n mapStore.setNearbyDataField({\n dataField,\n locationType: \"Property\",\n });\n };\n\n console.log(\n \"company/contact property fetch\",\n contextLocations.value,\n needsFetch && !contextStore.alreadyFetched(requestKey),\n );\n\n if (needsFetch && !contextStore.alreadyFetched(requestKey)) {\n api.get(`${endpoint}?as_of=${asOfMilliseconds}`).then((json) => {\n const locationFields = json.data;\n contextStore.patchLocationDataFields(locationFields);\n contextStore.registerFetchRequest(\n _.compact(locationFields),\n requestKey,\n );\n contextLocations.value.forEach(displayLocation);\n\n resolve();\n });\n } else {\n contextLocations.value.forEach(displayLocation);\n\n resolve();\n }\n } else if (zoom >= propertyZoomTrigger) {\n const analyzeParam =\n mode === \"validation\" || horizontalIsAnalyze ? \"all\" : \"explored\";\n const { fieldKeys } = storeToRefs(propertyFieldsStore);\n const { locationFetchData } = storeToRefs(mapStore);\n const payload = {\n alreadyFetchedPropertyIds: fieldKeys.value,\n };\n let fetchObject = null;\n\n if (locationFetchData.value) {\n const key = `Property_${southwestLatLng}_${northeastLatLng}_${zoom}`;\n fetchObject = locationFetchData.value[key];\n\n if (!fetchObject) {\n locationFetchData.value[key] = {\n mapStore,\n featureGroup,\n loadingEvents: false,\n loaded: false,\n count: 10,\n };\n fetchObject = locationFetchData.value[key];\n }\n }\n\n api\n .post(\n `content_locations/${southwestLatLng}/${northeastLatLng}?zoom=${zoom}&content_type=Property&as_of=${asOfMilliseconds}&active_change_group_id=${activeChangeGroupId}&analyze=${analyzeParam}`,\n payload,\n )\n .then((response) => {\n const { data, pagy } = response.data;\n if (fetchObject) {\n fetchObject.loadingEvents = false;\n fetchObject.loaded = !pagy.next;\n fetchObject.data = data;\n fetchObject.pagy = pagy;\n }\n const contentLocationDataFields = response.data.data;\n\n contentLocationDataFields.forEach((dataField) => {\n addLocationToMap({\n mode,\n dataField,\n mapStore,\n featureGroup,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n layoutStore,\n secondaryPanelStore,\n documentationStore,\n analyzePanelStore,\n });\n });\n\n resolve();\n });\n } else {\n resolve();\n }\n });\n}\n\nfunction fetchTaskPriorities({\n signedIn,\n tasksStore,\n southwestLatLng,\n northeastLatLng,\n zoom,\n propertyZoomTrigger,\n}) {\n return new Promise((resolve) => {\n if (signedIn && zoom >= propertyZoomTrigger) {\n api\n .post(`property_task_priorities/${southwestLatLng}/${northeastLatLng}`)\n .then((response) => {\n const taskPriorities = response.data;\n const { propertyTaskPriorities } = storeToRefs(tasksStore);\n\n propertyTaskPriorities.value = taskPriorities;\n\n resolve();\n });\n } else {\n resolve();\n }\n });\n}\n\nfunction fetchLandCoverings({\n mode,\n mapStore,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n secondaryPanelStore,\n documentationStore,\n analyzePanelStore,\n featureGroup,\n southwestLatLng,\n northeastLatLng,\n asOfMilliseconds,\n activeChangeGroupId,\n horizontalIsAnalyze,\n zoom,\n}) {\n return new Promise((resolve) => {\n if (zoom >= 16) {\n const analyzeParam =\n mode === \"validation\" || horizontalIsAnalyze ? \"all\" : \"explored\";\n const { storeLandCoveringLocationDataFields } =\n storeToRefs(propertyFieldsStore);\n const { locationFetchData } = storeToRefs(mapStore);\n const payload = {\n alreadyFetchedLandCoveringIds: _.keys(\n storeLandCoveringLocationDataFields.value,\n ),\n };\n let fetchObject = null;\n\n if (locationFetchData.value) {\n const key = `LandCovering_${southwestLatLng}_${northeastLatLng}_${zoom}`;\n fetchObject = locationFetchData.value[key];\n\n if (!fetchObject) {\n locationFetchData.value[key] = {\n mapStore,\n featureGroup,\n loadingEvents: false,\n loaded: false,\n count: 10,\n };\n fetchObject = locationFetchData.value[key];\n }\n }\n\n api\n .post(\n `content_locations/${southwestLatLng}/${northeastLatLng}?zoom=${zoom}&content_type=LandCovering&as_of=${asOfMilliseconds}&active_change_group_id=${activeChangeGroupId}&analyze=${analyzeParam}`,\n payload,\n )\n .then((response) => {\n const { data, pagy } = response.data;\n if (fetchObject) {\n fetchObject.loadingEvents = false;\n fetchObject.loaded = !pagy.next;\n fetchObject.data = data;\n fetchObject.pagy = pagy;\n }\n const contentLocationDataFields = response.data.data;\n\n contentLocationDataFields.forEach((dataField) => {\n const location = dataField.fieldContent;\n let workspaceMarker = null;\n if (mode === \"store\") {\n workspaceMarker = propertyLandCoveringMapMarker({\n dataField,\n location,\n mapStore,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n secondaryPanelStore,\n documentationStore,\n analyzePanelStore,\n });\n } else {\n const markerIcon = locationMarker({\n classes:\n \"h-3 w-3 bg-gray-600 hover:bg-gray-700 focus:ring-gray-500\",\n interactive: true,\n mapStore,\n propertyFieldsStore,\n landCoveringId: dataField.decoratingContentId,\n });\n workspaceMarker = L.marker([location.lat, location.lng], {\n draggable: false,\n icon: markerIcon,\n });\n }\n\n if (workspaceMarker) {\n featureGroup.addLayer(workspaceMarker);\n location.mapInternalId = featureGroup.getLayerId(workspaceMarker);\n if (mode === \"store\") {\n mapStore.setNearbyDataField({\n dataField,\n locationType: \"ContentLocation\",\n });\n }\n }\n });\n\n resolve();\n });\n } else {\n resolve();\n }\n });\n}\n\nfunction fetchParcels({\n mode,\n propertyFieldsStore,\n mapStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n layoutStore,\n secondaryPanelStore,\n documentationStore,\n analyzePanelStore,\n featureGroup,\n southwestLatLng,\n northeastLatLng,\n asOfMilliseconds,\n activeChangeGroupId,\n horizontalIsAnalyze,\n zoom,\n}) {\n return new Promise((resolve) => {\n if (zoom >= 16) {\n const analyzeParam =\n mode === \"validation\" || horizontalIsAnalyze ? \"all\" : \"explored\";\n const { storeParcelPolygonDataFields } = storeToRefs(propertyFieldsStore);\n const { locationFetchData } = storeToRefs(mapStore);\n const payload = {\n alreadyFetchedPropertyRightIds: _.keys(\n storeParcelPolygonDataFields.value,\n ),\n };\n let fetchObject = null;\n\n if (locationFetchData.value) {\n const key = `PropertyRight_${southwestLatLng}_${northeastLatLng}_${zoom}`;\n fetchObject = locationFetchData.value[key];\n\n if (!fetchObject) {\n locationFetchData.value[key] = {\n mapStore,\n featureGroup,\n loadingEvents: false,\n loaded: false,\n count: 10,\n };\n fetchObject = locationFetchData.value[key];\n }\n }\n\n api\n .post(\n `content_polygons/${southwestLatLng}/${northeastLatLng}?zoom=${zoom}&as_of=${asOfMilliseconds}&active_change_group_id=${activeChangeGroupId}&analyze=${analyzeParam}`,\n payload,\n )\n .then((response) => {\n const { data, pagy } = response.data;\n if (fetchObject) {\n fetchObject.loadingEvents = false;\n fetchObject.loaded = !pagy.next;\n fetchObject.data = data;\n fetchObject.pagy = pagy;\n }\n\n const contentPolygonDataFields = response.data.data;\n\n for (const dataField of contentPolygonDataFields) {\n addPolygonToMap({\n mode,\n dataField,\n mapStore,\n featureGroup,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n layoutStore,\n secondaryPanelStore,\n documentationStore,\n analyzePanelStore,\n horizontalIsAnalyze,\n });\n }\n\n resolve();\n });\n } else {\n resolve();\n }\n });\n}\n\nasync function fetchDetailPageHuntBoundaries({\n mapStore,\n companyDetailStore,\n contactDetailStore,\n featureGroup,\n asOfMilliseconds,\n}) {\n const { companyIdParam, companyFetchedPolygonDataFields } =\n storeToRefs(companyDetailStore);\n const { contactIdParam, contactFetchedPolygonDataFields } =\n storeToRefs(contactDetailStore);\n\n if (!companyIdParam.value && !contactIdParam.value) return;\n\n const requestKey = companyIdParam.value\n ? `Company${companyIdParam.value}Polygons`\n : `Contact${contactIdParam.value}Polygons`;\n\n const needsFetch = companyIdParam.value\n ? _.isEmpty(companyFetchedPolygonDataFields.value)\n : _.isEmpty(contactFetchedPolygonDataFields.value);\n const endpoint = companyIdParam.value\n ? `company_hunt_polygons/${companyIdParam.value}`\n : `contact_hunt_polygons/${contactIdParam.value}`;\n const contextStore = companyIdParam.value\n ? companyDetailStore\n : contactDetailStore;\n const contextPolygons = companyIdParam.value\n ? companyFetchedPolygonDataFields\n : contactFetchedPolygonDataFields;\n const displayPolygon = (dataField) => {\n const huntPolygon = dataField.fieldContent;\n\n if (huntPolygon.coordinates) {\n const polygon = L.polygon(huntPolygon.coordinates, {\n interactive: false,\n color: \"#fb7185\", // rose-400\n stroke: true,\n weight: 1.5,\n fill: true,\n });\n\n featureGroup.addLayer(polygon);\n huntPolygon.mapInternalId = featureGroup.getLayerId(polygon);\n }\n };\n\n console.log(\n \"company/contact polygon fetch\",\n contextPolygons.value,\n needsFetch && !contextStore.alreadyFetched(requestKey),\n );\n\n if (needsFetch && !contextStore.alreadyFetched(requestKey)) {\n const response = await api.get(`${endpoint}?as_of=${asOfMilliseconds}`);\n\n if (response?.data) {\n const contentPolygonDataFields = response.data;\n contextStore.patchPolygonDataFields(contentPolygonDataFields);\n contextStore.registerFetchRequest(\n _.compact(contentPolygonDataFields),\n requestKey,\n );\n\n for (const dataField of contextPolygons.value) {\n displayPolygon(dataField);\n }\n }\n } else {\n for (const dataField of contextPolygons.value) {\n displayPolygon(dataField);\n }\n }\n}\n\nasync function fetchNearbyHunts({\n mapStore,\n southwestLatLng,\n northeastLatLng,\n zoom,\n asOfMilliseconds,\n routeName,\n}) {\n if (routeName !== \"MainMap\") return;\n\n const { locationFetchData, nearbyRegionHuntIds } = storeToRefs(mapStore);\n const payload = {\n alreadyFetchedHuntIds: nearbyRegionHuntIds.value,\n };\n let huntRegionFetchObject = null;\n let huntInvolvementFetchObject = null;\n\n if (locationFetchData.value) {\n const huntRegionKey = `HuntRegion_${southwestLatLng}_${northeastLatLng}_${zoom}`;\n huntRegionFetchObject = locationFetchData.value[huntRegionKey];\n\n if (!huntRegionFetchObject) {\n locationFetchData.value[huntRegionKey] = {\n mapStore,\n featureGroup: null,\n loadingEvents: false,\n loaded: false,\n count: 5,\n };\n huntRegionFetchObject = locationFetchData.value[huntRegionKey];\n }\n\n const huntInvolvementKey = `HuntInvolvement_${southwestLatLng}_${northeastLatLng}_${zoom}`;\n huntInvolvementFetchObject = locationFetchData.value[huntInvolvementKey];\n\n if (!huntInvolvementFetchObject) {\n locationFetchData.value[huntInvolvementKey] = {\n mapStore,\n featureGroup: null,\n loadingEvents: false,\n loaded: false,\n count: 5,\n };\n huntInvolvementFetchObject = locationFetchData.value[huntInvolvementKey];\n }\n }\n\n const regionResponse = await api.post(\n `content_polygons/${southwestLatLng}/${northeastLatLng}?zoom=${zoom}&as_of=${asOfMilliseconds}&content_type=Hunt&output_type=region`,\n payload,\n );\n\n if (regionResponse?.data) {\n const { data, pagy } = regionResponse.data;\n if (huntRegionFetchObject) {\n huntRegionFetchObject.loadingEvents = false;\n huntRegionFetchObject.loaded = !pagy.next;\n huntRegionFetchObject.data = data;\n huntRegionFetchObject.pagy = pagy;\n }\n }\n\n const involvementResponse = await api.post(\n `content_polygons/${southwestLatLng}/${northeastLatLng}?zoom=${zoom}&as_of=${asOfMilliseconds}&content_type=Hunt&output_type=involvement`,\n payload,\n );\n\n if (involvementResponse?.data) {\n const { data, pagy } = involvementResponse.data;\n if (huntInvolvementFetchObject) {\n huntInvolvementFetchObject.loadingEvents = false;\n huntInvolvementFetchObject.loaded = !pagy.next;\n huntInvolvementFetchObject.data = data;\n huntInvolvementFetchObject.pagy = pagy;\n }\n }\n}\n","
\n
\n \n\n\n","
\n \n \n Open options \n \n \n \n \n \n\n \n \n \n \n \n\n\n","
\n \n \n Authorize and save\n \n \n\n\n","
\n \n record?.name\"\n :data-test=\"`${inputKey}-autocomplete-input`\"\n />\n \n \n \n {{ recipient.name }}\n \n \n \n \n \n\n\n","
\n \n
\n \n Designate a primary payout account \n \n \n \n {{\n payoutAccount.account.name ||\n `${_.capitalize(payoutAccount.account.category)} Account ${\n payoutAccount.account.id\n }`\n }} \n \n Remove \n \n \n \n\n
\n \n Designate a primary payment method \n \n \n \n \n {{ payee.cardRecord.card.brand }} \n \n \n \n \n x{{ payee.cardRecord.card.last4 }} \n \n Remove \n \n \n \n
\n \n\n\n","
\n \n \n \n \n\n\n","
\n {{ $filters.initials(team.name) }}
\n \n\n\n","
\n \n
\n \n
\n \n \n \n \n \n
\n
\n \n \n \n \n \n \n
\n \n \n
\n \n\n\n","
\n \n
\n \n \n ← Back\n \n
\n \n
\n You are currently in preview mode.\n
\n
\n \n Join {{ activeOption.name }}\n \n
\n
\n to send messages and track updates.\n
\n
\n \n
\n You are currently in preview mode.
\n \n \n ← Back\n \n \n Join {{ activeOption.name }}\n \n
\n \n
\n \n\n\n","
\n \n \n\n\n","
\n \n \n\n\n","
\n \n \n \n \n \n
\n \n\n\n","
\n \n \n \n \n\n\n","import {\n PencilIcon,\n ArrowUturnLeftIcon,\n ArrowUturnRightIcon,\n DocumentDuplicateIcon,\n LinkIcon,\n TrashIcon,\n FlagIcon,\n ChatBubbleLeftRightIcon,\n} from \"@heroicons/vue/20/solid\";\nimport { useUserStore } from \"@/stores/user\";\nimport { useSecondaryPanelStore } from \"@/stores/secondaryPanel\";\nimport { useWePanelStore } from \"@/stores/wePanel\";\nimport { useModalStore } from \"@/stores/modal\";\nimport { defineStore, storeToRefs, acceptHMRUpdate } from \"pinia\";\nimport { computed, markRaw } from \"vue\";\nimport _ from \"lodash\";\n\nexport const useWeMessageOutputStore = defineStore(\"weMessageOutput\", () => {\n const secondaryPanelStore = useSecondaryPanelStore();\n const userStore = useUserStore();\n const { signedIn } = storeToRefs(userStore);\n const wePanelStore = useWePanelStore();\n const { mainContent } = storeToRefs(wePanelStore);\n const modalStore = useModalStore();\n const { confirmationPayload } = storeToRefs(modalStore);\n const actions = computed(() => {\n return _.compact([\n {\n name: \"Edit\",\n icon: markRaw(PencilIcon),\n inline: true,\n moreActionsSection: \"00_directActions\",\n handler: () => {\n const callback = () => {};\n registrationGuard(callback);\n },\n },\n {\n name: \"Reply\",\n icon: markRaw(ArrowUturnLeftIcon),\n inline: true,\n moreActionsSection: \"00_directActions\",\n handler: () => {\n const callback = () => {};\n registrationGuard(callback);\n },\n },\n {\n name: \"Forward\",\n icon: markRaw(ArrowUturnRightIcon),\n inline: true,\n moreActionsSection: \"00_directActions\",\n handler: () => {\n const callback = () => {};\n registrationGuard(callback);\n },\n },\n threadable.value\n ? {\n name: \"Create Thread\",\n icon: markRaw(ChatBubbleLeftRightIcon),\n inline: false,\n moreActionsSection: \"00_directActions\",\n handler: () => {\n const callback = () => {};\n registrationGuard(callback);\n },\n }\n : null,\n {\n name: \"Copy Text\",\n icon: markRaw(DocumentDuplicateIcon),\n inline: false,\n moreActionsSection: \"01_secondaryActions\",\n handler: () => {\n const callback = () => {};\n registrationGuard(callback);\n },\n },\n {\n name: \"Copy Message Link\",\n icon: markRaw(LinkIcon),\n inline: false,\n moreActionsSection: \"01_secondaryActions\",\n handler: () => {\n const callback = () => {};\n registrationGuard(callback);\n },\n },\n {\n name: \"Delete Message\",\n icon: markRaw(TrashIcon),\n inline: false,\n moreActionsSection: \"02_confirmationActions\",\n handler: () => {\n const deleteCallback = () => {};\n const callback = () => {\n confirmationPayload.value = {\n title: \"Delete Message\",\n message: \"Are you sure you want to delete this message?\",\n affirmText: \"Delete\",\n affirmCallback: deleteCallback,\n };\n };\n\n registrationGuard(callback);\n },\n },\n {\n name: \"Report Message\",\n icon: markRaw(FlagIcon),\n inline: false,\n moreActionsSection: \"02_confirmationActions\",\n handler: () => {\n const reportCallback = () => {};\n const callback = () => {\n confirmationPayload.value = {\n title: \"Report Message\",\n message: \"Are you sure you want to report this message?\",\n affirmText: \"Report\",\n affirmCallback: reportCallback,\n };\n };\n\n registrationGuard(callback);\n },\n },\n ]);\n });\n\n const inlineActions = computed(() => {\n return actions.value.filter((action) => action.inline);\n });\n\n const groupedMoreActions = computed(() => {\n return _.groupBy(actions.value, \"moreActionsSection\");\n });\n\n const threadable = computed(\n () =>\n !_.includes([\"directMessage\", \"thread\"], mainContent.value?.contentType),\n );\n\n function registrationGuard(callback) {\n if (signedIn.value) {\n callback();\n } else {\n secondaryPanelStore.promptToRegister();\n }\n }\n\n return {\n inlineActions,\n groupedMoreActions,\n threadable,\n };\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useWeMessageOutputStore, import.meta.hot),\n );\n}\n","
\n \n
\n 1 && index === 0 ? 'rounded-t-md' : '',\n menuActions.length > 1 && index === menuActions.length - 1\n ? 'rounded-b-md'\n : '',\n action.moreActionsSection === '02_confirmationActions'\n ? 'bg-red-100'\n : 'bg-gray-100',\n ]\"\n >\n \n \n {{ action.name }}
\n \n \n \n
\n \n\n\n","
\n \n
\n \n {{ action.name }} \n \n \n \n \n More \n \n \n \n \n
\n \n \n {{ action.name }}
\n \n \n \n \n
\n \n \n \n
\n \n\n\n","
\n \n \n \n \n \n \n \n
\n
Author info
\n
Timestamp
\n
\n
\n
\n {{ words.join(\" \") }}\n
\n
\n
\n \n \n \n\n\n","
\n \n \n \n \n\n\n","import {\n DocumentArrowUpIcon,\n ChatBubbleLeftRightIcon,\n} from \"@heroicons/vue/20/solid\";\nimport { useUserStore } from \"@/stores/user\";\nimport { useSecondaryPanelStore } from \"@/stores/secondaryPanel\";\nimport { useWePanelStore } from \"@/stores/wePanel\";\nimport { defineStore, storeToRefs, acceptHMRUpdate } from \"pinia\";\nimport { computed, ref } from \"vue\";\nimport _ from \"lodash\";\n\nexport const useWeMessageInputStore = defineStore(\"weMessageInput\", () => {\n const secondaryPanelStore = useSecondaryPanelStore();\n const userStore = useUserStore();\n const { signedIn } = storeToRefs(userStore);\n const wePanelStore = useWePanelStore();\n const { mainContent } = storeToRefs(wePanelStore);\n const creationOptions = ref([\n {\n name: \"Upload a File\",\n handler: () => {\n const callback = (fileInputRef) => {\n fileInputRef.click();\n };\n registrationGuard(callback);\n },\n icon: DocumentArrowUpIcon,\n },\n {\n name: \"Create Thread\",\n handler: () => {\n const callback = () => {};\n registrationGuard(callback);\n },\n icon: ChatBubbleLeftRightIcon,\n },\n ]);\n const actionableCreationOptions = computed(() => {\n if (threadable.value) {\n return creationOptions.value;\n } else {\n return creationOptions.value.filter(\n ({ name }) => name !== \"Create Thread\",\n );\n }\n });\n\n const threadable = computed(\n () => !_.includes([\"directMessage\", \"thread\"], mainContent.value?.contentType),\n );\n\n function resizeTextArea(event) {\n event.target.style.height = \"auto\";\n event.target.style.height = event.target.scrollHeight + \"px\";\n }\n\n async function sendMessage() {\n const callback = () => {\n console.log(\"send message\");\n };\n registrationGuard(callback);\n }\n\n function registrationGuard(callback) {\n if (signedIn.value) {\n callback();\n } else {\n secondaryPanelStore.promptToRegister();\n }\n }\n\n return {\n creationOptions,\n actionableCreationOptions,\n threadable,\n resizeTextArea,\n sendMessage,\n };\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useWeMessageInputStore, import.meta.hot),\n );\n}\n","
\n \n
\n
\n \n \n
\n \n \n
\n
\n \n \n
\n
\n
\n \n\n\n","
\n \n
\n
\n \n \n \n \n \n \n \n
\n
\n
\n
\n \n\n\n","
\n \n \n \n
\n \n\n\n","
\n \n \n \n
\n
{{ region.name }}
\n
\n \n \n \n \n \n \n\n\n","
\n \n
\n \n \n \n Nearby Intel \n \n \n \n
\n \n Regions
\n \n \n \n \n \n
\n \n
\n
\n Regions let you filter intel more precisely by location.\n \n
\n Create Region\n \n
\n \n wePanelStore.loadRegions($state)\"\n />\n \n
\n \n\n\n","
\n \n \n
\n
\n
\n Safezone Sharing Rules\n \n
\n Automatically share certain types of info with this team. Rules do not\n retroactively share existing data.\n
\n\n
\n
\n \n Content Being Shared\n \n \n
\n
\n \n
\n
\n
Everything \n
\n All safezone data that you create.\n
\n
\n Warning! This will automatically share every safezone field\n you create. Please be sure this is appropriate for this\n team.\n
\n
\n
\n
\n \n
\n \n
\n
\n
Notes \n
\n Any note that you attach to a datapoint.\n
\n
\n
\n \n
\n \n
\n
\n
Companies \n
\n Companies you link (e.g., to deals, as advisors)\n
\n
\n
\n \n
\n \n
\n
\n
Contacts \n
\n People you link (e.g., to companies)\n
\n
\n
\n \n
\n \n
\n
\n
\n \n Go Back\n \n\n \n Save Rules\n \n
\n
\n \n \n\n\n","
\n \n {{ activeOption.name }}
\n \n \n \n \n \n \n \n \n \n \n\n\n","
\n \n {{ mainContent.content?.name }} \n \n \n\n\n","
\n \n \n \n \n \n \n \n\n\n","
\n \n \n \n \n \n \n \n \n\n\n","
\n \n \n \n \n \n \n {{ category.name }}\n \n \n \n \n
\n \n \n \n \n \n\n\n","
\n \n \n \n \n \n \n \n\n\n","
\n \n \n 0\" class=\"mr-2 flex items-center\">\n \n \n \n \n \n \n \n \n \n\n\n","
\n \n \n \n
\n \n \n \n \n
DM {{ directMessage }}
\n
\n \n \n \n \n \n \n\n\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 16 16\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\"\n }, [\n _createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\",\n \"clip-rule\": \"evenodd\"\n })\n ]))\n}","
\n \n \n \n \n\n\n","
\n \n
\n \n {{ networkTab }} — ##\n
\n \n
\n \n
\n People make real estate come alive.\n \n \n Add Friend\n \n \n
\n Friend {{ friend }} \n \n
\n \n\n\n","
\n \n
\n \n \n \n Network \n \n \n \n
\n \n Direct Messages
\n \n \n \n \n \n \n
\n DMs are invite-only discussions with named users.\n \n \n Create DM\n \n \n \n \n \n
\n \n\n\n","import { useUserStore } from \"@/stores/user\";\nimport { useSecondaryPanelStore } from \"@/stores/secondaryPanel\";\nimport { useWorkspaceLayoutStore } from \"@/stores/workspaceLayout\";\nimport { usePropertyDiagramStore } from \"@/stores/propertyDiagram\";\nimport { useCompanyDetailStore } from \"@/stores/companyDetail\";\nimport { useContactDetailStore } from \"@/stores/contactDetail\";\nimport { defineStore, storeToRefs, acceptHMRUpdate } from \"pinia\";\nimport { computed, markRaw, ref, watch } from \"vue\";\nimport moment from \"moment\";\nimport api from \"@/router/api\";\nimport {\n ChatBubbleOvalLeftIcon,\n GlobeAmericasIcon,\n MapPinIcon,\n PlusCircleIcon,\n SparklesIcon,\n} from \"@heroicons/vue/24/outline\";\nimport _ from \"lodash\";\nimport ComingSoon from \"@/components/ComingSoon.vue\";\nimport TeamForm from \"@/components/users/teams/TeamForm.vue\";\nimport WeTeamIcon from \"@/components/we/WeTeamIcon.vue\";\nimport WeHeroImageIcon from \"@/components/we/WeHeroImageIcon.vue\";\nimport WeShell from \"@/components/we/WeShell.vue\";\nimport NearbyMessagesSelector from \"@/components/we/selector-views/NearbyMessagesSelector.vue\";\nimport TeamMessagesSelector from \"@/components/we/selector-views/TeamMessagesSelector.vue\";\nimport DatafieldMessagesSelector from \"@/components/we/selector-views/DatafieldMessagesSelector.vue\";\nimport DirectMessagesSelector from \"@/components/we/selector-views/DirectMessagesSelector.vue\";\n\nexport const useWePanelStore = defineStore(\"we\", () => {\n const secondaryPanelStore = useSecondaryPanelStore();\n const companyDetailStore = useCompanyDetailStore();\n const { companyIdParam, companyDataField } = storeToRefs(companyDetailStore);\n const contactDetailStore = useContactDetailStore();\n const { contactIdParam, contactDataField } = storeToRefs(contactDetailStore);\n const propertyDiagramStore = usePropertyDiagramStore();\n const {\n propertyIdParam,\n propertyDiagramPropertyDataFields,\n propertyDiagramPropertyIds,\n } = storeToRefs(propertyDiagramStore);\n const userStore = useUserStore();\n const { signedIn } = storeToRefs(userStore);\n const layoutStore = useWorkspaceLayoutStore();\n const { isDesktop, workspaceLayout } = storeToRefs(layoutStore);\n\n const nearby = ref(true);\n const regionPagyContainer = ref({\n data: [],\n pagy: null,\n });\n const regions = computed(() => regionPagyContainer.value.data);\n const regionsPagy = computed(() => regionPagyContainer.value.pagy);\n function patchRegion(region) {\n regionPagyContainer.value.data = _.unionBy([region], regions.value, \"id\");\n }\n\n const categories = ref(\n _.times(3, function (i) {\n return {\n id: i + 1,\n name: `Category ${i + 1}`,\n expanded: true,\n };\n }),\n );\n\n const channels = ref(\n _.times(15, function (i) {\n return {\n id: i + 1,\n categoryId: _.random(1, 3),\n contentType: \"channel\",\n name: `Channel ${i + 1}`,\n };\n }),\n );\n\n const threads = ref(\n _.times(8, function (i) {\n return {\n id: i + 1,\n contentType: \"thread\",\n channelId: _.random(1, 15),\n name: `Thread ${i + 1}`,\n isVisible: true,\n locked: false,\n };\n }),\n );\n\n const teams = ref([]);\n function dropTeam(team) {\n teams.value = teams.value.filter((t) => t.id !== team.id);\n changeView();\n activeOption.value = null;\n }\n function patchTeam(team) {\n teams.value = _.unionBy([team], teams.value, \"id\");\n }\n\n const expandedView = computed(\n () => isDesktop.value && workspaceLayout.value === \"topAndBottom\",\n );\n const rightEdgeComponent = ref(null);\n const mainContent = ref(null);\n \n const bottomEdgeComponent = ref(null);\n const bottomEdgeProps = ref({});\n \n function selectionIsActive(selectionObject) {\n if (!!mainContent.value && !!rightEdgeComponent.value) {\n // console.log(\"selectionIsActive\", selectionObject, mainContent.value);\n if (_.isObject(mainContent.value)) {\n const regionMatch =\n !!mainContent.value.coordinates &&\n mainContent.value.id === selectionObject.id;\n const channelMatch =\n mainContent.value.contentType === \"channel\" &&\n selectionObject.contentType === \"channel\" &&\n mainContent.value.content.id === selectionObject.id;\n const threadMatch =\n mainContent.value.contentType === \"thread\" &&\n selectionObject.contentType === \"thread\" &&\n mainContent.value.content.id === selectionObject.id;\n const dmMatch =\n mainContent.value.contentType === \"directMessage\" &&\n mainContent.value.content.id === selectionObject;\n return regionMatch || channelMatch || threadMatch || dmMatch;\n } else {\n return selectionObject === mainContent.value;\n }\n } else {\n return false;\n }\n }\n function activeSelectionOptionClass(option) {\n return selectionIsActive(option) ? \"bg-gray-300\" : \"bg-white\";\n }\n\n const networkTab = ref(\"Online\");\n const networkTabs = ref([\n { name: \"Online\", href: \"\" },\n { name: \"All\", href: \"\" },\n { name: \"Pending\", href: \"\" },\n ]);\n\n const defaultView = {\n component: markRaw(ComingSoon),\n props: {},\n };\n const lastView = ref({\n component: null,\n props: {},\n });\n const activeOption = ref(null);\n const activeView = ref(defaultView);\n function changeView(newView = defaultView) {\n lastView.value = activeView.value;\n activeView.value = newView;\n closeRightEdgePanel();\n closeBottomEdgePanel();\n }\n function closeRightEdgePanel() {\n rightEdgeComponent.value = null;\n mainContent.value = null;\n }\n function closeBottomEdgePanel() {\n bottomEdgeComponent.value = null;\n bottomEdgeProps.value = {};\n }\n function closeTakeoverPanel() {\n if (\n activeOption.value?.container &&\n activeOption.value?.takeover?.component\n ) {\n activeOption.value.takeover = {\n component: null,\n props: {},\n };\n }\n }\n function closeSecondaryContentPanel() {\n if (expandedView.value) {\n closeTakeoverPanel();\n } else {\n closeBottomEdgePanel();\n }\n }\n function openSecondaryContentPanel({ component, props }) {\n if (signedIn.value) {\n if (expandedView.value) {\n activeOption.value.takeover = {\n component: markRaw(component),\n props,\n };\n } else {\n bottomEdgeComponent.value = markRaw(component);\n bottomEdgeProps.value = props;\n }\n } else {\n secondaryPanelStore.promptToRegister();\n }\n }\n\n const dragging = ref(false);\n const instantUpload = ref(false);\n function instantUploadHandler() {\n if (dragging.value) {\n instantUpload.value = !instantUpload.value;\n } else {\n instantUpload.value = false;\n }\n }\n\n function optionIconClass(option) {\n return activeOption.value?.name === option.name\n ? \"text-gray-700 bg-gray-300\"\n : \"text-gray-500 hover:bg-gray-200\";\n }\n\n const nearbyMessagesTab = computed(() => {\n return nearby.value\n ? {\n name: \"Nearby Intel\",\n container: true,\n href: \"\",\n handler: () => {\n changeView({\n component: markRaw(WeShell),\n props: {\n selectionComponent: markRaw(NearbyMessagesSelector),\n },\n });\n },\n icon: MapPinIcon,\n iconProps: {},\n iconClass: (option) => {\n return optionIconClass(option);\n },\n }\n : null;\n });\n const companyPreviewTab = computed(() => {\n return companyIdParam.value && companyDataField.value\n ? {\n name: companyDataField.value.fieldContent.name,\n matchType: companyDataField.value.fieldContentType,\n matchId: companyDataField.value.fieldContentId,\n matchContent: companyDataField.value,\n container: true,\n previewMode: true,\n href: \"\",\n handler: () => {\n changeView({\n component: markRaw(WeShell),\n props: {\n selectionComponent: markRaw(DatafieldMessagesSelector),\n },\n });\n },\n icon: markRaw(WeHeroImageIcon),\n iconProps: { dataField: companyDataField.value },\n iconClass: (option) => {\n return optionIconClass(option);\n },\n }\n : null;\n });\n const contactPreviewTab = computed(() => {\n return contactIdParam.value && contactDataField.value\n ? {\n name: contactDataField.value.fieldContent.name,\n matchType: contactDataField.value.fieldContentType,\n matchId: contactDataField.value.fieldContentId,\n matchContent: contactDataField.value,\n container: true,\n previewMode: true,\n href: \"\",\n handler: () => {\n changeView({\n component: markRaw(WeShell),\n props: {\n selectionComponent: markRaw(DatafieldMessagesSelector),\n },\n });\n },\n icon: markRaw(WeHeroImageIcon),\n iconProps: { dataField: contactDataField.value },\n iconClass: (option) => {\n return optionIconClass(option);\n },\n }\n : null;\n });\n const detailPageTabs = computed(() => {\n return _.compact([companyPreviewTab.value, contactPreviewTab.value]);\n });\n const propertyDiagramPreviewTabs = computed(() => {\n if (\n propertyIdParam.value &&\n _.size(propertyDiagramPropertyDataFields.value) > 0\n ) {\n return _.map(\n propertyDiagramPropertyDataFields.value,\n function (dataField) {\n return {\n name: dataField.fieldContent.name,\n matchType: dataField.fieldContentType,\n matchId: dataField.fieldContentId,\n matchContent: dataField,\n container: true,\n previewMode: true,\n href: \"\",\n handler: () => {\n changeView({\n component: markRaw(WeShell),\n props: {\n selectionComponent: markRaw(DatafieldMessagesSelector),\n },\n });\n },\n icon: markRaw(WeHeroImageIcon),\n iconProps: { dataField },\n iconClass: (option) => {\n return optionIconClass(option);\n },\n };\n },\n );\n } else {\n return [];\n }\n });\n\n watch(companyIdParam, () => {\n if (activeOption.value?.matchType === \"Company\" && !companyIdParam.value) {\n changeView();\n activeOption.value = null;\n }\n });\n watch(contactIdParam, () => {\n if (activeOption.value?.matchType === \"Contact\" && !contactIdParam.value) {\n changeView();\n activeOption.value = null;\n }\n });\n watch(\n propertyDiagramPropertyDataFields,\n () => {\n if (activeOption.value?.matchType === \"Property\") {\n if (\n !_.includes(\n propertyDiagramPropertyIds.value,\n activeOption.value.matchId,\n )\n ) {\n changeView();\n activeOption.value = null;\n }\n }\n },\n { deep: true },\n );\n\n const primaryNavigationOptions = computed(() => {\n const teamTabs = {\n order: 3,\n name: \"teams\",\n options: teams.value.map((team) => {\n return {\n name: team.name,\n matchType: \"Team\",\n matchId: team.id,\n matchContent: team,\n container: true,\n takeover: {\n component: null,\n props: {},\n },\n href: \"\",\n handler: () => {\n changeView({\n component: markRaw(WeShell),\n props: {\n selectionComponent: markRaw(TeamMessagesSelector),\n },\n });\n },\n icon: markRaw(WeTeamIcon),\n iconProps: { team },\n iconClass: () => {\n return activeOption.value?.matchType === \"Team\" &&\n activeOption.value?.matchId === team.id\n ? \"text-gray-700 bg-gray-300\"\n : \"text-gray-500 hover:bg-gray-200\";\n },\n };\n }),\n };\n const defaultMessagesTabs = _.concat(\n propertyDiagramPreviewTabs.value,\n detailPageTabs.value,\n _.compact([\n nearbyMessagesTab.value,\n {\n name: \"Direct Messages\",\n container: true,\n href: \"\",\n handler: () => {\n changeView({\n component: markRaw(WeShell),\n props: {\n selectionComponent: markRaw(DirectMessagesSelector),\n },\n });\n },\n icon: ChatBubbleOvalLeftIcon,\n iconProps: {},\n iconClass: (option) => {\n return optionIconClass(option);\n },\n },\n ]),\n );\n const rawTabs = [\n {\n order: 1,\n name: \"headerActions\",\n options: [\n {\n name: \"Nearby\",\n label: nearby.value ? \"Nearby\" : \"All\",\n container: false,\n href: \"\",\n handler: () => {\n nearby.value = !nearby.value;\n\n if (\n activeOption.value?.name === \"Nearby Intel\" &&\n !nearby.value\n ) {\n changeView();\n activeOption.value = null;\n }\n },\n icon: GlobeAmericasIcon,\n iconProps: {},\n iconClass: () => {\n return nearby.value\n ? \"bg-emerald-400\"\n : \"text-gray-500 hover:bg-gray-200\";\n },\n },\n ],\n },\n {\n order: 2,\n name: \"defaultMessages\",\n options: defaultMessagesTabs,\n },\n teams.value.length > 0 ? teamTabs : null,\n {\n order: 4,\n name: \"footerOptions\",\n options: [\n {\n name: \"Add a Team\",\n container: false,\n href: \"\",\n handler: () => {\n if (signedIn.value) {\n changeView({\n component: markRaw(TeamForm),\n props: { teamId: null },\n });\n } else {\n secondaryPanelStore.promptToRegister();\n }\n },\n icon: PlusCircleIcon,\n iconProps: {},\n iconClass: () => {\n return \"text-gray-500 hover:bg-gray-200\";\n },\n },\n {\n name: \"Discover\",\n container: true,\n href: \"\",\n handler: () => {\n changeView();\n },\n icon: SparklesIcon,\n iconProps: {},\n iconClass: (option) => {\n return activeOption.value?.name === option.name\n ? \"text-white bg-indigo-600\"\n : \"text-gray-500 hover:bg-gray-200\";\n },\n },\n ],\n },\n ];\n\n return _.orderBy(_.compact(rawTabs), [\"order\"], [\"asc\"]);\n });\n\n async function fetchTeams() {\n if (signedIn.value) {\n const teamsResponse = await api.get(`teams`);\n\n if (teamsResponse?.data) {\n teams.value = teamsResponse.data;\n }\n }\n }\n\n function cleanUrl(url) {\n return url.replace(\"/api/v1/\", \"\");\n }\n\n async function fetchRegions() {\n if (signedIn.value) {\n const regionsResponse = await api.get(`geography_regions`);\n\n if (regionsResponse?.data) {\n regionPagyContainer.value = regionsResponse.data;\n }\n }\n }\n\n async function loadRegions(paginationState) {\n if (signedIn.value && regionsPagy.value.next) {\n const endpoint = cleanUrl(regionsPagy.value.next_url);\n try {\n api.get(endpoint).then((json) => {\n const { data, pagy } = json.data;\n\n regionPagyContainer.value.data = _.concat(\n regionPagyContainer.value.data,\n data,\n );\n regionPagyContainer.value.pagy = pagy;\n if (data.length < 25) paginationState.complete();\n else {\n paginationState.loaded();\n }\n });\n } catch (error) {\n paginationState.error();\n }\n } else {\n paginationState.complete();\n }\n }\n\n async function hideRegion(region) {\n const hideResponse = await api.patch(\n `geography_region_hidings/${region.id}`,\n );\n\n if (hideResponse?.data) {\n regionPagyContainer.value.data = regionPagyContainer.value.data.filter(\n (r) => r.id !== region.id,\n );\n }\n }\n\n async function leaveDirectMessage(directMessage) {\n console.log(\"TODO: Leave DM\");\n }\n\n return {\n nearby,\n regionPagyContainer,\n regions,\n regionsPagy,\n fetchRegions,\n loadRegions,\n hideRegion,\n patchRegion,\n categories,\n channels,\n threads,\n leaveDirectMessage,\n primaryNavigationOptions,\n activeOption,\n activeView,\n lastView,\n rightEdgeComponent,\n mainContent,\n selectionIsActive,\n activeSelectionOptionClass,\n bottomEdgeComponent,\n bottomEdgeProps,\n networkTabs,\n networkTab,\n expandedView,\n nearbyMessagesTab,\n dragging,\n instantUpload,\n instantUploadHandler,\n changeView,\n fetchTeams,\n patchTeam,\n dropTeam,\n closeRightEdgePanel,\n closeBottomEdgePanel,\n closeTakeoverPanel,\n closeSecondaryContentPanel,\n openSecondaryContentPanel,\n };\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept(acceptHMRUpdate(useWePanelStore, import.meta.hot));\n}\n","/*\n Leaflet.draw 1.0.4, a plugin that adds drawing and editing tools to Leaflet powered maps.\n (c) 2012-2017, Jacob Toye, Jon West, Smartrak, Leaflet\n\n https://github.com/Leaflet/Leaflet.draw\n http://leafletjs.com\n */\n!function(t,e,i){function o(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}L.drawVersion=\"1.0.4\",L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:\"Cancel drawing\",text:\"Cancel\"},finish:{title:\"Finish drawing\",text:\"Finish\"},undo:{title:\"Delete last point drawn\",text:\"Delete last point\"},buttons:{polyline:\"Draw a polyline\",polygon:\"Draw a polygon\",rectangle:\"Draw a rectangle\",circle:\"Draw a circle\",marker:\"Draw a marker\",circlemarker:\"Draw a circlemarker\"}},handlers:{circle:{tooltip:{start:\"Click and drag to draw circle.\"},radius:\"Radius\"},circlemarker:{tooltip:{start:\"Click map to place circle marker.\"}},marker:{tooltip:{start:\"Click map to place marker.\"}},polygon:{tooltip:{start:\"Click to start drawing shape.\",cont:\"Click to continue drawing shape.\",end:\"Click first point to close this shape.\"}},polyline:{error:\"
Error: shape edges cannot cross!\",tooltip:{start:\"Click to start drawing line.\",cont:\"Click to continue drawing line.\",end:\"Click last point to finish line.\"}},rectangle:{tooltip:{start:\"Click and drag to draw rectangle.\"}},simpleshape:{tooltip:{end:\"Release mouse to finish drawing.\"}}}},edit:{toolbar:{actions:{save:{title:\"Save changes\",text:\"Save\"},cancel:{title:\"Cancel editing, discards all changes\",text:\"Cancel\"},clearAll:{title:\"Clear all layers\",text:\"Clear All\"}},buttons:{edit:\"Edit layers\",editDisabled:\"No layers to edit\",remove:\"Delete layers\",removeDisabled:\"No layers to delete\"}},handlers:{edit:{tooltip:{text:\"Drag handles or markers to edit features.\",subtext:\"Click cancel to undo changes.\"}},remove:{tooltip:{text:\"Click on a feature to remove.\"}}}}},L.Draw.Event={},L.Draw.Event.CREATED=\"draw:created\",L.Draw.Event.EDITED=\"draw:edited\",L.Draw.Event.DELETED=\"draw:deleted\",L.Draw.Event.DRAWSTART=\"draw:drawstart\",L.Draw.Event.DRAWSTOP=\"draw:drawstop\",L.Draw.Event.DRAWVERTEX=\"draw:drawvertex\",L.Draw.Event.EDITSTART=\"draw:editstart\",L.Draw.Event.EDITMOVE=\"draw:editmove\",L.Draw.Event.EDITRESIZE=\"draw:editresize\",L.Draw.Event.EDITVERTEX=\"draw:editvertex\",L.Draw.Event.EDITSTOP=\"draw:editstop\",L.Draw.Event.DELETESTART=\"draw:deletestart\",L.Draw.Event.DELETESTOP=\"draw:deletestop\",L.Draw.Event.TOOLBAROPENED=\"draw:toolbaropened\",L.Draw.Event.TOOLBARCLOSED=\"draw:toolbarclosed\",L.Draw.Event.MARKERCONTEXT=\"draw:markercontext\",L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({initialize:function(t,e){this._map=t,this._container=t._container,this._overlayPane=t._panes.overlayPane,this._popupPane=t._panes.popupPane,e&&e.shapeOptions&&(e.shapeOptions=L.Util.extend({},this.options.shapeOptions,e.shapeOptions)),L.setOptions(this,e);var i=L.version.split(\".\");1===parseInt(i[0],10)&&parseInt(i[1],10)>=2?L.Draw.Feature.include(L.Evented.prototype):L.Draw.Feature.include(L.Mixin.Events)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire(\"enabled\",{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire(\"disabled\",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(L.DomUtil.disableTextSelection(),t.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,\"keyup\",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,\"keyup\",this._cancelDrawing,this))},setOptions:function(t){L.setOptions(this,t)},_fireCreatedEvent:function(t){this._map.fire(L.Draw.Event.CREATED,{layer:t,layerType:this.type})},_cancelDrawing:function(t){27===t.keyCode&&(this._map.fire(\"draw:canceled\",{layerType:this.type}),this.disable())}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:\"polyline\"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:\"#b00b00\",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:\"leaflet-div-icon leaflet-editing-icon\"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:\"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon\"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:\"#3388ff\",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},initialize:function(t,e){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,e&&e.drawError&&(e.drawError=L.Util.extend({},this.options.drawError,e.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:\"leaflet-mouse-marker\",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on(\"mouseout\",this._onMouseOut,this).on(\"mousemove\",this._onMouseMove,this).on(\"mousedown\",this._onMouseDown,this).on(\"mouseup\",this._onMouseUp,this).addTo(this._map),this._map.on(\"mouseup\",this._onMouseUp,this).on(\"mousemove\",this._onMouseMove,this).on(\"zoomlevelschange\",this._onZoomEnd,this).on(\"touchstart\",this._onTouch,this).on(\"zoomend\",this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._clearHideErrorTimeout(),this._cleanUpShape(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,this._map.removeLayer(this._poly),delete this._poly,this._mouseMarker.off(\"mousedown\",this._onMouseDown,this).off(\"mouseout\",this._onMouseOut,this).off(\"mouseup\",this._onMouseUp,this).off(\"mousemove\",this._onMouseMove,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._clearGuides(),this._map.off(\"mouseup\",this._onMouseUp,this).off(\"mousemove\",this._onMouseMove,this).off(\"zoomlevelschange\",this._onZoomEnd,this).off(\"zoomend\",this._onZoomEnd,this).off(\"touchstart\",this._onTouch,this).off(\"click\",this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var t=this._markers.pop(),e=this._poly,i=e.getLatLngs(),o=i.splice(-1,1)[0];this._poly.setLatLngs(i),this._markerGroup.removeLayer(t),e.getLatLngs().length<2&&this._map.removeLayer(e),this._vertexChanged(o,!1)}},addVertex:function(t){if(this._markers.length>=2&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(t))return void this._showErrorTooltip();this._errorShown&&this._hideErrorTooltip(),this._markers.push(this._createMarker(t)),this._poly.addLatLng(t),2===this._poly.getLatLngs().length&&this._map.addLayer(this._poly),this._vertexChanged(t,!0)},completeShape:function(){this._markers.length<=1||!this._shapeIsValid()||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_finishShape:function(){var t=this._poly._defaultShape?this._poly._defaultShape():this._poly.getLatLngs(),e=this._poly.newLatLngIntersects(t[t.length-1]);if(!this.options.allowIntersection&&e||!this._shapeIsValid())return void this._showErrorTooltip();this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_shapeIsValid:function(){return!0},_onZoomEnd:function(){null!==this._markers&&this._updateGuide()},_onMouseMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent),i=this._map.layerPointToLatLng(e);this._currentLatLng=i,this._updateTooltip(i),this._updateGuide(e),this._mouseMarker.setLatLng(i),L.DomEvent.preventDefault(t.originalEvent)},_vertexChanged:function(t,e){this._map.fire(L.Draw.Event.DRAWVERTEX,{layers:this._markerGroup}),this._updateFinishHandler(),this._updateRunningMeasure(t,e),this._clearGuides(),this._updateTooltip()},_onMouseDown:function(t){if(!this._clickHandled&&!this._touchHandled&&!this._disableMarkers){this._onMouseMove(t),this._clickHandled=!0,this._disableNewMarkers();var e=t.originalEvent,i=e.clientX,o=e.clientY;this._startPoint.call(this,i,o)}},_startPoint:function(t,e){this._mouseDownOrigin=L.point(t,e)},_onMouseUp:function(t){var e=t.originalEvent,i=e.clientX,o=e.clientY;this._endPoint.call(this,i,o,t),this._clickHandled=null},_endPoint:function(e,i,o){if(this._mouseDownOrigin){var a=L.point(e,i).distanceTo(this._mouseDownOrigin),n=this._calculateFinishDistance(o.latlng);this.options.maxPoints>1&&this.options.maxPoints==this._markers.length+1?(this.addVertex(o.latlng),this._finishShape()):n<10&&L.Browser.touch?this._finishShape():Math.abs(a)<9*(t.devicePixelRatio||1)&&this.addVertex(o.latlng),this._enableNewMarkers()}this._mouseDownOrigin=null},_onTouch:function(t){var e,i,o=t.originalEvent;!o.touches||!o.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(e=o.touches[0].clientX,i=o.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,e,i),this._endPoint.call(this,e,i,t),this._touchHandled=null),this._clickHandled=null},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_calculateFinishDistance:function(t){var e;if(this._markers.length>0){var i;if(this.type===L.Draw.Polyline.TYPE)i=this._markers[this._markers.length-1];else{if(this.type!==L.Draw.Polygon.TYPE)return 1/0;i=this._markers[0]}var o=this._map.latLngToContainerPoint(i.getLatLng()),a=new L.Marker(t,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),n=this._map.latLngToContainerPoint(a.getLatLng());e=o.distanceTo(n)}else e=1/0;return e},_updateFinishHandler:function(){var t=this._markers.length;t>1&&this._markers[t-1].on(\"click\",this._finishShape,this),t>2&&this._markers[t-2].off(\"click\",this._finishShape,this)},_createMarker:function(t){var e=new L.Marker(t,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(e),e},_updateGuide:function(t){var e=this._markers?this._markers.length:0;e>0&&(t=t||this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[e-1].getLatLng()),t))},_updateTooltip:function(t){var e=this._getTooltipText();t&&this._tooltip.updatePosition(t),this._errorShown||this._tooltip.updateContent(e)},_drawGuide:function(t,e){var i,o,a,n=Math.floor(Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))),s=this.options.guidelineDistance,r=this.options.maxGuideLineLength,l=n>r?n-r:s;for(this._guidesContainer||(this._guidesContainer=L.DomUtil.create(\"div\",\"leaflet-draw-guides\",this._overlayPane));l
1&&this._markers[this._markers.length-1].off(\"click\",this._finishShape,this)},_fireCreatedEvent:function(){var t=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)}}),L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:\"polygon\"},Poly:L.Polygon,options:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:\"#3388ff\",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},initialize:function(t,e){L.Draw.Polyline.prototype.initialize.call(this,t,e),this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var t=this._markers.length;1===t&&this._markers[0].on(\"click\",this._finishShape,this),t>2&&(this._markers[t-1].on(\"dblclick\",this._finishShape,this),t>3&&this._markers[t-2].off(\"dblclick\",this._finishShape,this))},_getTooltipText:function(){var t,e;return 0===this._markers.length?t=L.drawLocal.draw.handlers.polygon.tooltip.start:this._markers.length<3?(t=L.drawLocal.draw.handlers.polygon.tooltip.cont,e=this._getMeasurementString()):(t=L.drawLocal.draw.handlers.polygon.tooltip.end,e=this._getMeasurementString()),{text:t,subtext:e}},_getMeasurementString:function(){var t=this._area,e=\"\";return t||this.options.showLength?(this.options.showLength&&(e=L.Draw.Polyline.prototype._getMeasurementString.call(this)),t&&(e+=\" \"+L.GeometryUtil.readableArea(t,this.options.metric,this.options.precision)),e):null},_shapeIsValid:function(){return this._markers.length>=3},_vertexChanged:function(t,e){var i;!this.options.allowIntersection&&this.options.showArea&&(i=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(i)),L.Draw.Polyline.prototype._vertexChanged.call(this,t,e)},_cleanUpShape:function(){var t=this._markers.length;t>0&&(this._markers[0].off(\"click\",this._finishShape,this),t>2&&this._markers[t-1].off(\"dblclick\",this._finishShape,this))}}),L.SimpleShape={},L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(t,e){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor=\"crosshair\",this._tooltip.updateContent({text:this._initialLabelText}),this._map.on(\"mousedown\",this._onMouseDown,this).on(\"mousemove\",this._onMouseMove,this).on(\"touchstart\",this._onMouseDown,this).on(\"touchmove\",this._onMouseMove,this),e.addEventListener(\"touchstart\",L.DomEvent.preventDefault,{passive:!1}))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor=\"\",this._map.off(\"mousedown\",this._onMouseDown,this).off(\"mousemove\",this._onMouseMove,this).off(\"touchstart\",this._onMouseDown,this).off(\"touchmove\",this._onMouseMove,this),L.DomEvent.off(e,\"mouseup\",this._onMouseUp,this),L.DomEvent.off(e,\"touchend\",this._onMouseUp,this),e.removeEventListener(\"touchstart\",L.DomEvent.preventDefault),this._shape&&(this._map.removeLayer(this._shape),delete this._shape)),this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(t){this._isDrawing=!0,this._startLatLng=t.latlng,L.DomEvent.on(e,\"mouseup\",this._onMouseUp,this).on(e,\"touchend\",this._onMouseUp,this).preventDefault(t.originalEvent)},_onMouseMove:function(t){var e=t.latlng;this._tooltip.updatePosition(e),this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(e))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()}}),L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:\"rectangle\"},options:{shapeOptions:{stroke:!0,color:\"#3388ff\",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showArea:!0,metric:!0},initialize:function(t,e){this.type=L.Draw.Rectangle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t,e)},disable:function(){this._enabled&&(this._isCurrentlyTwoClickDrawing=!1,L.Draw.SimpleShape.prototype.disable.call(this))},_onMouseUp:function(t){if(!this._shape&&!this._isCurrentlyTwoClickDrawing)return void(this._isCurrentlyTwoClickDrawing=!0);this._isCurrentlyTwoClickDrawing&&!o(t.target,\"leaflet-pane\")||L.Draw.SimpleShape.prototype._onMouseUp.call(this)},_drawShape:function(t){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,t)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,t),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t)},_getTooltipText:function(){var t,e,i,o=L.Draw.SimpleShape.prototype._getTooltipText.call(this),a=this._shape,n=this.options.showArea;return a&&(t=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),e=L.GeometryUtil.geodesicArea(t),i=n?L.GeometryUtil.readableArea(e,this.options.metric):\"\"),{text:o.text,subtext:i}}}),L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:\"marker\"},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(t,e){this.type=L.Draw.Marker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.marker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._tooltip.updateContent({text:this._initialLabelText}),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:\"leaflet-mouse-marker\",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on(\"click\",this._onClick,this).addTo(this._map),this._map.on(\"mousemove\",this._onMouseMove,this),this._map.on(\"click\",this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._map.off(\"click\",this._onClick,this).off(\"click\",this._onTouch,this),this._marker&&(this._marker.off(\"click\",this._onClick,this),this._map.removeLayer(this._marker),delete this._marker),this._mouseMarker.off(\"click\",this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off(\"mousemove\",this._onMouseMove,this))},_onMouseMove:function(t){var e=t.latlng;this._tooltip.updatePosition(e),this._mouseMarker.setLatLng(e),this._marker?(e=this._mouseMarker.getLatLng(),this._marker.setLatLng(e)):(this._marker=this._createMarker(e),this._marker.on(\"click\",this._onClick,this),this._map.on(\"click\",this._onClick,this).addLayer(this._marker))},_createMarker:function(t){return new L.Marker(t,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset})},_onClick:function(){this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_onTouch:function(t){this._onMouseMove(t),this._onClick()},_fireCreatedEvent:function(){var t=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)}}),L.Draw.CircleMarker=L.Draw.Marker.extend({statics:{TYPE:\"circlemarker\"},options:{stroke:!0,color:\"#3388ff\",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0,zIndexOffset:2e3},initialize:function(t,e){this.type=L.Draw.CircleMarker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circlemarker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,t,e)},_fireCreatedEvent:function(){var t=new L.CircleMarker(this._marker.getLatLng(),this.options);L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)},_createMarker:function(t){return new L.CircleMarker(t,this.options)}}),L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:\"circle\"},options:{shapeOptions:{stroke:!0,color:\"#3388ff\",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},initialize:function(t,e){this.type=L.Draw.Circle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t,e)},_drawShape:function(t){if(L.GeometryUtil.isVersion07x())var e=this._startLatLng.distanceTo(t);else var e=this._map.distance(this._startLatLng,t);this._shape?this._shape.setRadius(e):(this._shape=new L.Circle(this._startLatLng,e,this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t)},_onMouseMove:function(t){var e,i=t.latlng,o=this.options.showRadius,a=this.options.metric;if(this._tooltip.updatePosition(i),this._isDrawing){this._drawShape(i),e=this._shape.getRadius().toFixed(1);var n=\"\";o&&(n=L.drawLocal.draw.handlers.circle.radius+\": \"+L.GeometryUtil.readableDistance(e,a,this.options.feet,this.options.nautic)),this._tooltip.updateContent({text:this._endLabelText,subtext:n})}}}),L.Edit=L.Edit||{},L.Edit.Marker=L.Handler.extend({initialize:function(t,e){this._marker=t,L.setOptions(this,e)},addHooks:function(){var t=this._marker;t.dragging.enable(),t.on(\"dragend\",this._onDragEnd,t),this._toggleMarkerHighlight()},removeHooks:function(){var t=this._marker;t.dragging.disable(),t.off(\"dragend\",this._onDragEnd,t),this._toggleMarkerHighlight()},_onDragEnd:function(t){var e=t.target;e.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:e})},_toggleMarkerHighlight:function(){var t=this._marker._icon;t&&(t.style.display=\"none\",L.DomUtil.hasClass(t,\"leaflet-edit-marker-selected\")?(L.DomUtil.removeClass(t,\"leaflet-edit-marker-selected\"),this._offsetMarker(t,-4)):(L.DomUtil.addClass(t,\"leaflet-edit-marker-selected\"),this._offsetMarker(t,4)),t.style.display=\"\")},_offsetMarker:function(t,e){var i=parseInt(t.style.marginTop,10)-e,o=parseInt(t.style.marginLeft,10)-e;t.style.marginTop=i+\"px\",t.style.marginLeft=o+\"px\"}}),L.Marker.addInitHook(function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.Poly=L.Handler.extend({initialize:function(t){this.latlngs=[t._latlngs],t._holes&&(this.latlngs=this.latlngs.concat(t._holes)),this._poly=t,this._poly.on(\"revert-edited\",this._updateLatLngs,this)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._poly._latlngs)?this._poly._latlngs:this._poly._latlngs[0]:this._poly._latlngs},_eachVertexHandler:function(t){for(var e=0;et&&(i._index+=e)})},_createMiddleMarker:function(t,e){var i,o,a,n=this._getMiddleLatLng(t,e),s=this._createMarker(n);s.setOpacity(.6),t._middleRight=e._middleLeft=s,o=function(){s.off(\"touchmove\",o,this);var a=e._index;s._index=a,s.off(\"click\",i,this).on(\"click\",this._onMarkerClick,this),n.lat=s.getLatLng().lat,n.lng=s.getLatLng().lng,this._spliceLatLngs(a,0,n),this._markers.splice(a,0,s),s.setOpacity(1),this._updateIndexes(a,1),e._index++,this._updatePrevNext(t,s),this._updatePrevNext(s,e),this._poly.fire(\"editstart\")},a=function(){s.off(\"dragstart\",o,this),s.off(\"dragend\",a,this),s.off(\"touchmove\",o,this),this._createMiddleMarker(t,s),this._createMiddleMarker(s,e)},i=function(){o.call(this),a.call(this),this._fireEdit()},s.on(\"click\",i,this).on(\"dragstart\",o,this).on(\"dragend\",a,this).on(\"touchmove\",o,this),this._markerGroup.addLayer(s)},_updatePrevNext:function(t,e){t&&(t._next=e),e&&(e._prev=t)},_getMiddleLatLng:function(t,e){var i=this._poly._map,o=i.project(t.getLatLng()),a=i.project(e.getLatLng());return i.unproject(o._add(a)._divideBy(2))}}),L.Polyline.addInitHook(function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this),this.options.editable&&this.editing.enable()),this.on(\"add\",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on(\"remove\",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))}),L.Edit=L.Edit||{},L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:\"leaflet-div-icon leaflet-editing-icon leaflet-edit-move\"}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),\nclassName:\"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize\"}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:\"leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon\"}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:\"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon\"})},initialize:function(t,e){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon),this._shape=t,L.Util.setOptions(this,e)},addHooks:function(){var t=this._shape;this._shape._map&&(this._map=this._shape._map,t.setStyle(t.options.editing),t._map&&(this._map=t._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var t=this._shape;if(t.setStyle(t.options.original),t._map){this._unbindMarker(this._moveMarker);for(var e=0,i=this._resizeMarkers.length;e \"+L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.draw.handlers.circle.radius+\": \"+L.GeometryUtil.readableDistance(radius,!0,this.options.feet,this.options.nautic)}),this._shape.setRadius(radius),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})}}),L.Circle.addInitHook(function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable())}),L.Map.mergeOptions({touchExtend:!0}),L.Map.TouchExtend=L.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,\"touchstart\",this._onTouchStart,this),L.DomEvent.on(this._container,\"touchend\",this._onTouchEnd,this),L.DomEvent.on(this._container,\"touchmove\",this._onTouchMove,this),this._detectIE()?(L.DomEvent.on(this._container,\"MSPointerDown\",this._onTouchStart,this),L.DomEvent.on(this._container,\"MSPointerUp\",this._onTouchEnd,this),L.DomEvent.on(this._container,\"MSPointerMove\",this._onTouchMove,this),L.DomEvent.on(this._container,\"MSPointerCancel\",this._onTouchCancel,this)):(L.DomEvent.on(this._container,\"touchcancel\",this._onTouchCancel,this),L.DomEvent.on(this._container,\"touchleave\",this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,\"touchstart\",this._onTouchStart,this),L.DomEvent.off(this._container,\"touchend\",this._onTouchEnd,this),L.DomEvent.off(this._container,\"touchmove\",this._onTouchMove,this),this._detectIE()?(L.DomEvent.off(this._container,\"MSPointerDown\",this._onTouchStart,this),L.DomEvent.off(this._container,\"MSPointerUp\",this._onTouchEnd,this),L.DomEvent.off(this._container,\"MSPointerMove\",this._onTouchMove,this),L.DomEvent.off(this._container,\"MSPointerCancel\",this._onTouchCancel,this)):(L.DomEvent.off(this._container,\"touchcancel\",this._onTouchCancel,this),L.DomEvent.off(this._container,\"touchleave\",this._onTouchLeave,this))},_touchEvent:function(t,e){var i={};if(void 0!==t.touches){if(!t.touches.length)return;i=t.touches[0]}else{if(\"touch\"!==t.pointerType)return;if(i=t,!this._filterClick(t))return}var o=this._map.mouseEventToContainerPoint(i),a=this._map.mouseEventToLayerPoint(i),n=this._map.layerPointToLatLng(a);this._map.fire(e,{latlng:n,layerPoint:a,containerPoint:o,pageX:i.pageX,pageY:i.pageY,originalEvent:t})},_filterClick:function(t){var e=t.timeStamp||t.originalEvent.timeStamp,i=L.DomEvent._lastClick&&e-L.DomEvent._lastClick;return i&&i>100&&i<500||t.target._simulatedClick&&!t._simulated?(L.DomEvent.stop(t),!1):(L.DomEvent._lastClick=e,!0)},_onTouchStart:function(t){if(this._map._loaded){this._touchEvent(t,\"touchstart\")}},_onTouchEnd:function(t){if(this._map._loaded){this._touchEvent(t,\"touchend\")}},_onTouchCancel:function(t){if(this._map._loaded){var e=\"touchcancel\";this._detectIE()&&(e=\"pointercancel\"),this._touchEvent(t,e)}},_onTouchLeave:function(t){if(this._map._loaded){this._touchEvent(t,\"touchleave\")}},_onTouchMove:function(t){if(this._map._loaded){this._touchEvent(t,\"touchmove\")}},_detectIE:function(){var e=t.navigator.userAgent,i=e.indexOf(\"MSIE \");if(i>0)return parseInt(e.substring(i+5,e.indexOf(\".\",i)),10);if(e.indexOf(\"Trident/\")>0){var o=e.indexOf(\"rv:\");return parseInt(e.substring(o+3,e.indexOf(\".\",o)),10)}var a=e.indexOf(\"Edge/\");return a>0&&parseInt(e.substring(a+5,e.indexOf(\".\",a)),10)}}),L.Map.addInitHook(\"addHandler\",\"touchExtend\",L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){return this.addInteractiveTarget?L.Marker.prototype._initInteraction.apply(this):this._initInteractionLegacy()},_initInteractionLegacy:function(){if(this.options.clickable){var t=this._icon,e=[\"dblclick\",\"mousedown\",\"mouseover\",\"mouseout\",\"contextmenu\",\"touchstart\",\"touchend\",\"touchmove\"];this._detectIE?e.concat([\"MSPointerDown\",\"MSPointerUp\",\"MSPointerMove\",\"MSPointerCancel\"]):e.concat([\"touchcancel\"]),L.DomUtil.addClass(t,\"leaflet-clickable\"),L.DomEvent.on(t,\"click\",this._onMouseClick,this),L.DomEvent.on(t,\"keypress\",this._onKeyPress,this);for(var i=0;i0)return parseInt(e.substring(i+5,e.indexOf(\".\",i)),10);if(e.indexOf(\"Trident/\")>0){var o=e.indexOf(\"rv:\");return parseInt(e.substring(o+3,e.indexOf(\".\",o)),10)}var a=e.indexOf(\"Edge/\");return a>0&&parseInt(e.substring(a+5,e.indexOf(\".\",a)),10)}}),L.LatLngUtil={cloneLatLngs:function(t){for(var e=[],i=0,o=t.length;i2){for(var s=0;s1&&(i=i+s+r[1])}return i},readableArea:function(e,i,o){var a,n,o=L.Util.extend({},t,o);return i?(n=[\"ha\",\"m\"],type=typeof i,\"string\"===type?n=[i]:\"boolean\"!==type&&(n=i),a=e>=1e6&&-1!==n.indexOf(\"km\")?L.GeometryUtil.formattedNumber(1e-6*e,o.km)+\" km²\":e>=1e4&&-1!==n.indexOf(\"ha\")?L.GeometryUtil.formattedNumber(1e-4*e,o.ha)+\" ha\":L.GeometryUtil.formattedNumber(e,o.m)+\" m²\"):(e/=.836127,a=e>=3097600?L.GeometryUtil.formattedNumber(e/3097600,o.mi)+\" mi²\":e>=4840?L.GeometryUtil.formattedNumber(e/4840,o.ac)+\" acres\":L.GeometryUtil.formattedNumber(e,o.yd)+\" yd²\"),a},readableDistance:function(e,i,o,a,n){var s,n=L.Util.extend({},t,n);switch(i?\"string\"==typeof i?i:\"metric\":o?\"feet\":a?\"nauticalMile\":\"yards\"){case\"metric\":s=e>1e3?L.GeometryUtil.formattedNumber(e/1e3,n.km)+\" km\":L.GeometryUtil.formattedNumber(e,n.m)+\" m\";break;case\"feet\":e*=3.28083,s=L.GeometryUtil.formattedNumber(e,n.ft)+\" ft\";break;case\"nauticalMile\":e*=.53996,s=L.GeometryUtil.formattedNumber(e/1e3,n.nm)+\" nm\";break;case\"yards\":default:e*=1.09361,s=e>1760?L.GeometryUtil.formattedNumber(e/1760,n.mi)+\" miles\":L.GeometryUtil.formattedNumber(e,n.yd)+\" yd\"}return s},isVersion07x:function(){var t=L.version.split(\".\");return 0===parseInt(t[0],10)&&7===parseInt(t[1],10)}})}(),L.Util.extend(L.LineUtil,{segmentsIntersect:function(t,e,i,o){return this._checkCounterclockwise(t,i,o)!==this._checkCounterclockwise(e,i,o)&&this._checkCounterclockwise(t,e,i)!==this._checkCounterclockwise(t,e,o)},_checkCounterclockwise:function(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}}),L.Polyline.include({intersects:function(){var t,e,i,o=this._getProjectedPoints(),a=o?o.length:0;if(this._tooFewPointsForIntersection())return!1;for(t=a-1;t>=3;t--)if(e=o[t-1],i=o[t],this._lineSegmentsIntersectsRange(e,i,t-2))return!0;return!1},newLatLngIntersects:function(t,e){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(t),e)},newPointIntersects:function(t,e){var i=this._getProjectedPoints(),o=i?i.length:0,a=i?i[o-1]:null,n=o-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(a,t,n,e?1:0)},_tooFewPointsForIntersection:function(t){var e=this._getProjectedPoints(),i=e?e.length:0;return i+=t||0,!e||i<=3},_lineSegmentsIntersectsRange:function(t,e,i,o){var a,n,s=this._getProjectedPoints();o=o||0;for(var r=i;r>o;r--)if(a=s[r-1],n=s[r],L.LineUtil.segmentsIntersect(t,e,a,n))return!0;return!1},_getProjectedPoints:function(){if(!this._defaultShape)return this._originalPoints;for(var t=[],e=this._defaultShape(),i=0;i=2?L.Toolbar.include(L.Evented.prototype):L.Toolbar.include(L.Mixin.Events)},enabled:function(){return null!==this._activeMode},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(t){var e,i=L.DomUtil.create(\"div\",\"leaflet-draw-section\"),o=0,a=this._toolbarClass||\"\",n=this.getModeHandlers(t);for(this._toolbarContainer=L.DomUtil.create(\"div\",\"leaflet-draw-toolbar leaflet-bar\"),this._map=t,e=0;e0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,\"leaflet-draw-tooltip-single\"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,\"leaflet-draw-tooltip-single\"),this._singleLineLabel=!0),this._container.innerHTML=(t.subtext.length>0?''+t.subtext+\" \":\"\")+\"\"+t.text+\" \",t.text||t.subtext?(this._visible=!0,this._container.style.visibility=\"inherit\"):(this._visible=!1,this._container.style.visibility=\"hidden\"),this):this},updatePosition:function(t){var e=this._map.latLngToLayerPoint(t),i=this._container;return this._container&&(this._visible&&(i.style.visibility=\"inherit\"),L.DomUtil.setPosition(i,e)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,\"leaflet-error-draw-tooltip\"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,\"leaflet-error-draw-tooltip\"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility=\"hidden\")}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:\"draw\"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{},circlemarker:{}},initialize:function(t){for(var e in this.options)this.options.hasOwnProperty(e)&&t[e]&&(t[e]=L.extend({},this.options[e],t[e]));this._toolbarClass=\"leaflet-draw-draw\",L.Toolbar.prototype.initialize.call(this,t)},getModeHandlers:function(t){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(t,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(t,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(t,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(t,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(t,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker},{enabled:this.options.circlemarker,handler:new L.Draw.CircleMarker(t,this.options.circlemarker),title:L.drawLocal.draw.toolbar.buttons.circlemarker}]},getActions:function(t){return[{enabled:t.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:t.completeShape,context:t},{enabled:t.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:t.deleteLastVertex,context:t},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(t){L.setOptions(this,t);for(var e in this._modes)this._modes.hasOwnProperty(e)&&t.hasOwnProperty(e)&&this._modes[e].handler.setOptions(t[e])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:\"edit\"},options:{edit:{selectedPathOptions:{dashArray:\"10, 10\",fill:!0,fillColor:\"#fe57a1\",fillOpacity:.1,maintainColor:!1}},remove:{},poly:null,featureGroup:null},initialize:function(t){t.edit&&(void 0===t.edit.selectedPathOptions&&(t.edit.selectedPathOptions=this.options.edit.selectedPathOptions),t.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,t.edit.selectedPathOptions)),t.remove&&(t.remove=L.extend({},this.options.remove,t.remove)),t.poly&&(t.poly=L.extend({},this.options.poly,t.poly)),this._toolbarClass=\"leaflet-draw-edit\",L.Toolbar.prototype.initialize.call(this,t),this._selectedFeatureCount=0},getModeHandlers:function(t){var e=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(t,{featureGroup:e,selectedPathOptions:this.options.edit.selectedPathOptions,poly:this.options.poly}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(t,{featureGroup:e}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(t){var e=[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}];return t.removeAllLayers&&e.push({title:L.drawLocal.edit.toolbar.actions.clearAll.title,text:L.drawLocal.edit.toolbar.actions.clearAll.text,callback:this._clearAllLayers,context:this}),e},addToolbar:function(t){var e=L.Toolbar.prototype.addToolbar.call(this,t);return this._checkDisabled(),this.options.featureGroup.on(\"layeradd layerremove\",this._checkDisabled,this),e},removeToolbar:function(){this.options.featureGroup.off(\"layeradd layerremove\",this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode&&this._activeMode.handler.disable()},_clearAllLayers:function(){this._activeMode.handler.removeAllLayers(),this._activeMode&&this._activeMode.handler.disable()},_checkDisabled:function(){var t,e=this.options.featureGroup,i=0!==e.getLayers().length;this.options.edit&&(t=this._modes[L.EditToolbar.Edit.TYPE].button,i?L.DomUtil.removeClass(t,\"leaflet-disabled\"):L.DomUtil.addClass(t,\"leaflet-disabled\"),t.setAttribute(\"title\",i?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(t=this._modes[L.EditToolbar.Delete.TYPE].button,i?L.DomUtil.removeClass(t,\"leaflet-disabled\"):L.DomUtil.addClass(t,\"leaflet-disabled\"),t.setAttribute(\"title\",i?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:\"edit\"},initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.setOptions(this,e),this._featureGroup=e.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error(\"options.featureGroup must be a L.FeatureGroup\");this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE;var i=L.version.split(\".\");1===parseInt(i[0],10)&&parseInt(i[1],10)>=2?L.EditToolbar.Edit.include(L.Evented.prototype):L.EditToolbar.Edit.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire(\"enabled\",{handler:this.type}),this._map.fire(L.Draw.Event.EDITSTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on(\"layeradd\",this._enableLayerEdit,this).on(\"layerremove\",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off(\"layeradd\",this._enableLayerEdit,this).off(\"layerremove\",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.EDITSTOP,{handler:this.type}),this.fire(\"disabled\",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),t._editTooltip=this._tooltip,this._updateTooltip(),this._map.on(\"mousemove\",this._onMouseMove,this).on(\"touchmove\",this._onMouseMove,this).on(\"MSPointerMove\",this._onMouseMove,this).on(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off(\"mousemove\",this._onMouseMove,this).off(\"touchmove\",this._onMouseMove,this).off(\"MSPointerMove\",this._onMouseMove,this).off(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},revertLayers:function(){this._featureGroup.eachLayer(function(t){this._revertLayer(t)},this)},save:function(){var t=new L.LayerGroup;this._featureGroup.eachLayer(function(e){e.edited&&(t.addLayer(e),e.edited=!1)}),this._map.fire(L.Draw.Event.EDITED,{layers:t})},_backupLayer:function(t){var e=L.Util.stamp(t);this._uneditedLayerProps[e]||(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?this._uneditedLayerProps[e]={latlngs:L.LatLngUtil.cloneLatLngs(t.getLatLngs())}:t instanceof L.Circle?this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng()),radius:t.getRadius()}:(t instanceof L.Marker||t instanceof L.CircleMarker)&&(this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(t){var e=L.Util.stamp(t);t.edited=!1,this._uneditedLayerProps.hasOwnProperty(e)&&(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?t.setLatLngs(this._uneditedLayerProps[e].latlngs):t instanceof L.Circle?(t.setLatLng(this._uneditedLayerProps[e].latlng),t.setRadius(this._uneditedLayerProps[e].radius)):(t instanceof L.Marker||t instanceof L.CircleMarker)&&t.setLatLng(this._uneditedLayerProps[e].latlng),t.fire(\"revert-edited\",{layer:t}))},_enableLayerEdit:function(t){var e,i,o=t.layer||t.target||t;this._backupLayer(o),this.options.poly&&(i=L.Util.extend({},this.options.poly),o.options.poly=i),this.options.selectedPathOptions&&(e=L.Util.extend({},this.options.selectedPathOptions),e.maintainColor&&(e.color=o.options.color,e.fillColor=o.options.fillColor),o.options.original=L.extend({},o.options),o.options.editing=e),o instanceof L.Marker?(o.editing&&o.editing.enable(),o.dragging.enable(),o.on(\"dragend\",this._onMarkerDragEnd).on(\"touchmove\",this._onTouchMove,this).on(\"MSPointerMove\",this._onTouchMove,this).on(\"touchend\",this._onMarkerDragEnd,this).on(\"MSPointerUp\",this._onMarkerDragEnd,this)):o.editing.enable()},_disableLayerEdit:function(t){var e=t.layer||t.target||t;e.edited=!1,e.editing&&e.editing.disable(),delete e.options.editing,delete e.options.original,\nthis._selectedPathOptions&&(e instanceof L.Marker?this._toggleMarkerHighlight(e):(e.setStyle(e.options.previousOptions),delete e.options.previousOptions)),e instanceof L.Marker?(e.dragging.disable(),e.off(\"dragend\",this._onMarkerDragEnd,this).off(\"touchmove\",this._onTouchMove,this).off(\"MSPointerMove\",this._onTouchMove,this).off(\"touchend\",this._onMarkerDragEnd,this).off(\"MSPointerUp\",this._onMarkerDragEnd,this)):e.editing.disable()},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_onMarkerDragEnd:function(t){var e=t.target;e.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:e})},_onTouchMove:function(t){var e=t.originalEvent.changedTouches[0],i=this._map.mouseEventToLayerPoint(e),o=this._map.layerPointToLatLng(i);t.target.setLatLng(o)},_hasAvailableLayers:function(){return 0!==this._featureGroup.getLayers().length}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:\"remove\"},initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.Util.setOptions(this,e),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error(\"options.featureGroup must be a L.FeatureGroup\");this.type=L.EditToolbar.Delete.TYPE;var i=L.version.split(\".\");1===parseInt(i[0],10)&&parseInt(i[1],10)>=2?L.EditToolbar.Delete.include(L.Evented.prototype):L.EditToolbar.Delete.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire(\"enabled\",{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on(\"layeradd\",this._enableLayerDelete,this).on(\"layerremove\",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off(\"layeradd\",this._enableLayerDelete,this).off(\"layerremove\",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire(\"disabled\",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on(\"mousemove\",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off(\"mousemove\",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(t){this._deletableLayers.addLayer(t),t.fire(\"revert-deleted\",{layer:t})},this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer(function(t){this._removeLayer({layer:t})},this),this.save()},_enableLayerDelete:function(t){(t.layer||t.target||t).on(\"click\",this._removeLayer,this)},_disableLayerDelete:function(t){var e=t.layer||t.target||t;e.off(\"click\",this._removeLayer,this),this._deletedLayers.removeLayer(e)},_removeLayer:function(t){var e=t.layer||t.target||t;this._deletableLayers.removeLayer(e),this._deletedLayers.addLayer(e),e.fire(\"deleted\")},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_hasAvailableLayers:function(){return 0!==this._deletableLayers.getLayers().length}})}(window,document);","\n \n
\n
\n
Search \n
\n
\n \n
\n
record?.name || record?.description\"\n />\n \n \n \n
\n \n\n \n 0\">\n \n Your Regions (select to add to this Hunt) \n \n \n \n \n \n {{\n searchResult.name\n }} \n \n \n \n \n 0\">\n Places \n \n \n \n \n {{\n place.description\n }} \n \n \n \n \n \n\n \n
\n
No results found
\n
\n We couldn’t find anything with that term. Please try again.\n
\n
\n \n
\n
\n \n Reset \n \n
\n\n
\n
\n
\n Draw region boundaries\n \n
\n Draw parcel boundaries\n \n
\n Click on the map to place. Draw/edit controls on map's left edge.\n
\n
\n
\n \n Reset \n \n
\n\n
\n
\n
\n
\n
\n
\n Cancel\n \n
\n \n \n \n Save \n \n \n \n
\n
\n
\n \n\n\n","\n \n \n Map Regions \n What geographic regions are being targeted? \n \n\n \n \n
\n
\n
\n \n \n \n Unlock to view map\n \n
\n \n
\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n Add region boundaries \n \n \n \n \n \n
\n \n \n \n\n\n","\n \n
\n\n
\n \n
\n \n \n\n
\n \n
\n
\n
\n \n\n\n","import { ref, computed } from \"vue\";\nimport { defineStore, acceptHMRUpdate } from \"pinia\";\nimport _ from \"lodash\";\n\nexport const useSharingStore = defineStore(\"sharing\", () => {\n const sharingDataFields = ref([]);\n const userRecipients = ref([]);\n const teamRecipients = ref([]);\n const stagedCount = computed(() => {\n return sharingDataFields.value.length;\n });\n\n function alreadyInStage(dataField) {\n return _.find(sharingDataFields.value, { localId: dataField.localId });\n }\n function addSharingDataFields(dataFields) {\n const newFields = _.unionBy(dataFields, sharingDataFields.value, \"localId\");\n\n sharingDataFields.value = newFields;\n }\n function removeFromDataFieldSharing(dataFields) {\n const newFields = _.differenceBy(\n sharingDataFields.value,\n dataFields,\n \"localId\",\n );\n\n sharingDataFields.value = newFields;\n }\n function addUser(user) {\n const newUsers = _.unionBy([user], userRecipients.value, \"name\");\n\n userRecipients.value = newUsers;\n }\n function removeUser(user) {\n const newUsers = _.differenceBy(userRecipients.value, [user], \"name\");\n\n userRecipients.value = newUsers;\n }\n function addTeam(team) {\n const newTeams = _.unionBy([team], teamRecipients.value, \"name\");\n\n teamRecipients.value = newTeams;\n }\n function removeTeam(team) {\n const newTeams = _.differenceBy(teamRecipients.value, [team], \"name\");\n\n teamRecipients.value = newTeams;\n }\n function setRecipientPayStructure({ option, recipient }) {\n if (recipient.className === \"Team\") {\n const oldTeam = _.find(teamRecipients.value, {\n id: recipient.id,\n });\n const newTeam = _.merge({}, oldTeam, { payStructure: option });\n const newTeams = _.unionBy([newTeam], teamRecipients.value, \"name\");\n\n teamRecipients.value = newTeams;\n } else {\n const finder = recipient.id\n ? { id: recipient.id }\n : { email: recipient.email };\n\n const oldPerson = _.find(userRecipients.value, finder);\n const newPerson = _.merge({}, oldPerson, { payStructure: option });\n const newContacts = _.unionBy([newPerson], userRecipients.value, \"name\");\n\n userRecipients.value = newContacts;\n }\n }\n function reset() {\n sharingDataFields.value = [];\n userRecipients.value = [];\n teamRecipients.value = [];\n }\n\n return {\n sharingDataFields,\n userRecipients,\n teamRecipients,\n stagedCount,\n alreadyInStage,\n addSharingDataFields,\n addUser,\n addTeam,\n removeUser,\n removeTeam,\n removeFromDataFieldSharing,\n setRecipientPayStructure,\n reset,\n };\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept(acceptHMRUpdate(useSharingStore, import.meta.hot));\n}\n","\n \n Use setting \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n","\n \n Denominators \n \n
\n
\n \n
\n
\n
{{ denominator.name }} \n
\n {{ denominator.description }}\n
\n
\n
\n
\n \n \n\n\n","\n \n Excluded Uses \n \n
\n
\n \n
\n
\n {{ use.name }} \n {{ \" \" }}\n {{ use.measure }} {{ use.measure }} \n
\n
\n
\n \n \n\n\n","\n \n Included Value Types \n \n
\n
\n \n
\n
\n {{ valueType.name }} \n
\n
\n
\n \n \n\n\n","import IncludeAirRights from \"@/components/analyze/calculations/options/IncludeAirRights.vue\";\nimport PerAreaDenominator from \"@/components/analyze/calculations/options/PerAreaDenominator.vue\";\nimport ExcludedUses from \"@/components/analyze/calculations/options/ExcludedUses.vue\";\nimport IncludedValueTypes from \"@/components/analyze/calculations/options/IncludedValueTypes.vue\";\nimport pluralize from \"pluralize\";\n\nexport default function calculationOptionsFor(calculationName, optionsData) {\n const operableOptions = optionsData?.calculationOptions || optionsData;\n const excludedUsesCount =\n operableOptions?.excludedUses?.useTypes?.length || 0;\n const excludedUses = {\n label: pluralize(\"excluded use\", excludedUsesCount, true),\n description: \"Remove floor area with selected use(s) from the total.\",\n component: ExcludedUses,\n orientation: \"y\",\n };\n const denominator = {\n label:\n excludedUsesCount > 0 ? \"Denominator (see exclusions)\" : \"Denominator\",\n description: \"Select a size and unit type.\",\n component: PerAreaDenominator,\n orientation: \"y\",\n };\n\n switch (calculationName) {\n case \"sizes_uses\":\n return [includeAirRights, excludedUses];\n case \"investment_volume\":\n return [includedValueTypes];\n case \"price_per_area\":\n return [includeAirRights, denominator, excludedUses];\n default:\n return [];\n }\n}\n\nconst includeAirRights = {\n label: \"Include air rights\",\n description: \"Add floor area from air rights to the total.\",\n component: IncludeAirRights,\n orientation: \"x\",\n};\nconst includedValueTypes = {\n label: \"Included value types\",\n description:\n \"Each investment contributes one valuation (when available) to the volume calculation. Choose which value types are eligible.\",\n component: IncludedValueTypes,\n orientation: \"y\",\n};\n","\n \n \n \n \n Calculation Options\n \n \n\n \n \n
\n
\n {{ option.label }} \n \n
\n
\n
\n \n \n \n\n\n","\n \n
\n \n
\n {{ calculationDescription }} \n
\n\n \n
\n \n \n
\n \n \n
\n \n \n \n
0\n \"\n :calculation-name=\"calculationName\"\n :calculation-option-data=\"calculationOptionData\"\n />\n \n \n
\n
\n \n
\n Make changes \n
\n \n \n
\n \n \n \n \n \n \n \n \n \n
\n \n
\n Make changes \n
\n \n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n Admin actions \n \n \n \n \n \n \n \n Easy Data Input Preemption\n
\n \n \n \n \n
\n
\n Link to an Easy Data Input Job:\n \n
\n
\n
\n \n \n \n \n \n \n \n \n
\n
\n Credibility & Cost \n
\n
\n \n \n
\n
\n
\n \n\n\n","\n \n
\n
\n \n
\n
\n Confidential\n
\n
\n
\n
\n
\n \n \n \n \n \n \n
\n
\n
\n
\n
\n
\n {{\n moment(citationDetails.dateField.fieldValue).format(\n \"MMM YYYY\",\n )\n }} \n Undated \n
\n
\n
\n
\n
\n
\n {{ _.capitalize(citationType) }}\n
\n
\n
\n \n \n \n \n \n \n
\n \n \n
\n
\n
\n
\n
\n
\n \n \n Paywalled \n \n \n \n Public \n \n
\n
\n
\n
\n
\n
\n
\n \n\n\n","\n \n
\n
\n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n\n\n","\n \n \n \n \n \n \n\n \n \n
\n \n \n \n \n
\n \n \n \n
\n \n \n \n
\n \n Clear\n \n \n Save\n \n
\n
\n \n \n
\n
\n \n \n \n\n\n\n\n","\n \n \n
0 || folders.length > 0 || citations.length > 0\n ? 'mb-12'\n : ''\n \"\n class=\"bg-white p-2\"\n >\n
\n
\n
Files \n
\n Be more productive with this {{ contentType }} with files and\n links.\n
\n
\n
0 || folders.length > 0 || citations.length > 0\n \"\n class=\"ml-4 mt-4 flex-shrink-0\"\n >\n \n
\n
\n\n
0\" class=\"mt-6\">\n
\n Individual Files\n \n
\n
\n\n
0\" class=\"mt-6\">\n
\n Folders\n \n
\n
\n \n
\n
\n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n
\n\n
0\" class=\"mt-6\">\n
\n Citations\n \n
\n
\n\n
\n
\n \n \n
No files \n
\n \n Get started by choosing some folders and/or files.\n
\n \n \n
\n \n
\n \n We're unable to let you choose files on this browser.\n
\n \n
\n
\n
\n \n \n\n\n","import { defineStore, acceptHMRUpdate } from \"pinia\";\nimport { computed, nextTick, ref, watch } from \"vue\";\nimport _ from \"lodash\";\nimport moment from \"moment\";\n\nexport const useCashflowDefinitionStore = defineStore(\n \"cashflowDefinition\",\n () => {\n const scheduleDisplayable = ref(true);\n const cashflowSchedule = ref({\n 0: {\n date: null,\n dateType: \"Relative\",\n inputType: \"annual\",\n inputValue: null,\n dataSource: \"input\",\n valid: false,\n },\n });\n const tenantImprovementAllowance = ref({\n date: null,\n dateType: \"Relative\",\n inputType: \"annual\",\n inputValue: null,\n dataSource: \"input\",\n valid: false,\n });\n const processedCashflowSchedule = ref([]);\n\n const selectedCashflowType = ref({\n order: 1,\n name: \"Periodic stepping\",\n value: \"stepping\",\n description: \"ex. Rents\",\n frequency: \"multiple\",\n });\n const cashflowTypes = ref([\n {\n order: 1,\n name: \"Periodic stepping\",\n value: \"stepping\",\n description: \"ex. Rents\",\n frequency: \"multiple\",\n disabled: false,\n },\n {\n order: 2,\n name: \"Tenant improvement allowance\",\n value: \"tenantImprovementAllowance\",\n description: \"Link to buildouts\",\n frequency: \"single\",\n disabled: false,\n },\n {\n order: 3,\n name: \"Time series\",\n value: \"timeSeries\",\n description: \"Raw monthly inputs\",\n frequency: \"multiple\",\n disabled: true,\n },\n {\n order: 4,\n name: \"One-time\",\n value: \"single\",\n description: \"Date and amount\",\n frequency: \"single\",\n disabled: true,\n },\n ]);\n\n const steppingScheduleComplete = computed(() => {\n return _.every(processedCashflowSchedule.value, validScheduleItem);\n });\n const tenantImprovementAllowanceComplete = computed(() => {\n return tenantImprovementAllowance.value.valid;\n });\n function validScheduleItem(item) {\n return item.valid;\n }\n\n const savePayload = computed(() => {\n switch (selectedCashflowType.value?.value) {\n case \"stepping\": {\n if (steppingScheduleComplete.value) {\n const structuredItems = _.map(\n processedCashflowSchedule.value,\n function (item, itemKey) {\n let formattedDate = item.date;\n\n if (item.dateType === \"Actual\") {\n formattedDate = item.date\n ? moment(item.date).valueOf()\n : null;\n }\n return _.merge({}, item, {\n date: formattedDate,\n itemNumber: _.toNumber(itemKey),\n });\n },\n );\n return {\n scheduleItems: structuredItems,\n };\n } else {\n return null;\n }\n }\n case \"tenantImprovementAllowance\": {\n if (tenantImprovementAllowanceComplete.value) {\n let formattedDate = tenantImprovementAllowanceComplete.value.date;\n\n if (\n tenantImprovementAllowanceComplete.value.dateType === \"Actual\"\n ) {\n formattedDate = tenantImprovementAllowanceComplete.value.date\n ? moment(\n tenantImprovementAllowanceComplete.value.date,\n ).valueOf()\n : null;\n }\n\n return {\n scheduleItems: [\n _.merge({}, tenantImprovementAllowance.value, {\n date: formattedDate,\n itemNumber: 0,\n }),\n ],\n };\n } else {\n return null;\n }\n }\n default:\n return null;\n }\n });\n\n watch(selectedCashflowType, (val, oldVal) => {\n if (val?.name !== oldVal?.name) {\n resetSchedule();\n }\n });\n\n function getScheduleItem(key) {\n return cashflowSchedule.value[key];\n }\n const maxScheduleItem = computed(() => {\n const numKeys = _.keys(cashflowSchedule.value).map(_.toNumber);\n\n return _.max(numKeys);\n });\n function addScheduleItem() {\n if (_.isNumber(maxScheduleItem.value)) {\n const newScheduleItemKey = maxScheduleItem.value + 1;\n cashflowSchedule.value[newScheduleItemKey] = {\n date: null,\n dateType: \"Relative\",\n inputType: \"annual\",\n inputValue: null,\n dataSource: \"input\",\n valid: false,\n };\n }\n }\n function removeScheduleItem(key) {\n delete cashflowSchedule.value[key];\n }\n\n async function resetSchedule() {\n scheduleDisplayable.value = false;\n cashflowSchedule.value = {\n 0: {\n date: null,\n dateType: \"Relative\",\n inputType: \"annual\",\n inputValue: null,\n dataSource: \"input\",\n valid: false,\n },\n };\n tenantImprovementAllowance.value = {\n date: null,\n dateType: \"Relative\",\n inputType: \"annual\",\n inputValue: null,\n dataSource: \"input\",\n valid: false,\n };\n processedCashflowSchedule.value = [];\n await nextTick();\n scheduleDisplayable.value = true;\n }\n\n function reset() {\n selectedCashflowType.value = {\n order: 1,\n name: \"Periodic stepping\",\n value: \"stepping\",\n description: \"ex. Rents\",\n frequency: \"multiple\",\n };\n resetSchedule();\n }\n\n return {\n scheduleDisplayable,\n cashflowSchedule,\n tenantImprovementAllowance,\n processedCashflowSchedule,\n savePayload,\n selectedCashflowType,\n cashflowTypes,\n getScheduleItem,\n addScheduleItem,\n removeScheduleItem,\n resetSchedule,\n reset,\n };\n },\n);\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useCashflowDefinitionStore, import.meta.hot),\n );\n}\n","\n \n
\n
\n \n
\n
\n
Data Warning \n
\n fetchPropertyDataFields(isVisible, entry, warning),\n once: true,\n }\"\n :key=\"warning.id\"\n class=\"flex items-center justify-between\"\n >\n
\n
\n {{ warning.description }}\n
\n
\n
\n \n View issues\n \n \n \n \n \n
\n
\n
\n
\n \n\n\n","\n \n
{{ fetchLabel }} \n
Sizes & Uses \n
\n \n \n
0\"\n :warning-data=\"outputData?.warnings\"\n class=\"mt-1\"\n />\n \n 1 || !outputData)\n \"\n class=\"overflow-hidden bg-gray-100 rounded-md p-2\"\n :class=\"[\n hasOutputs && fullyLicensed && !interceptCalculation ? 'col-span-1' : '',\n ]\"\n >\n
Total \n \n \n \n 0\"\n :warning-data=\"outputData?.warnings\"\n class=\"mt-1\"\n />\n \n \n
\n {{ useType.name }}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 0\"\n :warning-data=\"useType.warnings\"\n class=\"mt-1\"\n />\n \n \n\n\n","\n \n Cashflow Type \n\n \n
\n \n \n \n {{ sizeType.name }} \n {{ sizeType.description }} \n \n \n \n \n
\n \n
\n \n \n\n\n","\n \n
\n
\n
\n
\n
Date \n
\n
\n Date Type \n \n Relative \n Actual \n \n
\n
\n
\n \n Mth \n
\n \n \n
\n
\n
\n
Type \n
\n \n \n {{ option.name }}\n \n \n
\n
\n
\n
{{\n inputType === \"annualPercentageIncrease\" ? \"%\" : \"$\"\n }}\n Amount \n
\n \n
\n
\n
\n {{ validationHelp }}\n
\n
\n
\n
\n \n\n\n","\n \n
\n
\n Output Preview\n
\n
\n
\n
\n \n \n \n Date\n \n \n # of Months\n \n \n $/Area\n \n \n $ Amount\n \n \n \n \n \n \n {{ moment(emptyCommencedPeriod.date).format(\"MM/DD/YYYY\") }}\n \n \n Month {{ emptyCommencedPeriod.date }}\n \n \n Date unknown\n \n \n {{ emptyCommencedPeriod.monthsDuration || \"LXD unknown\" }}\n \n \n ${{ currencyAmount(emptyCommencedPeriod.monthlyPerArea * 12, 2) }}\n \n \n $0.00\n \n \n ${{ currencyAmount(emptyCommencedPeriod.monthlyOutput * 12, 0) }}\n \n \n \n \n {{ moment(period.date).format(\"MM/DD/YYYY\") }}\n \n \n {{\n moment(existingCommencementDate)\n .add(period.date - 1, \"months\")\n .format(\"MM/DD/YYYY\")\n }}\n \n \n Month {{ period.date }}\n \n \n Date unknown\n \n \n {{ period.monthsDuration || \"LXD unknown\" }}\n \n \n ${{ currencyAmount(period.monthlyPerArea * 12, 2) }}\n \n \n Fetch or add size\n \n \n ${{ currencyAmount(_.toNumber(period.monthlyOutput) * 12, 0) }}\n \n \n \n
\n
\n
\n \n\n\n","\n \n
\n
Define Steps
\n
\n
\n \n \n \n \n \n \n \n \n Add step \n \n \n \n
\n\n
\n \n
\n\n
\n
\n LCD: {{ commencedDate }} \n · \n LXD: {{ expiredDate }} \n
\n
\n
\n
\n \n \n
\n \n \n \n \n \n \n \n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n
Date \n
\n
\n Date Type \n \n Relative \n Actual \n \n
\n
\n
\n \n Mth \n
\n \n \n
\n
\n
\n
Type \n
\n \n \n {{ option.name }}\n \n \n
\n
\n
\n
{{\n inputType === \"annualPercentageIncrease\" ? \"%\" : \"$\"\n }}\n Amount \n
\n \n
\n
\n
\n {{ validationHelp }}\n
\n
\n
\n
\n \n\n\n","\n \n
\n\n
\n
\n LCD: {{ commencedDate }} \n · \n TIA Timing: {{ allowanceDate }} \n · \n TIA Cost: {{ allowanceAmount }} \n
\n
\n
\n
\n \n \n
\n \n \n \n \n \n \n \n
\n
\n
\n \n\n\n","\n \n
\n New Cashflow Schedule ({{ selectedCashflowType?.name }})\n
\n\n
\n\n
\n\n
\n
\n \n\n\n","\n \n
\n {{ summaryString }}\n
\n
\n \n\n\n","\n \n
\n \n \n \n \n \n \n \n \n \n Link to {{ layout.fieldContent?.name }} \n \n \n \n \n \n
\n \n \n \n\n \n \n \n \n \n \n \n \n \n
\n \n\n\n","\n \n
\n \n Multiple spaces \n Please link via the space list.
\n \n
\n \n
\n Add valuable context to this TI allowance by linking it to related\n floor area layouts.\n
\n
\n
\n 0 &&\n propertyDiagramEditAction?.floorArea?.fieldContentId\n \"\n tooltip=\"Add a new layout to this floor area\"\n class=\"inline-flex\"\n >\n \n \n \n Save \n \n \n \n Select related floor areas, or: \n \n Cancel\n \n \n
\n \n \n \n Add Layout \n \n \n \n
\n
\n \n
0\"\n class=\"flex flex-col space-y-2\"\n >\n Linked Layouts: \n \n \n
\n
\n
\n No Linked Layouts\n \n
\n Link layouts to this TI allowance.\n
\n
\n
0\"\n class=\"flex flex-col space-y-2\"\n >\n Unlinked Layouts: \n \n \n
\n
\n
\n No Unlinked Layouts\n \n
\n Layouts for this floor area will appear here.\n
\n
\n
\n \n
\n \n\n\n","\n \n
\n
\n
\n
\n {{ _.startCase(mode) }} Time Series{{ timeSeriesSuffix }}\n
\n
\n \n \n Use list view \n \n \n \n Use grid view \n \n
\n
\n
\n
\n
\n
\n \n \n \n {{\n period.date\n }} \n {{\n moment(period.date).format(\"MM/YYYY\")\n }} \n \n \n \n \n \n \n ${{ currencyAmount(period.amount, 0) }}\n \n \n \n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n {{ scheduleDataField.fieldContent?.name }}\n
\n
1\" class=\"\">\n
\n Select a tab \n \n \n \n {{ tab.name }}\n \n \n
\n
\n
\n
\n \n \n \n
\n
\n
\n \n\n\n","\n \n
\n
\n \n
\n
\n {{ _.startCase(dataField.fieldContentType) }} Cashflows\n \n
\n
\n \n \n \n \n \n \n \n \n \n \n Add cashflow schedule \n \n \n \n \n \n
\n LCD: {{ commencedDate }} \n · \n LXD: {{ expiredDate }} \n \n
\n \n
\n
\n
\n
\n \n\n \n\n \n \n
\n \n
\n
\n \n\n\n","\n \n \n
\n \n \n\n
\n \n
\n
\n \n\n\n","\n \n
\n \n
\n
\n \n
\n
\n \n \n \n \n \n \n
\n
\n \n
0 || prospectHunts.data.length > 0\"\n placement=\"left-start\"\n >\n \n \n
\n \n
\n View related Hunts\n
\n \n \n \n \n
\n
\n View a Hunt linked to this prospect:\n \n
\n
\n
\n \n \n
0 || prospectEligibleHunts.data.length > 0\n \"\n placement=\"left-start\"\n >\n \n \n \n Link to active Hunt\n
\n \n \n \n \n
\n
\n Select a Hunt\n for {{ companyName }}: \n \n
\n
\n
\n \n \n\n \n
\n \n \n
\n \n \n
0 ||\n usageFulfillingHuntIds.length > 0\n \"\n placement=\"left-start\"\n >\n \n \n
\n \n
\n View related Hunts\n
\n \n \n \n \n
\n
\n View a Hunt linked to this space usage:\n \n
\n
\n
\n \n \n
\n \n \n \n \n \n \n \n \n
0\"\n placement=\"left-start\"\n >\n \n \n \n Link to active Hunt\n
\n \n \n \n \n
\n
\n Select a Hunt\n for {{ companyName }}: \n \n
\n
\n
\n \n \n
0\"\n placement=\"left-start\"\n >\n \n \n \n Fulfill a Hunt\n
\n \n \n \n \n
\n
\n Select a Hunt\n for {{ companyName }}: \n \n
\n
\n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n
\n \n \n
\n \n\n\n","\n \n \n \n \n \n
\n \n
\n
\n
\n
\n
\n
\n {{ fetchCompanyId }}\n
\n
\n {{ _.capitalize(role) }}\n
\n
\n
\n
\n
\n\n
\n
\n \n \n \n \n\n \n \n \n \n\n
\n \n \n \n \n\n \n \n \n \n\n
\n \n \n \n \n\n \n \n \n \n
\n
\n\n
\n
\n \n \n Add contact \n \n \n \n \n\n
\n 0\">\n \n \n 0\">\n \n \n
\n
\n\n
\n
\n \n
\n
\n
\n \n \n\n
\n \n \n \n \n \n \n \n
\n
\n
\n \n \n\n\n","\n \n
\n
\n
\n
\n \n \n
\n \n Cancel \n \n Cancel \n \n\n \n\n \n \n \n Add loan \n \n Loan \n \n \n \n \n
\n\n \n
\n
\n {{ label }} \n being assumed \n
\n
\n \n \n \n \n\n \n \n \n \n
\n
\n Hide nested stack \n View nested stack \n \n
\n\n
\n \n
\n \n \n
\n Active/pending\n \n
Edit the deal below.
\n
\n 0 ||\n remainingOwnershipInterests.length > 0\n \"\n >\n \n\n \n \n \n
\n \n \n
No Owners \n
\n Rewind the timeline and add older deals.\n
\n
\n\n \n \n
\n\n \n
\n \n Cancel \n \n Cancel \n \n\n \n\n \n \n \n Add loan \n \n Loan \n \n \n \n \n
\n \n \n
\n
\n
\n \n\n\n","import { ref } from \"vue\";\nimport { defineStore, acceptHMRUpdate } from \"pinia\";\nimport _ from \"lodash\";\n\nexport const useDatabaseUpdatesChannelStore = defineStore(\n \"databaseUpdatesChannel\",\n () => {\n const DatabaseUpdatesChannel = ref(null);\n const databaseUpdatesChannelDataQueue = ref([]);\n\n function pushAndTrim(data) {\n databaseUpdatesChannelDataQueue.value.push(data);\n databaseUpdatesChannelDataQueue.value = _.takeRight(\n databaseUpdatesChannelDataQueue.value,\n 3\n );\n }\n\n return {\n DatabaseUpdatesChannel,\n databaseUpdatesChannelDataQueue,\n pushAndTrim,\n };\n }\n);\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useDatabaseUpdatesChannelStore, import.meta.hot)\n );\n}\n","\n \n
\n \n Open in Deal Builder\n \n \n View & Add Deals\n \n
\n
\n \n \n \n \n
\n \n\n\n","\n \n \n \n Capital Stack \n \n \n \n as of\n {{\n moment(asOfDate).format(\"MMM YYYY\")\n }} \n
\n \n \n Layers of funding ordered by their rights to the cash flow. \n \n\n \n \n \n \n\n\n","\n \n
\n\n
\n
\n \n \n \n \n \n \n \n \n \n Add {{ actorLabel }} \n \n \n \n \n \n \n \n \n
\n
\n \n\n\n","\n 0\">\n \n Add sublease \n \n Sublease \n \n\n \n \n \n \n \n\n\n","\n \n
\n
\n
\n
\n \n \n
\n \n Cancel \n \n Cancel \n \n\n \n\n \n \n \n Add sublease \n \n Sublease \n \n \n \n \n
\n \n
\n
\n \n
\n \n \n
\n Active/pending\n \n
\n Edit the availability below.\n
\n
\n 0 || remainingSpaceUsers.length > 0\n \"\n >\n \n\n \n \n \n
\n \n \n
\n No Space Users\n \n
\n Rewind the timeline and add older deals.\n
\n
\n\n \n \n
\n\n \n
\n \n Cancel \n \n Cancel \n \n\n \n\n \n \n \n Add sublease \n \n Sublease \n \n \n \n \n
\n \n \n
\n
\n \n\n\n","\n \n
\n \n View Space Hub\n \n
\n
\n \n \n
\n \n\n\n","\n \n \n \n Space Usage Stack \n \n \n \n as of\n {{\n moment(asOfDate).format(\"MMM YYYY\")\n }} \n
\n \n \n Contractual usages of space. \n \n\n \n \n \n \n\n\n","\n \n \n\n\n\n\n\n\n","\n \n
\n
\n {{ cardMonthYear }}\n
\n
\n \n\n\n","\n \n
\n
\n
\n
\n
\n
\n
\n Data Input \n Opportunity \n \n \n
\n {{ revenueSplitSummary }}\n
\n
\n {{ payloadItem.inputComplexity }} Complexity\n
\n
\n {{ payload.uses.map(({ name }) => name).join(\", \") }}\n
\n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n \n
\n {{ bundleDataField?.fieldContent?.name }}\n \n \n {{ cityStateFor(bundleDataField) }}\n \n \n {{ contactCompanies }}\n \n \n
\n
\n
\n \n {{ costDescription\n }}: \n
\n \n \n
\n
\n Help us populate this record. Contributors earn revenue.\n \n
\n \n
\n
\n
\n \n\n\n","\n \n
\n \n \n \n\n \n
\n \n \n \n \n \n \n \n
\n
\n \n \n
\n \n\n\n","\n \n \n \n \n
\n \n\n\n","import { ref } from \"vue\";\nimport { defineStore, acceptHMRUpdate } from \"pinia\";\nimport {\n StarIcon,\n NewspaperIcon,\n QuestionMarkCircleIcon,\n ChatBubbleLeftRightIcon,\n BoltIcon,\n} from \"@heroicons/vue/24/outline\";\nimport { useRouter } from \"vue-router\";\n\nexport const useMobileNavigationStore = defineStore(\"mobileNavigation\", () => {\n const selectedMobileTab = ref(\"News\");\n\n const router = useRouter();\n const mobilePages = ref([\n {\n name: \"News\",\n href: \"\",\n handler: () => {\n router.push({ path: \"/\" });\n selectedMobileTab.value = \"News\";\n },\n icon: NewspaperIcon,\n },\n {\n name: \"We\",\n href: \"\",\n handler: () => {\n router.push({ path: \"/\" });\n selectedMobileTab.value = \"We\";\n },\n icon: ChatBubbleLeftRightIcon,\n },\n {\n name: \"Tasks\",\n href: \"\",\n handler: () => {\n router.push({ path: \"/\" });\n selectedMobileTab.value = \"Tasks\";\n },\n icon: StarIcon,\n },\n {\n name: \"Add Data\",\n href: \"\",\n handler: () => router.push({ name: \"DataEasyButton\" }),\n icon: BoltIcon,\n },\n {\n name: \"Help\",\n href: \"\",\n handler: () => router.push({ name: \"HelpCenter\" }),\n icon: QuestionMarkCircleIcon,\n },\n ]);\n\n return {\n selectedMobileTab,\n mobilePages,\n };\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useMobileNavigationStore, import.meta.hot),\n );\n}\n","\n \n
\n
\n
\n
\n Task \n Due \n \n
\n {{ task?.name || \"Title\" }}\n
\n
\n Linked to: \n \n
\n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n
\n {{ availableValidationsCount }} Available \n Validations \n \n
\n ${{ _.round(availableValidationsRewards, 3) }}\n
\n
\n of potential rewards \n
\n
0\"\n class=\"mx-auto mt-10 max-w-sm flex justify-center\"\n >\n
\n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n
\n Shared \n Task List \n \n
\n {{ taskList?.name || \"List Name\" }}\n
\n
\n Shared by {{ sharedByName }}\n
\n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n
\n Team \n Joined \n \n
\n {{ card.taskName }}\n
\n
\n
\n
\n \n\n\n","import _ from \"lodash\";\n\nexport function standaloneGroupingData(dataFieldChange) {\n const changeType = dataFieldChange.changeType;\n const beforeField = dataFieldChange.before;\n const afterField = dataFieldChange.after;\n const primaryField = changeType === \"addition\" ? afterField : beforeField;\n\n return {\n contentType: primaryField.decoratingContentType,\n contentId: primaryField.decoratingContentId,\n };\n}\n\nexport function rollUpGroupingData(apiLookupKey) {\n const [keyType, joiningType, joiningId, decoratingType, name] = _.split(\n apiLookupKey,\n \"-\"\n );\n\n const keyData = {\n keyType,\n joiningType,\n joiningId,\n decoratingType,\n name: `${joiningType} ${joiningId}`,\n noIdName: `${joiningType}`,\n secondaryName: `${decoratingType} ${name}`,\n rawName: name,\n };\n\n return {\n contentType: keyData.joiningType,\n contentId: keyData.joiningId,\n };\n}\n\nexport function hasManyGroupingData(apiLookupKey) {\n const [keyType] = _.split(apiLookupKey, \"-\");\n switch (keyType) {\n case \"joiningContentFieldContent\": {\n return {\n contentType: hasManyKeyData(apiLookupKey).joiningType,\n contentId: hasManyKeyData(apiLookupKey).joiningId,\n };\n }\n case \"decoratingContentFieldContent\":\n case \"decoratingContentFieldContentWithSubType\": {\n return {\n contentType: hasManyKeyData(apiLookupKey).decoratingType,\n contentId: hasManyKeyData(apiLookupKey).decoratingId,\n };\n }\n default: {\n console.log(\"NO GROUPING DATA?\", apiLookupKey);\n return {\n contentType: null,\n contentId: null,\n };\n }\n }\n}\n\nfunction hasManyKeyData(apiLookupKey) {\n const [keyType, ...rest] = _.split(apiLookupKey, \"-\");\n\n switch (keyType) {\n case \"joiningContentFieldContent\": {\n const [joiningType, joiningId, fieldContentType] = rest;\n\n return {\n joiningType,\n joiningId,\n fieldContentType,\n name: `${joiningType} ${joiningId}`,\n noIdName: `${joiningType}`,\n secondaryName: `${fieldContentType}`,\n };\n }\n case \"decoratingContentFieldContent\": {\n const [decoratingType, decoratingId, fieldContentType] = rest;\n\n return {\n decoratingType,\n decoratingId,\n fieldContentType,\n name: `${decoratingType} ${decoratingId}`,\n noIdName: `${decoratingType}`,\n secondaryName: `${fieldContentType}`,\n };\n }\n case \"decoratingContentFieldContentWithSubType\": {\n const [\n decoratingType,\n decoratingId,\n fieldContentType,\n fieldContentSubType,\n ] = rest;\n\n return {\n decoratingType,\n decoratingId,\n fieldContentType,\n name: `${decoratingType} ${decoratingId}`,\n noIdName: `${decoratingType}`,\n secondaryName: `${fieldContentType} ${fieldContentSubType}`,\n };\n }\n default:\n return null;\n }\n}\n","\n \n
\n
\n
\n
\n Note on \n {{ contextLabel }} \n \n
\n \n
\n
\n Shared by {{ sharedByName }}\n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n
\n {{ card.contentsCount }} Safezone \n {{\n pluralize(\"Datapoint\", card.contentsCount)\n }} \n \n
\n Shared by {{ sharedByName }}\n
\n
\n \n Unlock card for details. \n
\n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n
\n
\n
\n
\n {{\n cardData.company.fieldContent.companyName\n }} \n \n
\n {{ cardData.hunt.fieldContent.name }}\n
\n
\n {{ cardData.huntType }}\n
\n
\n \n {{ dateLabel }} \n
\n
\n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n
\n
\n
\n
\n {{\n cardData.property.fieldContent.name\n }} \n \n
\n {{ cardData.investmentSummary.summary }}\n
\n
\n \n {{ dateLabel }} \n
\n
\n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n
\n
\n
\n
\n {{ userName }} \n \n
\n {{ cardData.availabilitySummary.summary }}\n
\n
\n \n {{ dateLabel }} \n · {{ cardData?.property.fieldContent.name }} \n
\n
\n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n
\n
\n
\n
\n {{\n cardData.property.fieldContent.name\n }} \n \n
\n {{ dateType }}\n
\n
\n {{ dateOutput }}\n
\n
\n
\n
\n
\n \n\n\n","\n 0\"\n class=\"h-full rounded-lg overflow-hidden\"\n >\n
\n
\n
\n
\n
\n
\n
\n {{\n cardTypeMetadata.headline1\n }} \n {{\n cardTypeMetadata.headline2\n }} \n \n
\n {{ dealActionAlias }}\n
\n
\n {{ huntType }}\n
\n
\n \n Unlock card for details. \n
\n
View Property \n
\n
\n
\n \n\n\n","import { ref } from \"vue\";\nimport { defineStore, acceptHMRUpdate } from \"pinia\";\nimport _ from \"lodash\";\n\nexport const useCollectibleCardsChannelStore = defineStore(\n \"collectibleCardsChannel\",\n () => {\n const CollectibleCardsChannel = ref(null);\n const collectibleCardsChannelDataQueue = ref([]);\n const pulseAvailableCards = ref(false);\n const pulseIntervalId = ref(null);\n\n function pushAndTrim(data) {\n collectibleCardsChannelDataQueue.value.push(data);\n collectibleCardsChannelDataQueue.value = _.takeRight(\n collectibleCardsChannelDataQueue.value,\n 3\n );\n }\n\n function resetPulse() {\n clearPulse();\n beginPulse();\n }\n\n function clearPulse() {\n pulseAvailableCards.value = false;\n if (pulseIntervalId.value) {\n clearInterval(pulseIntervalId.value);\n pulseIntervalId.value = null;\n }\n }\n\n function beginPulse() {\n if (!pulseIntervalId.value) {\n pulseIntervalId.value = setInterval(() => {\n logoCardPulse();\n }, 2100);\n }\n }\n\n function logoCardPulse() {\n pulseAvailableCards.value = true;\n\n setTimeout(() => {\n pulseAvailableCards.value = false;\n }, 1600);\n }\n\n return {\n CollectibleCardsChannel,\n collectibleCardsChannelDataQueue,\n pulseAvailableCards,\n pushAndTrim,\n clearPulse,\n beginPulse,\n resetPulse,\n };\n }\n);\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useCollectibleCardsChannelStore, import.meta.hot)\n );\n}\n","\n \n
\n
\n
\n
\n {{ successfulContributions?.attributions }} Successful \n Contributions \n \n
\n \n ${{ _.round(successfulContributions.rewards, 3) }}\n
\n \n you've earned (so far)! \n
\n \n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n
\n \n {{\n pluralize(\"Vote\", validationSubmissions.votes, true)\n }} \n On Your Edits \n \n \n {{ validationSubmissions.voteSummary.accepted }}\n
\n \n {{ validationSubmissions.voteSummary.rejected }}\n
\n \n {{ validationSubmissions.voteSummary.skipped }}\n
\n \n (so far) \n
\n \n
\n \n Votes \n Coming In \n \n \n For a batch of changes you voted on\n
\n \n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n
\n {{ staleContributionsCount }} Unpublished \n Contributions \n \n
\n Costing you: ${{ _.round(staleContributionsRewards.stakes, 3) }}\n
\n
\n Potential rewards: ${{\n _.round(staleContributionsRewards.rewards, 3)\n }} \n
\n
0\"\n class=\"mx-auto mt-10 max-w-sm flex justify-center\"\n >\n
\n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n
\n {{ contentAlias }} \n Key Date \n {{ timingAlias }} \n \n
\n {{ propertyField?.fieldContent?.name }}\n
\n
\n Can you assist?\n
\n
\n
\n
\n \n\n\n","\n \n \n\n\n","\n \n
\n
\n \n \n \n \n \n \n \n \n \n \n
\n
\n \n\n\n","\n \n
\n Welcome to Tower Hunt! Below is a summary of what we know about\n {{\n dataField.fieldContent?.name\n }} . To see all the details, please visit from a desktop browser.\n
\n
\n
\n\n \n \n Highlight \n A summary of important information. \n \n\n \n \n \n \n \n \n We don't have a highlight for this yet.\n \n
\n \n \n \n \n\n\n","\n \n
Add Property Use
\n
\n \n {{ option.name }}\n \n \n
\n
\n \n \n\n
\n \n \n \n \n \n \n \n
\n
\n \n\n\n","\n \n \n \n
Property Uses \n
\n\n
\n\n
\n
\n \n \n \n \n \n \n \n \n \n Add a use \n \n \n \n \n \n
\n
\n \n \n \n Uses \n How is the space used, now or in the future? \n \n\n \n \n\n \n\n \n
\n \n \n \n \n \n \n \n \n \n Add a use \n \n \n \n \n \n
\n \n \n \n \n\n\n","\n \n
\n \n
New room(s) \n
\n Choose the type of room and how many are in this layout.\n
\n
\n \n
\n
\n Room type \n \n \n {{ option.name }}\n \n \n
\n
\n
Custom room type \n
\n \n
\n
\n
\n \n
\n
\n Cancel\n \n
\n \n \n \n Save \n \n \n \n
\n
\n \n\n\n","\n \n
\n \n \n \n
\n {{ pluralize(roomType, roomFields.length, true) }}\n \n \n
\n
\n \n\n\n","\n \n \n Rooms \n Add rooms based upon the floor area use(s). \n \n\n \n \n\n \n
\n \n \n \n \n \n \n \n \n \n Add rooms \n \n \n \n \n \n
\n\n \n \n \n \n\n\n","\n \n
\n
\n Connect this floor area to a related condo or co-op.\n
\n
\n
\n
0\"\n class=\"flex flex-col space-y-2\"\n >\n
Linked Unit Rights: \n
\n \n \n \n \n \n
\n
\n
\n
\n No Linked Unit Rights\n \n
\n Link a condo or co-op to this floor area.\n
\n
\n
0\"\n class=\"flex flex-col space-y-2\"\n >\n Unlinked Unit Rights: \n \n \n
\n
\n
\n No Unlinked Unit Rights\n \n
\n Unit Rights for this floor area will appear here.\n
\n
\n
\n
\n \n\n\n","\n \n
\n
\n {{ _.startCase(_.toLower(label)) }}\n
\n
\n
\n \n {{ leadingAddOn }}\n \n
\n
\n
\n \n {{ trailingAddOn }}\n \n
\n
\n
\n
\n \n \n\n
\n \n \n \n \n \n \n \n
\n
\n\n
\n
\n {{ _.startCase(_.toLower(label)) }}\n \n \n \n \n \n\n
\n \n \n \n \n \n \n \n \n Add {{ label }} \n \n \n \n
\n\n
\n
\n \n \n \n \n \n \n \n \n \n Add {{ label }} \n \n \n \n \n \n
\n
\n \n\n\n","\n \n \n Sizes \n Add different floor area size measurements depending upon the\n use(s). \n \n\n \n \n \n \n \n \n \n\n\n","\n
\n \n\n\n","\n \n
\n
\n
\n
\n \n
\n
record?.name || record?.description\"\n data-test=\"content-location-search\"\n />\n \n \n \n
\n \n\n \n 0\">\n Places \n \n \n \n \n {{\n place.description\n }} \n \n \n \n \n \n\n \n
\n
No results found
\n
\n We couldn’t find anything with that term. Please try again.\n
\n
\n \n
\n
\n \n Reset \n \n
\n\n
\n
\n
\n
\n Cancel\n \n
\n \n \n \n Save \n \n \n \n
\n
\n \n\n\n","\n \n \n Location \n Show exactly where this {{ dataField.fieldContentType }} is in the\n world. \n \n\n \n \n \n \n\n \n
\n \n \n \n \n \n \n \n \n \n Add {{ dataField.fieldContentType }} location \n \n \n \n \n \n
\n \n \n \n\n\n","\n \n
\n
\n {{ headerLabel }}\n
\n
\n \n \n \n \n
\n
\n\n
\n \n Owners\n
\n 0\" class=\"space-y-2\">\n
\n
\n persistCompanies(proofCompanies, ownershipInterestDataField)\n \"\n @refetch=\"refetch\"\n @override-refetch=\"refetch\"\n />\n \n
Advisors \n \n \n \n
\n \n \n
\n \n
\n \n\n\n","\n \n \n Operational Control \n Who controls this {{ contentType }}, and which advisors are\n engaged? \n \n\n \n \n \n \n \n\n\n","\n \n
\n
\n \n
\n Target Occupancy Date\n \n \n \n \n \n \n
\n
\n \n\n\n","import { computed, nextTick, ref, watch } from \"vue\";\nimport { defineStore, acceptHMRUpdate } from \"pinia\";\nimport { currencyAmount } from \"@/assets/numberHelpers\";\nimport _ from \"lodash\";\nimport useTypes from \"@/assets/useTypes\";\nimport dateValid from \"@/assets/dateValid\";\nimport moment from \"moment\";\n\nexport const useOccupierSpaceDefinitionStore = defineStore(\n \"occupierSpaceDefinition\",\n () => {\n const selectedUse = ref(null);\n const officeUse = computed(() => _.find(useTypes, { name: \"Office\" }));\n const actionableUses = computed(() => {\n return useTypes.filter(({ value }) =>\n _.includes([\"Office\", \"Retail\", \"Industrial\", \"R&D\"], value),\n );\n });\n const displaySizeTypes = computed(() =>\n _.includes([\"Office\", \"R&D\"], selectedUse.value),\n );\n\n const sizeTypeDisplayable = ref(true);\n const selectedSizeType = ref({\n order: 1,\n name: \"Area\",\n value: \"area\",\n description: \"Square feet\",\n });\n const sizeTypes = ref([\n {\n order: 1,\n name: \"Area\",\n value: \"area\",\n description: \"Square feet\",\n },\n {\n order: 2,\n name: \"Headcount\",\n value: \"headCount\",\n description: \"Converts to SF\",\n },\n ]);\n const headCountToAreaAssumptions = ref({\n minAreaPerPerson: 200,\n maxAreaPerPerson: 230,\n densityPercentModifier: 5,\n });\n const displayHeadcountAssumptions = computed(\n () => selectedSizeType.value.name === \"Headcount\",\n );\n\n const phases = ref({\n 0: {\n minHeadcount: null,\n maxHeadcount: null,\n minArea: null,\n maxArea: null,\n },\n });\n function impliedPhaseArea(key) {\n const phase = getPhase(key);\n if (\n selectedSizeType.value.name === \"Headcount\" &&\n headCountToAreaAssumptions.value.minAreaPerPerson &&\n phase.minHeadcount &&\n headCountToAreaAssumptions.value.maxAreaPerPerson &&\n phase.maxHeadcount &&\n headCountToAreaAssumptions.value.densityPercentModifier &&\n headCountToAreaAssumptions.value.minAreaPerPerson <\n headCountToAreaAssumptions.value.maxAreaPerPerson &&\n phase.minHeadcount < phase.maxHeadcount &&\n headCountToAreaAssumptions.value.densityPercentModifier > 0\n ) {\n const toPercent = (n) => {\n return n / 100;\n };\n const lowEnd =\n headCountToAreaAssumptions.value.minAreaPerPerson *\n phase.minHeadcount *\n (1 -\n toPercent(headCountToAreaAssumptions.value.densityPercentModifier));\n const highEnd =\n headCountToAreaAssumptions.value.maxAreaPerPerson *\n phase.maxHeadcount *\n (1 +\n toPercent(headCountToAreaAssumptions.value.densityPercentModifier));\n\n return `${currencyAmount(lowEnd, 0, -3)}-${currencyAmount(\n highEnd,\n 0,\n -3,\n )} SF`;\n } else {\n return null;\n }\n }\n function getPhase(key) {\n return phases.value[key];\n }\n const maxPhase = computed(() => {\n const numKeys = _.keys(phases.value).map(_.toNumber);\n\n return _.max(numKeys);\n });\n function addPhase() {\n if (_.isNumber(maxPhase.value)) {\n const newPhaseKey = maxPhase.value + 1;\n phases.value[newPhaseKey] = {\n minHeadcount: null,\n maxHeadcount: null,\n minArea: null,\n maxArea: null,\n targetDate: null,\n };\n }\n }\n function removePhase(key) {\n delete phases.value[key];\n }\n function validPhase(phase, phaseKey) {\n const dateCheck =\n _.toNumber(phaseKey) === 0 ? true : dateValid(phase.targetDate);\n if (selectedSizeType.value.name === \"Area\") {\n return (\n phase.minArea &&\n phase.maxArea &&\n phase.minArea < phase.maxArea &&\n dateCheck\n );\n } else {\n return (\n phase.minHeadcount &&\n phase.maxHeadcount &&\n phase.minHeadcount < phase.maxHeadcount &&\n dateCheck\n );\n }\n }\n const validAssumptions = computed(() => {\n if (selectedSizeType.value.name === \"Headcount\") {\n return (\n headCountToAreaAssumptions.value.minAreaPerPerson &&\n headCountToAreaAssumptions.value.maxAreaPerPerson &&\n headCountToAreaAssumptions.value.densityPercentModifier &&\n headCountToAreaAssumptions.value.minAreaPerPerson <\n headCountToAreaAssumptions.value.maxAreaPerPerson &&\n headCountToAreaAssumptions.value.densityPercentModifier > 0\n );\n } else {\n return true;\n }\n });\n const complete = computed(() => {\n return (\n selectedUse.value &&\n _.every(phases.value, validPhase) &&\n validAssumptions.value\n );\n });\n\n watch(selectedSizeType, (val, oldVal) => {\n if (val?.name !== oldVal?.name) {\n resetPhases();\n }\n });\n\n async function resetPhases() {\n sizeTypeDisplayable.value = false;\n phases.value = {\n 0: {\n minHeadcount: null,\n maxHeadcount: null,\n minArea: null,\n maxArea: null,\n },\n };\n headCountToAreaAssumptions.value = {\n minAreaPerPerson: 200,\n maxAreaPerPerson: 230,\n densityPercentModifier: 5,\n };\n await nextTick();\n sizeTypeDisplayable.value = true;\n }\n\n function reset() {\n selectedUse.value = officeUse.value?.value || _.head(useTypes).value;\n selectedSizeType.value = {\n order: 1,\n name: \"Area\",\n value: \"area\",\n description: \"Square feet\",\n };\n resetPhases();\n }\n\n const savePayload = computed(() => {\n if (complete.value) {\n const structuredPhases = _.map(\n phases.value,\n function (phase, phaseKey) {\n const formattedDate = phase.targetDate\n ? moment(phase.targetDate).valueOf()\n : null;\n return _.merge({}, phase, {\n targetDate: formattedDate,\n phaseNumber: _.toNumber(phaseKey),\n });\n },\n );\n return {\n useType: selectedUse.value,\n phases: structuredPhases,\n assumptions: displayHeadcountAssumptions.value\n ? headCountToAreaAssumptions.value\n : null,\n };\n } else {\n return null;\n }\n });\n\n return {\n addPhase,\n removePhase,\n getPhase,\n reset,\n selectedUse,\n actionableUses,\n displaySizeTypes,\n selectedSizeType,\n sizeTypeDisplayable,\n sizeTypes,\n phases,\n impliedPhaseArea,\n complete,\n savePayload,\n headCountToAreaAssumptions,\n displayHeadcountAssumptions,\n };\n },\n);\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useOccupierSpaceDefinitionStore, import.meta.hot),\n );\n}\n","\n \n
\n
\n
{{ phaseLabel }}
\n
\n
\n {{ occupierSpaceStore.impliedPhaseArea(phaseKey) }}\n
\n
\n \n \n
\n
\n
\n
\n
\n
\n
Min. People \n
\n \n
\n
\n
\n
Max. People \n
\n \n
\n
\n
\n
Target Date \n
\n \n
\n
\n
\n
\n
\n \n\n\n","\n \n Sizing Method \n\n \n
\n \n \n \n {{ sizeType.name }} \n {{ sizeType.description }} \n \n \n \n \n
\n \n
\n \n \n\n\n","\n \n
\n Area Conversion Assumptions\n
\n
\n Convert to SF via a density range plus a % modifier.\n
\n
\n
\n \n\n\n","\n \n
New Space Definition
\n\n
\n
Property Use
\n
\n \n {{ option.name }}\n \n \n
\n\n
\n\n
\n
Phasing
\n
\n
\n \n \n \n \n \n \n \n \n Add phase \n \n \n \n
\n\n
\n\n
\n
\n \n \n
\n \n \n \n \n \n \n \n
\n
\n \n\n\n","\n 0\" class=\"flex flex-col space-y-2\">\n
\n Area Conversion Assumptions\n
\n
\n Convert to SF via a density range plus a % modifier.\n
\n
\n
\n \n\n\n","\n \n \n\n\n","\n \n
\n
\n \n \n
\n
\n
\n
\n
\n
Min. People \n
\n \n
\n
\n
\n
Max. People \n
\n \n
\n
\n
\n
Target Date \n
\n \n
\n
\n
\n
\n
\n \n\n\n","\n \n \n\n\n","\n \n
\n
\n \n
Space Needs \n
\n \n\n \n \n \n \n \n \n \n \n \n \n \n Add space requirement \n \n \n \n \n \n\n \n\n \n \n
\n \n
\n
\n \n\n\n","\n \n
\n
\n \n
\n Space Usages fulfilling this Hunt:\n \n
\n \n\n \n\n \n \n \n \n Link space usages resulting from this Hunt to indicate the\n space user is no longer in the market.\n \n
\n \n \n
\n\n \n
Shortlisted Spaces: \n
\n \n\n \n\n \n \n \n \n Link spaces being considered for this Hunt to keep track of\n the occupier's preferences.\n \n
\n \n \n
\n\n \n
\n Space Usages triggering this Hunt:\n \n
\n \n\n \n\n \n \n \n \n Link existing space usages to this Hunt to indicate a\n potential relocation.\n \n
\n \n \n
\n \n
\n
\n \n\n\n","\n \n \n Occupier Needs \n Hunting for space? These datapoints help describe what is\n needed. \n \n\n \n \n
\n \n \n\n
\n \n
\n
\n \n \n\n\n","\n \n \n Location \n Show exactly where this parcel is in the world. \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n Add parcel boundaries \n \n \n \n \n \n
\n \n \n \n\n\n","\n \n \n Target Markets \n Specify the potential locations for this hunt. \n \n\n \n
0\">\n \n
Map Preview \n
\n View all of the target markets at once.\n
\n
\n 0\"\n :map-id=\"`hunt-${hunt.id}-combined-parcels`\"\n :polygons=\"mappablePolygons\"\n class=\"my-3 h-56 w-full\"\n />\n \n \n \n \n Unlock markets to view map\n \n
\n \n \n
\n
Markets List \n
\n Define new market locations and location-specific contacts.\n
\n
\n
\n
\n
\n Markets\n
\n
\n
\n \n \n \n \n \n \n Add \n \n \n \n \n\n \n \n
Name
\n
\n
\n
\n \n \n\n
\n \n \n \n \n \n \n \n
\n
\n \n \n
\n
\n
\n
\n
\n \n \n\n\n","\n \n
\n
\n \n \n {{ option.name }}\n
\n \n \n\n
\n \n \n \n\n \n \n \n \n \n \n \n \n \n
\n\n
\n \n
\n \n \n \n \n
\n
\n \n \n \n \n\n
\n
\n\n \n
\n \n \n \n \n \n \n \n \n \n \n {{ fieldTrueLabel }} \n \n \n \n \n \n
· \n
\n \n \n \n \n \n \n \n \n \n \n {{ fieldFalseLabel }} \n \n \n \n \n \n
\n \n
\n \n\n\n","\n \n Investment Types \n \n \n
\n \n \n\n\n","\n \n \n\n\n","\n \n \n Investment Criteria \n What type of real estate investments are being hunted? \n \n\n \n \n \n \n
\n \n \n\n\n","\n \n \n
\n
\n View details for {{ photo.name }} \n \n
\n \n \n \n \n\n\n","\n \n 0\"\n visibility=\"safezone\"\n class=\"w-full\"\n >\n \n \n Add photos\n \n \n \n \n \n \n \n \n \n \n \n Add photos\n \n \n \n \n \n \n\n\n","import ComingSoon from \"@/components/ComingSoon.vue\";\nimport ContentAppearance from \"@/components/crowdsourcing/ContentAppearance.vue\";\nimport ContentContactInfo from \"@/components/crowdsourcing/ContentContactInfo.vue\";\nimport ContentCapitalStack from \"@/components/crowdsourcing/ContentCapitalStack.vue\";\nimport ContentSpaceUsageStack from \"@/components/crowdsourcing/ContentSpaceUsageStack.vue\";\nimport ContentFiles from \"@/components/crowdsourcing/ContentFiles.vue\";\nimport ContentHighlight from \"@/components/collectible-cards/ContentHighlight.vue\";\nimport ContentPlayers from \"@/components/crowdsourcing/ContentPlayers.vue\";\nimport ContentPolygons from \"@/components/crowdsourcing/ContentPolygons.vue\";\nimport ContentPropertyUses from \"@/components/crowdsourcing/ContentPropertyUses.vue\";\nimport ContentNotes from \"@/components/crowdsourcing/ContentNotes.vue\";\nimport ContentTiming from \"@/components/crowdsourcing/ContentTiming.vue\";\nimport FloorAreaLayoutPartitions from \"@/components/crowdsourcing/FloorAreaLayoutPartitions.vue\";\nimport FloorAreaLinkedUnitRights from \"@/components/crowdsourcing/FloorAreaLinkedUnitRights.vue\";\nimport FloorAreaSizes from \"@/components/crowdsourcing/FloorAreaSizes.vue\";\nimport LandCoveringPhysical from \"@/components/crowdsourcing/LandCoveringPhysical.vue\";\nimport LandCoveringLevelHeight from \"@/components/crowdsourcing/LandCoveringLevelHeight.vue\";\nimport ContentLocation from \"@/components/crowdsourcing/ContentLocation.vue\";\nimport OperationalControllingAssetContacts from \"@/components/we/OperationalControllingAssetContacts.vue\";\nimport OccupierNeeds from \"@/components/crowdsourcing/OccupierNeeds.vue\";\nimport ParcelLocation from \"@/components/crowdsourcing/ParcelLocation.vue\";\nimport HuntLocations from \"@/components/crowdsourcing/HuntLocations.vue\";\nimport HuntInvestmentFilters from \"@/components/crowdsourcing/HuntInvestmentFilters.vue\";\nimport PhotosList from \"@/components/crowdsourcing/PhotosList.vue\";\nimport PropertyRightSize from \"@/components/crowdsourcing/PropertyRightSize.vue\";\nimport { markRaw } from \"vue\";\nimport _ from \"lodash\";\n\nexport function initialSelectedTabFor(dataField) {\n switch (_.get(dataField, \"fieldContentType\")) {\n case \"PropertyRight\": {\n if (\n _.includes(\n [\n \"Fee simple\",\n \"fee_simple\",\n \"Leasehold\",\n \"leasehold\",\n \"Condominium\",\n \"condominium\",\n \"Co-op\",\n \"co_op\",\n ],\n _.get(dataField, \"fieldContent.type\"),\n )\n ) {\n return _.get(rawTabs, \"capitalStack\");\n } else {\n return _.get(rawTabs, \"appearance\");\n }\n }\n case \"LandCovering\":\n case \"LandCoveringGrouping\":\n case \"LandCoveringLevel\":\n case \"LandCoveringDiagramVerticalGrouping\":\n case \"FloorAreaLayout\":\n case \"PropertyEnhancement\":\n return _.get(rawTabs, \"appearance\");\n case \"FloorArea\":\n return _.get(rawTabs, \"uses\");\n case \"CompanyInvolvement\":\n case \"Property\":\n case \"Company\":\n case \"Contact\":\n case \"Hunt\":\n return _.get(rawTabs, \"highlight\");\n default:\n return _.get(rawTabs, \"comingSoon\");\n }\n}\n\nexport function tabsFor(dataField) {\n switch (_.get(dataField, \"fieldContentType\")) {\n case \"PropertyRight\":\n if (\n _.includes(\n [\"Fee simple\", \"fee_simple\"],\n _.get(dataField, \"fieldContent.type\"),\n )\n ) {\n return [\n _.get(rawTabs, \"capitalStack\"),\n _.get(rawTabs, \"operationalControl\"),\n _.get(rawTabs, \"parcelLocation\"),\n _.get(rawTabs, \"propertyRightSize\"),\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"timing\"),\n _.get(rawTabs, \"notes\"),\n _.get(rawTabs, \"files\"),\n _.get(rawTabs, \"photos\"),\n ];\n } else if (\n _.includes(\n [\n \"Leasehold\",\n \"leasehold\",\n \"Condominium\",\n \"condominium\",\n \"Co-op\",\n \"co_op\",\n ],\n _.get(dataField, \"fieldContent.type\"),\n )\n ) {\n return [\n _.get(rawTabs, \"capitalStack\"),\n _.get(rawTabs, \"operationalControl\"),\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"timing\"),\n _.get(rawTabs, \"notes\"),\n _.get(rawTabs, \"files\"),\n _.get(rawTabs, \"photos\"),\n ];\n } else if (\n _.includes(\n [\"Unused Development Rights\"],\n _.get(dataField, \"fieldContent.type\"),\n )\n ) {\n return [\n _.get(rawTabs, \"capitalStack\"),\n _.get(rawTabs, \"operationalControl\"),\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"timing\"),\n _.get(rawTabs, \"notes\"),\n _.get(rawTabs, \"files\"),\n ];\n } else {\n return [\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"notes\"),\n _.get(rawTabs, \"files\"),\n ];\n }\n case \"LandCovering\":\n if (_.get(dataField, \"fieldContentSubType\") === \"surface_structure\") {\n return [\n _.get(rawTabs, \"operationalControl\"),\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"timing\"),\n _.get(rawTabs, \"location\"),\n _.get(rawTabs, \"notes\"),\n _.get(rawTabs, \"files\"),\n _.get(rawTabs, \"photos\"),\n ];\n } else {\n return [\n _.get(rawTabs, \"operationalControl\"),\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"timing\"),\n _.get(rawTabs, \"location\"),\n _.get(rawTabs, \"physical\"),\n _.get(rawTabs, \"notes\"),\n _.get(rawTabs, \"files\"),\n _.get(rawTabs, \"photos\"),\n ];\n }\n case \"LandCoveringLevel\":\n return [\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"levelHeight\"),\n _.get(rawTabs, \"notes\"),\n ];\n case \"LandCoveringDiagramVerticalGrouping\":\n return [_.get(rawTabs, \"appearance\"), _.get(rawTabs, \"notes\")];\n case \"LandCoveringGrouping\":\n return [\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"notes\"),\n _.get(rawTabs, \"files\"),\n _.get(rawTabs, \"photos\"),\n ];\n case \"PropertyEnhancement\":\n return [\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"timing\"),\n _.get(rawTabs, \"spaceUsageStack\"),\n _.get(rawTabs, \"notes\"),\n _.get(rawTabs, \"files\"),\n _.get(rawTabs, \"photos\"),\n ];\n case \"Property\":\n return [\n _.get(rawTabs, \"highlight\"),\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"location\"),\n _.get(rawTabs, \"notes\"),\n _.get(rawTabs, \"files\"),\n _.get(rawTabs, \"photos\"),\n ];\n case \"FloorArea\":\n return [\n _.get(rawTabs, \"uses\"),\n _.get(rawTabs, \"sizes\"),\n _.get(rawTabs, \"operationalControl\"),\n _.get(rawTabs, \"spaceUsageStack\"),\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"timing\"),\n _.get(rawTabs, \"linkedPropertyRights\"),\n _.get(rawTabs, \"notes\"),\n _.get(rawTabs, \"files\"),\n _.get(rawTabs, \"photos\"),\n ];\n case \"FloorAreaLayout\":\n return [\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"layoutPartitions\"),\n _.get(rawTabs, \"timing\"),\n _.get(rawTabs, \"notes\"),\n _.get(rawTabs, \"files\"),\n _.get(rawTabs, \"photos\"),\n ];\n case \"LayoutPartition\":\n return [\n _.get(rawTabs, \"sizes\"),\n _.get(rawTabs, \"spaceUsageStack\"),\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"notes\"),\n _.get(rawTabs, \"files\"),\n ];\n case \"Company\":\n return [\n _.get(rawTabs, \"highlight\"),\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"notes\"),\n _.get(rawTabs, \"files\"),\n _.get(rawTabs, \"photos\"),\n ];\n case \"Contact\":\n return [\n _.get(rawTabs, \"highlight\"),\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"contactInfo\"),\n _.get(rawTabs, \"notes\"),\n _.get(rawTabs, \"files\"),\n _.get(rawTabs, \"photos\"),\n ];\n case \"CompanyInvolvement\": {\n switch (_.get(dataField, \"fieldContentSubType\")) {\n case \"operational_advisor\":\n return [\n _.get(rawTabs, \"highlight\"),\n _.get(rawTabs, \"timing\"),\n _.get(rawTabs, \"notes\"),\n ];\n default: {\n if (\n _.includes(\n [\"Hunt\", \"HuntGeographyIntent\"],\n _.get(dataField, \"decoratingContentType\"),\n )\n ) {\n const thirdParty =\n dataField.fieldContent?.name !==\n dataField.fieldContent?.huntClient?.name;\n return _.compact([\n _.get(rawTabs, \"highlight\"),\n thirdParty ? _.get(rawTabs, \"timing\") : null,\n dataField.decoratingContentType === \"Hunt\"\n ? _.get(rawTabs, \"huntLocations\")\n : _.get(rawTabs, \"mapRegions\"),\n _.get(rawTabs, \"notes\"),\n ]);\n } else {\n return [_.get(rawTabs, \"highlight\"), _.get(rawTabs, \"notes\")];\n }\n }\n }\n }\n case \"Hunt\":\n return [\n _.get(rawTabs, \"highlight\"),\n _.get(rawTabs, \"huntLocations\"),\n _.get(rawTabs, \"timing\"),\n _.get(rawTabs, \"players\"),\n _.get(rawTabs, \"occupier\"),\n _.get(rawTabs, \"huntInvestmentCriteria\"),\n _.get(rawTabs, \"appearance\"),\n _.get(rawTabs, \"notes\"),\n ];\n default:\n return [_.get(rawTabs, \"comingSoon\")];\n }\n}\n\nexport function tabPropertiesFor(dataField) {\n return {\n dataField,\n contentDataField: dataField,\n focus: false,\n context: \"detailsTab\",\n };\n}\n\nexport const rawTabs = {\n appearance: {\n name: \"Appearance\",\n tabQuery: \"Appearance\",\n href: \"\",\n svgPaths: [\n \"M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2\",\n ],\n component: markRaw(ContentAppearance),\n },\n contactInfo: {\n name: \"Contact Info\",\n tabQuery: \"ContactInfo\",\n href: \"\",\n svgPaths: [\n \"M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 002.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 01-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 00-1.091-.852H4.5A2.25 2.25 0 002.25 4.5v2.25z\",\n ],\n component: markRaw(ContentContactInfo),\n },\n capitalStack: {\n name: \"Capital Stack\",\n tabQuery: \"CapitalStack\",\n href: \"\",\n svgPaths: [\"M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4\"],\n component: markRaw(ContentCapitalStack),\n },\n spaceUsageStack: {\n name: \"Space Usages\",\n tabQuery: \"SpaceUsageStack\",\n href: \"\",\n svgPaths: [\n \"m21 7.5-9-5.25L3 7.5m18 0-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9\",\n ],\n component: markRaw(ContentSpaceUsageStack),\n },\n files: {\n name: \"Files\",\n tabQuery: \"Files\",\n href: \"\",\n svgPaths: [\n \"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z\",\n ],\n component: markRaw(ContentFiles),\n },\n notes: {\n name: \"Notes\",\n tabQuery: \"Notes\",\n href: \"\",\n svgPaths: [\n \"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z\",\n ],\n component: markRaw(ContentNotes),\n },\n photos: {\n name: \"Photos\",\n tabQuery: \"Photos\",\n href: \"\",\n svgPaths: [\n \"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z\",\n ],\n component: markRaw(PhotosList),\n },\n layoutPartitions: {\n name: \"Rooms\",\n tabQuery: \"Rooms\",\n href: \"\",\n svgPaths: [\n \"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4\",\n ],\n component: markRaw(FloorAreaLayoutPartitions),\n },\n location: {\n name: \"Location\",\n tabQuery: \"Location\",\n href: \"\",\n svgPaths: [\n \"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z\",\n ],\n component: markRaw(ContentLocation),\n },\n parcelLocation: {\n name: \"Location\",\n tabQuery: \"Location\",\n href: \"\",\n svgPaths: [\n \"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z\",\n ],\n component: markRaw(ParcelLocation),\n },\n linkedPropertyRights: {\n name: \"Linked Unit Rights\",\n tabQuery: \"LinkedUnitRights\",\n href: \"\",\n svgPaths: [\n \"m21 7.5-2.25-1.313M21 7.5v2.25m0-2.25-2.25 1.313M3 7.5l2.25-1.313M3 7.5l2.25 1.313M3 7.5v2.25m9 3 2.25-1.313M12 12.75l-2.25-1.313M12 12.75V15m0 6.75 2.25-1.313M12 21.75V19.5m0 2.25-2.25-1.313m0-16.875L12 2.25l2.25 1.313M21 14.25v2.25l-2.25 1.313m-13.5 0L3 16.5v-2.25\",\n ],\n component: markRaw(FloorAreaLinkedUnitRights),\n },\n propertyRightSize: {\n name: \"Size\",\n tabQuery: \"Size\",\n href: \"\",\n svgPaths: [\n \"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4\",\n ],\n component: markRaw(PropertyRightSize),\n },\n physical: {\n name: \"Physical\",\n tabQuery: \"Physical\",\n href: \"\",\n svgPaths: [\n \"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4\",\n ],\n component: markRaw(LandCoveringPhysical),\n },\n levelHeight: {\n name: \"Height\",\n tabQuery: \"Height\",\n href: \"\",\n svgPaths: [\n \"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4\",\n ],\n component: markRaw(LandCoveringLevelHeight),\n },\n sizes: {\n name: \"Sizes\",\n tabQuery: \"Sizes\",\n href: \"\",\n svgPaths: [\n \"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z\",\n ],\n component: markRaw(FloorAreaSizes),\n },\n huntInvestmentCriteria: {\n name: \"Investment Criteria\",\n tabQuery: \"InvestmentCriteria\",\n href: \"\",\n svgPaths: [\n \"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5\",\n ],\n component: markRaw(HuntInvestmentFilters),\n },\n huntLocations: {\n name: \"Target Markets\",\n tabQuery: \"TargetMarkets\",\n href: \"\",\n svgPaths: [\n \"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z\",\n ],\n component: markRaw(HuntLocations),\n },\n mapRegions: {\n name: \"Map Regions\",\n tabQuery: \"MapRegions\",\n href: \"\",\n svgPaths: [\n \"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z\",\n ],\n component: markRaw(ContentPolygons),\n },\n players: {\n name: \"Players\",\n tabQuery: \"Players\",\n href: \"\",\n svgPaths: [\n \"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z\",\n ],\n component: markRaw(ContentPlayers),\n },\n occupier: {\n name: \"Occupier Needs\",\n tabQuery: \"Occupier\",\n href: \"\",\n svgPaths: [\n \"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3\",\n ],\n component: markRaw(OccupierNeeds),\n },\n uses: {\n name: \"Uses\",\n tabQuery: \"Uses\",\n href: \"\",\n svgPaths: [\n \"M7 11.5V14m0-2.5v-6a1.5 1.5 0 113 0m-3 6a1.5 1.5 0 00-3 0v2a7.5 7.5 0 0015 0v-5a1.5 1.5 0 00-3 0m-6-3V11m0-5.5v-1a1.5 1.5 0 013 0v1m0 0V11m0-5.5a1.5 1.5 0 013 0v3m0 0V11\",\n ],\n component: markRaw(ContentPropertyUses),\n },\n timing: {\n name: \"Timing\",\n tabQuery: \"Timing\",\n href: \"\",\n svgPaths: [\"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z\"],\n component: markRaw(ContentTiming),\n },\n highlight: {\n name: \"Highlight\",\n tabQuery: \"Highlight\",\n href: \"\",\n svgPaths: [\n \"M3 3v1.5M3 21v-6m0 0l2.77-.693a9 9 0 016.208.682l.108.054a9 9 0 006.086.71l3.114-.732a48.524 48.524 0 01-.005-10.499l-3.11.732a9 9 0 01-6.085-.711l-.108-.054a9 9 0 00-6.208-.682L3 4.5M3 15V4.5\",\n ],\n component: markRaw(ContentHighlight),\n },\n operationalControl: {\n name: \"Operational Control\",\n tabQuery: \"OperationalControl\",\n href: \"\",\n svgPaths: [\n \"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z\",\n ],\n component: markRaw(OperationalControllingAssetContacts),\n },\n comingSoon: {\n name: \"Coming Soon\",\n tabQuery: \"ComingSoon\",\n href: \"\",\n svgPaths: [\n \"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z\",\n ],\n component: markRaw(ComingSoon),\n },\n};\n","\n \n \n for \n \n \n at \n \n \n
\n \n \n
\n \n \n\n
\n \n
\n
\n \n \n\n\n","import { useDealBuilderStore } from \"@/stores/dealBuilder\";\nimport { useSpaceUsageBuilderStore } from \"@/stores/spaceUsageBuilder\";\nimport { useWorkspaceLayoutStore } from \"@/stores/workspaceLayout\";\nimport { ref, computed } from \"vue\";\nimport { defineStore, storeToRefs, acceptHMRUpdate } from \"pinia\";\nimport { useRouter, useRoute } from \"vue-router\";\nimport { useUserStore } from \"@/stores/user\";\nimport { useMainMapStore } from \"@/stores/mainMap\";\nimport { usePropertyDiagramStore } from \"@/stores/propertyDiagram\";\nimport { useCompanyDetailStore } from \"@/stores/companyDetail\";\nimport { useContactDetailStore } from \"@/stores/contactDetail\";\nimport { useAnalyzePanelStore } from \"@/stores/analyzePanel\";\nimport { useCrowdsourcedChangeGroupStore } from \"@/stores/crowdsourcedChangeGroup\";\nimport DataFieldDetails from \"@/components/crowdsourcing/DataFieldDetails.vue\";\nimport _ from \"lodash\";\n\nexport const useSecondaryPanelStore = defineStore(\"secondaryPanel\", () => {\n const layoutStore = useWorkspaceLayoutStore();\n const { workspaceResized, workspaceLayout, isDesktop } =\n storeToRefs(layoutStore);\n const userStore = useUserStore();\n const { signedIn } = storeToRefs(userStore);\n const propertyDiagramStore = usePropertyDiagramStore();\n const { propertyIdParam } = storeToRefs(propertyDiagramStore);\n const companyDetailStore = useCompanyDetailStore();\n const { companyIdParam } = storeToRefs(companyDetailStore);\n const contactDetailStore = useContactDetailStore();\n const { contactIdParam } = storeToRefs(contactDetailStore);\n const analyzePanelStore = useAnalyzePanelStore();\n const { analyzeDisplayable } = storeToRefs(analyzePanelStore);\n const dealBuilderStore = useDealBuilderStore();\n const { dealBuilder } = storeToRefs(dealBuilderStore);\n const spaceUsageBuilderStore = useSpaceUsageBuilderStore();\n const { spaceUsageBuilder } = storeToRefs(spaceUsageBuilderStore);\n const changeGroupStore = useCrowdsourcedChangeGroupStore();\n const { existingChangeGroupId } = storeToRefs(changeGroupStore);\n const mapStore = useMainMapStore();\n const { map } = storeToRefs(mapStore);\n const router = useRouter();\n const route = useRoute();\n const query = computed(() => route.query);\n const verticalTab = computed(() => _.get(query.value, \"verticalTab\"));\n\n const secondaryPanelTabs = [\n {\n name: \"We\",\n tabQuery: \"We\",\n href: \"\",\n },\n {\n name: \"Me\",\n tabQuery: \"Me\",\n href: \"\",\n },\n ];\n const selectedSecondaryPanelTab = ref({\n name: \"We\",\n tabQuery: \"We\",\n href: \"\",\n });\n const validationsActive = ref(false);\n const myAccountActive = ref(false);\n const authenticateActive = ref(false);\n const helpActive = ref(false);\n const safezoneActive = computed(\n () =>\n selectedSecondaryPanelTab.value.name === \"Me\" &&\n verticalTab.value === \"Safezone\",\n );\n const secondaryPanelTypedTabs = computed(() => {\n return _.compact(\n _.concat(\n secondaryPanelTabs,\n authenticateTab.value,\n myAccountTab.value,\n validationsTab.value,\n analyzeTab.value,\n dealBuilderTab.value,\n spaceUsageBuilderTab.value,\n detailsTab.value,\n helpTab.value,\n ),\n );\n });\n const helpTab = computed(() => {\n if (helpActive.value) {\n return [{ name: \"Help\", tabQuery: \"Help\", href: \"\" }];\n } else {\n return null;\n }\n });\n const dealBuilderTab = computed(() => {\n if (dealBuilder.value) {\n return [{ name: \"Deal Hub\", tabQuery: \"Deals\", href: \"\" }];\n } else {\n return null;\n }\n });\n const spaceUsageBuilderTab = computed(() => {\n if (spaceUsageBuilder.value) {\n return [{ name: \"Space Hub\", tabQuery: \"Spaces\", href: \"\" }];\n } else {\n return null;\n }\n });\n const detailsTab = computed(() => {\n if (secondaryPanelDetailsComponent.value) {\n return [{ name: \"Details\", tabQuery: \"Details\", href: \"\" }];\n } else {\n return null;\n }\n });\n const validationsTab = computed(() => {\n if (validationsActive.value) {\n return [{ name: \"Validations\", tabQuery: \"Validations\", href: \"\" }];\n } else {\n return null;\n }\n });\n const myAccountTab = computed(() => {\n if (myAccountActive.value) {\n return [{ name: \"My Account\", tabQuery: \"Account\", href: \"\" }];\n } else {\n return null;\n }\n });\n const authenticateTab = computed(() => {\n if (authenticateActive.value && !signedIn.value) {\n return [{ name: \"Sign in\", tabQuery: \"Authenticate\", href: \"\" }];\n } else {\n return null;\n }\n });\n const analyzeTab = computed(() => {\n if (analyzeDisplayable.value) {\n return [{ name: \"Analyze\", tabQuery: \"Analyze\", href: \"\" }];\n } else {\n return null;\n }\n });\n const secondaryPanelDetailsComponent = computed(() => {\n if (propertyIdParam.value || companyIdParam.value || contactIdParam.value) {\n return DataFieldDetails;\n } else {\n return null;\n }\n });\n function closeValidations() {\n if (validationsActive.value) {\n validationsActive.value = false;\n existingChangeGroupId.value = null;\n revertPanel();\n }\n }\n function setSecondaryPanelWidth(columns = \"3fr 10px 450px\") {\n if (workspaceLayout.value === \"sideBySide\") {\n const bounds = map.value?.getBounds();\n document.getElementById(\"workspace-shell-grid-container\").style[\n \"grid-template-columns\"\n ] = columns;\n\n workspaceResized.value = bounds;\n }\n }\n function setAuthenticate(val = false) {\n if (!signedIn.value) {\n authenticateActive.value = val;\n } else {\n authenticateActive.value = false;\n }\n\n router.push({\n name: route.name,\n query: {\n ...route.query,\n teamInvitationToken: undefined,\n userInvitationToken: undefined,\n },\n });\n }\n function revertPanel() {\n setTimeout(() => {\n setSecondaryPanelWidth();\n }, 250);\n\n const needsTabRedirect = !_.includes(\n [\"Me\", \"We\"],\n _.get(selectedSecondaryPanelTab.value, \"name\"),\n );\n\n if (needsTabRedirect) {\n setQueryFromTab({\n name: \"Me\",\n tabQuery: \"Me\",\n href: \"\",\n });\n }\n }\n\n function setQueryFromTab(newTab) {\n if (isDesktop.value) {\n router.push({\n name: route.name,\n query: {\n ...route.query,\n horizontalTab: newTab.tabQuery,\n verticalTab: undefined,\n },\n });\n }\n }\n\n function setTabsFromQuery() {\n const { horizontalTab } = query.value;\n if (isDesktop && horizontalTab) {\n switch (horizontalTab) {\n case \"Authenticate\":\n setAuthenticate(true);\n break;\n case \"Account\":\n myAccountActive.value = true;\n break;\n case \"Validations\":\n validationsActive.value = true;\n break;\n case \"Help\":\n helpActive.value = true;\n break;\n case \"Me\":\n case \"We\":\n case \"Deals\":\n case \"Spaces\":\n case \"Details\":\n default:\n }\n\n activateHorizontalTab(horizontalTab);\n }\n }\n\n function activateHorizontalTab(tabQuery) {\n const newTab = _.find(secondaryPanelTypedTabs.value, {\n tabQuery,\n });\n selectedSecondaryPanelTab.value = newTab;\n if (workspaceLayout.value === \"fullScreen\")\n layoutStore.matchLayoutToScreen();\n }\n\n function promptToRegister() {\n if (isDesktop.value) {\n setAuthenticate({ name: \"Register\" });\n router.push({\n name: route.name,\n query: {\n ...route.query,\n horizontalTab: \"Authenticate\",\n verticalTab: \"Register\",\n },\n });\n } else {\n router.push({\n name: \"Register\",\n query: {\n teamInvitationToken: route.query.teamInvitationToken,\n userInvitationToken: route.query.userInvitationToken,\n easyDataInputJobInvitationToken:\n route.query.easyDataInputJobInvitationToken,\n },\n });\n }\n }\n\n return {\n selectedSecondaryPanelTab,\n validationsActive,\n safezoneActive,\n myAccountActive,\n authenticateActive,\n helpActive,\n secondaryPanelDetailsComponent,\n secondaryPanelTypedTabs,\n setSecondaryPanelWidth,\n setAuthenticate,\n revertPanel,\n setTabsFromQuery,\n promptToRegister,\n closeValidations,\n };\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useSecondaryPanelStore, import.meta.hot),\n );\n}\n","import { computed, ref } from \"vue\";\nimport { useUserStore } from \"@/stores/user\";\nimport { useSecondaryPanelStore } from \"@/stores/secondaryPanel\";\nimport { usePropertyDiagramStore } from \"@/stores/propertyDiagram\";\nimport { usePropertyUsersChannelsStore } from \"@/stores/propertyUsersChannels\";\nimport { useModalStore } from \"@/stores/modal\";\nimport { useUnlockerStore } from \"@/stores/unlocker\";\nimport { defineStore, storeToRefs, acceptHMRUpdate } from \"pinia\";\nimport subscribeInterceptor from \"@/components/crowdsourcing/subscribeInterceptor\";\nimport api from \"@/router/api\";\nimport _ from \"lodash\";\n\nexport const useCrowdsourcedChangeGroupStore = defineStore(\n \"changeGroup\",\n () => {\n const crowdsourcedChangeGroup = ref(null);\n const existingChangeGroupId = ref(null);\n const originatingData = ref(false);\n const changeGroupId = computed(() =>\n _.get(crowdsourcedChangeGroup.value, \"changeGroupId\"),\n );\n const userStore = useUserStore();\n const { signedIn, emailUnverified } = storeToRefs(userStore);\n const secondaryPanelStore = useSecondaryPanelStore();\n const modalStore = useModalStore();\n const { modalPayload } = storeToRefs(modalStore);\n const unlockerStore = useUnlockerStore();\n const { upgradeSuccessful } = storeToRefs(unlockerStore);\n const propertyUsersChannelStore = usePropertyUsersChannelsStore();\n const { propertyChannelSubscriptions } = storeToRefs(\n propertyUsersChannelStore,\n );\n\n async function manageCrowdsourcedChangeGroup(json) {\n return new Promise((resolve) => {\n if (!crowdsourcedChangeGroup.value && json.data.changeGroupId) {\n crowdsourcedChangeGroup.value = {\n changeGroupId: json.data.changeGroupId,\n };\n\n setTimeout(() => {\n resolve();\n }, 250);\n } else {\n resolve();\n }\n });\n }\n\n function reportFieldsToPropertyUsersChannel(json, propertyId) {\n let channel = null;\n if (propertyId) {\n const subscription = propertyChannelSubscriptions.value?.[propertyId];\n\n if (subscription) {\n channel = propertyChannelSubscriptions.value[propertyId].channel;\n channel.perform(\"origination_successful\", {\n propertyId,\n originationJson: json,\n });\n }\n }\n }\n\n async function dismissData({\n dataFieldId,\n byUser = true,\n isInner = false,\n successCallback = async (json) => {\n await manageCrowdsourcedChangeGroup(json);\n },\n }) {\n const failureCallback = async () => {\n console.log(\"Unstaked dismissal\");\n };\n\n const apiRequestFunc = () =>\n api.post(`dismiss_data_field`, {\n dataFieldId,\n isInner,\n byUser,\n changeGroupId: changeGroupId.value,\n });\n\n const result = await originateData(\n apiRequestFunc,\n successCallback,\n failureCallback,\n );\n\n originatingData.value = false;\n\n return result;\n }\n\n async function originateData(\n apiRequestFunc,\n successCallback = async () => {},\n failureCallback = async () => {},\n mapSignedIn,\n ) {\n originatingData.value = true;\n const propertyDiagramStore = usePropertyDiagramStore();\n const { propertyDiagramSelectedPropertyId } =\n storeToRefs(propertyDiagramStore);\n console.log(\"originate\", propertyDiagramSelectedPropertyId.value);\n\n if (emailUnverified.value) {\n userStore.promptToVerify();\n await failureCallback();\n originatingData.value = false;\n } else if (signedIn.value || mapSignedIn) {\n const responseHandler = async (json) => {\n const staked = _.includes(json.data.stakeStatus, \"staked\");\n if (staked || upgradeSuccessful.value) {\n await manageCrowdsourcedChangeGroup(json);\n reportFieldsToPropertyUsersChannel(\n json,\n propertyDiagramSelectedPropertyId.value,\n );\n await successCallback(json);\n } else if (json.data.stakeStatus === null) {\n console.log(\"null stakeStatus: dismissal of rejected field\");\n await successCallback(json);\n } else if (json.data.proofStatus) {\n console.log(\"proof status\", json.data.proofStatus);\n await successCallback(json);\n } else {\n await failureCallback(json);\n }\n };\n\n return subscribeInterceptor({\n apiRequestFunc,\n successCallback: responseHandler,\n failureCallback,\n modalPayloadRef: modalPayload,\n upgradeSuccessfulRef: upgradeSuccessful,\n afterSubscribe: \"successCallback\",\n context: \"originating\",\n originatingDataRef: originatingData,\n });\n } else {\n secondaryPanelStore.promptToRegister();\n await failureCallback();\n originatingData.value = false;\n }\n }\n\n return {\n changeGroupId,\n crowdsourcedChangeGroup,\n existingChangeGroupId,\n originatingData,\n manageCrowdsourcedChangeGroup,\n originateData,\n dismissData,\n };\n },\n);\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useCrowdsourcedChangeGroupStore, import.meta.hot),\n );\n}\n","import { computed, ref, watch, nextTick, markRaw } from \"vue\";\nimport { useCrowdsourcedChangeGroupStore } from \"@/stores/crowdsourcedChangeGroup\";\nimport { useTimeTravelStore } from \"@/stores/timeTravel\";\nimport { usePropertyDiagramStore } from \"@/stores/propertyDiagram\";\nimport { useCalculationFieldsStore } from \"@/stores/calculationFields\";\nimport { useModalStore } from \"@/stores/modal\";\nimport { useUnlockerStore } from \"@/stores/unlocker\";\nimport { useWorkspaceLayoutStore } from \"@/stores/workspaceLayout\";\nimport { useNotificationsStore } from \"@/stores/notifications\";\nimport { useDataFieldLoadingStore } from \"@/stores/dataFieldLoadingManagement\";\nimport { defineStore, storeToRefs, acceptHMRUpdate } from \"pinia\";\nimport {\n localCapitalProviders,\n matchingInvestmentGroup,\n providersFetchRequestKey,\n awardedProvidersFetchRequestKey,\n} from \"@/assets/investmentHelpers\";\nimport {\n awardable,\n mustBeClosed,\n unknownSupplySide,\n contentType,\n contentId,\n existingContentType,\n existingContentId,\n groupId,\n fetchMilliseconds,\n} from \"@/assets/transactionHelpers\";\nimport decoratingAndFieldKey from \"@/components/crowdsourcing/decoratingAndFieldKey\";\nimport unlockableInnerContent from \"@/components/crowdsourcing/unlockableInnerContent\";\nimport subscribeInterceptor from \"@/components/crowdsourcing/subscribeInterceptor\";\nimport UnlicensedContentWarning from \"@/components/users/subscribe-prompts/UnlicensedContentWarning.vue\";\nimport api from \"@/router/api\";\nimport moment from \"moment\";\nimport _ from \"lodash\";\nimport VueScrollTo from \"vue-scrollto\";\nimport { useRoute, useRouter } from \"vue-router\";\n\nexport const useDealBuilderStore = defineStore(\"dealBuilder\", () => {\n const dataFieldLoadingStore = useDataFieldLoadingStore();\n const calculationFieldsStore = useCalculationFieldsStore();\n const notificationsStore = useNotificationsStore();\n const changeGroupStore = useCrowdsourcedChangeGroupStore();\n const { changeGroupId } = storeToRefs(changeGroupStore);\n const timeTravelStore = useTimeTravelStore();\n const { asOfMilliseconds, timeTravelTo } = storeToRefs(timeTravelStore);\n const propertyDiagramStore = usePropertyDiagramStore();\n const { selectedTimelineEvent, propertyIdParam, propertyDiagramPropertyIds } =\n storeToRefs(propertyDiagramStore);\n const layoutStore = useWorkspaceLayoutStore();\n const { workspaceLayout } = storeToRefs(layoutStore);\n const upgradeInProgress = ref(false);\n const { resetRequired, upgradeSuccessful } = storeToRefs(useUnlockerStore());\n const { modalPayload } = storeToRefs(useModalStore());\n const fetchingDealBuilderData = ref(false);\n const dealBuilderPropertyDataFields = ref([]);\n const allFetchedFields = ref([]);\n const fetchRequests = ref([]);\n const investmentPatchableTimelineEvents = ref([]);\n const patchableCompanyInvolvementFieldIds = ref([]);\n\n const dealBuilderCalculationData = ref({});\n const dealBuilder = ref(null);\n const assets = computed(() => {\n return _.get(dealBuilder.value, \"assets\", {});\n });\n const assetFieldIds = computed(() => {\n if (dealBuilder.value) {\n return _.map(assets.value, function (assetObject) {\n return assetObject.dataField.localId;\n });\n } else {\n return [];\n }\n });\n const refetchDealBuilderEditor = ref(null);\n const contactInvolvementFields = computed(() => {\n return allFetchedFields.value.filter((cdf) => {\n return cdf.fieldContentType === \"ContactCompanyInvolvement\";\n });\n });\n const patchableCompanySize = computed(\n () => patchableCompanyInvolvementFieldIds.value.length,\n );\n const contactFieldSize = computed(\n () => contactInvolvementFields.value.length,\n );\n const crossInteraction = computed({\n get() {\n return _.get(dealBuilder.value, \"crossInteraction\");\n },\n set(val) {\n if (dealBuilder.value) dealBuilder.value.crossInteraction = val;\n },\n });\n const investmentGroups = computed(() => {\n return _.get(dealBuilder.value, \"investmentGroups\", []);\n });\n\n const assetModIndex = computed(\n () => _.size(dealBuilder.value?.assets || {}) % 6,\n );\n const assetBorderColors = [\"teal\", \"violet\", \"lime\", \"sky\", \"rose\", \"blue\"];\n const assetLegendColors = [\n \"bg-teal-600\",\n \"bg-violet-500\",\n \"bg-lime-500\",\n \"bg-sky-500\",\n \"bg-rose-600\",\n \"bg-blue-600\",\n ];\n\n watch(resetRequired, () => {\n if (upgradeInProgress.value) {\n resetRequired.value = false;\n upgradeInProgress.value = false;\n }\n });\n\n const fetchedKeys = computed(() =>\n fetchRequests.value.map((request) => request.key),\n );\n\n // CALCULATION DATA\n\n const fetchedCalculationKeys = computed(() =>\n _.keys(dealBuilderCalculationData.value),\n );\n\n async function fetchDealBuilderCalculationData({\n contentType,\n contentId,\n override = false,\n }) {\n const contentKey = `${contentType}${contentId}`;\n if (alreadyFetchedCalculations(contentKey) && !override) {\n console.log(\"already fetched\", contentKey);\n } else if (contentType && contentId) {\n try {\n const payload = {\n contentType,\n contentIds: [contentId],\n calculationName: \"sizes_uses\",\n bundle: \"calculation\",\n asOf: asOfMilliseconds.value,\n };\n const key = `sizes_uses-${payload.contentType}-${payload.contentIds}-${payload.asOf}`;\n\n fetchingDealBuilderData.value = true;\n\n const calculationFields =\n await calculationFieldsStore.calculationDataInitialFetch({\n payload,\n key,\n endpoint: `calculation_data_fields`,\n calculationName: payload.calculationName,\n analyzePanelSet: false,\n paginationCount: 10,\n });\n let bundleResponse = null;\n\n if (calculationFields?.data) {\n const bundlePayload = {\n bundleFieldIds: calculationFields.data.map(\n ({ localId }) => localId,\n ),\n bundle: \"calculation\",\n };\n bundleResponse = await api.post(\n `crowdsourced_data_field_calculation_bundles`,\n bundlePayload,\n );\n }\n\n if (bundleResponse?.data) {\n dealBuilderCalculationData.value[contentKey] = {\n allFieldsData: bundleResponse.data,\n sizesUses: structuredCalculationDataFor(\n \"sizes_uses\",\n calculationFields.data,\n ),\n };\n }\n } catch (error) {\n console.error(error);\n notificationsStore.addNotification(\"anErrorOccurred\");\n } finally {\n fetchingDealBuilderData.value = false;\n }\n }\n }\n\n function structuredCalculationDataFor(calculationName, rawFields) {\n switch (calculationName) {\n case \"sizes_uses\": {\n let tempState = {\n interceptableFields: [],\n floorAreaDataFields: [],\n propertyUseDataFields: [],\n standardizedAreaDataFields: [],\n useBasedAreaDataFields: [],\n };\n\n const interceptableFields = rawFields.filter(\n (df) => df.meteringStatus === \"prompt_to_subscribe\",\n );\n const floorAreaDataFields = rawFields.filter(\n (df) => df.fieldContentType === \"FloorArea\",\n );\n const propertyUseDataFields = rawFields.filter(\n (df) => df.fieldContentType === \"ContentPropertyUse\",\n );\n const standardizedAreaDataFields = rawFields.filter(\n (df) => df.fieldName === \"standardized_area\",\n );\n const useBasedAreaDataFields = rawFields.filter(\n (df) => df.fieldName === \"use_based_area\",\n );\n\n tempState.interceptableFields = interceptableFields;\n tempState.floorAreaDataFields = floorAreaDataFields;\n tempState.propertyUseDataFields = propertyUseDataFields;\n tempState.standardizedAreaDataFields = standardizedAreaDataFields;\n tempState.useBasedAreaDataFields = useBasedAreaDataFields;\n\n return tempState;\n }\n }\n }\n\n function alreadyFetchedCalculations(contentKey) {\n return _.includes(fetchedCalculationKeys.value, contentKey);\n }\n\n function calculationDataByKey(contentKey) {\n return _.get(dealBuilderCalculationData.value, `[${contentKey}]`, {});\n }\n\n // DEAL BUILDER DATA\n\n function fetchPropertyDataField(propertyId) {\n fetchingDealBuilderData.value = true;\n api.get(`properties/${propertyId}`).then((json) => {\n fetchingDealBuilderData.value = false;\n patchPropertyDataFields(json.data);\n });\n }\n function alreadyFetchedFieldsFor(fetchRequestKey) {\n const request = _.find(fetchRequests.value, { key: fetchRequestKey });\n\n return allFetchedFields.value.filter((field) =>\n _.includes(request?.fieldIds || [], field.localId),\n );\n }\n function alreadyFetched(fetchRequestKey) {\n return _.includes(fetchedKeys.value, fetchRequestKey);\n }\n function registerFetchRequest(dataFields, fetchRequestKey) {\n const payload = {\n key: fetchRequestKey,\n fieldIds: dataFields.map((field) => field.localId),\n };\n\n fetchRequests.value = _.unionBy([payload], fetchRequests.value, \"key\");\n }\n function updateFetchRequests(dataFields, fetchRequestKey) {\n const stillPresentFields = alreadyFetchedFieldsFor(fetchRequestKey);\n // console.log(\n // \"still present\",\n // fetchRequestKey,\n // stillPresentFields.map((field) => field.localId)\n // );\n const updatedFields = _.unionBy(dataFields, stillPresentFields, \"localId\");\n // console.log(\n // \"updated\",\n // fetchRequestKey,\n // updatedFields.map((field) => field.localId)\n // );\n\n registerFetchRequest(updatedFields, fetchRequestKey);\n }\n function dropFetchRequest(dropKey) {\n fetchRequests.value = fetchRequests.value.filter(\n ({ key }) => key !== dropKey,\n );\n }\n function cleanUpRequests() {\n fetchRequests.value.forEach(({ key }) => updateFetchRequests([], key));\n }\n\n function clearDealBuilder(clearBuilder = true, clearCalculationData = true) {\n // console.log(\"clear deal builder. wipe builder?\", clearBuilder);\n if (clearBuilder) dealBuilder.value = null;\n if (clearCalculationData) dealBuilderCalculationData.value = {};\n\n allFetchedFields.value = [];\n dealBuilderPropertyDataFields.value = [];\n fetchRequests.value = [];\n investmentPatchableTimelineEvents.value = [];\n clearSelectedEvent();\n clearMetaData();\n }\n\n function clearSelectedEvent() {\n selectedTimelineEvent.value = null;\n }\n\n function clearMetaData() {\n if (dealBuilder.value?.assets) {\n _.forEach(dealBuilder.value.assets, function (assetObject, assetKey) {\n clearDealBuilderAssetManipulatedLoans({ assetKey });\n clearDealBuilderAssetIndividualOwnershipInterests({ assetKey });\n });\n }\n }\n\n function interceptableField(dataField) {\n return _.get(dataField, \"meteringStatus\") === \"prompt_to_subscribe\";\n }\n async function refreshInvestmentGroup({\n closingGroupId,\n groupId,\n dealAction,\n isExistingGroup,\n }) {\n if (groupId && dealAction) {\n removeDealBuilderInvestmentGroup({\n groupId: closingGroupId || groupId,\n existing: isExistingGroup,\n });\n clearDealBuilder(false);\n refetchDealBuilderEditor.value = true;\n\n await nextTick();\n\n console.log(\"add group again\");\n\n addDealBuilderInvestmentGroup({\n existingGroupId: groupId,\n dealAction,\n });\n }\n }\n async function refetchDataField(dataFieldLocalId) {\n fetchingDealBuilderData.value = true;\n api.get(`data_field_by_id/${dataFieldLocalId}`).then((json) => {\n fetchingDealBuilderData.value = false;\n interceptablePatch([json.data]);\n });\n }\n function interceptablePatch(dataFields, fetchRequestKey = null) {\n if (_.some(dataFields, interceptableField)) {\n promptToSubscribe();\n } else {\n patchDiagramFields(dataFields);\n if (fetchRequestKey) registerFetchRequest(dataFields, fetchRequestKey);\n }\n }\n const debouncedUnlockWarn = _.debounce(function () {\n unlockWarn();\n }, 3000);\n function unlockWarn() {\n return new Promise((resolve) => {\n if (!modalPayload.value) {\n modalPayload.value = {\n size: \"base\",\n theme: \"light\",\n component: markRaw(UnlicensedContentWarning),\n props: {},\n };\n resolve();\n } else {\n resolve();\n }\n });\n }\n function promptToSubscribe() {\n return new Promise((resolve) => {\n if (!modalPayload.value) {\n upgradeInProgress.value = true;\n const successCallback = () => {\n if (upgradeSuccessful.value) {\n console.log(\"user subscribed\");\n upgradeInProgress.value = false;\n upgradeSuccessful.value = false;\n // fetchDiagramData();\n resolve();\n }\n };\n\n subscribeInterceptor({\n apiRequestFunc: null,\n successCallback,\n modalPayloadRef: modalPayload,\n upgradeSuccessfulRef: upgradeSuccessful,\n afterSubscribe: \"successCallback\",\n promptReason: \"dataUsage\",\n context: \"licensing\",\n });\n } else {\n resolve();\n }\n });\n }\n async function postEditingPatch(json, fetchRequestKey = null) {\n let newData = null;\n if (json.data.dataField) newData = [json.data.dataField];\n else if (json.data.dataFields) newData = json.data.dataFields;\n\n if (newData) patchDiagramFields(newData, fetchRequestKey);\n if (json.data.timelineEvents) {\n investmentPatchableTimelineEvents.value = json.data.timelineEvents;\n }\n }\n\n function patchPropertyDataFields(newFields) {\n dealBuilderPropertyDataFields.value = _.unionBy(\n _.isArray(newFields) ? newFields : [newFields],\n dealBuilderPropertyDataFields.value,\n \"localId\",\n );\n }\n\n function patchDiagramFields(newFields, fetchRequestKey = null) {\n return new Promise((resolve) => {\n dropInterceptFields();\n allFetchedFields.value = _.unionBy(\n newFields,\n allFetchedFields.value,\n \"localId\",\n );\n dropDeprecatedFields();\n if (fetchRequestKey) {\n const remainingFields = _.intersectionBy(\n newFields,\n allFetchedFields.value,\n \"localId\",\n );\n updateFetchRequests(remainingFields, fetchRequestKey);\n }\n patchCompanyInvolvements(newFields);\n\n if (_.some(newFields, unlockableInnerContent)) {\n debouncedUnlockWarn();\n }\n\n resolve();\n });\n }\n function patchCompanyInvolvements(newFields) {\n // decoratingContentType: 'OwnershipInterest', fieldContentType: 'CompanyInvolvement'\n const involvementFields = newFields.filter(\n (field) => field.fieldContentType === \"CompanyInvolvement\",\n );\n const fieldIds = involvementFields.map((field) => field.localId);\n\n patchableCompanyInvolvementFieldIds.value = _.union(\n fieldIds,\n patchableCompanyInvolvementFieldIds.value,\n );\n }\n function dropInterceptFields() {\n const strippedFields = allFetchedFields.value.filter((dataField) => {\n return !dataField.meteringStatus;\n });\n allFetchedFields.value = strippedFields;\n cleanUpRequests();\n }\n function dropDeprecatedFields() {\n const strippedFields = allFetchedFields.value.filter((dataField) => {\n return !dataField.deprecatedAt && !dataField.dismissed;\n });\n allFetchedFields.value = strippedFields;\n cleanUpRequests();\n }\n\n function resetDealBuilderInvestments() {\n _.forEach(dealBuilder.value.assets, function (assetObject) {\n assetObject.investments = [];\n });\n }\n\n async function upsertDealBuilder({\n assetDataField = null,\n existingGroupId = null,\n timelineInvestmentId = null,\n timeTravelDate = undefined,\n focus = \"Valuations\",\n }) {\n let assetKey = null;\n let newCrossInteraction = null;\n if (timelineInvestmentId) {\n newCrossInteraction = {\n dealAction: null,\n assetKey,\n combinedKey: timelineInvestmentId,\n focus,\n source: \"TimelineInvestment\",\n };\n }\n let asOf = undefined;\n\n if (timeTravelDate) {\n asOf = moment(timeTravelDate).valueOf();\n timeTravelTo.value = timeTravelDate;\n }\n\n if (dealBuilder.value) {\n if (assetDataField) {\n assetKey = decoratingAndFieldKey(assetDataField);\n const assetObject = {\n dataField: assetDataField,\n investments: [],\n expanded: true,\n ownershipInterests: [],\n };\n\n crossInteraction.value = newCrossInteraction;\n addDealBuilderAsset({\n assetObject,\n assetKey,\n });\n }\n } else {\n if (assetDataField) {\n assetKey = decoratingAndFieldKey(assetDataField);\n }\n\n newDealBuilder({\n assetDataField,\n crossInteraction: newCrossInteraction,\n });\n }\n\n if (existingGroupId) {\n addDealBuilderInvestmentGroup({\n existingGroupId,\n });\n }\n\n await nextTick();\n router.push({\n name: route.name,\n query: {\n ...route.query,\n horizontalTab: \"Deals\",\n verticalTab: undefined,\n assetFieldIds: assetFieldIds.value,\n asOf,\n },\n });\n\n collapseAllAssetsExcept({ assetKey });\n\n if (\n assetDataField?.joiningContentType === \"Property\" &&\n propertyIdParam.value\n ) {\n if (\n !_.includes(\n propertyDiagramPropertyIds.value,\n assetDataField.joiningContentId,\n )\n ) {\n propertyDiagramStore.addPropertyToDiagram(\n assetDataField.joiningContentId,\n );\n }\n }\n\n if (workspaceLayout.value === \"fullScreen\") {\n layoutStore.matchLayoutToScreen();\n }\n }\n\n function newDealBuilder({\n assetDataField = null,\n investmentFieldContent = null,\n crossInteraction = null,\n ownershipInterestIds = [],\n dealAction = null,\n seniorLoanForeclosure = false,\n depth,\n stubbedDeal = null,\n }) {\n let assetKey = null;\n let assets = {};\n\n if (assetDataField) {\n assetKey = decoratingAndFieldKey(assetDataField);\n assets[assetKey] = {\n dataField: assetDataField,\n investments: [],\n expanded: true,\n datedTimelineFetched: false,\n undatedTimelineFetched: false,\n diagramBorderColor: assetBorderColors[assetModIndex.value],\n diagramLegendColor: assetLegendColors[assetModIndex.value],\n ownershipInterests: [],\n loans: [],\n assumptionLoans: [],\n foreclosureLoans: [],\n entireInterests: [],\n partialInterests: [],\n };\n }\n\n let investmentGroups = [];\n let currentInvestmentGroupPlaceholderId = 1000;\n\n if (investmentFieldContent && dealAction) {\n let investments = {};\n const investmentKey = decoratingAndFieldKey(investmentFieldContent);\n const combinedKey = `${assetKey}_${investmentKey}`;\n let newInvestment = {\n investmentGroupId: `temp${currentInvestmentGroupPlaceholderId}`,\n temporaryId: combinedKey,\n capitalStackTopLevelAsset: assetDataField,\n investmentFieldContent,\n ownershipInterestIds,\n capitalProviders: [],\n advisors: [],\n dealAction,\n date: null,\n state: null,\n dollarValue: null,\n dollarValueType: null,\n seniorLoanForeclosure,\n depth,\n };\n\n if (stubbedDeal) {\n investments[combinedKey] = _.merge({}, newInvestment, stubbedDeal);\n } else {\n investments[combinedKey] = newInvestment;\n }\n\n const initialGroup = {\n placeholderId: `temp${currentInvestmentGroupPlaceholderId}`,\n dealAction,\n investments,\n };\n\n investmentGroups.push(initialGroup);\n currentInvestmentGroupPlaceholderId++;\n }\n const initialStructure = {\n currentInvestmentGroupPlaceholderId,\n assets,\n investmentGroups,\n crossInteraction,\n foreclosureSubordinateKey: null,\n };\n\n dealBuilder.value = initialStructure;\n }\n\n function addDealBuilderInvestmentToGroup({\n existingGroupId = null,\n existingInvestment = undefined,\n stubbedDeal = null,\n groupInvestmentDataField = undefined,\n assetDataField = null,\n investmentFieldContent = null,\n investmentGroupPlaceholderId = null,\n ownershipInterestIds = [],\n seniorLoanForeclosure = false,\n }) {\n let group = null;\n\n if (existingGroupId) {\n group = _.find(dealBuilder.value.investmentGroups, {\n id: existingGroupId,\n });\n } else if (investmentGroupPlaceholderId) {\n group = _.find(dealBuilder.value.investmentGroups, {\n placeholderId: investmentGroupPlaceholderId,\n });\n }\n\n if (group) {\n const impliedLoanSeniority =\n group.dealAction === \"refinance\" ? { loanSeniority: \"senior\" } : {};\n let combinedKey;\n\n if (assetDataField && investmentFieldContent) {\n const assetKey = decoratingAndFieldKey(assetDataField);\n const investmentKey = decoratingAndFieldKey(investmentFieldContent);\n\n combinedKey = `${assetKey}_${investmentKey}`;\n } else if (existingInvestment) {\n combinedKey = existingInvestment.id;\n }\n\n const newInvestment = _.merge(\n {},\n {\n existingInvestment,\n groupInvestmentDataField,\n investmentGroupId: existingGroupId || investmentGroupPlaceholderId,\n temporaryId: combinedKey,\n capitalStackTopLevelAsset: assetDataField,\n investmentFieldContent,\n ownershipInterestIds,\n capitalProviders: [],\n advisors: [],\n dealAction: group.dealAction,\n date: null,\n state: null,\n dollarValue: null,\n dollarValueType: null,\n seniorLoanForeclosure,\n },\n impliedLoanSeniority,\n );\n\n if (stubbedDeal) {\n group.investments[combinedKey] = _.merge(\n {},\n newInvestment,\n stubbedDeal,\n );\n } else if (existingInvestment) {\n group.investments[combinedKey] = _.merge(\n {},\n newInvestment,\n existingInvestment,\n );\n } else {\n group.investments[combinedKey] = newInvestment;\n }\n\n if (existingGroupId && existingInvestment && !group.dealAction) {\n group.dealAction = existingInvestment.portfolioDealAction;\n }\n }\n }\n\n function removeDealBuilderAsset(assetKey) {\n delete dealBuilder.value.assets[assetKey];\n\n router.push({\n name: route.name,\n query: {\n ...route.query,\n horizontalTab: \"Deals\",\n verticalTab: undefined,\n assetFieldIds: assetFieldIds.value,\n },\n });\n }\n\n function removeDealBuilderInvestment({ investmentKey, dealAction }) {\n dealBuilder.value.investmentGroups.forEach((group) => {\n const investment = _.get(group, `investments[${investmentKey}]`);\n\n if (\n investment &&\n (investment.dealAction === dealAction || investment.existingInvestment)\n ) {\n delete group.investments[investmentKey];\n }\n });\n\n const remainingGroups = dealBuilder.value.investmentGroups.filter(\n (group) => {\n return _.size(group.investments) > 0;\n },\n );\n\n dealBuilder.value.investmentGroups = remainingGroups;\n }\n function removeDealBuilderInvestmentGroup({ groupId, existing = true }) {\n let group, differenceKey;\n\n if (existing) {\n group = _.find(dealBuilder.value.investmentGroups, {\n id: groupId,\n });\n differenceKey = \"id\";\n } else {\n group = _.find(dealBuilder.value.investmentGroups, {\n placeholderId: groupId,\n });\n differenceKey = \"placeholderId\";\n }\n\n const filteredGroups = _.differenceBy(\n dealBuilder.value.investmentGroups,\n [group],\n differenceKey,\n );\n\n dealBuilder.value.investmentGroups = filteredGroups;\n }\n\n function addInvestmentGroupInvestmentPlayers({\n groupId,\n investmentCombinedKey,\n addedCompanies,\n path,\n compareBy = _.identity,\n }) {\n if (groupId) {\n const existingGroup = _.find(dealBuilder.value.investmentGroups, {\n id: groupId,\n });\n const placeholderGroup = _.find(dealBuilder.value.investmentGroups, {\n placeholderId: groupId,\n });\n const group = existingGroup || placeholderGroup;\n const investment = _.get(group, `investments[${investmentCombinedKey}]`);\n let newProviders;\n\n if (investment.existingInvestment) {\n newProviders = _.unionBy(\n _.get(investment, `existingInvestment.${path}`, []),\n addedCompanies,\n compareBy,\n );\n\n group.investments[investmentCombinedKey].existingInvestment[path] =\n newProviders;\n } else {\n newProviders = _.unionBy(\n _.get(investment, path, []),\n addedCompanies,\n compareBy,\n );\n\n group.investments[investmentCombinedKey][path] = newProviders;\n }\n }\n }\n function removeInvestmentGroupInvestmentPlayer({\n groupId,\n investmentCombinedKey,\n toRemove,\n path,\n compareBy = _.identity,\n }) {\n if (groupId) {\n const existingGroup = _.find(dealBuilder.value.investmentGroups, {\n id: groupId,\n });\n const placeholderGroup = _.find(dealBuilder.value.investmentGroups, {\n placeholderId: groupId,\n });\n const group = existingGroup || placeholderGroup;\n const investment = _.get(group, `investments[${investmentCombinedKey}]`);\n let filteredProviders;\n\n if (investment.existingInvestment) {\n filteredProviders = _.differenceBy(\n _.get(investment, `existingInvestment.${path}`, []),\n [toRemove],\n compareBy,\n );\n\n group.investments[investmentCombinedKey].existingInvestment[path] =\n filteredProviders;\n } else {\n filteredProviders = _.differenceBy(\n _.get(investment, path, []),\n [toRemove],\n compareBy,\n );\n\n group.investments[investmentCombinedKey][path] = filteredProviders;\n }\n }\n }\n\n function updateInvestmentGroupInvestment({\n groupId,\n newInvestment,\n fieldName = null,\n }) {\n if (groupId) {\n const existingGroup = _.find(dealBuilder.value.investmentGroups, {\n id: groupId,\n });\n const placeholderGroup = _.find(dealBuilder.value.investmentGroups, {\n placeholderId: groupId,\n });\n const group = existingGroup || placeholderGroup;\n let combinedKey = null;\n\n if (\n newInvestment.capitalStackTopLevelAsset &&\n newInvestment.investmentFieldContent &&\n group\n ) {\n const assetKey = decoratingAndFieldKey(\n newInvestment.capitalStackTopLevelAsset,\n );\n const investmentKey = decoratingAndFieldKey(\n newInvestment.investmentFieldContent,\n );\n\n combinedKey = `${assetKey}_${investmentKey}`;\n\n if (fieldName) {\n group.investments[combinedKey][fieldName] = newInvestment[fieldName];\n } else {\n group.investments[combinedKey] = newInvestment;\n }\n } else if (newInvestment.id) {\n // console.log(\"existing investment\");\n const groupInvestment = _.find(\n group.investments,\n function (investment) {\n return investment.existingInvestment.id === newInvestment.id;\n },\n );\n\n console.log(newInvestment);\n console.log(groupInvestment);\n\n combinedKey = groupInvestment.temporaryId;\n\n if (fieldName) {\n group.investments[combinedKey].existingInvestment[fieldName] =\n newInvestment[fieldName];\n } else {\n group.investments[combinedKey].existingInvestment = newInvestment;\n }\n }\n }\n }\n function addTimingFieldsToInvestmentGroup({ groupId, newFields }) {\n if (groupId) {\n const existingGroup = _.find(dealBuilder.value.investmentGroups, {\n id: groupId,\n });\n const placeholderGroup = _.find(dealBuilder.value.investmentGroups, {\n placeholderId: groupId,\n });\n const group = existingGroup || placeholderGroup;\n\n group.timingFields = _.unionBy(newFields, group.timingFields, \"localId\");\n }\n }\n\n async function fetchGroupTimingFields(groupId) {\n const response = await api.get(`investment_group_timing_fields/${groupId}`);\n\n addTimingFieldsToInvestmentGroup({ groupId, newFields: response.data });\n }\n\n async function checkGroupTimingUnlockability(groupId) {\n const response = await api.get(\n `investment_group_timing_unlockability/${groupId}`,\n );\n\n return response;\n }\n\n function addDealBuilderInvestmentGroup({\n existingGroupId = null,\n existingInvestment = undefined,\n assetDataField = null,\n investmentFieldContent = null,\n ownershipInterestIds = [],\n dealAction = null,\n depth,\n loanSeniority = null,\n loanCollateralType = null,\n seniorLoanForeclosure = false,\n stubbedDeal = null,\n }) {\n const borderColors = [\"green\", \"blue\", \"purple\", \"fuchsia\"];\n const legendColors = [\n \"bg-green-500\",\n \"bg-blue-500\",\n \"bg-purple-500\",\n \"bg-fuchsia-500\",\n ];\n const modIndex = dealBuilder.value.currentInvestmentGroupPlaceholderId % 4;\n const impliedLoanSeniority =\n dealAction === \"refinance\" ? \"senior\" : loanSeniority;\n const newGroup = {\n id: existingGroupId,\n placeholderId: `temp${dealBuilder.value.currentInvestmentGroupPlaceholderId}`,\n diagramBorderColor: borderColors[modIndex],\n diagramLegendColor: legendColors[modIndex],\n dealAction,\n investments: {},\n timingFields: [],\n expanded: !!existingInvestment,\n };\n\n if (!existingGroupId) {\n const assetKey = decoratingAndFieldKey(assetDataField);\n const investmentKey = decoratingAndFieldKey(investmentFieldContent);\n const combinedKey = `${assetKey}_${investmentKey}`;\n let newInvestment = {\n existingInvestment,\n investmentGroupId:\n existingGroupId ||\n `temp${dealBuilder.value.currentInvestmentGroupPlaceholderId}`,\n temporaryId: combinedKey,\n capitalStackTopLevelAsset: assetDataField,\n investmentFieldContent,\n ownershipInterestIds,\n capitalProviders: [],\n advisors: [],\n dealAction,\n date: null,\n state: null,\n dollarValue: null,\n dollarValueType: null,\n loanCollateralType,\n loanSeniority: impliedLoanSeniority,\n seniorLoanForeclosure,\n depth,\n };\n\n if (stubbedDeal) {\n newGroup.investments[combinedKey] = _.merge(\n {},\n newInvestment,\n stubbedDeal,\n );\n } else {\n newGroup.investments[combinedKey] = newInvestment;\n }\n }\n\n if (existingGroupId) {\n const newGroups = _.unionBy(\n dealBuilder.value.investmentGroups,\n [newGroup],\n function (group) {\n return group.id || group.placeholderId;\n },\n );\n\n dealBuilder.value.investmentGroups = newGroups;\n } else {\n dealBuilder.value.investmentGroups.push(newGroup);\n }\n dealBuilder.value.currentInvestmentGroupPlaceholderId++;\n }\n\n async function saveInvestmentGroup({ placeholderId, successCallback }) {\n const equityActions = [\n \"sellOutright\",\n \"sellEntireInterest\",\n \"sellPartialInterest\",\n \"sellMultipleInterests\",\n \"foreclosureSellOutright\",\n ];\n\n function persist(investment) {\n const focalInvestment = investment.existingInvestment || investment;\n const investmentType = focalInvestment.dealAction;\n let layerType = \"OwnershipInterest\";\n\n if (investment.existingInvestment) {\n layerType = investment.existingInvestment.investmentType;\n } else if (focalInvestment.dealAction) {\n layerType =\n _.intersection(equityActions, [focalInvestment.dealAction]).length > 0\n ? \"OwnershipInterest\"\n : \"Loan\";\n }\n\n const validDollar =\n focalInvestment.dollarValueType &&\n _.toNumber(focalInvestment.dollarValue) > 10000;\n\n let assetObject = null;\n let contentId = null;\n let contentType = null;\n let entireInterestIds = [];\n let partialInterestIds = [];\n let assumptionLoanIds = [];\n let foreclosureLoanIds = [];\n\n if (!investment.existingInvestment) {\n assetObject = matchingAssetObject(\n decoratingAndFieldKey(investment.capitalStackTopLevelAsset),\n );\n entireInterestIds = _.get(assetObject, \"entireInterests\", []).map(\n (id) => {\n return { id };\n },\n );\n partialInterestIds = _.get(assetObject, \"partialInterests\", []).map(\n (id) => {\n return { id };\n },\n );\n assumptionLoanIds = _.get(assetObject, \"assumptionLoans\", []).map(\n (id) => {\n return { id };\n },\n );\n foreclosureLoanIds = _.get(assetObject, \"foreclosureLoans\", []).map(\n (id) => {\n return { id };\n },\n );\n\n switch (focalInvestment.investmentFieldContent.decoratingContentType) {\n case \"Property\":\n case \"PropertyRight\":\n {\n if (\n focalInvestment.investmentFieldContent.fieldContentType ===\n \"OwnershipInterest\"\n ) {\n console.log(\n \"investment group setting content id/type from ownership interest\",\n focalInvestment.investmentFieldContent,\n );\n contentId =\n focalInvestment.investmentFieldContent.decoratingContentId;\n contentType =\n focalInvestment.investmentFieldContent.decoratingContentType;\n } else {\n console.log(\n \"investment group setting content id/type from asset\",\n focalInvestment.investmentFieldContent,\n );\n contentId =\n focalInvestment.investmentFieldContent.fieldContentId;\n contentType =\n focalInvestment.investmentFieldContent.fieldContentType;\n }\n }\n break;\n default:\n console.log(\n \"investment group setting content id/type\",\n focalInvestment.investmentFieldContent,\n );\n contentId =\n focalInvestment.investmentFieldContent.decoratingContentId;\n contentType =\n focalInvestment.investmentFieldContent.decoratingContentType;\n break;\n }\n }\n\n return {\n investmentGroup: true,\n existingInvestmentId: focalInvestment.id,\n layerType,\n linkToInvestmentId: null,\n existingDataFieldId: null,\n contentId: contentId,\n contentType: contentType,\n collateralType: focalInvestment?.loanCollateralType,\n seniority: focalInvestment?.loanSeniority,\n companies: _.get(focalInvestment, \"capitalProviders\", []),\n advisors: _.get(focalInvestment, \"advisors\", []),\n prospects: _.get(focalInvestment, \"prospects\", []),\n entireInterestIds,\n partialInterestIds,\n investmentType,\n foreclosureLoanIds,\n assumptionLoanIds,\n date: focalInvestment.date,\n state: focalInvestment.state,\n dollarValue: validDollar ? focalInvestment.dollarValue : null,\n dollarValueType: validDollar ? focalInvestment.dollarValueType : null,\n };\n }\n\n if (dealBuilder.value) {\n const group = _.find(dealBuilder.value.investmentGroups, {\n placeholderId,\n });\n\n if (group) {\n const groupPayload = {\n dealAction: group.dealAction,\n investments: _.map(group.investments, persist),\n changeGroupId: changeGroupId.value,\n };\n\n const apiRequestFunc = () =>\n api.post(`investment_groups`, groupPayload);\n const failureCallback = () => {};\n await changeGroupStore.originateData(\n apiRequestFunc,\n successCallback,\n failureCallback,\n );\n }\n }\n }\n\n async function fetchInvestmentGroupInvestments(investmentGroupId) {\n if (investmentGroupId) {\n fetchingDealBuilderData.value = true;\n const response = await api.get(\n `investment_group_investments/${investmentGroupId}`,\n );\n const investmentDataFields = response.data;\n\n investmentDataFields.forEach((dataField) => {\n addDealBuilderInvestmentToGroup({\n existingGroupId: investmentGroupId,\n existingInvestment: dataField.fieldContent,\n groupInvestmentDataField: dataField,\n });\n });\n\n fetchingDealBuilderData.value = false;\n\n collapsePortfolioAssets({\n groupId: investmentGroupId,\n });\n setDealBuilderInvestmentGroupExpanded({\n groupId: investmentGroupId,\n expanded: true,\n });\n }\n }\n\n function setDealBuilderInvestmentGroupExpanded({ groupId, expanded }) {\n const existingGroup = _.find(dealBuilder.value.investmentGroups, {\n id: groupId,\n });\n const placeholderGroup = _.find(dealBuilder.value.investmentGroups, {\n placeholderId: groupId,\n });\n const group = existingGroup || placeholderGroup;\n\n if (group) {\n group.expanded = expanded;\n }\n }\n\n function setDealBuilderAssetExpanded({\n assetKey,\n expanded,\n investment = null,\n }) {\n if (assetKey && dealBuilder.value.assets[assetKey]) {\n dealBuilder.value.assets[assetKey].expanded = expanded;\n } else if (investment && investment.id) {\n const derivedAssetKey = _.findKey(\n dealBuilder.value.assets,\n function (asset) {\n return !!_.find(asset.investments, { id: investment.id });\n },\n );\n\n if (derivedAssetKey) {\n dealBuilder.value.assets[derivedAssetKey].expanded = expanded;\n }\n }\n }\n\n function collapsePortfolioAssets({ groupId }) {\n const existingGroup = _.find(dealBuilder.value.investmentGroups, {\n id: groupId,\n });\n const placeholderGroup = _.find(dealBuilder.value.investmentGroups, {\n placeholderId: groupId,\n });\n const group = existingGroup || placeholderGroup;\n\n if (group) {\n _.forEach(group.investments, function (investment) {\n const assetKey = investment.capitalStackTopLevelAsset\n ? decoratingAndFieldKey(investment.capitalStackTopLevelAsset)\n : null;\n\n setDealBuilderAssetExpanded({\n assetKey,\n expanded: false,\n investment: investment.existingInvestment,\n });\n });\n }\n }\n\n function collapseAllAssetsExcept({ assetKey }) {\n _.forEach(\n _.get(dealBuilder.value, \"assets\", {}),\n function (assetObject, key) {\n if (key !== assetKey) {\n setDealBuilderAssetExpanded({\n assetKey: key,\n expanded: false,\n });\n }\n },\n );\n }\n\n function setDealBuilderAssetOwnershipInterests({ assetKey, interests = [] }) {\n if (dealBuilder.value?.assets && dealBuilder.value.assets[assetKey]) {\n dealBuilder.value.assets[assetKey].ownershipInterests = interests;\n }\n }\n\n function setDealBuilderAssetTimelineFetchState({\n assetKey,\n dated,\n state = false,\n }) {\n if (assetKey && dealBuilder.value?.assets?.[assetKey]) {\n const key = dated ? \"datedTimelineFetched\" : \"undatedTimelineFetched\";\n\n if (dealBuilder.value?.assets?.[assetKey]?.[key]) {\n dealBuilder.value.assets[assetKey][key] = state;\n }\n }\n }\n function updateDealBuilderAssetInvestments({ assetKey, investments }) {\n console.log(\"update asset investments; new investments:\", investments);\n const oldAssetObject = dealBuilder.value?.assets?.[assetKey];\n\n if (oldAssetObject) {\n investments.forEach((investment) => {\n let matchingId = null;\n\n if (investment.fieldContentId) {\n const newInvestments = _.unionBy(\n [investment],\n oldAssetObject.investments,\n \"fieldContentId\",\n );\n oldAssetObject.investments = newInvestments;\n } else if (investment.existingInvestment) {\n console.log(\"has existing investment\");\n matchingId = investment.existingInvestment.id;\n } else {\n console.log(\"temp or direct id\");\n matchingId = investment.temporaryId || investment.id;\n }\n\n if (matchingId) {\n let matchingOldInvestment = _.find(oldAssetObject.investments, {\n fieldContentId: matchingId,\n });\n\n if (matchingOldInvestment) {\n matchingOldInvestment.fieldContent = investment;\n }\n }\n });\n\n addDealBuilderAsset({\n assetObject: oldAssetObject,\n assetKey,\n });\n }\n }\n function addDealBuilderAssets(moreAssets) {\n moreAssets.forEach((assetObject) => {\n if (\n !dealBuilder.value.assets[decoratingAndFieldKey(assetObject.dataField)]\n ) {\n dealBuilder.value.assets[decoratingAndFieldKey(assetObject.dataField)] =\n assetObject;\n }\n });\n }\n\n const query = computed(() => route.query);\n const horizontalIsDeals = computed(\n () => _.get(query.value, \"horizontalTab\") === \"Deals\",\n );\n\n async function addDealBuilderAsset({ assetObject, assetKey }) {\n const newAsset = {\n dataField: _.get(assetObject, \"dataField\"),\n investments: _.get(assetObject, \"investments\", []),\n expanded: _.get(assetObject, \"expanded\", true),\n datedTimelineFetched: _.get(assetObject, \"datedTimelineFetched\", false),\n undatedTimelineFetched: _.get(\n assetObject,\n \"undatedTimelineFetched\",\n false,\n ),\n ownershipInterests: _.get(assetObject, \"ownershipInterests\", []),\n loans: _.get(assetObject, \"loans\", []),\n assumptionLoans: _.get(assetObject, \"assumptionLoans\", []),\n foreclosureLoans: _.get(assetObject, \"foreclosureLoans\", []),\n entireInterests: _.get(assetObject, \"entireInterests\", []),\n partialInterests: _.get(assetObject, \"partialInterests\", []),\n diagramBorderColor: _.get(\n assetObject,\n \"diagramBorderColor\",\n assetBorderColors[assetModIndex.value],\n ),\n diagramLegendColor: _.get(\n assetObject,\n \"diagramLegendColor\",\n assetLegendColors[assetModIndex.value],\n ),\n };\n\n dealBuilder.value.assets[assetKey] = newAsset;\n await nextTick();\n\n if (horizontalIsDeals.value) {\n router.push({\n name: route.name,\n query: {\n ...route.query,\n horizontalTab: \"Deals\",\n verticalTab: undefined,\n assetFieldIds: assetFieldIds.value,\n },\n });\n }\n }\n\n function addDealBuilderAssetLoan({ assetKey, loanId }) {\n if (dealBuilder.value?.assets && dealBuilder.value.assets[assetKey]) {\n const newLoans = _.union(\n [loanId],\n dealBuilder.value.assets[assetKey].loans,\n );\n\n dealBuilder.value.assets[assetKey].loans = newLoans;\n }\n }\n\n function clearDealBuilderAssetManipulatedLoans({ assetKey }) {\n if (dealBuilder.value?.assets && dealBuilder.value.assets[assetKey]) {\n dealBuilder.value.assets[assetKey].assumptionLoans = [];\n dealBuilder.value.assets[assetKey].foreclosureLoans = [];\n dealBuilder.value.foreclosureSubordinateKey = null;\n }\n }\n function clearDealBuilderAssetIndividualOwnershipInterests({ assetKey }) {\n if (dealBuilder.value?.assets && dealBuilder.value.assets[assetKey]) {\n dealBuilder.value.assets[assetKey].entireInterests = [];\n dealBuilder.value.assets[assetKey].partialInterests = [];\n }\n }\n\n function matchingAssetObject(assetKey) {\n if (dealBuilder.value) {\n return dealBuilder.value.assets[assetKey];\n } else {\n return null;\n }\n }\n\n // PREPOPULATE\n async function populateDealBuilderFromQuery(ids) {\n for await (const id of ids) {\n try {\n fetchingDealBuilderData.value = true;\n const response = await api.get(`data_field_by_id/${id}`);\n fetchingDealBuilderData.value = false;\n const dataField = response.data;\n const assetKey = decoratingAndFieldKey(dataField);\n if (dealBuilder.value) {\n const assetObject = {\n dataField,\n investments: [],\n expanded: true,\n ownershipInterests: [],\n };\n\n addDealBuilderAsset({\n assetObject,\n assetKey,\n });\n } else {\n newDealBuilder({\n assetDataField: dataField,\n });\n }\n } catch (error) {\n fetchingDealBuilderData.value = false;\n console.log(error);\n }\n }\n }\n\n function prepopulateDealBuilder({\n dealAction,\n depth,\n stubbedDeal = null,\n futureDeal = null,\n matchingInvestmentGroup = null,\n dealBuilderAssetDataField,\n localAssetDataField,\n decoratingDataField = null,\n ownershipInterestIds = [],\n nestedCapitalStack,\n }) {\n if (dealBuilder.value) {\n const alreadySellingInterest = _.includes(\n [\"sellPartialInterest\", \"sellEntireInterest\"],\n dealAction,\n );\n\n crossInteraction.value = null;\n\n if (futureDeal && alreadySellingInterest) {\n const newInvestment = _.merge({}, futureDeal, {\n dealAction: \"sellMultipleInterests\",\n });\n const existingGroup = _.find(dealBuilder.value.investmentGroups, {\n id: matchingInvestmentGroup.id,\n });\n const placeholderGroup = _.find(dealBuilder.value.investmentGroups, {\n placeholderId: matchingInvestmentGroup.placeholderId,\n });\n const group = existingGroup || placeholderGroup;\n const matchingInvestment = _.find(\n group.investments,\n function (investment, key) {\n const investmentKeyParts = _.split(key, \"_\");\n\n return (\n _.head(investmentKeyParts) ===\n decoratingAndFieldKey(dealBuilderAssetDataField)\n );\n },\n );\n const existingOwnershipInterestIds =\n matchingInvestment?.ownershipInterestIds;\n // this helps hide any outgoing companies from the \"after\" stack\n const newOwnershipInterestIds = _.union(\n [decoratingDataField.fieldContentId],\n existingOwnershipInterestIds,\n );\n const editedInvestment = _.merge({}, newInvestment, {\n ownershipInterestIds: newOwnershipInterestIds,\n });\n const patchableInvestment =\n dealAction === \"sellPartialInterest\"\n ? newInvestment\n : editedInvestment;\n updateInvestmentGroupField({\n groupId:\n matchingInvestmentGroup.id || matchingInvestmentGroup.placeholderId,\n fieldName: \"dealAction\",\n fieldValue: \"sellMultipleInterests\",\n });\n\n updateInvestmentGroupInvestment({\n groupId:\n matchingInvestmentGroup.id || matchingInvestmentGroup.placeholderId,\n newInvestment: patchableInvestment,\n fieldName: \"dealAction\",\n });\n updateInvestmentGroupInvestment({\n groupId:\n matchingInvestmentGroup.id || matchingInvestmentGroup.placeholderId,\n newInvestment: patchableInvestment,\n fieldName: \"ownershipInterestIds\",\n });\n // store.dispatch(\n // \"flash\",\n // \"New investment updated to reflect multiple interest sale.\"\n // );\n } else {\n console.log(\"nested?\", nestedCapitalStack);\n if (nestedCapitalStack) {\n extractNestedCapitalStackAsset({\n dealBuilderAssetDataField,\n localAssetDataField,\n expanded: true,\n });\n }\n addDealBuilderInvestmentGroup({\n assetDataField: nestedCapitalStack\n ? localAssetDataField\n : dealBuilderAssetDataField,\n investmentFieldContent: decoratingDataField,\n ownershipInterestIds,\n dealAction,\n depth,\n stubbedDeal,\n });\n }\n } else {\n beginDealBuilder({\n dealAction,\n depth,\n stubbedDeal,\n assetDataField: nestedCapitalStack\n ? localAssetDataField\n : dealBuilderAssetDataField,\n investmentFieldContent: decoratingDataField,\n ownershipInterestIds,\n });\n }\n\n if (dealAction === \"sellPartialInterest\") {\n sellPartialInterest({\n decoratingDataField,\n assetKey: decoratingAndFieldKey(dealBuilderAssetDataField),\n });\n } else if (dealAction === \"sellEntireInterest\") {\n sellEntireInterest({\n decoratingDataField,\n assetKey: decoratingAndFieldKey(dealBuilderAssetDataField),\n });\n }\n }\n\n function updateInvestmentGroupField({ groupId, fieldName, fieldValue }) {\n const existingGroup = _.find(dealBuilder.value.investmentGroups, {\n id: groupId,\n });\n const placeholderGroup = _.find(dealBuilder.value.investmentGroups, {\n placeholderId: groupId,\n });\n const group = existingGroup || placeholderGroup;\n\n if (group && fieldName && fieldValue) {\n group[fieldName] = fieldValue;\n }\n }\n\n const router = useRouter();\n const route = useRoute();\n\n function beginDealBuilder({\n dealAction = null,\n depth,\n stubbedDeal = null,\n assetDataField = null,\n investmentFieldContent = null,\n ownershipInterestIds,\n }) {\n newDealBuilder({\n assetDataField,\n investmentFieldContent,\n ownershipInterestIds: ownershipInterestIds,\n dealAction,\n depth,\n stubbedDeal,\n });\n router.push({\n name: route.name,\n query: {\n ...route.query,\n horizontalTab: \"Deals\",\n verticalTab: undefined,\n assetFieldIds: assetFieldIds.value,\n },\n });\n }\n\n async function loadTimelinePortfolioInvestment() {\n if (!selectedTimelineEvent.value) return;\n const { portfolioId, portfolioDealAction } =\n selectedTimelineEvent.value.event;\n\n if (portfolioId && portfolioDealAction) {\n addDealBuilderInvestmentGroup({\n existingGroupId: portfolioId,\n dealAction: portfolioDealAction,\n });\n\n collapseAllAssetsExcept({\n assetKey: null,\n });\n await nextTick();\n VueScrollTo.scrollTo(\"#investment-portfolios-list\", 100, {\n container: \"#lists-panel-container\",\n });\n }\n }\n\n function loadPropertyRightTimelineInvestment({ propertyRightDataField }) {\n if (!selectedTimelineEvent.value) return;\n if (!propertyRightDataField) return;\n\n const { assetId, assetType } = selectedTimelineEvent.value.event;\n const idMatch = propertyRightDataField.fieldContentId === assetId;\n const typeMatch = \"PropertyRight\" === assetType;\n const matchingRight = idMatch && typeMatch;\n\n if (matchingRight) {\n addPropertyDiagramAssetToDealBuilder({\n matchingRight: propertyRightDataField,\n });\n } else if (assetType === \"Loan\") {\n addNestedLoanToDealBuilder({\n loanId: assetId,\n investmentId: selectedTimelineEvent.value.event.fieldContentId,\n });\n } else {\n console.log(\"no match at property diagram level\");\n }\n }\n\n async function addPropertyDiagramAssetToDealBuilder({ matchingRight }) {\n const newCrossInteraction = {\n dealAction: null,\n assetKey: decoratingAndFieldKey(matchingRight),\n combinedKey: selectedTimelineEvent.value.event.fieldContentId,\n focus: \"Valuations\",\n source: \"TimelineInvestment\",\n };\n const dealBuilderPayload = {\n assetDataField: matchingRight,\n crossInteraction: newCrossInteraction,\n };\n\n if (dealBuilder.value) {\n const assetKey = decoratingAndFieldKey(matchingRight);\n const assetObject = {\n dataField: matchingRight,\n investments: [],\n expanded: true,\n datedTimelineFetched: false,\n undatedTimelineFetched: false,\n diagramBorderColor: assetBorderColors[assetModIndex.value],\n diagramLegendColor: assetLegendColors[assetModIndex.value],\n ownershipInterests: [],\n };\n\n addDealBuilderAsset({\n assetObject,\n assetKey,\n });\n crossInteraction.value = newCrossInteraction;\n } else {\n newDealBuilder(dealBuilderPayload);\n await nextTick();\n router.push({\n name: route.name,\n query: {\n ...route.query,\n horizontalTab: \"Deals\",\n verticalTab: undefined,\n assetFieldIds: assetFieldIds.value,\n },\n });\n }\n selectedTimelineEvent.value = null;\n }\n\n async function addNestedLoanToDealBuilder({ loanId, investmentId }) {\n fetchingDealBuilderData.value = true;\n const loanResponse = await api.get(`loans/${loanId}`);\n fetchingDealBuilderData.value = false;\n const loanDataField = loanResponse.data;\n const assetKey = decoratingAndFieldKey(loanDataField);\n const assetObject = {\n dataField: loanDataField,\n investments: [],\n expanded: true,\n datedTimelineFetched: false,\n undatedTimelineFetched: false,\n ownershipInterests: [],\n };\n const newCrossInteraction = {\n dealAction: null,\n assetKey,\n combinedKey: investmentId,\n focus: \"Valuations\",\n source: \"TimelineInvestment\",\n };\n const dealBuilderPayload = {\n assetDataField: loanDataField,\n crossInteraction: newCrossInteraction,\n };\n\n if (dealBuilder.value) {\n addDealBuilderAsset({\n assetObject,\n assetKey,\n });\n crossInteraction.value = newCrossInteraction;\n } else {\n newDealBuilder(dealBuilderPayload);\n await nextTick();\n router.push({\n name: route.name,\n query: {\n ...route.query,\n horizontalTab: \"Deals\",\n verticalTab: undefined,\n assetFieldIds: assetFieldIds.value,\n },\n });\n }\n }\n\n function extractNestedCapitalStackAsset({\n dealBuilderAssetDataField,\n localAssetDataField,\n expanded = true,\n }) {\n const assetKey = decoratingAndFieldKey(localAssetDataField);\n const assetObject = {\n dataField: localAssetDataField,\n investments: [],\n expanded,\n ownershipInterests: [],\n };\n\n addDealBuilderAsset({ assetObject, assetKey });\n setDealBuilderAssetExpanded({\n assetKey: decoratingAndFieldKey(dealBuilderAssetDataField),\n expanded: false,\n });\n }\n\n function sellEntireInterest({ decoratingDataField, assetKey }) {\n const entireInterestId = decoratingDataField.fieldContentId;\n\n addDealBuilderAssetEntireInterest({\n assetKey,\n entireInterestId,\n });\n }\n\n function sellPartialInterest({ decoratingDataField, assetKey }) {\n const partialInterestId = decoratingDataField.fieldContentId;\n\n addDealBuilderAssetPartialInterest({\n assetKey,\n partialInterestId,\n });\n }\n\n function addDealBuilderAssetEntireInterest({ assetKey, entireInterestId }) {\n if (dealBuilder.value?.assets && dealBuilder.value.assets[assetKey]) {\n const newInterests = _.union(\n [entireInterestId],\n dealBuilder.value.assets[assetKey].entireInterests,\n );\n\n dealBuilder.value.assets[assetKey].entireInterests = newInterests;\n }\n }\n function addDealBuilderAssetPartialInterest({ assetKey, partialInterestId }) {\n if (dealBuilder.value?.assets && dealBuilder.value.assets[assetKey]) {\n const newInterests = _.union(\n [partialInterestId],\n dealBuilder.value.assets[assetKey].partialInterests,\n );\n\n dealBuilder.value.assets[assetKey].partialInterests = newInterests;\n }\n }\n function addDealBuilderAssetAssumptionLoan({ assetKey, loanId }) {\n if (dealBuilder.value?.assets && dealBuilder.value.assets[assetKey]) {\n const newLoans = _.union(\n [loanId],\n dealBuilder.value.assets[assetKey].assumptionLoans,\n );\n\n dealBuilder.value.assets[assetKey].assumptionLoans = newLoans;\n }\n }\n function addDealBuilderAssetForeclosureLoan({ assetKey, loanId }) {\n if (dealBuilder.value?.assets && dealBuilder.value.assets[assetKey]) {\n const newLoans = _.union(\n [loanId],\n dealBuilder.value.assets[assetKey].foreclosureLoans,\n );\n\n dealBuilder.value.assets[assetKey].foreclosureLoans = newLoans;\n }\n }\n // END PREPOPULATE\n\n function mountInvestmentMetadata({ assetKey, investment }) {\n const foreclosureLoans = _.get(investment, \"foreclosureLoans\", []);\n const assumptionLoans = _.get(investment, \"assumptionLoans\", []);\n const partialInterests = _.get(investment, \"partialInterests\", []);\n const entireInterests = _.get(investment, \"entireInterests\", []);\n\n foreclosureLoans.forEach((loanId) => {\n addDealBuilderAssetForeclosureLoan({ assetKey, loanId });\n });\n assumptionLoans.forEach((loanId) => {\n addDealBuilderAssetAssumptionLoan({ assetKey, loanId });\n });\n partialInterests.forEach((partialInterestId) => {\n addDealBuilderAssetPartialInterest({ assetKey, partialInterestId });\n });\n entireInterests.forEach((entireInterestId) => {\n addDealBuilderAssetEntireInterest({ assetKey, entireInterestId });\n });\n }\n\n async function retireLoan({ loanId }) {\n const apiRequestFunc = () =>\n api.post(`loan_retirings`, {\n loanId,\n changeGroupId: changeGroupId.value,\n });\n await changeGroupStore.originateData(apiRequestFunc);\n timeTravelStore.triggerRefetch();\n }\n // TODO: TRIGGER EXISTING PRINCIPALS REFETCH\n async function awardInvestment({ investmentId, companyInvolvementId }) {\n const apiRequestFunc = () =>\n api.post(`investment_awardings`, {\n investmentId,\n companyInvolvementId,\n changeGroupId: changeGroupId.value,\n });\n await changeGroupStore.originateData(apiRequestFunc);\n }\n async function awardGroupInvestment({ investmentGroupId, companyId }) {\n const apiRequestFunc = () =>\n api.post(`investment_group_awardings`, {\n investmentGroupId,\n rawCompanyId: companyId,\n changeGroupId: changeGroupId.value,\n });\n await changeGroupStore.originateData(apiRequestFunc);\n }\n async function dropAwardedInvestment({ investmentId }) {\n const apiRequestFunc = () =>\n api.delete(\n `investment_awardings/${investmentId}?change_group_id=${changeGroupId.value}`,\n );\n await changeGroupStore.originateData(apiRequestFunc);\n }\n async function dropAwardedGroupInvestment({ investmentGroupId }) {\n const apiRequestFunc = () =>\n api.delete(\n `investment_group_awardings/${investmentGroupId}?change_group_id=${changeGroupId.value}`,\n );\n await changeGroupStore.originateData(apiRequestFunc);\n }\n\n // FETCH AND DISPLAY DEAL PRINCIPALS\n\n async function refetchInvestment(assetObject, investment) {\n if (investment?.id) {\n const response = await api.get(`investments/${investment?.id}`);\n\n updateStoreInvestment({\n assetObject,\n existingInvestment: investment,\n newInvestment: response?.data,\n });\n }\n }\n\n function updateStoreInvestment({\n assetObject,\n existingInvestment,\n newInvestment,\n }) {\n if (groupId(existingInvestment)) {\n console.log(\"has existing group id\");\n updateInvestmentGroupInvestment({\n groupId: groupId(existingInvestment),\n newInvestment,\n });\n } else if (matchingInvestmentGroup(existingInvestment, dealBuilder.value)) {\n console.log(\"has new group id\");\n updateInvestmentGroupInvestment({\n groupId:\n matchingInvestmentGroup(existingInvestment, dealBuilder.value).id ||\n matchingInvestmentGroup(existingInvestment, dealBuilder.value)\n .placeholderId,\n newInvestment,\n });\n } else if (existingInvestment?.id && assetObject) {\n console.log(\"has investment id and asset\");\n updateDealBuilderAssetInvestments({\n assetKey: decoratingAndFieldKey(assetObject.dataField),\n investments: [newInvestment],\n });\n } else {\n console.log(\"nothing to update!\");\n }\n }\n\n async function linkInvestment(investment, linkedInvestmentId) {\n if (investment?.id && linkedInvestmentId) {\n const payload = {\n investmentId: investment?.id,\n historicalLinkedInvestmentId: linkedInvestmentId,\n };\n\n console.log(\n \"link\",\n investment?.id,\n \"to\",\n linkedInvestmentId,\n \"payload\",\n payload,\n );\n\n const apiRequestFunc = () =>\n api.post(`historical_investment_links`, payload);\n const successCallback = () => {\n timeTravelStore.triggerRefetch();\n return \"success\";\n };\n const failureCallback = () => {\n timeTravelStore.triggerRefetch();\n return \"failure\";\n };\n await changeGroupStore.originateData(\n apiRequestFunc,\n successCallback,\n failureCallback,\n );\n }\n }\n\n async function fetchPrincipalsFor({ assetObject, investment, maybePayload }) {\n let responsePayload = {\n capitalConsumers: [],\n capitalProviders: [],\n awardedCapitalProviders: [],\n emitMessage: null,\n };\n if (!unknownSupplySide(investment)) {\n responsePayload.capitalConsumers = await fetchSupplySidePrincipals({\n assetObject,\n investment,\n maybePayload,\n });\n }\n\n if (investment?.id) {\n responsePayload.capitalProviders = await fetchDemandSidePrincipals({\n investment,\n maybePayload,\n });\n\n if (awardable(investment)) {\n responsePayload.awardedCapitalProviders = await fetchDemandSideAwardees(\n { investment, maybePayload },\n );\n\n if (\n responsePayload.capitalProviders.length === 0 &&\n responsePayload.awardedCapitalProviders.length === 0 &&\n localCapitalProviders(investment, dealBuilder.value).length == 0\n ) {\n responsePayload.emitMessage = \"editingDemand\";\n }\n }\n } else {\n responsePayload.emitMessage = \"editingDemand\";\n }\n\n // console.log(\"fetch investment principals\", responsePayload);\n\n return responsePayload;\n }\n\n async function fetchSupplySidePrincipals({\n assetObject,\n investment,\n maybePayload,\n }) {\n // console.log(\"fetch supply side cap mkts principals\");\n const consumerFetchRequestKey = `investment_${\n investment?.id\n }_ownership_interests_${\n existingContentType({\n containerObject: assetObject,\n transaction: investment,\n }) || contentType(investment)\n }_${\n existingContentId({\n containerObject: assetObject,\n transaction: investment,\n }) || contentId(investment)\n }${mustBeClosed(investment) ? \"&investment_role=capital_consumer\" : \"\"}`;\n\n if (alreadyFetched(consumerFetchRequestKey) && !maybePayload?.override) {\n const alreadyFetched = alreadyFetchedFieldsFor(consumerFetchRequestKey);\n\n return alreadyFetched.filter((cdf) => {\n return (\n cdf.fieldContentType === \"OwnershipInterest\" &&\n cdf.decoratingContentType !== \"Investment\"\n );\n });\n } else if (dataFieldLoadingStore.isLoading(consumerFetchRequestKey)) {\n // console.log(\"currently loading supply side\");\n await new Promise((resolve) => setTimeout(resolve, 1000));\n // console.log(\"currently loading RETRY\");\n const result = await fetchSupplySidePrincipals({\n assetObject,\n investment,\n maybePayload,\n });\n\n return result;\n } else if (\n existingContentType({\n containerObject: assetObject,\n transaction: investment,\n }) ||\n contentType(investment)\n ) {\n dataFieldLoadingStore.patchIds([consumerFetchRequestKey]);\n // console.log(\"DEAL BUILDER SUPPLY SIDE fetch\", consumerFetchRequestKey);\n const json = await api.get(\n `ownership_interests/?content_type=${\n existingContentType({\n containerObject: assetObject,\n transaction: investment,\n }) || contentType(investment)\n }&content_id=${\n existingContentId({\n containerObject: assetObject,\n transaction: investment,\n }) || contentId(investment)\n }&as_of=${fetchMilliseconds(investment, asOfMilliseconds.value)}${\n mustBeClosed(investment) ? \"&investment_role=capital_consumer\" : \"\"\n }`,\n );\n\n if (json?.data) {\n dataFieldLoadingStore.dropId(consumerFetchRequestKey);\n interceptablePatch(json.data, consumerFetchRequestKey);\n return json.data;\n }\n } else {\n // console.log(\"DEAL BUILDER SUPPLY SIDE no content?\");\n }\n }\n\n async function fetchDemandSidePrincipals({ investment, maybePayload }) {\n // console.log(\"fetch demand side cap mkts principals\");\n if (\n alreadyFetched(providersFetchRequestKey(investment)) &&\n !maybePayload?.override\n ) {\n const alreadyFetched = alreadyFetchedFieldsFor(\n providersFetchRequestKey(investment),\n );\n\n return alreadyFetched.filter((cdf) => {\n return (\n cdf.fieldContentType === \"OwnershipInterest\" &&\n cdf.decoratingContentType === \"Investment\"\n );\n });\n } else if (\n dataFieldLoadingStore.isLoading(providersFetchRequestKey(investment))\n ) {\n // console.log(\"currently loading demand side\");\n await new Promise((resolve) => setTimeout(resolve, 1000));\n // console.log(\"currently loading RETRY\");\n const result = await fetchDemandSidePrincipals({\n investment,\n maybePayload,\n });\n\n return result;\n } else {\n dataFieldLoadingStore.patchIds([providersFetchRequestKey(investment)]);\n // console.log(\n // \"DEAL BUILDER DEMAND SIDE fetch\",\n // providersFetchRequestKey(investment),\n // );\n const investmentInterestsResponse = await api.get(\n `investment_ownership_interests/?investment_id=${investment?.id}`,\n );\n\n if (investmentInterestsResponse?.data) {\n dataFieldLoadingStore.dropId(providersFetchRequestKey(investment));\n interceptablePatch(\n investmentInterestsResponse.data,\n providersFetchRequestKey(investment),\n );\n return investmentInterestsResponse.data;\n }\n }\n }\n\n async function fetchDemandSideAwardees({ investment, maybePayload }) {\n // console.log(\"fetch demand side cap mkts awardees\");\n if (\n alreadyFetched(awardedProvidersFetchRequestKey(investment)) &&\n !maybePayload?.override\n ) {\n const alreadyFetched = alreadyFetchedFieldsFor(\n awardedProvidersFetchRequestKey(investment),\n );\n\n return alreadyFetched.filter((cdf) => {\n return cdf.fieldContentType === \"CompanyInvolvement\";\n });\n } else if (\n dataFieldLoadingStore.isLoading(\n awardedProvidersFetchRequestKey(investment),\n )\n ) {\n // console.log(\"currently loading demand side awardees\");\n await new Promise((resolve) => setTimeout(resolve, 1000));\n // console.log(\"currently loading RETRY\");\n const result = await fetchDemandSideAwardees({\n investment,\n maybePayload,\n });\n\n return result;\n } else {\n dataFieldLoadingStore.patchIds([\n awardedProvidersFetchRequestKey(investment),\n ]);\n // console.log(\n // \"DEAL BUILDER DEMAND SIDE AWARDEES fetch\",\n // awardedProvidersFetchRequestKey(investment),\n // );\n const awardedInterestsResponse = await api.get(\n `investment_ownership_interests/?investment_id=${investment?.id}&conditional_modifier=awarded`,\n );\n\n if (awardedInterestsResponse?.data) {\n dataFieldLoadingStore.dropId(\n awardedProvidersFetchRequestKey(investment),\n );\n interceptablePatch(\n awardedInterestsResponse.data,\n awardedProvidersFetchRequestKey(investment),\n );\n return awardedInterestsResponse.data;\n }\n }\n }\n\n return {\n dealBuilder,\n dealBuilderCalculationData,\n refetchDealBuilderEditor,\n assets,\n assetFieldIds,\n crossInteraction,\n investmentGroups,\n fetchRequests,\n dealBuilderPropertyDataFields,\n allFetchedFields,\n contactFieldSize,\n fetchingDealBuilderData,\n patchableCompanyInvolvementFieldIds,\n patchableCompanySize,\n refetchDataField,\n patchDiagramFields,\n patchPropertyDataFields,\n dropFetchRequest,\n postEditingPatch,\n interceptablePatch,\n matchingAssetObject,\n setDealBuilderAssetOwnershipInterests,\n setDealBuilderAssetTimelineFetchState,\n updateDealBuilderAssetInvestments,\n resetDealBuilderInvestments,\n upsertDealBuilder,\n newDealBuilder,\n loadTimelinePortfolioInvestment,\n loadPropertyRightTimelineInvestment,\n addDealBuilderAssets,\n addDealBuilderAsset,\n addDealBuilderAssetLoan,\n addDealBuilderInvestmentToGroup,\n fetchGroupTimingFields,\n checkGroupTimingUnlockability,\n removeDealBuilderAsset,\n removeDealBuilderInvestment,\n removeDealBuilderInvestmentGroup,\n addInvestmentGroupInvestmentPlayers,\n removeInvestmentGroupInvestmentPlayer,\n updateInvestmentGroupInvestment,\n saveInvestmentGroup,\n fetchInvestmentGroupInvestments,\n addDealBuilderInvestmentGroup,\n setDealBuilderAssetExpanded,\n setDealBuilderInvestmentGroupExpanded,\n collapsePortfolioAssets,\n collapseAllAssetsExcept,\n addDealBuilderAssetAssumptionLoan,\n addDealBuilderAssetEntireInterest,\n addDealBuilderAssetForeclosureLoan,\n addDealBuilderAssetPartialInterest,\n clearDealBuilderAssetManipulatedLoans,\n clearDealBuilderAssetIndividualOwnershipInterests,\n prepopulateDealBuilder,\n populateDealBuilderFromQuery,\n mountInvestmentMetadata,\n retireLoan,\n awardInvestment,\n awardGroupInvestment,\n dropAwardedInvestment,\n dropAwardedGroupInvestment,\n alreadyFetched,\n alreadyFetchedFieldsFor,\n clearDealBuilder,\n refreshInvestmentGroup,\n refetchInvestment,\n updateStoreInvestment,\n fetchPrincipalsFor,\n linkInvestment,\n fetchPropertyDataField,\n fetchDealBuilderCalculationData,\n calculationDataByKey,\n };\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept(acceptHMRUpdate(useDealBuilderStore, import.meta.hot));\n}\n","\n \n
\n \n Subscribe to view \n \n\n
\n \n {{ taskLabel }} \n \n \n \n \n \n \n \n \n \n
\n \n \n {{ primaryText }} \n \n\n \n \n \n
\n \n \n
\n \n\n\n","\n \n
\n
\n
\n \n \n \n \n\n \n \n \n \n
\n
\n
\n
\n \n\n\n","\n \n
\n \n
\n
\n
\n
\n {{ displayableFieldType }}\n
\n
{{ moment(dataField.updatedAt).fromNow() }} \n
\n
\n \n \n
\n \n
\n
\n
\n
\n \n\n\n","\n \n \n
\n \n\n \n \n
\n
\n
\n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n
\n Data coverage\n \n
\n
\n
\n \n \n \n {{ dataType.name }}\n \n \n
\n
\n \n \n \n\n\n\n\n","\n \n \n
\n \n\n \n \n
\n
\n
\n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n \n\n\n\n\n","/* global L */\nimport { mount } from \"mount-vue-component\";\nimport app from \"@/entrypoints/application\";\nimport PropertyMarker from \"@/components/property-diagram/PropertyMarker.vue\";\nimport LandCoveringMarker from \"@/components/land-covering-diagram/LandCoveringMarker.vue\";\n\nexport default function propertyLandCoveringMapMarker({\n dataField,\n location,\n mapStore,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n layoutStore,\n secondaryPanelStore,\n documentationStore,\n analyzePanelStore,\n playerMinimap,\n}) {\n let markerVueEl;\n\n switch (dataField.decoratingContentType) {\n case \"Property\": {\n const { el } = mount(PropertyMarker, {\n props: {\n mapStore,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n layoutStore,\n secondaryPanelStore,\n documentationStore,\n analyzePanelStore,\n location,\n locationDataField: dataField,\n playerMinimap,\n },\n app,\n });\n\n markerVueEl = el;\n break;\n }\n case \"LandCovering\": {\n const { el } = mount(LandCoveringMarker, {\n props: {\n mapStore,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n secondaryPanelStore,\n documentationStore,\n analyzePanelStore,\n location,\n locationDataField: dataField,\n },\n app,\n });\n\n markerVueEl = el;\n break;\n }\n default:\n console.log(\"unknown marker content type\");\n }\n\n if (markerVueEl && location.lat && location.lng) {\n const icon = L.divIcon({\n className: \"workspace-marker\",\n html: markerVueEl,\n });\n\n return L.marker([location.lat, location.lng], { icon });\n } else {\n return null;\n }\n}\n","import propertyLandCoveringMapMarker from \"@/components/property-diagram/propertyLandCoveringMapMarker\";\nimport locationMarker from \"@/components/maps/locationMarker\";\n\nexport async function addLocationToMap({\n mode = \"store\",\n dataField,\n mapStore,\n featureGroup,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n layoutStore,\n secondaryPanelStore,\n documentationStore,\n analyzePanelStore,\n}) {\n const location = dataField.fieldContent;\n\n let workspaceMarker = null;\n\n if (mode === \"store\") {\n workspaceMarker = propertyLandCoveringMapMarker({\n dataField,\n location,\n mapStore,\n propertyFieldsStore,\n modalStore,\n unlockerStore,\n userStore,\n tasksStore,\n taskListStore,\n reminderStore,\n guestProfileStore,\n propertyDiagramStore,\n changeGroupStore,\n layoutStore,\n secondaryPanelStore,\n documentationStore,\n analyzePanelStore,\n });\n } else {\n const markerIcon = locationMarker({\n classes: \"h-3 w-3 bg-gray-600 hover:bg-gray-700 focus:ring-gray-500\",\n interactive: true,\n mapStore,\n propertyFieldsStore,\n propertyId: dataField.decoratingContentId,\n });\n workspaceMarker = L.marker([location.lat, location.lng], {\n draggable: false,\n icon: markerIcon,\n });\n }\n\n if (workspaceMarker) {\n featureGroup.addLayer(workspaceMarker);\n const layerId = featureGroup.getLayerId(workspaceMarker);\n location.mapInternalId = layerId;\n if (mode === \"store\") {\n mapStore.setNearbyDataField({\n dataField,\n locationType: dataField.decoratingContentType === \"Property\" ? \"Property\" : \"ContentLocation\",\n });\n }\n }\n}\n","\n \n \n
\n
\n \n \n
\n
\n {{ reputationHelp }}\n
\n
\n \n \n
\n
\n \n \n \n\n\n","/* global L */\nimport app from \"@/entrypoints/application\";\nimport { mount } from \"mount-vue-component\";\nimport UserMarker from \"@/components/maps/UserMarker.vue\";\n\nexport default function userMarker({\n geographyIntent,\n mapStore,\n documentationStore,\n}) {\n let markerVueEl;\n\n const { el } = mount(UserMarker, {\n props: { geographyIntent, mapStore, documentationStore },\n app,\n });\n\n markerVueEl = el;\n\n if (markerVueEl) {\n return L.divIcon({\n className: \"workspace-marker\",\n html: markerVueEl,\n });\n } else {\n return null;\n }\n}\n","L.AnimatedMarker = L.Marker.extend({\n options: {\n // meters\n distance: 200,\n // ms\n interval: 1000,\n // animate on add?\n autoStart: true,\n // callback onend\n onEnd: function(){},\n clickable: false\n },\n\n initialize: function (latlngs, options) {\n this.setLine(latlngs);\n L.Marker.prototype.initialize.call(this, latlngs[0], options);\n },\n\n // Breaks the line up into tiny chunks (see options) ONLY if CSS3 animations\n // are not supported.\n _chunk: function(latlngs) {\n var i,\n len = latlngs.length,\n chunkedLatLngs = [];\n\n for (i=1;i this.options.distance) {\n while (dist > this.options.distance) {\n cur = new L.LatLng(cur.lat + dLat, cur.lng + dLng);\n dist = cur.distanceTo(next);\n chunkedLatLngs.push(cur);\n }\n } else {\n chunkedLatLngs.push(cur);\n }\n }\n chunkedLatLngs.push(latlngs[len-1]);\n\n return chunkedLatLngs;\n },\n\n onAdd: function (map) {\n L.Marker.prototype.onAdd.call(this, map);\n\n // Start animating when added to the map\n if (this.options.autoStart) {\n this.start();\n }\n },\n\n animate: function() {\n var self = this,\n len = this._latlngs.length,\n speed = this.options.interval;\n\n // Normalize the transition speed from vertex to vertex\n if (this._i < len && this.i > 0) {\n speed = this._latlngs[this._i-1].distanceTo(this._latlngs[this._i]) / this.options.distance * this.options.interval;\n }\n\n // Only if CSS3 transitions are supported\n if (L.DomUtil.TRANSITION) {\n if (this._icon) { this._icon.style[L.DomUtil.TRANSITION] = ('all ' + speed + 'ms linear'); }\n if (this._shadow) { this._shadow.style[L.DomUtil.TRANSITION] = 'all ' + speed + 'ms linear'; }\n }\n\n // Move to the next vertex\n this.setLatLng(this._latlngs[this._i]);\n this._i++;\n\n // Queue up the animation to the next next vertex\n this._tid = setTimeout(function(){\n if (self._i === len) {\n self.options.onEnd.apply(self, Array.prototype.slice.call(arguments));\n } else {\n self.animate();\n }\n }, speed);\n },\n\n // Start the animation\n start: function() {\n this.animate();\n },\n\n // Stop the animation in place\n stop: function() {\n if (this._tid) {\n clearTimeout(this._tid);\n }\n },\n\n setLine: function(latlngs){\n if (L.DomUtil.TRANSITION) {\n // No need to to check up the line if we can animate using CSS3\n this._latlngs = latlngs;\n } else {\n // Chunk up the lines into options.distance bits\n this._latlngs = this._chunk(latlngs);\n this.options.distance = 10;\n this.options.interval = 30;\n }\n this._i = 0;\n }\n\n});\n\nL.animatedMarker = function (latlngs, options) {\n return new L.AnimatedMarker(latlngs, options);\n};\n","/* global L */\nimport { ref, computed, toRaw } from \"vue\";\nimport { defineStore, acceptHMRUpdate, storeToRefs } from \"pinia\";\nimport { createChannel, removeChannel } from \"@/channels/channel\";\nimport { useUserStore } from \"@/stores/user\";\nimport { useMainMapStore } from \"@/stores/mainMap\";\nimport locationMarker from \"@/components/maps/locationMarker\";\nimport userMarker from \"@/components/maps/userMarker\";\nimport \"leaflet.animatedmarker/src/AnimatedMarker\";\nimport _ from \"lodash\";\n\nexport const useUserGeographiesStore = defineStore(\"userGeographies\", () => {\n const editingColorCodes = [\n \"#38bdf8\",\n \"#2dd4bf\",\n \"#a3e635\",\n \"#fbbf24\",\n \"#fb923c\",\n \"#f472b6\",\n ];\n const editingColorNames = [\n \"sky\",\n \"teal\",\n \"lime\",\n \"amber\",\n \"orange\",\n \"pink\",\n ];\n\n const mapStore = useMainMapStore();\n const userStore = useUserStore();\n const { currentUser } = storeToRefs(userStore);\n const userGeographies = ref({});\n const userTokens = computed(() => _.keys(userGeographies.value));\n const editingUserTokens = computed(() => {\n const filtered = _.map(\n userGeographies.value,\n function ({ pendingLayerId }, token) {\n if (pendingLayerId) {\n return token;\n } else {\n return null;\n }\n },\n );\n\n return _.compact(filtered);\n });\n function markerColor() {\n const size = _.size(editingUserTokens.value);\n const numerator = size > 0 ? size - 1 : 0;\n const modIndex = numerator % 6;\n\n return editingColorNames[modIndex];\n }\n function lineColor() {\n const size = _.size(editingUserTokens.value);\n const numerator = size > 0 ? size - 1 : 0;\n const modIndex = numerator % 6;\n\n return editingColorCodes[modIndex];\n }\n\n function updateUsers(intents, mapStore, mapFeatureGroup, documentationStore) {\n const incomingTokens = intents.map((geographyIntent) =>\n _.get(geographyIntent, \"user.token\"),\n );\n const orphanedTokens = _.difference(userTokens.value, incomingTokens);\n disconnectChannelsFor(orphanedTokens, mapFeatureGroup);\n\n intents.forEach((geographyIntent) => {\n const token = _.get(geographyIntent, \"user.token\");\n const existingUser = userGeographies.value[token];\n if (existingUser) {\n updateExistingUserIntent(\n geographyIntent,\n mapStore,\n mapFeatureGroup,\n documentationStore,\n );\n } else {\n const icon = userMarker({\n geographyIntent,\n mapStore,\n documentationStore,\n });\n\n let workspaceMarker = null;\n\n if (icon && currentUser.value?.token !== token) {\n workspaceMarker = L.marker(\n [geographyIntent.lat, geographyIntent.lng],\n { icon, zIndexOffset: -9999 },\n );\n mapFeatureGroup.addLayer(workspaceMarker);\n }\n\n userGeographies.value[token] = {\n layerId: workspaceMarker\n ? mapFeatureGroup.getLayerId(workspaceMarker)\n : null,\n pendingLayerId: null,\n connectingLineId: null,\n geographyIntent,\n channel: createChannel(\n {\n channel: \"UserGeographiesChannel\",\n userToken: token,\n },\n {\n connected() {},\n received(data) {\n if (currentUser.value?.token !== token) {\n switch (data.action) {\n case \"create\":\n createPendingMarker(mapFeatureGroup, token, data);\n break;\n case \"remove\":\n removePendingMarker(mapFeatureGroup, token);\n break;\n case \"rename\":\n renamePendingMarker(mapFeatureGroup, token, data);\n break;\n case \"relocate\":\n relocatePendingMarker(mapFeatureGroup, token, data);\n break;\n }\n }\n updateExistingUserIntent(\n data.geographyIntent,\n mapStore,\n mapFeatureGroup,\n documentationStore,\n );\n },\n },\n ),\n };\n }\n });\n }\n\n function createPendingMarker(mapFeatureGroup, token, { lat, lng }) {\n // console.log(\"create\", token, lat, lng);\n const existingUserChannel = userGeographies.value[token];\n if (existingUserChannel) {\n const mapMarker = L.marker([lat, lng]);\n mapFeatureGroup.addLayer(mapMarker);\n\n existingUserChannel.pendingLayerId =\n mapFeatureGroup.getLayerId(mapMarker);\n\n const color = markerColor();\n const markerIcon = locationMarker({\n classes: `h-6 w-6 bg-${color}-400 hover:bg-${color}-500 focus:ring-${color}-300`,\n interactive: false,\n mapStore,\n });\n mapMarker.setIcon(markerIcon);\n\n // create line from user to pending property\n const userLatLng = existingUserChannel.geographyIntent;\n const line = L.polyline(\n [\n [lat, lng],\n [userLatLng.lat, userLatLng.lng],\n ],\n { color: lineColor(), weight: 6, dashArray: \"5, 10\" },\n );\n mapFeatureGroup.addLayer(line);\n line.bindTooltip(\"User adding a new property\").openTooltip();\n existingUserChannel.connectingLineId = mapFeatureGroup.getLayerId(line);\n }\n }\n function relocatePendingMarker(mapFeatureGroup, token, { lat, lng }) {\n // console.log(\"relocate\", token, lat, lng);\n const existingUserChannel = userGeographies.value[token];\n if (existingUserChannel?.pendingLayerId) {\n const marker = mapFeatureGroup.getLayer(\n existingUserChannel.pendingLayerId,\n );\n const line = mapFeatureGroup.getLayer(\n existingUserChannel.connectingLineId,\n );\n line.closeTooltip();\n const latLng = L.latLng(lat, lng);\n\n marker.setLatLng(latLng);\n const userLatLng = existingUserChannel.geographyIntent;\n line.setLatLngs([latLng, [userLatLng.lat, userLatLng.lng]]);\n line.openTooltip();\n }\n }\n function renamePendingMarker(mapFeatureGroup, token, { name }) {\n const existingUserChannel = userGeographies.value[token];\n // console.log(\"rename\", token, name, existingUserChannel);\n if (existingUserChannel?.pendingLayerId) {\n const marker = mapFeatureGroup.getLayer(\n existingUserChannel.pendingLayerId,\n );\n\n if (marker.isPopupOpen()) {\n marker.setTooltipContent(name);\n } else {\n marker.bindTooltip(name, { permanent: true }).openTooltip();\n }\n }\n }\n function removePendingMarker(mapFeatureGroup, token) {\n // console.log(\"remove\", token);\n const existingUserChannel = userGeographies.value[token];\n if (existingUserChannel?.pendingLayerId) {\n mapFeatureGroup.removeLayer(existingUserChannel.pendingLayerId);\n mapFeatureGroup.removeLayer(existingUserChannel.connectingLineId);\n existingUserChannel.pendingLayerId = null;\n existingUserChannel.connectingLineId = null;\n }\n }\n\n function updateExistingUserIntent(\n geographyIntent,\n mapStore,\n mapFeatureGroup,\n documentationStore,\n ) {\n const token = _.get(geographyIntent, \"user.token\");\n const existingUser = userGeographies.value[token];\n if (existingUser) {\n if (existingUser.layerId) {\n // create line\n const line = L.polyline([\n [existingUser.geographyIntent.lat, existingUser.geographyIntent.lng],\n [geographyIntent.lat, geographyIntent.lng],\n ]);\n // create icon\n const icon = userMarker({\n geographyIntent,\n mapStore,\n documentationStore,\n });\n let animatedMarker = null;\n\n if (icon) {\n // animate marker\n animatedMarker = L.animatedMarker(line.getLatLngs(), {\n icon,\n zIndexOffset: -9999,\n });\n mapFeatureGroup.removeLayer(existingUser.layerId);\n mapFeatureGroup.addLayer(animatedMarker);\n existingUser.layerId = mapFeatureGroup.getLayerId(animatedMarker);\n }\n }\n\n existingUser.geographyIntent = geographyIntent;\n }\n }\n\n function disconnectChannelsFor(orphanedTokens, mapFeatureGroup) {\n orphanedTokens.forEach((token) => {\n const intent = _.get(userGeographies.value, token);\n\n if (intent) {\n const rawChannel = toRaw(intent.channel);\n removeChannel(rawChannel);\n\n if (intent.layerId) {\n mapFeatureGroup.removeLayer(intent.layerId);\n }\n\n delete userGeographies.value[token];\n }\n });\n }\n\n function addLayerIdToUser(token, layerId) {\n userGeographies.value[token].layerId = layerId;\n }\n\n return {\n userGeographies,\n updateUsers,\n addLayerIdToUser,\n };\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useUserGeographiesStore, import.meta.hot),\n );\n}\n","/* global L */\nimport { ref, computed } from \"vue\";\nimport { defineStore, acceptHMRUpdate, storeToRefs } from \"pinia\";\nimport { addLocationToMap } from \"@/components/maps/addLocationToMap\";\nimport { addPolygonToMap } from \"@/components/maps/addPolygonToMap\";\nimport { useUserStore } from \"@/stores/user\";\nimport { useUserGeographiesStore } from \"@/stores/userGeographies\";\nimport { useWorkspaceLayoutStore } from \"@/stores/workspaceLayout\";\nimport { usePropertyFieldsStore } from \"@/stores/propertyFields\";\nimport { usePropertyDiagramStore } from \"@/stores/propertyDiagram\";\nimport { useDocumentationStore } from \"@/stores/documentation\";\nimport { useAnalyzePanelStore } from \"@/stores/analyzePanel\";\nimport { useSecondaryPanelStore } from \"@/stores/secondaryPanel\";\nimport { useCrowdsourcedChangeGroupStore } from \"@/stores/crowdsourcedChangeGroup\";\nimport { useModalStore } from \"@/stores/modal\";\nimport { useUnlockerStore } from \"@/stores/unlocker\";\nimport { useTasksStore } from \"@/stores/tasks\";\nimport { useTaskListStore } from \"@/stores/taskList\";\nimport { useReminderStore } from \"@/stores/reminder\";\nimport { useGuestProfileStore } from \"@/stores/guestProfile\";\nimport locationMarker from \"@/components/maps/locationMarker\";\nimport api from \"@/router/api\";\nimport _ from \"lodash\";\nimport { useRoute } from \"vue-router\";\n\nexport const useMainMapStore = defineStore(\"mainMap\", () => {\n const map = ref(null);\n const refreshing = ref(false);\n const fitting = ref(false);\n const placeDetails = ref(null);\n const placePredictions = ref(null);\n const minimapSize = ref(\"micro\");\n const expandedMap = computed(() => minimapSize.value === \"compact\");\n const zoomBasedLayerSwitchOverride = ref(false);\n const mapAddingProperty = ref(false);\n const fetchingMapData = ref(false);\n const fetchingAddedPropertyAddress = ref(false);\n const mapAddedProperty = ref({\n marker: null,\n name: null,\n address: null,\n cityState: null,\n customAddress: false,\n });\n const mapSearch = ref(null);\n const hoveringSearchResults = ref(false);\n const searchControl = ref(null);\n const loaderControl = ref(null);\n const searchMarker = ref(null);\n const newOriginOverride = ref(false);\n const temporaryMapCenter = ref({\n lat: null,\n lng: null,\n zoom: null,\n });\n const mapBoundaryMeta = ref({\n centerLatLng: null,\n southwestLatLng: null,\n northeastLatLng: null,\n zoom: null,\n });\n const zoom = computed(() => mapBoundaryMeta.value.zoom);\n const centerLatLng = computed(() => mapBoundaryMeta.value.centerLatLng);\n const compositeMapMeta = computed(\n () => `${centerLatLng.value}_${zoom.value}`,\n );\n const propertyMarkerPulseId = ref(null);\n const nearbyPropertyDataFields = ref({});\n const nearbyLandCoveringLocationDataFields = ref({});\n const nearbyParcelPolygonDataFields = ref({});\n const nearbyHunts = computed(() => {\n if (map.value) {\n const bounds = map.value.getBounds();\n return nearbyHuntRegionFields.value.filter(({ fieldContent }) => {\n if (fieldContent) {\n const { coordinates } = fieldContent;\n\n if (coordinates) {\n return bounds.overlaps(L.polygon(coordinates).getBounds());\n }\n }\n });\n } else {\n return [];\n }\n });\n const nearbyHuntDataFields = computed(() => {\n const huntFetches = _.filter(\n locationFetchData.value,\n function (fetchData, fetchKey) {\n const fetchKeyData = _.split(fetchKey, \"_\");\n const fetchKeyContentType = _.head(fetchKeyData);\n\n return fetchKeyContentType === \"HuntInvolvement\" && fetchData.data;\n },\n );\n\n const rawHunts = huntFetches.flatMap(({ data }) => data);\n const filteredHunts = rawHunts.filter(({ fieldContentId }) =>\n _.includes(\n nearbyHunts.value.map(({ joiningContentId }) => joiningContentId),\n fieldContentId,\n ),\n );\n\n return _.uniqBy(filteredHunts, \"fieldContentId\");\n });\n const nearbyHuntRegionFields = computed(() => {\n const huntFetches = _.filter(\n locationFetchData.value,\n function (fetchData, fetchKey) {\n const fetchKeyData = _.split(fetchKey, \"_\");\n const fetchKeyContentType = _.head(fetchKeyData);\n\n return fetchKeyContentType === \"HuntRegion\" && fetchData.data;\n },\n );\n\n const rawHunts = huntFetches.flatMap(({ data }) => data);\n\n return _.uniqBy(rawHunts, \"fieldContentId\");\n });\n const nearbyRegionHuntIds = computed(() =>\n _.uniq(\n nearbyHuntRegionFields.value.map(\n ({ joiningContentId }) => joiningContentId,\n ),\n ),\n );\n const propertyFieldsStore = usePropertyFieldsStore();\n const { storeLandCoveringLocationDataFields, storeParcelPolygonDataFields } =\n storeToRefs(propertyFieldsStore);\n\n function cleanUrl(url) {\n return url.replace(\"/api/v1/\", \"\");\n }\n const locationFetchData = ref({});\n const allPagysLoaded = computed(() =>\n _.every(locationFetchData.value, function (fetchObject) {\n if (fetchObject.loaded) {\n return true;\n } else {\n return false;\n }\n }),\n );\n async function loadPaginatedLocationRecords({ state, somePagy, key, count }) {\n let existingData = locationFetchData.value[key];\n const payload = {\n alreadyFetchedPropertyIds: [], // fieldKeys only on initial fetch, not pagination\n };\n\n if (somePagy.next && !existingData.loadingEvents) {\n existingData.loadingEvents = true;\n const endpoint = cleanUrl(somePagy.next_url);\n try {\n api.post(endpoint, payload).then((json) => {\n const { data, pagy } = json.data;\n\n existingData.data = _.uniqBy(\n _.concat(existingData.data, data),\n \"localId\",\n );\n existingData.pagy = pagy;\n\n data.forEach((dataField) => {\n if (dataField.fieldContentType === \"ContentLocation\") {\n addLocationToMap({\n mode: \"store\",\n dataField,\n mapStore: existingData.mapStore,\n featureGroup: existingData.featureGroup,\n propertyFieldsStore,\n modalStore: useModalStore(),\n unlockerStore: useUnlockerStore(),\n userStore,\n tasksStore: useTasksStore(),\n taskListStore: useTaskListStore(),\n reminderStore: useReminderStore(),\n guestProfileStore: useGuestProfileStore(),\n propertyDiagramStore: usePropertyDiagramStore(),\n changeGroupStore: useCrowdsourcedChangeGroupStore(),\n layoutStore: useWorkspaceLayoutStore(),\n secondaryPanelStore: useSecondaryPanelStore(),\n documentationStore: useDocumentationStore(),\n analyzePanelStore: useAnalyzePanelStore(),\n });\n } else if (dataField.fieldContentType === \"ContentPolygon\") {\n addPolygonToMap({\n mode: \"store\",\n dataField,\n mapStore: existingData.mapStore,\n featureGroup: existingData.featureGroup,\n propertyFieldsStore,\n modalStore: useModalStore(),\n unlockerStore: useUnlockerStore(),\n userStore,\n tasksStore: useTasksStore(),\n taskListStore: useTaskListStore(),\n reminderStore: useReminderStore(),\n guestProfileStore: useGuestProfileStore(),\n propertyDiagramStore: usePropertyDiagramStore(),\n changeGroupStore: useCrowdsourcedChangeGroupStore(),\n layoutStore: useWorkspaceLayoutStore(),\n secondaryPanelStore: useSecondaryPanelStore(),\n documentationStore: useDocumentationStore(),\n analyzePanelStore: useAnalyzePanelStore(),\n horizontalIsAnalyze: horizontalIsAnalyze.value,\n });\n }\n });\n\n if (data.length < count || !pagy.next) {\n state.complete();\n existingData.loadingEvents = false;\n existingData.loaded = true;\n // console.log(\"pagination fully complete\", key);\n } else {\n state.loaded();\n existingData.loadingEvents = false;\n }\n });\n } catch (error) {\n state.error();\n existingData.loadingEvents = false;\n }\n } else {\n // console.log(\"pagination complete without ever fetching\", key);\n state.complete();\n if (existingData) existingData.loaded = true;\n }\n }\n\n const route = useRoute();\n const query = computed(() => route.query);\n const horizontalIsAnalyze = computed(\n () => _.get(query.value, \"horizontalTab\") === \"Analyze\",\n );\n const propertyZoomTrigger = computed(() => {\n return horizontalIsAnalyze.value ? 11 : 13;\n });\n\n function clearSearchMarker() {\n if (searchMarker.value) {\n map.value.removeLayer(searchMarker.value);\n searchMarker.value = null;\n }\n }\n\n function clearSearchControl() {\n if (searchControl.value) {\n map.value.removeControl(searchControl.value);\n searchControl.value = null;\n }\n }\n\n function clearLoaderControl() {\n if (loaderControl.value) {\n map.value.removeControl(loaderControl.value);\n loaderControl.value = null;\n }\n }\n\n function tapView() {\n let { lat, lng } = map.value.getCenter();\n lat += 0.0000000000005;\n lng += 0.0000000000005;\n const zoom = map.value.getZoom();\n map.value.setView([lat, lng], zoom);\n }\n\n const userGeographiesStore = useUserGeographiesStore();\n const { userGeographies } = storeToRefs(userGeographiesStore);\n const userStore = useUserStore();\n const { currentUser } = storeToRefs(userStore);\n\n function renameRemotePendingMarker() {\n const existingUserGeographiesChannel =\n userGeographies.value[currentUser.value.token];\n\n if (existingUserGeographiesChannel) {\n existingUserGeographiesChannel.channel.perform(\"rename_pending_marker\", {\n token: currentUser.value.token,\n name: mapAddedProperty.value.name,\n });\n }\n }\n\n async function lookupMapAddedPropertyAddress(mapStoreInstance) {\n return new Promise((resolve) => {\n let payload = {};\n\n if (mapAddedProperty.value.marker) {\n const currentCoordinates = mapAddedProperty.value.marker.getLatLng();\n payload.lat = currentCoordinates.lat;\n payload.lng = currentCoordinates.lng;\n } else if (mapSearch.value) {\n const { lat, lng } = mapSearch.value;\n payload.lat = lat;\n payload.lng = lng;\n\n clearSearchMarker();\n\n const markerIcon = locationMarker({\n classes: \"h-5 w-5 bg-red-600 hover:bg-red-700 focus:ring-red-500\",\n interactive: true,\n mapStore: mapStoreInstance,\n });\n mapAddedProperty.value.marker = L.marker([lat, lng], {\n icon: markerIcon,\n });\n mapAddedProperty.value.marker.addTo(map.value);\n mapAddedProperty.value.marker.pm.enable();\n }\n\n fetchingAddedPropertyAddress.value = true;\n\n api.post(`property_address_lookups`, payload).then(\n (json) => {\n if (json.data) {\n const { street_number, street, city, state } = json.data;\n const number = street_number ? `${street_number} ` : \"\";\n const cityState = `${city}, ${state}`;\n const rawAddress = `${number}${street}`;\n let simpleAddress;\n\n simpleAddress = rawAddress;\n\n if (!mapAddedProperty.value.customAddress) {\n setMapAddedPropertyName({\n name: simpleAddress,\n userCustomized: false,\n });\n }\n mapAddedProperty.value.address = rawAddress;\n mapAddedProperty.value.cityState = cityState;\n } else {\n if (!mapAddedProperty.value.customAddress) {\n setMapAddedPropertyName({\n name: \"New Property\",\n userCustomized: false,\n });\n }\n mapAddedProperty.value.address = \"Unknown address\";\n mapAddedProperty.value.cityState = \"Unknown area\";\n }\n\n if (!mapSearch.value) mapAddedProperty.value.marker.openPopup();\n fetchingAddedPropertyAddress.value = false;\n resolve();\n },\n () => {\n if (!mapAddedProperty.value.customAddress) {\n setMapAddedPropertyName({\n name: \"New Property\",\n userCustomized: false,\n });\n }\n if (!mapSearch.value) mapAddedProperty.value.marker.openPopup();\n mapAddedProperty.value.address = \"Unknown address\";\n mapAddedProperty.value.cityState = \"Unknown area\";\n fetchingAddedPropertyAddress.value = false;\n resolve();\n },\n );\n });\n }\n\n function clearMapAddedProperty() {\n mapAddedProperty.value = {\n marker: null,\n address: null,\n cityState: null,\n customAddress: false,\n };\n }\n\n function setMapAddedPropertyName({ name, userCustomized }) {\n mapAddedProperty.value.name = name;\n mapAddedProperty.value.customAddress = userCustomized;\n renameRemotePendingMarker();\n }\n\n async function setNearbyDataField({ dataField, locationType }) {\n if (dataField) {\n let layerId = null;\n switch (locationType) {\n case \"Property\": {\n const propertyId =\n dataField.joiningContentType === \"Property\"\n ? dataField.joiningContentId\n : null;\n\n if (propertyId) {\n await propertyFieldsStore.fetchPropertyDataField(\n propertyId,\n \"?scope=draft_visible&template=draft_visible\",\n );\n layerId = dataField.fieldContent.mapInternalId;\n propertyFieldsStore.setPropertyFieldLayerId(propertyId, layerId);\n }\n nearbyPropertyDataFields.value[dataField.fieldContentId] = dataField;\n break;\n }\n case \"ContentLocation\":\n nearbyLandCoveringLocationDataFields.value[dataField.fieldContentId] =\n dataField;\n if (\n _.isObject(\n storeLandCoveringLocationDataFields.value[\n dataField.decoratingContentId\n ],\n )\n ) {\n // console.log(\"land covering exists in store\", dataField.decoratingContentId);\n storeLandCoveringLocationDataFields.value[\n dataField.decoratingContentId\n ].locationField = dataField;\n } else {\n // console.log(\"land covering absent from store\", dataField.decoratingContentId);\n storeLandCoveringLocationDataFields.value[\n dataField.decoratingContentId\n ] = {\n locationField: dataField,\n landCoveringField: null,\n };\n }\n\n layerId = dataField.fieldContent.mapInternalId;\n propertyFieldsStore.setLandCoveringFieldLayerId(\n dataField.decoratingContentId,\n layerId,\n );\n break;\n case \"ContentPolygon\":\n nearbyParcelPolygonDataFields.value[dataField.fieldContentId] =\n dataField;\n if (\n _.isObject(\n storeParcelPolygonDataFields.value[dataField.decoratingContentId],\n )\n ) {\n // console.log(\"parcel exists in store\", dataField.decoratingContentId);\n storeParcelPolygonDataFields.value[\n dataField.decoratingContentId\n ].parcelField = dataField;\n } else {\n // console.log(\"parcel absent from store\", dataField.decoratingContentId);\n storeParcelPolygonDataFields.value[dataField.decoratingContentId] =\n {\n parcelField: dataField,\n propertyRightField: null,\n };\n }\n\n layerId = dataField.fieldContent.mapInternalId;\n propertyFieldsStore.setParcelFieldLayerId(\n dataField.decoratingContentId,\n layerId,\n );\n break;\n default:\n console.log(\"setNearbyDataField: unknown locationType\", locationType);\n }\n }\n }\n\n return {\n map,\n refreshing,\n fitting,\n placeDetails,\n placePredictions,\n mapAddedProperty,\n mapSearch,\n hoveringSearchResults,\n temporaryMapCenter,\n mapBoundaryMeta,\n zoom,\n propertyZoomTrigger,\n centerLatLng,\n minimapSize,\n mapAddingProperty,\n fetchingMapData,\n fetchingAddedPropertyAddress,\n propertyMarkerPulseId,\n nearbyPropertyDataFields,\n nearbyLandCoveringLocationDataFields,\n nearbyParcelPolygonDataFields,\n nearbyHunts,\n nearbyHuntDataFields,\n nearbyHuntRegionFields,\n nearbyRegionHuntIds,\n searchMarker,\n searchControl,\n loaderControl,\n newOriginOverride,\n zoomBasedLayerSwitchOverride,\n expandedMap,\n horizontalIsAnalyze,\n locationFetchData,\n allPagysLoaded,\n compositeMapMeta,\n loadPaginatedLocationRecords,\n clearMapAddedProperty,\n clearSearchMarker,\n clearSearchControl,\n clearLoaderControl,\n setMapAddedPropertyName,\n setNearbyDataField,\n lookupMapAddedPropertyAddress,\n tapView,\n };\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept(acceptHMRUpdate(useMainMapStore, import.meta.hot));\n}\n","\n \n
\n
\n Number of key data types present:\n
\n
\n
\n
\n
\n
\n {{ style.name }}\n
\n
\n
\n
\n
\n \n\n\n","import { defineStore, acceptHMRUpdate } from \"pinia\";\nimport { useMainMapStore } from \"@/stores/mainMap\";\nimport { useUserStore } from \"@/stores/user\";\nimport { useTimeTravelStore } from \"@/stores/timeTravel\";\nimport { useCalculationFieldsStore } from \"@/stores/calculationFields\";\nimport { usePropertyDiagramStore } from \"@/stores/propertyDiagram\";\nimport { useCompanyDetailStore } from \"@/stores/companyDetail\";\nimport { useContactDetailStore } from \"@/stores/contactDetail\";\nimport { useNotificationsStore } from \"@/stores/notifications\";\nimport { assetDataFieldFor } from \"@/components/company-detail/companyInvolvementGroups\";\nimport { storeToRefs } from \"pinia\";\nimport { ref, computed, watch, markRaw, nextTick } from \"vue\";\nimport { useRoute, useRouter } from \"vue-router\";\nimport milestones from \"@/assets/contentMilestones\";\nimport useTypes from \"@/assets/useTypes\";\nimport delay from \"@/assets/delay\";\nimport DataCoverage from \"@/components/analyze/layers/DataCoverage.vue\";\nimport api from \"@/router/api\";\nimport _ from \"lodash\";\n/* global L */\n\nexport const useAnalyzePanelStore = defineStore(\"analyzePanel\", () => {\n const calculationFieldsStore = useCalculationFieldsStore();\n const notificationsStore = useNotificationsStore();\n const userStore = useUserStore();\n const { signedIn } = storeToRefs(userStore);\n const mapStore = useMainMapStore();\n const {\n map,\n zoom,\n centerLatLng,\n nearbyPropertyDataFields,\n nearbyHuntDataFields,\n compositeMapMeta,\n allPagysLoaded: mapPagysLoaded,\n } = storeToRefs(mapStore);\n const timeTravelStore = useTimeTravelStore();\n const {\n asOfMilliseconds,\n combinedTimelineInvestmentFields,\n combinedInvestmentIds,\n combinedTimelineSpaceAvailabilityFields,\n combinedSpaceAvailabilityIds,\n mainTimelineCustomLookbackDate,\n allPagysLoaded: timelinePagysLoaded,\n } = storeToRefs(timeTravelStore);\n const propertyDiagramStore = usePropertyDiagramStore();\n const {\n propertyIdParam,\n propertyDiagramPropertyIds,\n propertyDiagramSelected,\n propertySelectedRecordDataField,\n propertyDiagramPropertyDataFields,\n propertyDataField,\n editingMode,\n } = storeToRefs(propertyDiagramStore);\n const companyDetailStore = useCompanyDetailStore();\n const {\n companyIdParam,\n companyDetailSelected,\n companySelectedRecordDataField,\n companyFetchedPolygonDataFields,\n companyFetchedLocationDataFields,\n } = storeToRefs(companyDetailStore);\n const contactDetailStore = useContactDetailStore();\n const {\n contactIdParam,\n contactDetailSelected,\n contactSelectedRecordDataField,\n contactFetchedPolygonDataFields,\n contactFetchedLocationDataFields,\n } = storeToRefs(contactDetailStore);\n\n const router = useRouter();\n const route = useRoute();\n const routeName = computed(() => route.name);\n const query = computed(() => route.query);\n const horizontalIsAnalyze = computed(\n () =>\n _.includes(\n [\"CompanyShell\", \"ContactShell\", \"PropertyShell\"],\n routeName.value,\n ) || _.get(query.value, \"horizontalTab\") === \"Analyze\",\n );\n const asyncReady = computed(\n () =>\n horizontalIsAnalyze.value &&\n mapPagysLoaded.value &&\n timelinePagysLoaded.value,\n );\n const fetchingAnalyzePanelData = ref(false);\n const layers = ref([\n {\n id: 1,\n title: \"Base\",\n description: \"Standard coloring for properties, buildings, and parcels\",\n component: null,\n },\n {\n id: 2,\n title: \"Data Coverage\",\n description:\n \"Which properties have: Leasing, Investments, Key Dates, Uses, and Sizes\",\n component: markRaw(DataCoverage),\n },\n ]);\n const selectedLayer = ref(layers.value[0]);\n const hoveringTableRowContent = ref(null);\n const mapSearchShortcutAction = ref(null);\n const emptySpaceUsageStates = () => {\n const rawStates = _.get(milestones, \"SpaceUsage\", []);\n\n return rawStates.map((stateObject) => {\n return {\n value: stateObject.value,\n label: stateObject.statusLabel,\n openDateFieldName: stateObject.openDateFieldName,\n closeDateFieldName: stateObject.closeDateFieldName,\n checked: _.includes([\"terminated\", \"expired\"], stateObject.value)\n ? false\n : true,\n };\n });\n };\n const emptyLoanStates = () => {\n const rawStates = _.get(milestones, \"Loan\", []);\n\n return rawStates.map((stateObject) => {\n return {\n value: stateObject.value,\n label: stateObject.statusLabel,\n openDateFieldName: stateObject.openDateFieldName,\n closeDateFieldName: stateObject.closeDateFieldName,\n checked: stateObject.value === \"retired\" ? false : true,\n };\n });\n };\n const emptyInvestmentStates = () => {\n const rawStates = _.get(milestones, \"Investment\", []);\n\n return rawStates.map((stateObject) => {\n return {\n value: stateObject.value,\n label: stateObject.statusLabel,\n openDateFieldName: stateObject.openDateFieldName,\n closeDateFieldName: stateObject.closeDateFieldName,\n checked: stateObject.value === \"withdrawn\" ? false : true,\n };\n });\n };\n const emptySpaceAvailabilityStates = () => {\n const rawStates = _.get(milestones, \"SpaceAvailability\", []);\n\n return rawStates.map((stateObject) => {\n return {\n value: stateObject.value,\n label: stateObject.name,\n openDateFieldName: stateObject.openDateFieldName,\n closeDateFieldName: stateObject.closeDateFieldName,\n checked: _.includes([\"withdrawn\"], stateObject.value) ? false : true,\n };\n });\n };\n const emptyLiveSpaceAvailabilityStates = () => {\n const rawStates = _.get(milestones, \"SpaceAvailability\", []);\n\n return rawStates.map((stateObject) => {\n return {\n value: stateObject.value,\n label: stateObject.name,\n openDateFieldName: stateObject.openDateFieldName,\n closeDateFieldName: stateObject.closeDateFieldName,\n checked: _.includes([\"live\"], stateObject.value) ? true : false,\n };\n });\n };\n const emptyUseTypes = () => {\n const rawTypes = useTypes;\n\n return rawTypes.map((useTypeObject) => {\n return {\n value: useTypeObject.value,\n label: useTypeObject.value,\n checked: true,\n };\n });\n };\n const filters = ref({\n category: [\n { value: \"hunts\", label: \"Hunts\", checked: false },\n { value: \"companies\", label: \"Companies\", checked: false },\n {\n value: \"space-availabilities\",\n label: \"Space Availabilities\",\n checked: false,\n },\n { value: \"space-usages\", label: \"Leases/Licenses\", checked: false },\n { value: \"investments\", label: \"Investments\", checked: false },\n { value: \"loans\", label: \"Loans\", checked: false },\n { value: \"sizes-uses\", label: \"Sizes & Uses\", checked: false },\n ],\n dates: [{ label: \"From\" }, { label: \"To\" }],\n geography: [\n { value: \"boundaries\", label: \"Map Boundaries\" },\n { value: \"polygon\", label: \"Polygon\", polygon: null, editing: false },\n ],\n landCoveringUseType: emptyUseTypes(),\n landCoveringState: [\n {\n value: [\"hypothetical\"],\n label: \"Hypothetical\",\n checked: false,\n },\n {\n value: [\"construction_proposed\"],\n label: \"Proposed\",\n checked: false,\n },\n {\n value: [\"construction_approved\", \"construction_permitted\"],\n label: \"Approved\",\n checked: false,\n },\n {\n value: [\"construction_commenced\"],\n label: \"Under Construction\",\n checked: true,\n },\n {\n value: [\n \"demolition_proposed\",\n \"demolition_permitted\",\n \"construction_completed\",\n \"remeasurement_created\",\n ],\n label: \"Completed\",\n checked: true,\n },\n ],\n companyEventType: [\n { value: \"capMarkets\", label: \"Capital Markets Deal\", checked: true },\n { value: \"leasing\", label: \"Leasing Deal\", checked: true },\n { value: \"capMarketsHunt\", label: \"Capital Markets Hunt\", checked: true },\n { value: \"leasingHunt\", label: \"Occupier Hunt\", checked: true },\n ],\n companyRole: [\n { value: \"Principal\", label: \"Principal\", checked: true },\n { value: \"Advisor\", label: \"Advisor\", checked: true },\n { value: \"Prospect\", label: \"Include Prospects?\", checked: true },\n ],\n loanState: emptyLoanStates(),\n loanMaturityDate: [\n {\n value: \"maturity_date\",\n label: \"On or before\",\n date: null,\n editing: false,\n },\n ],\n spaceUsageState: emptySpaceUsageStates(),\n spaceUsageExpirationDate: [\n {\n value: \"expired_date\",\n label: \"On or before\",\n date: null,\n editing: false,\n },\n ],\n spaceAvailabilitySpaceType: [\n { value: \"FloorArea\", label: \"Floor Area\", checked: true },\n { value: \"LayoutPartition\", label: \"Room\", checked: false },\n {\n value: \"PropertyEnhancement\",\n label: \"Property Feature\",\n checked: false,\n },\n ],\n spaceAvailabilityState: emptySpaceAvailabilityStates(),\n spaceAvailabilitySize: [{ label: \"Area (SF)\", min: null, max: null }],\n investmentState: emptyInvestmentStates(),\n investmentValuation: [{ label: \"Value\", min: null, max: null }],\n investmentType: [\n {\n value: [\"sellOutright\", \"foreclosureSellOutright\"],\n label: \"Sale\",\n checked: true,\n },\n {\n value: [\n \"sellEntireInterest\",\n \"sellPartialInterest\",\n \"sellMultipleInterests\",\n ],\n label: \"Recap\",\n checked: true,\n },\n {\n value: [\"originateLoan\", \"refinance\"],\n label: \"Financing\",\n checked: false,\n },\n ],\n investmentAssetType: [\n { value: \"Fee simple\", label: \"Fee parcel\", checked: true },\n { value: \"Leasehold\", label: \"Leasehold\", checked: true },\n { value: \"Condominium\", label: \"Condominium\", checked: true },\n { value: \"Co-op\", label: \"Co-op\", checked: true },\n {\n value: \"Unused Development Rights\",\n label: \"Air Rights\",\n checked: true,\n },\n { value: \"senior\", label: \"Senior Loan\", checked: true },\n { value: \"junior\", label: \"Junior Loan\", checked: true },\n ],\n });\n const polygonPropertyLocations = ref([]);\n const polygonInvestmentIds = ref([]);\n const polygonAvailabilityIds = ref([]);\n const polygonPropertyIds = computed(() =>\n translatePropertyIds(\n polygonPropertyLocations.value.map(\n (locationField) => locationField.decoratingContentId,\n ),\n ),\n );\n const selectedGeography = ref(\n _.find(filters.value.geography, { value: \"boundaries\" }),\n );\n const geographyFilterPolygon = computed(\n () =>\n _.find(filters.value.geography, {\n value: \"polygon\",\n }).polygon,\n );\n const editingPolygon = computed(() => {\n return (\n selectedGeography.value?.value === \"polygon\" &&\n _.find(filters.value.geography, {\n value: \"polygon\",\n }).editing\n );\n });\n const polygonArea = computed(() => {\n if (geographyFilterPolygon.value) {\n const latLngs = geographyFilterPolygon.value.getLatLngs()[0];\n return L.GeometryUtil.geodesicArea(latLngs);\n } else {\n return null;\n }\n });\n function getPolygonCoordinates() {\n if (geographyFilterPolygon.value) {\n return geographyFilterPolygon.value.getLatLngs()[0].map((c) => {\n return { lat: c.lat, lng: c.lng };\n });\n }\n }\n const emptyCategoriesFetchable = computed(\n () =>\n _.includes([\"CompanyShell\", \"ContactShell\"], routeName.value) ||\n checkedCategories.value.length > 0,\n );\n const triggerClearMapPolygon = ref(false);\n const filterCategories = computed(() => {\n switch (routeName.value) {\n case \"MainMap\":\n return filters.value.category;\n case \"CompanyShell\":\n case \"ContactShell\":\n return filters.value.category.filter((category) => {\n return _.includes(\n [\n \"space-availabilities\",\n \"space-usages\",\n \"sizes-uses\",\n \"investments\",\n \"loans\",\n ],\n category.value,\n );\n });\n case \"PropertyShell\":\n default:\n return filters.value.category.filter((category) => {\n return _.includes(\n [\"space-availabilities\", \"space-usages\", \"sizes-uses\"],\n category.value,\n );\n });\n }\n });\n const filterDates = computed(() => {\n switch (routeName.value) {\n case \"MainMap\": {\n if (\n spaceAvailabilitiesChecked.value ||\n spaceUsagesChecked.value ||\n investmentsChecked.value ||\n loansChecked.value\n ) {\n return filters.value.dates;\n } else {\n return null;\n }\n }\n case \"CompanyShell\":\n case \"ContactShell\":\n default:\n return null;\n }\n });\n const filterGeography = computed(() => {\n switch (routeName.value) {\n case \"MainMap\":\n case \"CompanyShell\":\n case \"ContactShell\": {\n if (checkedCategories.value.length > 0) {\n return filters.value.geography;\n } else {\n return null;\n }\n }\n default:\n return null;\n }\n });\n const filterLandCoveringUseTypes = computed(() => {\n switch (routeName.value) {\n case \"PropertyShell\":\n case \"MainMap\": {\n if (checkedCategories.value.length > 0) {\n return filters.value.landCoveringUseType;\n } else {\n return null;\n }\n }\n case \"CompanyShell\":\n case \"ContactShell\":\n return filters.value.landCoveringUseType;\n default:\n return null;\n }\n });\n const filterLandCoveringStates = computed(() => {\n switch (routeName.value) {\n case \"PropertyShell\":\n case \"MainMap\": {\n if (checkedCategories.value.length > 0) {\n return filters.value.landCoveringState;\n } else {\n return null;\n }\n }\n case \"CompanyShell\":\n case \"ContactShell\":\n return filters.value.landCoveringState;\n default:\n return null;\n }\n });\n const filterSpaceAvailabilitySpaceTypes = computed(() => {\n switch (routeName.value) {\n case \"PropertyShell\":\n case \"MainMap\": {\n if (\n spaceAvailabilitiesChecked.value ||\n companiesChecked.value ||\n spaceUsagesChecked.value\n ) {\n return filters.value.spaceAvailabilitySpaceType;\n } else {\n return null;\n }\n }\n case \"CompanyShell\":\n case \"ContactShell\":\n return filters.value.spaceAvailabilitySpaceType;\n default:\n return null;\n }\n });\n const filterInvestmentAssetTypes = computed(() => {\n switch (routeName.value) {\n case \"PropertyShell\":\n case \"MainMap\": {\n if (\n investmentsChecked.value ||\n companiesChecked.value ||\n loansChecked.value\n ) {\n return filters.value.investmentAssetType;\n } else {\n return null;\n }\n }\n case \"CompanyShell\":\n case \"ContactShell\":\n return filters.value.investmentAssetType;\n default:\n return null;\n }\n });\n const filterSpaceUsageExpirationDate = computed(() => {\n switch (routeName.value) {\n case \"MainMap\": {\n if (spaceUsagesChecked.value) {\n return filters.value.spaceUsageExpirationDate;\n } else {\n return null;\n }\n }\n case \"CompanyShell\":\n case \"ContactShell\": {\n if (spaceUsagesChecked.value) {\n return filters.value.spaceUsageExpirationDate;\n } else {\n return null;\n }\n }\n default:\n return null;\n }\n });\n const filterSpaceAvailabilityStates = computed(() => {\n switch (routeName.value) {\n case \"PropertyShell\":\n case \"MainMap\": {\n if (spaceAvailabilitiesChecked.value || companiesChecked.value) {\n return filters.value.spaceAvailabilityState;\n } else {\n return null;\n }\n }\n case \"CompanyShell\":\n case \"ContactShell\": {\n return filters.value.spaceAvailabilityState;\n }\n default:\n return null;\n }\n });\n const filterSpaceUsageStates = computed(() => {\n switch (routeName.value) {\n case \"PropertyShell\":\n case \"MainMap\": {\n if (spaceUsagesChecked.value || companiesChecked.value) {\n return filters.value.spaceUsageState;\n } else {\n return null;\n }\n }\n case \"CompanyShell\":\n case \"ContactShell\": {\n return filters.value.spaceUsageState;\n }\n default:\n return null;\n }\n });\n const filterLoanMaturityDate = computed(() => {\n switch (routeName.value) {\n case \"MainMap\": {\n if (loansChecked.value) {\n return filters.value.loanMaturityDate;\n } else {\n return null;\n }\n }\n case \"CompanyShell\":\n case \"ContactShell\": {\n if (loansChecked.value) {\n return filters.value.loanMaturityDate;\n } else {\n return null;\n }\n }\n default:\n return null;\n }\n });\n const filterLoanStates = computed(() => {\n switch (routeName.value) {\n case \"MainMap\": {\n if (loansChecked.value) {\n return filters.value.loanState;\n } else {\n return null;\n }\n }\n case \"CompanyShell\":\n case \"ContactShell\": {\n if (loansChecked.value) {\n return filters.value.loanState;\n } else {\n return null;\n }\n }\n default:\n return null;\n }\n });\n const filterInvestmentStates = computed(() => {\n switch (routeName.value) {\n case \"PropertyShell\":\n case \"MainMap\": {\n if (investmentsChecked.value || companiesChecked.value) {\n return filters.value.investmentState;\n } else {\n return null;\n }\n }\n case \"CompanyShell\":\n case \"ContactShell\":\n return filters.value.investmentState;\n default:\n return null;\n }\n });\n const filterCompanyEventTypes = computed(() => {\n switch (routeName.value) {\n case \"MainMap\": {\n if (companiesChecked.value) {\n return filters.value.companyEventType;\n } else if (huntsChecked.value) {\n return filters.value.companyEventType.filter(({ value }) =>\n _.includes([\"capMarketsHunt\", \"leasingHunt\"], value),\n );\n } else {\n return null;\n }\n }\n case \"CompanyShell\":\n case \"ContactShell\":\n return filters.value.companyEventType;\n default:\n return null;\n }\n });\n const filterCompanyRoles = computed(() => {\n switch (routeName.value) {\n case \"MainMap\": {\n if (companiesChecked.value) {\n return filters.value.companyRole;\n } else {\n return null;\n }\n }\n case \"CompanyShell\":\n case \"ContactShell\": {\n return filters.value.companyRole;\n }\n default:\n return null;\n }\n });\n const filterInvestmentTypes = computed(() => {\n switch (routeName.value) {\n case \"PropertyShell\":\n case \"MainMap\": {\n if (\n huntsChecked.value &&\n _.includes(selectedCompanyEventTypes.value, \"capMarketsHunt\")\n ) {\n return filters.value.investmentType;\n } else if (investmentsChecked.value || companiesChecked.value) {\n return filters.value.investmentType;\n } else {\n return null;\n }\n }\n case \"CompanyShell\":\n case \"ContactShell\":\n return filters.value.investmentType;\n default:\n return null;\n }\n });\n const filterValuations = computed(() => {\n if (\n huntsChecked.value &&\n _.includes(selectedCompanyEventTypes.value, \"capMarketsHunt\")\n ) {\n return filters.value.investmentValuation;\n } else if (\n _.includes([\"CompanyShell\", \"ContactShell\"], routeName.value) ||\n investmentsChecked.value ||\n companiesChecked.value ||\n loansChecked.value\n ) {\n return filters.value.investmentValuation;\n } else {\n return null;\n }\n });\n const filterSpaceAvailabilitySizes = computed(() => {\n if (\n huntsChecked.value &&\n _.includes(selectedCompanyEventTypes.value, \"leasingHunt\")\n ) {\n return filters.value.spaceAvailabilitySize;\n } else if (\n _.includes([\"CompanyShell\", \"ContactShell\"], routeName.value) ||\n spaceAvailabilitiesChecked.value ||\n spaceUsagesChecked.value ||\n companiesChecked.value\n ) {\n return filters.value.spaceAvailabilitySize;\n } else {\n return null;\n }\n });\n\n const spaceUsageExpirationDateFilterInput = computed(\n () =>\n _.find(filters.value.spaceUsageExpirationDate, {\n value: \"expired_date\",\n }).date,\n );\n const editingSpaceUsageExpirationDate = computed(() => {\n return _.find(filters.value.spaceUsageExpirationDate, {\n value: \"expired_date\",\n }).editing;\n });\n const fetchingSpaceUsageExpirationDateFilterData = ref(false);\n const filteredSpaceUsageExpirationDateFields = ref([]);\n\n const fetchingSpaceAvailabilityStateFilterData = ref(false);\n const filteredSpaceAvailabilityStateFields = ref([]);\n const filteredSpaceAvailabilityStateIds = computed(() => {\n if (selectedSpaceAvailabilityStates.value.length > 0) {\n return filteredSpaceAvailabilityStateFields.value.map(\n (dataFieldStub) => dataFieldStub.decoratingContentId,\n );\n } else {\n return [];\n }\n });\n\n const fetchingSpaceAvailabilitySpaceTypeFilterData = ref(false);\n const filteredSpaceAvailabilitySpaceTypeFields = ref([]);\n const filteredSpaceAvailabilitySpaceTypeIds = computed(() => {\n if (selectedSpaceTypes.value.length > 0) {\n return filteredSpaceAvailabilitySpaceTypeFields.value.map(\n (dataFieldStub) => dataFieldStub.fieldContentId,\n );\n } else {\n return [];\n }\n });\n\n const fetchingSpaceUsageStateFilterData = ref(false);\n const filteredSpaceUsageStateFields = ref([]);\n const filteredSpaceUsageStateSpaceUsageIds = computed(() => {\n if (selectedSpaceUsageStates.value.length > 0) {\n return filteredSpaceUsageStateFields.value.map(\n (dataFieldStub) => dataFieldStub.decoratingContentId,\n );\n } else {\n return [];\n }\n });\n\n const filteredSpaceAvailabilityLikes = computed(() => {\n const sizeArray = spaceAvailabilitySizeFilterApplied.value\n ? filteredStandaloneSpaceAvailabilitySizeFields.value\n : null;\n const eligibleArrays = _.compact([sizeArray]);\n const mapped = eligibleArrays.map((mixedFormatRecords) => {\n const rawMapping = mixedFormatRecords.map((record) => {\n if (record.availabilityId) {\n return {\n id: record.availabilityId,\n type: \"SpaceAvailability\",\n };\n } else if (record.availabilityGroupId) {\n return {\n id: record.availabilityGroupId,\n type: \"SpaceAvailabilityGroup\",\n };\n } else {\n return null;\n }\n });\n\n return _.compact(rawMapping);\n });\n\n if (_.size(eligibleArrays) > 0) {\n return _.intersectionBy(...mapped, function ({ id, type }) {\n return `${type}${id}`;\n });\n } else {\n return _.flatten(mapped);\n }\n });\n\n const filteredSpaceUsageAvailabilityLikes = computed(() => {\n const sizeArray = spaceAvailabilitySizeFilterApplied.value\n ? filteredStandaloneSpaceUsageAvailabilitySizeFields.value\n : null;\n const expirationArray = spaceUsageExpirationDateFilterInput.value\n ? filteredSpaceUsageExpirationDateFields.value\n : null;\n const eligibleArrays = _.compact([sizeArray, expirationArray]);\n const mapped = eligibleArrays.map((mixedFormatRecords) => {\n const rawMapping = mixedFormatRecords.map((record) => {\n if (record.spaceAvailabilityLikeId) {\n return {\n id: record.spaceAvailabilityLikeId,\n type: record.spaceAvailabilityLikeType,\n };\n } else if (record.availabilityId) {\n return {\n id: record.availabilityId,\n type: \"SpaceAvailability\",\n };\n } else if (record.availabilityGroupId) {\n return {\n id: record.availabilityGroupId,\n type: \"SpaceAvailabilityGroup\",\n };\n } else {\n return null;\n }\n });\n\n return _.compact(rawMapping);\n });\n\n if (_.size(eligibleArrays) > 0) {\n return _.intersectionBy(...mapped, function ({ id, type }) {\n return `${type}${id}`;\n });\n } else {\n return _.flatten(mapped);\n }\n });\n const combinedFilteredSpaceUsageAvailabilityIds = computed(() => {\n const eligibleIdArrays = [polygonAvailabilityIds.value].filter(\n (arr) => arr.length > 0,\n );\n const combinedIdArrays = _.concat(\n [\n filteredSpaceUsageAvailabilityIds.value,\n landCoveringSpaceAvailabilityIds.value,\n ],\n eligibleIdArrays,\n );\n\n return _.intersection(...combinedIdArrays);\n });\n const combinedFilteredSpaceAvailabilityIds = computed(() => {\n const eligibleIdArrays = [polygonAvailabilityIds.value].filter(\n (arr) => arr.length > 0,\n );\n const combinedIdArrays = _.concat(\n [\n filteredSpaceAvailabilityStateIds.value,\n filteredSpaceAvailabilitySpaceTypeIds.value,\n landCoveringSpaceAvailabilityIds.value,\n ],\n eligibleIdArrays,\n );\n\n return _.intersection(...combinedIdArrays);\n });\n function combinedFilteredSpaceAvailabilityIncluded(availabilityId) {\n // console.log(\n // \"filtered state ids\",\n // filteredSpaceAvailabilityStateIds.value,\n // \"filtered space type ids\",\n // filteredSpaceAvailabilitySpaceTypeIds.value,\n // \"land covering availability ids\",\n // landCoveringSpaceAvailabilityIds.value,\n // \"filtered availability ids\",\n // combinedFilteredSpaceAvailabilityIds.value,\n // \"filtered usage availability ids\",\n // combinedFilteredSpaceUsageAvailabilityIds.value,\n // );\n const availabilityIncluded =\n combinedFilteredSpaceAvailabilityIds.value.length > 0 &&\n _.includes(combinedFilteredSpaceAvailabilityIds.value, availabilityId);\n const usageAvailabilityIncluded =\n combinedFilteredSpaceUsageAvailabilityIds.value.length > 0 &&\n _.includes(\n combinedFilteredSpaceUsageAvailabilityIds.value,\n availabilityId,\n );\n\n return availabilityIncluded || usageAvailabilityIncluded;\n }\n const spaceAvailabilityLikeFilterable = computed(\n () => spaceAvailabilitySizeFilterApplied.value,\n );\n function spaceAvailabilityLikeIncluded(availabilityId, portfolioId) {\n if (spaceAvailabilityLikeFilterable.value && portfolioId) {\n return _.some(\n filteredSpaceAvailabilityLikes.value,\n function ({ id, type }) {\n return type === \"SpaceAvailabilityGroup\" && id === portfolioId;\n },\n );\n } else if (spaceAvailabilityLikeFilterable.value && availabilityId) {\n return _.some(\n filteredSpaceAvailabilityLikes.value,\n function ({ id, type }) {\n return type === \"SpaceAvailability\" && id === availabilityId;\n },\n );\n } else {\n return true;\n }\n }\n\n const spaceUsageAvailabilityLikeFilterable = computed(\n () =>\n spaceAvailabilitySizeFilterApplied.value ||\n spaceUsageExpirationDateFilterInput.value,\n );\n function spaceUsageAvailabilityLikeIncluded(availabilityId, portfolioId) {\n if (spaceUsageAvailabilityLikeFilterable.value && portfolioId) {\n return _.some(\n filteredSpaceUsageAvailabilityLikes.value,\n function ({ id, type }) {\n return type === \"SpaceAvailabilityGroup\" && id === portfolioId;\n },\n );\n } else if (spaceUsageAvailabilityLikeFilterable.value && availabilityId) {\n return _.some(\n filteredSpaceUsageAvailabilityLikes.value,\n function ({ id, type }) {\n return type === \"SpaceAvailability\" && id === availabilityId;\n },\n );\n } else {\n return true;\n }\n }\n\n const loanMaturityDateFilterInput = computed(\n () =>\n _.find(filters.value.loanMaturityDate, {\n value: \"maturity_date\",\n }).date,\n );\n const editingLoanMaturityDate = computed(() => {\n return _.find(filters.value.loanMaturityDate, {\n value: \"maturity_date\",\n }).editing;\n });\n const fetchingLoanMaturityDateFilterData = ref(false);\n const filteredLoanMaturityDateFields = ref([]);\n\n const fetchingLoanStateFilterData = ref(false);\n const filteredLoanStateFields = ref([]);\n const filteredLoanStateLoanIds = computed(() => {\n if (selectedLoanStates.value.length > 0) {\n return filteredLoanStateFields.value.map(\n (dataFieldStub) => dataFieldStub.decoratingContentId,\n );\n } else {\n return [];\n }\n });\n const fetchingInvestmentStateFilterData = ref(false);\n const filteredInvestmentStateFields = ref([]);\n const filteredInvestmentStateIds = computed(() => {\n if (selectedInvestmentStates.value.length > 0) {\n return filteredInvestmentStateFields.value;\n } else {\n return [];\n }\n });\n const filteredInvestmentAssetTypeFields = ref([]);\n const filteredAssetTypedInvestmentIds = computed(() => {\n if (selectedInvestmentAssetTypes.value.length > 0) {\n return filteredInvestmentAssetTypeFields.value;\n } else {\n return [];\n }\n });\n const fetchingInvestmentAssetTypeFilterData = ref(false);\n\n const fetchingLandCoveringUseTypeFilterData = ref(false);\n const filteredLandCoveringUseTypeFields = ref({\n floorAreas: [],\n landCoverings: [],\n });\n\n const useTypeFilteredLandCoveringIds = computed(() => {\n if (\n checkedCategories.value.length > 0 &&\n selectedLandCoveringUseTypes.value.length > 0\n ) {\n return filteredLandCoveringUseTypeFields.value.landCoverings.map(\n (dataFieldStub) => dataFieldStub.fieldContentId,\n );\n } else {\n return [];\n }\n });\n\n const fetchingLandCoveringStateFilterData = ref(false);\n const filteredLandCoveringStateFields = ref({\n stateFilteredPropertyEnhancements: [],\n stateFilteredLayoutPartitions: [],\n stateFilteredFloorAreas: [],\n landCoveringFloorAreas: [], // extract LandCoverings from these\n allFloorAreas: [],\n });\n const stateFilteredPropertyEnhancementFields = computed(() => {\n return _.concat(\n filteredLandCoveringStateFields.value.stateFilteredPropertyEnhancements,\n );\n });\n const stateFilteredLayoutPartitionFields = computed(() => {\n return _.concat(\n filteredLandCoveringStateFields.value.stateFilteredLayoutPartitions,\n );\n });\n const stateFilteredFloorAreaFields = computed(() => {\n return _.concat(\n filteredLandCoveringStateFields.value.landCoveringFloorAreas,\n filteredLandCoveringStateFields.value.stateFilteredFloorAreas,\n filteredLandCoveringStateFields.value.allFloorAreas,\n );\n });\n\n const combinedFilteredLandCoveringFloorAreaFields = computed(() => {\n const intersection = _.intersectionBy(\n filteredLandCoveringUseTypeFields.value.floorAreas,\n stateFilteredFloorAreaFields.value,\n function (dataFieldStub) {\n if (dataFieldStub.decoratingContentType === \"FloorArea\") {\n return dataFieldStub.decoratingContentId;\n } else if (dataFieldStub.fieldContentType === \"FloorArea\") {\n return dataFieldStub.fieldContentId;\n } else {\n return null;\n }\n },\n );\n\n return _.compact(intersection);\n });\n\n const combinedFilteredLandCoveringFloorAreaPropertyIds = computed(() =>\n translatePropertyIds(\n combinedFilteredLandCoveringFloorAreaFields.value.map(\n (dataFieldStub) => dataFieldStub.propertyId,\n ),\n ),\n );\n\n const stateFilteredLandCoveringIds = computed(() => {\n if (\n checkedCategories.value.length > 0 &&\n selectedLandCoveringStates.value.length > 0\n ) {\n const raw = stateFilteredFloorAreaFields.value.map((dataFieldStub) => {\n const landCoveringStub = _.find(\n filteredLandCoveringStateFields.value.allFloorAreas,\n function (allFieldsStub) {\n if (dataFieldStub.decoratingContentType === \"FloorArea\") {\n return (\n allFieldsStub.fieldContentId ===\n dataFieldStub.decoratingContentId\n );\n } else if (dataFieldStub.fieldContentType === \"FloorArea\") {\n return (\n allFieldsStub.fieldContentId === dataFieldStub.fieldContentId\n );\n } else {\n return null;\n }\n },\n );\n\n if (landCoveringStub?.joiningContentType === \"LandCovering\") {\n return landCoveringStub.joiningContentId;\n } else {\n return landCoveringStub?.decoratingContentId;\n }\n });\n\n return _.uniq(raw);\n } else {\n return [];\n }\n });\n\n const combinedFilteredLandCoveringIds = computed(() => {\n const eligibleIdArrays = [].filter((arr) => arr.length > 0);\n const combinedIdArrays = _.concat(\n [\n stateFilteredLandCoveringIds.value,\n useTypeFilteredLandCoveringIds.value,\n ],\n eligibleIdArrays,\n );\n\n return _.intersection(...combinedIdArrays);\n });\n\n const stateFilteredLandCoveringPropertyIds = computed(() => {\n if (\n checkedCategories.value.length > 0 &&\n selectedLandCoveringStates.value.length > 0\n ) {\n return translatePropertyIds(\n stateFilteredFloorAreaFields.value.map(\n (dataFieldStub) => dataFieldStub.propertyId,\n ),\n );\n } else {\n return [];\n }\n });\n const contextedPropertiesArray = computed(() => {\n let array = _.toArray(nearbyPropertyDataFields.value);\n\n if (unselectedPropertyDiagram.value) {\n array = _.toArray(propertyDiagramPropertyDataFields.value);\n } else if (propertySelectedPropertyDiagram.value) {\n array = [propertyDataField.value];\n }\n\n return array;\n });\n const propertyTranslationIds = computed(() => {\n const translations = contextedPropertiesArray.value.map((df) => {\n const propertyId =\n df.decoratingContentType === \"Property\"\n ? df.decoratingContentId\n : df.fieldContentId;\n if (df.fieldContent.airLayerPropertyId) {\n return [\n {\n propertyId,\n translatedIds: [\n df.decoratingContentId,\n df.fieldContent.airLayerPropertyId,\n ],\n },\n {\n propertyId: df.fieldContent.airLayerPropertyId,\n translatedIds: [propertyId, df.fieldContent.airLayerPropertyId],\n },\n ];\n } else {\n return {\n propertyId,\n translatedIds: [propertyId],\n };\n }\n });\n\n return _.flatten(translations);\n });\n function translatePropertyIds(ids) {\n const translated = _.flatten(\n ids.map(\n (id) =>\n _.find(propertyTranslationIds.value, { propertyId: id })\n ?.translatedIds,\n ),\n );\n\n // console.log(propertyTranslationIds.value, ids, translated);\n\n return _.uniq(_.compact(translated));\n }\n const combinedFilteredPropertyIds = computed(() => {\n const eligibleIdArrays = [polygonPropertyIds.value].filter(\n (arr) => arr.length > 0,\n );\n const investmentPropertyIds =\n investmentsChecked.value || loansChecked.value\n ? [datedInvestmentPropertyIds.value]\n : [];\n const spaceAvailabilityPropertyIds =\n spaceAvailabilitiesChecked.value || spaceUsagesChecked.value\n ? [datedAvailabilityPropertyIds.value]\n : [];\n const combinedInvestmentArrays = _.concat(\n [combinedFilteredLandCoveringFloorAreaPropertyIds.value],\n investmentPropertyIds,\n eligibleIdArrays,\n );\n const combinedSpaceAvailabilityArrays = _.concat(\n [combinedFilteredLandCoveringFloorAreaPropertyIds.value],\n spaceAvailabilityPropertyIds,\n eligibleIdArrays,\n );\n const combinedSizeArrays = _.concat(\n [combinedFilteredLandCoveringFloorAreaPropertyIds.value],\n eligibleIdArrays,\n );\n\n if (filterGeography.value) {\n const intersectedInvestments =\n investmentsChecked.value || loansChecked.value || companiesChecked.value\n ? _.intersection(...combinedInvestmentArrays)\n : [];\n const intersectedSpaceAvailabilities =\n spaceAvailabilitiesChecked.value ||\n spaceUsagesChecked.value ||\n companiesChecked.value\n ? _.intersection(...combinedSpaceAvailabilityArrays)\n : [];\n const intersectedSizes = sizesChecked.value\n ? _.intersection(...combinedSizeArrays)\n : [];\n\n // console.log(\n // \"raw property ids\",\n // datedInvestmentPropertyIds.value,\n // datedAvailabilityPropertyIds.value,\n // \"combined filtered property ids\",\n // intersectedSizes,\n // intersectedInvestments,\n // intersectedSpaceAvailabilities,\n // );\n\n return _.uniq(\n _.concat(\n intersectedSizes,\n intersectedInvestments,\n intersectedSpaceAvailabilities,\n ),\n );\n } else {\n return _.uniq(\n _.union(\n ...combinedSizeArrays,\n ...combinedInvestmentArrays,\n ...combinedSpaceAvailabilityArrays,\n ),\n );\n }\n });\n\n const fetchingLoanInvestmentFields = ref(false);\n const loanInvestmentFields = ref([]);\n const multiPropertyPortfolioLoanFields = computed(() =>\n loanInvestmentFields.value.filter(\n (loanStub) =>\n loanStub.loanCategory === \"portfolio\" && !loanStub.propertyId,\n ),\n );\n const singlePropertyPortfolioLoanFields = computed(() =>\n loanInvestmentFields.value.filter(\n (loanStub) =>\n loanStub.loanCategory === \"portfolio\" && loanStub.propertyId,\n ),\n );\n const portfolioInvestmentFields = computed(() =>\n loanInvestmentFields.value.filter(\n (loanStub) => loanStub.loanCategory === \"group_investment\",\n ),\n );\n const individualLoanInvestmentFields = computed(() =>\n loanInvestmentFields.value.filter(\n (loanStub) => !loanStub.loanCategory && loanStub.loanId,\n ),\n );\n const portfolioAssetLoans = computed(() =>\n individualLoanInvestmentFields.value.filter((loanStub) =>\n _.find(portfolioInvestmentFields.value, {\n investmentId: loanStub.investmentId,\n }),\n ),\n );\n const standaloneAssetLoans = computed(() =>\n individualLoanInvestmentFields.value.filter(\n (loanStub) =>\n !_.find(portfolioInvestmentFields.value, {\n investmentId: loanStub.investmentId,\n }),\n ),\n );\n const filterableLoans = computed(() =>\n _.concat(portfolioAssetLoans.value, standaloneAssetLoans.value),\n );\n const filteredLoanInvestmentIds = computed(() => {\n return filterableLoans.value.map(\n (dataFieldStub) => dataFieldStub.investmentId,\n );\n });\n const filteredPortfolioAssetLoans = computed(() => {\n if (loansChecked.value) {\n return portfolioAssetLoans.value.filter(loanInvestmentIncluded);\n } else {\n return [];\n }\n });\n const filteredStandaloneAssetLoans = computed(() => {\n if (loansChecked.value) {\n return standaloneAssetLoans.value.filter(loanInvestmentIncluded);\n } else {\n return [];\n }\n });\n function loanInvestmentIncluded(loanStub) {\n const loanIncluded = _.includes(\n filteredLoanStateLoanIds.value,\n loanStub.loanId,\n );\n const ids = _.intersection(\n combinedInvestmentIds.value,\n combinedFilteredLoanInvestmentIds.value,\n );\n const nonValuationIncluded = _.includes(ids, loanStub.investmentId);\n let valuationIncluded = true;\n\n if (investmentLikeFilterable.value) {\n const valuationMatches = _.intersectionBy(\n [{ id: loanStub.investmentId, type: \"Investment\" }],\n filteredInvestmentLikes.value,\n function ({ id, type }) {\n return `${type}${id}`;\n },\n );\n valuationIncluded = _.size(valuationMatches) > 0;\n }\n\n return loanIncluded && nonValuationIncluded && valuationIncluded;\n }\n function filteredPortfolioLoanStubs(portfolioLoans = []) {\n return portfolioLoans.filter(({ investmentGroupId, loanId }) => {\n const loanIncluded = _.includes(filteredLoanStateLoanIds.value, loanId);\n const includedLoans = portfolioInvestmentFields.value.filter(\n (loanStub) => loanStub.investmentGroupId === investmentGroupId,\n );\n const assetLoanIncluded =\n _.size(\n _.intersectionBy(\n includedLoans,\n filteredPortfolioAssetLoans.value,\n \"investmentId\",\n ),\n ) > 0;\n let valuationIncluded = false;\n\n if (investmentLikeFilterable.value) {\n const valuationMatches = _.intersectionBy(\n [\n {\n id: investmentGroupId,\n type: \"InvestmentGroup\",\n },\n ],\n filteredInvestmentLikes.value,\n function ({ id, type }) {\n return `${type}${id}`;\n },\n );\n valuationIncluded = _.size(valuationMatches) > 0;\n }\n\n // console.log(\n // loanId,\n // investmentGroupId,\n // loanIncluded,\n // assetLoanIncluded,\n // valuationIncluded,\n // );\n\n return loanIncluded && (assetLoanIncluded || valuationIncluded);\n });\n }\n const loansTableAssemblyContent = computed(() => {\n return {\n multiPropertyPortfolioLoans: filteredPortfolioLoanStubs(\n multiPropertyPortfolioLoanFields.value,\n ),\n singlePropertyPortfolioLoans: filteredPortfolioLoanStubs(\n singlePropertyPortfolioLoanFields.value,\n ),\n propertyGroupedStandaloneAssetLoans: _.groupBy(\n filteredStandaloneAssetLoans.value,\n \"propertyId\",\n ),\n };\n });\n const displayableLoanTableRows = computed(() => {\n const multiPropertyPortfolioLoans =\n loansTableAssemblyContent.value.multiPropertyPortfolioLoans.map(\n (loanStub) => {\n return {\n rowType: \"multiPropertyPortfolioLoan\",\n loanStub,\n };\n },\n );\n const singlePropertyPortfolioLoans =\n loansTableAssemblyContent.value.singlePropertyPortfolioLoans.map(\n (loanStub) => {\n return {\n rowType: \"singlePropertyPortfolioLoan\",\n loanStub,\n };\n },\n );\n const standalonePropertyLoans = _.map(\n loansTableAssemblyContent.value.propertyGroupedStandaloneAssetLoans,\n function (loanStubs, propertyId) {\n return {\n rowType: \"singlePropertyLoan\",\n propertyId:\n propertyId === \"unlicensed\" ? propertyId : _.toNumber(propertyId),\n loanStubs,\n };\n },\n );\n\n return _.orderBy(\n _.concat(\n multiPropertyPortfolioLoans,\n singlePropertyPortfolioLoans,\n standalonePropertyLoans,\n ),\n [\"localId\"],\n [\"desc\"],\n );\n });\n\n const loanCount = computed(() => {\n if (loansChecked.value) {\n const combined = _.concat(\n loansTableAssemblyContent.value.multiPropertyPortfolioLoans,\n loansTableAssemblyContent.value.singlePropertyPortfolioLoans,\n _.values(\n loansTableAssemblyContent.value.propertyGroupedStandaloneAssetLoans,\n ),\n );\n return _.size(_.flatten(combined));\n } else {\n return 0;\n }\n });\n\n const fetchingSpaceUsageAvailabilityFields = ref(false);\n const spaceUsageAvailabilityFields = ref([]);\n\n const portfolioSpaceAvailabilityFields = computed(() =>\n spaceUsageAvailabilityFields.value.filter(\n (spaceUsageStub) =>\n spaceUsageStub.spaceUsageCategory === \"group_availability\",\n ),\n );\n const individualSpaceUsageAvailabilityFields = computed(() =>\n spaceUsageAvailabilityFields.value.filter(\n (spaceUsageStub) =>\n !spaceUsageStub.spaceUsageCategory && spaceUsageStub.spaceUsageId,\n ),\n );\n const portfolioSpaceTypeSpaceUsages = computed(\n () => portfolioSpaceAvailabilityFields.value,\n );\n const standaloneSpaceUsages = computed(() =>\n individualSpaceUsageAvailabilityFields.value.filter(\n (spaceUsageStub) =>\n !_.find(portfolioSpaceAvailabilityFields.value, {\n availabilityId: spaceUsageStub.availabilityId,\n }),\n ),\n );\n const filterableSpaceUsages = computed(() =>\n _.concat(portfolioSpaceTypeSpaceUsages.value, standaloneSpaceUsages.value),\n );\n const filteredSpaceUsageAvailabilityIds = computed(() => {\n if (spaceUsagesChecked.value) {\n return filterableSpaceUsages.value.map(\n (dataFieldStub) => dataFieldStub.availabilityId,\n );\n } else {\n return [];\n }\n });\n const filteredPortfolioSpaceUsages = computed(() => {\n if (spaceUsagesChecked.value) {\n return portfolioSpaceTypeSpaceUsages.value.filter(\n spaceUsageAvailabilityIncluded,\n );\n } else {\n return [];\n }\n });\n const filteredStandaloneSpaceTypeSpaceUsages = computed(() => {\n if (spaceUsagesChecked.value) {\n return standaloneSpaceUsages.value.filter(spaceUsageAvailabilityIncluded);\n } else {\n return [];\n }\n });\n\n function spaceUsageAvailabilityIncluded(spaceUsageStub) {\n const spaceUsageIncluded = _.includes(\n filteredSpaceUsageStateSpaceUsageIds.value,\n spaceUsageStub.spaceUsageId,\n );\n const ids = _.intersection(\n combinedSpaceAvailabilityIds.value,\n combinedFilteredSpaceUsageAvailabilityIds.value,\n );\n\n const nonSizeIncluded = _.includes(ids, spaceUsageStub.availabilityId);\n let sizeIncluded = true;\n\n if (spaceAvailabilityLikeFilterable.value) {\n const valuationMatches = _.intersectionBy(\n [{ id: spaceUsageStub.availabilityId, type: \"SpaceAvailability\" }],\n filteredSpaceUsageAvailabilityLikes.value,\n function ({ id, type }) {\n return `${type}${id}`;\n },\n );\n sizeIncluded = _.size(valuationMatches) > 0;\n }\n\n // console.log(\n // \"availability included\",\n // spaceUsageStub,\n // filteredSpaceUsageStateSpaceUsageIds.value,\n // combinedSpaceAvailabilityIds.value,\n // combinedFilteredSpaceUsageAvailabilityIds.value,\n // filteredSpaceUsageAvailabilityLikes.value,\n // sizeIncluded,\n // );\n\n return spaceUsageIncluded && nonSizeIncluded && sizeIncluded;\n }\n function filteredPortfolioSpaceUsageStubs(portfolioUsages = []) {\n const uniqueGroups = _.uniqBy(portfolioUsages, \"availabilityGroupId\");\n return uniqueGroups.filter(({ availabilityGroupId, spaceUsageId }) => {\n const spaceUsageIncluded = _.includes(\n filteredSpaceUsageStateSpaceUsageIds.value,\n spaceUsageId,\n );\n const includedSpaceUsages = portfolioSpaceAvailabilityFields.value.filter(\n (spaceUsageStub) =>\n spaceUsageStub.availabilityGroupId === availabilityGroupId,\n );\n const spaceTypeSpaceUsageIncluded =\n _.size(\n _.intersectionBy(\n includedSpaceUsages,\n filteredPortfolioSpaceUsages.value,\n \"availabilityId\",\n ),\n ) > 0;\n\n let sizeIncluded = false;\n\n if (spaceAvailabilityLikeFilterable.value) {\n const sizeMatches = _.intersectionBy(\n [\n {\n id: availabilityGroupId,\n type: \"SpaceAvailabilityGroup\",\n },\n ],\n filteredSpaceUsageAvailabilityLikes.value,\n function ({ id, type }) {\n return `${type}${id}`;\n },\n );\n sizeIncluded = _.size(sizeMatches) > 0;\n }\n\n // console.log(\n // \"portfolio included\",\n // spaceUsageId,\n // availabilityGroupId,\n // spaceUsageIncluded,\n // spaceTypeSpaceUsageIncluded,\n // filteredSpaceUsageAvailabilityLikes.value,\n // sizeIncluded,\n // );\n\n return (\n spaceUsageIncluded && (spaceTypeSpaceUsageIncluded || sizeIncluded)\n );\n });\n }\n\n const spaceUsagesTableAssemblyContent = computed(() => {\n return {\n singlePropertyPortfolioSpaceUsages: filteredPortfolioSpaceUsageStubs(\n portfolioSpaceTypeSpaceUsages.value,\n ),\n propertyGroupedStandaloneSpaceTypeSpaceUsages: _.groupBy(\n filteredStandaloneSpaceTypeSpaceUsages.value,\n \"propertyId\",\n ),\n };\n });\n\n const displayableSpaceUsageTableRows = computed(() => {\n const singlePropertyPortfolioSpaceUsages =\n spaceUsagesTableAssemblyContent.value.singlePropertyPortfolioSpaceUsages.map(\n (spaceUsageStub) => {\n const stubs = portfolioSpaceAvailabilityFields.value.filter(\n ({ availabilityGroupId }) =>\n availabilityGroupId === spaceUsageStub.availabilityGroupId,\n );\n return {\n rowType: \"singlePropertyPortfolioSpaceUsage\",\n propertyId:\n spaceUsageStub.propertyId === \"unlicensed\"\n ? spaceUsageStub.propertyId\n : _.toNumber(spaceUsageStub.propertyId),\n spaceUsageStubs: stubs,\n };\n },\n );\n const standalonePropertySpaceUsages = _.map(\n spaceUsagesTableAssemblyContent.value\n .propertyGroupedStandaloneSpaceTypeSpaceUsages,\n function (spaceUsageStubs, propertyId) {\n return {\n rowType: \"singlePropertySpaceUsage\",\n propertyId:\n propertyId === \"unlicensed\" ? propertyId : _.toNumber(propertyId),\n spaceUsageStubs,\n };\n },\n );\n\n return _.orderBy(\n _.concat(\n singlePropertyPortfolioSpaceUsages,\n standalonePropertySpaceUsages,\n ),\n [\"localId\"],\n [\"desc\"],\n );\n });\n\n const combinedFilteredSpaceUsages = computed(() => {\n const portfolioStubs =\n spaceUsagesTableAssemblyContent.value.singlePropertyPortfolioSpaceUsages.map(\n (spaceUsageStub) => {\n const stubs = portfolioSpaceAvailabilityFields.value.filter(\n ({ availabilityGroupId }) =>\n availabilityGroupId === spaceUsageStub.availabilityGroupId,\n );\n\n return stubs;\n },\n );\n const combined = _.concat(\n portfolioStubs,\n _.values(\n spaceUsagesTableAssemblyContent.value\n .propertyGroupedStandaloneSpaceTypeSpaceUsages,\n ),\n );\n\n return _.flatten(combined);\n });\n const combinedFilteredSpaceUsageIds = computed(() => {\n return _.uniq(\n combinedFilteredSpaceUsages.value.map(({ spaceUsageId }) => spaceUsageId),\n );\n });\n\n const spaceUsageCount = computed(() => {\n if (spaceUsagesChecked.value) {\n return _.size(combinedFilteredSpaceUsages.value);\n } else {\n return 0;\n }\n });\n const landCoveringSpaceAvailabilityIds = ref([]);\n const landCoveringInvestmentIds = ref([]);\n const filteredInvestmentTypeFields = ref([]);\n const filteredTypedInvestmentIds = computed(() => {\n if (selectedInvestmentTypes.value.length > 0) {\n return filteredInvestmentTypeFields.value;\n } else {\n return [];\n }\n });\n\n const spaceAvailabilitySizeFilterApplied = ref(false);\n const fetchingSpaceAvailabilitySizeFilterData = ref(false);\n const minSpaceAvailabilitySize = computed({\n get() {\n return _.find(filters.value.spaceAvailabilitySize, { label: \"Area (SF)\" })\n .min;\n },\n set(newMin) {\n let spaceAvailabilitySizesFilter = _.find(\n filters.value.spaceAvailabilitySize,\n {\n label: \"Area (SF)\",\n },\n );\n\n spaceAvailabilitySizesFilter.min = newMin;\n\n filters.value.spaceAvailabilitySize = _.unionBy(\n [spaceAvailabilitySizesFilter],\n filters.value.spaceAvailabilitySize,\n );\n },\n });\n const maxSpaceAvailabilitySize = computed({\n get() {\n return _.find(filters.value.spaceAvailabilitySize, { label: \"Area (SF)\" })\n .max;\n },\n set(newMax) {\n let spaceAvailabilitySizesFilter = _.find(\n filters.value.spaceAvailabilitySize,\n {\n label: \"Area (SF)\",\n },\n );\n\n spaceAvailabilitySizesFilter.max = newMax;\n\n filters.value.spaceAvailabilitySize = _.unionBy(\n [spaceAvailabilitySizesFilter],\n filters.value.spaceAvailabilitySize,\n );\n },\n });\n const validMinSpaceAvailabilitySize = computed(() => {\n if (minSpaceAvailabilitySize.value && maxSpaceAvailabilitySize.value) {\n return minSpaceAvailabilitySize.value < maxSpaceAvailabilitySize.value;\n } else if (minSpaceAvailabilitySize.value) {\n return minSpaceAvailabilitySize.value > 0;\n } else {\n return true;\n }\n });\n const validMaxSpaceAvailabilitySize = computed(() => {\n if (minSpaceAvailabilitySize.value && maxSpaceAvailabilitySize.value) {\n return maxSpaceAvailabilitySize.value > minSpaceAvailabilitySize.value;\n } else if (maxSpaceAvailabilitySize.value) {\n return maxSpaceAvailabilitySize.value > 0;\n } else {\n return true;\n }\n });\n const validSpaceAvailabilitySizeRange = computed(() => {\n return (\n validMaxSpaceAvailabilitySize.value && validMinSpaceAvailabilitySize.value\n );\n });\n const validSpaceAvailabilitySizeFilters = computed(() => {\n return validSpaceAvailabilitySizeRange.value;\n });\n const filteredStandaloneSpaceAvailabilitySizeFields = ref([]);\n const filteredStandaloneSpaceUsageAvailabilitySizeFields = ref([]);\n\n const fetchingInvestmentTypeFilterData = ref(false);\n const valueFilterApplied = ref(false);\n const fetchingValuationFilterData = ref(false);\n const minValue = computed({\n get() {\n return _.find(filters.value.investmentValuation, { label: \"Value\" }).min;\n },\n set(newMin) {\n let valuationsFilter = _.find(filters.value.investmentValuation, {\n label: \"Value\",\n });\n\n valuationsFilter.min = newMin;\n\n filters.value.investmentValuation = _.unionBy(\n [valuationsFilter],\n filters.value.investmentValuation,\n );\n },\n });\n const maxValue = computed({\n get() {\n return _.find(filters.value.investmentValuation, { label: \"Value\" }).max;\n },\n set(newMax) {\n let valuationsFilter = _.find(filters.value.investmentValuation, {\n label: \"Value\",\n });\n\n valuationsFilter.max = newMax;\n\n filters.value.investmentValuation = _.unionBy(\n [valuationsFilter],\n filters.value.investmentValuation,\n );\n },\n });\n const validMinValue = computed(() => {\n if (minValue.value && maxValue.value) {\n return minValue.value < maxValue.value;\n } else if (minValue.value) {\n return minValue.value > 0;\n } else {\n return true;\n }\n });\n const validMaxValue = computed(() => {\n if (minValue.value && maxValue.value) {\n return maxValue.value > minValue.value;\n } else if (maxValue.value) {\n return maxValue.value > 0;\n } else {\n return true;\n }\n });\n const validValueRange = computed(() => {\n return validMaxValue.value && validMinValue.value;\n });\n const validValuationFilters = computed(() => {\n return validValueRange.value;\n });\n const filteredStandaloneValueFields = ref([]);\n const filteredInvestmentLikes = computed(() => {\n const valueArray = valueFilterApplied.value\n ? filteredStandaloneValueFields.value\n : null;\n const maturityArray = loanMaturityDateFilterInput.value\n ? filteredLoanMaturityDateFields.value\n : null;\n const eligibleArrays = _.compact([valueArray, maturityArray]);\n const mapped = eligibleArrays.map((dataFields) => {\n return dataFields.map((dataField) => {\n return {\n id: dataField.investmentLikeId,\n type: dataField.investmentLikeType,\n };\n });\n });\n\n if (_.size(eligibleArrays) > 0) {\n return _.intersectionBy(...mapped, function ({ id, type }) {\n return `${type}${id}`;\n });\n } else {\n return _.flatten(mapped);\n }\n });\n const combinedFilteredOccupierHuntIds = computed(() => {\n const eligibleIdArrays = [polygonHuntIds.value].filter(\n (arr) => arr.length > 0,\n );\n const sizeIds = spaceAvailabilitySizeFilterApplied.value\n ? [occupierSizeFilteredHuntIds.value]\n : [];\n const combinedOccupierIdArrays = _.concat(\n [useTypeFilteredHuntIds.value],\n sizeIds,\n eligibleIdArrays,\n );\n\n return _.intersection(...combinedOccupierIdArrays);\n });\n const combinedFilteredInvestorHuntIds = computed(() => {\n const eligibleIdArrays = [polygonHuntIds.value].filter(\n (arr) => arr.length > 0,\n );\n const valueIds = valueFilterApplied.value\n ? [valueFilteredHuntIds.value]\n : [];\n const combinedInvestmentIdArrays = _.concat(\n [investmentTypeFilteredHuntIds.value, useTypeFilteredHuntIds.value],\n valueIds,\n eligibleIdArrays,\n );\n\n return _.intersection(...combinedInvestmentIdArrays);\n });\n function combinedFilteredHuntIncluded(huntId) {\n const fetchedDataField = _.find(nearbyHuntDataFields.value, {\n fieldContentId: huntId,\n });\n const capMarketsHuntEventsIncluded = _.includes(\n selectedCompanyEventTypes.value,\n \"capMarketsHunt\",\n );\n const leasingHuntEventsIncluded = _.includes(\n selectedCompanyEventTypes.value,\n \"leasingHunt\",\n );\n\n let capMarketsEventIncluded = false;\n let leasingEventIncluded = false;\n let filtersIncluded = false;\n\n if (\n fetchedDataField &&\n capMarketsHuntEventsIncluded &&\n fetchedDataField.fieldContent?.hasInvestmentCriteria\n ) {\n capMarketsEventIncluded = true;\n filtersIncluded =\n combinedFilteredInvestorHuntIds.value.length > 0 &&\n _.includes(combinedFilteredInvestorHuntIds.value, huntId);\n }\n if (\n fetchedDataField &&\n leasingHuntEventsIncluded &&\n fetchedDataField.fieldContent?.hasSpaceRequirements\n ) {\n leasingEventIncluded = true;\n filtersIncluded =\n combinedFilteredOccupierHuntIds.value.length > 0 &&\n _.includes(combinedFilteredOccupierHuntIds.value, huntId);\n }\n\n const eventIncluded = capMarketsEventIncluded || leasingEventIncluded;\n\n // console.log(\n // \"filtered type ids\",\n // investmentTypeFilteredHuntIds.value,\n // \"filtered use ids\",\n // useTypeFilteredHuntIds.value,\n // \"filtered value ids\",\n // valueFilteredHuntIds.value,\n // \"filtered occupier ids\",\n // occupierSizeFilteredHuntIds.value,\n // \"combined\",\n // combinedFilteredOccupierHuntIds.value,\n // combinedFilteredInvestorHuntIds.value,\n // \"field\",\n // fetchedDataField,\n // \"included\",\n // filtersIncluded,\n // \"eventIncluded\",\n // eventIncluded,\n // );\n\n return filtersIncluded && eventIncluded;\n }\n const combinedFilteredLoanInvestmentIds = computed(() => {\n const eligibleIdArrays = [polygonInvestmentIds.value].filter(\n (arr) => arr.length > 0,\n );\n const combinedIdArrays = _.concat(\n [filteredAssetTypedInvestmentIds.value, filteredLoanInvestmentIds.value],\n eligibleIdArrays,\n );\n\n return _.intersection(...combinedIdArrays);\n });\n const combinedFilteredInvestmentIds = computed(() => {\n const eligibleIdArrays = [polygonInvestmentIds.value].filter(\n (arr) => arr.length > 0,\n );\n const combinedIdArrays = _.concat(\n [\n filteredInvestmentStateIds.value,\n filteredTypedInvestmentIds.value,\n filteredAssetTypedInvestmentIds.value,\n landCoveringInvestmentIds.value,\n ],\n eligibleIdArrays,\n );\n\n return _.intersection(...combinedIdArrays);\n });\n function combinedFilteredInvestmentIncluded(investmentId) {\n // console.log(\n // \"filtered state ids\",\n // filteredInvestmentStateIds.value,\n // \"filtered type ids\",\n // filteredTypedInvestmentIds.value,\n // \"asset type ids\",\n // filteredAssetTypedInvestmentIds.value,\n // \"land covering investment ids\",\n // landCoveringInvestmentIds.value,\n // \"filtered investment ids\",\n // combinedFilteredInvestmentIds.value,\n // \"filtered loan investment ids\",\n // combinedFilteredLoanInvestmentIds.value,\n // );\n const investmentIncluded =\n combinedFilteredInvestmentIds.value.length > 0 &&\n _.includes(combinedFilteredInvestmentIds.value, investmentId);\n const loanInvestmentIncluded =\n combinedFilteredLoanInvestmentIds.value.length > 0 &&\n _.includes(combinedFilteredLoanInvestmentIds.value, investmentId);\n\n return investmentIncluded || loanInvestmentIncluded;\n }\n const investmentLikeFilterable = computed(\n () => valueFilterApplied.value || loanMaturityDateFilterInput.value,\n );\n function investmentLikeIncluded(investmentId, portfolioId) {\n if (investmentLikeFilterable.value && portfolioId) {\n return _.some(filteredInvestmentLikes.value, function ({ id, type }) {\n return type === \"InvestmentGroup\" && id === portfolioId;\n });\n } else if (investmentLikeFilterable.value && investmentId) {\n return _.some(filteredInvestmentLikes.value, function ({ id, type }) {\n return type === \"Investment\" && id === investmentId;\n });\n } else {\n return true;\n }\n }\n\n function clearValueRange() {\n minValue.value = null;\n maxValue.value = null;\n valueFilterApplied.value = false;\n valueFilteredHuntIds.value = [];\n }\n function clearValuationFilters() {\n clearValueRange();\n filteredStandaloneValueFields.value = [];\n }\n function clearSpaceAvailabilitySizeRange() {\n minSpaceAvailabilitySize.value = null;\n maxSpaceAvailabilitySize.value = null;\n spaceAvailabilitySizeFilterApplied.value = false;\n }\n function clearSpaceAvailabilitySizeFilters() {\n clearSpaceAvailabilitySizeRange();\n filteredStandaloneSpaceAvailabilitySizeFields.value = [];\n filteredStandaloneSpaceUsageAvailabilitySizeFields.value = [];\n }\n function clearInvestmentTypeFilters() {\n fetchingInvestmentTypeFilterData.value = false;\n filteredInvestmentTypeFields.value = [];\n investmentTypeFilteredHuntIds.value = [];\n filters.value.investmentType = [\n {\n value: [\"sellOutright\", \"foreclosureSellOutright\"],\n label: \"Sale\",\n checked: true,\n },\n {\n value: [\n \"sellEntireInterest\",\n \"sellPartialInterest\",\n \"sellMultipleInterests\",\n ],\n label: \"Recap\",\n checked: true,\n },\n {\n value: [\"originateLoan\", \"refinance\"],\n label: \"Financing\",\n checked: false,\n },\n ];\n }\n function clearLandCoveringStateFilters() {\n landCoveringInvestmentIds.value = [];\n fetchingLandCoveringUseTypeFilterData.value = false;\n filteredLandCoveringUseTypeFields.value = {\n floorAreas: [],\n landCoverings: [],\n };\n fetchingLandCoveringStateFilterData.value = false;\n filteredLandCoveringStateFields.value = {\n stateFilteredPropertyEnhancements: [],\n stateFilteredLayoutPartitions: [],\n stateFilteredFloorAreas: [],\n landCoveringFloorAreas: [],\n allFloorAreas: [],\n };\n filters.value.landCoveringUseType = emptyUseTypes();\n useTypeFilteredHuntIds.value = [];\n filters.value.landCoveringState = [\n {\n value: [\"hypothetical\"],\n label: \"Hypothetical\",\n checked: false,\n openDateFieldName: [\"hypothetical_date\"],\n closeDateFieldName: [\n \"construction_proposed_date\",\n \"demolition_proposed_date\",\n \"construction_approved_date\",\n \"construction_permitted_date\",\n \"construction_commenced_date\",\n \"demolition_permitted_date\",\n \"construction_completed_date\",\n \"remeasurement_created_date\",\n \"remeasurement_retired_date\",\n \"demolished_date\",\n \"withdrawn_date\",\n \"destroyed_date\",\n ],\n },\n {\n value: [\"construction_proposed\"],\n label: \"Proposed\",\n checked: false,\n openDateFieldName: [\"construction_proposed_date\"],\n closeDateFieldName: [\n \"demolition_proposed_date\",\n \"construction_approved_date\",\n \"construction_permitted_date\",\n \"construction_commenced_date\",\n \"demolition_permitted_date\",\n \"construction_completed_date\",\n \"remeasurement_created_date\",\n \"remeasurement_retired_date\",\n \"demolished_date\",\n \"withdrawn_date\",\n \"destroyed_date\",\n ],\n },\n {\n value: [\"construction_approved\", \"construction_permitted\"],\n label: \"Approved\",\n checked: false,\n openDateFieldName: [\n \"construction_approved_date\",\n \"construction_permitted_date\",\n ],\n closeDateFieldName: [\n \"construction_commenced_date\",\n \"demolition_permitted_date\",\n \"construction_completed_date\",\n \"remeasurement_created_date\",\n \"remeasurement_retired_date\",\n \"demolished_date\",\n \"withdrawn_date\",\n \"destroyed_date\",\n ],\n },\n {\n value: [\"construction_commenced\"],\n label: \"Under Construction\",\n checked: true,\n openDateFieldName: [\"construction_commenced_date\"],\n closeDateFieldName: [\n \"demolition_permitted_date\",\n \"construction_completed_date\",\n \"remeasurement_created_date\",\n \"remeasurement_retired_date\",\n \"demolished_date\",\n \"withdrawn_date\",\n \"destroyed_date\",\n ],\n },\n {\n value: [\n \"demolition_proposed\",\n \"demolition_permitted\",\n \"construction_completed\",\n \"remeasurement_created_date\",\n \"created\",\n ],\n label: \"Completed\",\n checked: true,\n openDateFieldName: [\n \"demolition_proposed_date\",\n \"demolition_permitted_date\",\n \"construction_completed_date\",\n \"remeasurement_created_date\",\n \"created_date\",\n ],\n closeDateFieldName: [\n \"remeasurement_retired_date\",\n \"demolished_date\",\n \"withdrawn_date\",\n \"destroyed_date\",\n ],\n },\n ];\n }\n function clearSpaceUsageStates() {\n fetchingSpaceUsageStateFilterData.value = false;\n filteredSpaceUsageStateFields.value = [];\n filters.value.spaceUsageState = emptySpaceUsageStates();\n }\n function clearSpaceAvailabilityStates() {\n fetchingSpaceAvailabilityStateFilterData.value = false;\n filteredSpaceAvailabilityStateFields.value = [];\n filters.value.spaceAvailabilityState = emptySpaceAvailabilityStates();\n }\n function clearSpaceAvailabilitySpaceTypeFilters() {\n fetchingSpaceAvailabilitySpaceTypeFilterData.value = false;\n filteredSpaceAvailabilitySpaceTypeFields.value = [];\n filters.value.spaceAvailabilitySpaceType = [\n { value: \"FloorArea\", label: \"Floor Areas\", checked: true },\n { value: \"LayoutPartition\", label: \"Rooms\", checked: false },\n {\n value: \"PropertyEnhancement\",\n label: \"Property Enhancements\",\n checked: false,\n },\n ];\n }\n function clearLoanStates() {\n fetchingLoanStateFilterData.value = false;\n filteredLoanStateFields.value = [];\n filters.value.loanState = emptyLoanStates();\n }\n function clearInvestmentStates() {\n fetchingInvestmentStateFilterData.value = false;\n filteredInvestmentStateFields.value = [];\n filters.value.investmentState = emptyInvestmentStates();\n }\n function clearInvestmentAssetTypeFilters() {\n fetchingInvestmentAssetTypeFilterData.value = false;\n filteredInvestmentAssetTypeFields.value = [];\n filters.value.investmentAssetType = [\n { value: \"Fee simple\", label: \"Fee parcel\", checked: true },\n { value: \"Leasehold\", label: \"Leasehold\", checked: true },\n { value: \"Condominium\", label: \"Condominium\", checked: true },\n { value: \"Co-op\", label: \"Co-op\", checked: true },\n {\n value: \"Unused Development Rights\",\n label: \"Air Rights\",\n checked: true,\n },\n { value: \"senior\", label: \"Senior Loan\", checked: true },\n { value: \"junior\", label: \"Junior Loan\", checked: true },\n ];\n }\n const huntsCategory = computed(() =>\n _.find(filterCategories.value, { value: \"hunts\" }),\n );\n const huntsChecked = computed(() => huntsCategory.value?.checked);\n const spaceAvailabilitiesCategory = computed(() =>\n _.find(filterCategories.value, { value: \"space-availabilities\" }),\n );\n const spaceAvailabilitiesChecked = computed(\n () => spaceAvailabilitiesCategory.value?.checked,\n );\n const spaceUsagesCategory = computed(() =>\n _.find(filterCategories.value, { value: \"space-usages\" }),\n );\n const spaceUsagesChecked = computed(() => spaceUsagesCategory.value?.checked);\n const sizesCategory = computed(() =>\n _.find(filterCategories.value, { value: \"sizes-uses\" }),\n );\n const sizesChecked = computed(() => sizesCategory.value?.checked);\n const companiesCategory = computed(() =>\n _.find(filterCategories.value, { value: \"companies\" }),\n );\n const companiesChecked = computed(() => companiesCategory.value?.checked);\n const investmentsCategory = computed(() =>\n _.find(filterCategories.value, { value: \"investments\" }),\n );\n const investmentsChecked = computed(() => investmentsCategory.value?.checked);\n const loansCategory = computed(() =>\n _.find(filterCategories.value, { value: \"loans\" }),\n );\n const loansChecked = computed(() => loansCategory.value?.checked);\n const checkedCategories = computed(() =>\n filterCategories.value.filter((category) => category.checked),\n );\n const selectedFilterCategories = computed(() => {\n const hasPolygon = geographyFilterPolygon.value ? 1 : 0;\n const hasValueFilter = valueFilterApplied.value ? 1 : 0;\n const hasSizeFilter = spaceAvailabilitySizeFilterApplied.value ? 1 : 0;\n const hasMaturityDateFilter = loanMaturityDateFilterInput.value ? 1 : 0;\n const hasExpirationDateFilter = spaceUsageExpirationDateFilterInput.value\n ? 1\n : 0;\n const hasDateFilter = mainTimelineCustomLookbackDate.value ? 1 : 0;\n const eventTypesCount = filterCompanyEventTypes.value\n ? selectedCompanyEventTypes.value.length\n : 0;\n const rolesCount = filterCompanyRoles.value\n ? selectedCompanyRoles.value.length\n : 0;\n const spaceTypesCount = filterSpaceAvailabilitySpaceTypes.value\n ? selectedSpaceTypes.value.length\n : 0;\n const assetTypesCount = filterInvestmentAssetTypes.value\n ? selectedInvestmentAssetTypes.value.length\n : 0;\n const spaceUsageStatesCount = filterSpaceUsageStates.value\n ? selectedSpaceUsageStates.value.length\n : 0;\n const availabilityStatesCount = filterSpaceAvailabilityStates.value\n ? selectedSpaceAvailabilityStates.value.length\n : 0;\n const loanStatesCount = filterLoanStates.value\n ? selectedLoanStates.value.length\n : 0;\n const investmentStatesCount = filterInvestmentStates.value\n ? selectedInvestmentStates.value.length\n : 0;\n const investmentTypesCount = filterInvestmentTypes.value\n ? filters.value.investmentType.filter((invType) => invType.checked).length\n : 0;\n const landStatesCount = filterLandCoveringStates.value\n ? filters.value.landCoveringState.filter(\n (developmentState) => developmentState.checked,\n ).length\n : 0;\n const landUsesCount = filterLandCoveringUseTypes.value\n ? selectedLandCoveringUseTypes.value.length\n : 0;\n\n return (\n checkedCategories.value.length +\n hasPolygon +\n hasValueFilter +\n hasSizeFilter +\n hasMaturityDateFilter +\n hasExpirationDateFilter +\n hasDateFilter +\n eventTypesCount +\n rolesCount +\n spaceTypesCount +\n assetTypesCount +\n loanStatesCount +\n availabilityStatesCount +\n spaceUsageStatesCount +\n investmentStatesCount +\n investmentTypesCount +\n landStatesCount +\n landUsesCount\n );\n });\n const selectedCompanyEventTypes = computed(() => {\n return filters.value.companyEventType\n .filter((eventType) => eventType.checked)\n .map((eventType) => eventType.value);\n });\n const selectedCompanyRoles = computed(() => {\n return filters.value.companyRole\n .filter((role) => role.checked)\n .map((role) => role.value);\n });\n const selectedLoanStates = computed(() => {\n return filters.value.loanState\n .filter((loanState) => loanState.checked)\n .map((loanState) => loanState.value);\n });\n const selectedLoanStateFilteringMetadata = computed(() => {\n return filters.value.loanState\n .filter((loanState) => loanState.checked)\n .map((loanState) => {\n return {\n openDateFieldName: loanState.openDateFieldName,\n closeDateFieldName: loanState.closeDateFieldName,\n };\n });\n });\n const selectedSpaceUsageStates = computed(() => {\n return filters.value.spaceUsageState\n .filter((spaceUsageState) => spaceUsageState.checked)\n .map((spaceUsageState) => spaceUsageState.value);\n });\n const selectedSpaceUsageStateFilteringMetadata = computed(() => {\n return filters.value.spaceUsageState\n .filter((spaceUsageState) => spaceUsageState.checked)\n .map((spaceUsageState) => {\n return {\n openDateFieldName: spaceUsageState.openDateFieldName,\n closeDateFieldName: spaceUsageState.closeDateFieldName,\n };\n });\n });\n const selectedSpaceAvailabilityStates = computed(() => {\n return filters.value.spaceAvailabilityState\n .filter((availState) => availState.checked)\n .map((availState) => availState.value);\n });\n const selectedSpaceAvailabilityStateFilteringMetadata = computed(() => {\n return filters.value.spaceAvailabilityState\n .filter((availState) => availState.checked)\n .map((availState) => {\n return {\n openDateFieldName: availState.openDateFieldName,\n closeDateFieldName: availState.closeDateFieldName,\n };\n });\n });\n const selectedInvestmentStates = computed(() => {\n return filters.value.investmentState\n .filter((invState) => invState.checked)\n .map((invState) => invState.value);\n });\n const selectedInvestmentStateFilteringMetadata = computed(() => {\n return filters.value.investmentState\n .filter((invState) => invState.checked)\n .map((invState) => {\n return {\n openDateFieldName: invState.openDateFieldName,\n closeDateFieldName: invState.closeDateFieldName,\n };\n });\n });\n const selectedLandCoveringUseTypes = computed(() => {\n return filters.value.landCoveringUseType\n .filter((useType) => useType.checked)\n .map((useType) => useType.value);\n });\n const selectedLandCoveringStates = computed(() => {\n return filters.value.landCoveringState\n .filter((developmentState) => developmentState.checked)\n .flatMap((developmentState) => developmentState.value);\n });\n const selectedLandCoveringStateFilteringMetadata = computed(() => {\n return filters.value.landCoveringState\n .filter((coveringState) => coveringState.checked)\n .map((coveringState) => {\n return {\n openDateFieldName: coveringState.openDateFieldName,\n closeDateFieldName: coveringState.closeDateFieldName,\n };\n });\n });\n const selectedInvestmentTypeLabels = computed(() => {\n return filters.value.investmentType\n .filter((invType) => invType.checked)\n .map((invType) => invType.label);\n });\n const selectedInvestmentTypes = computed(() => {\n return filters.value.investmentType\n .filter((invType) => invType.checked)\n .flatMap((invType) => invType.value);\n });\n const selectedInvestmentAssetTypes = computed(() => {\n return filters.value.investmentAssetType\n .filter((invType) => invType.checked)\n .map((assetType) => assetType.value);\n });\n const selectedSpaceTypes = computed(() => {\n return filters.value.spaceAvailabilitySpaceType\n .filter((spaceType) => spaceType.checked)\n .map((spaceType) => spaceType.value);\n });\n\n const exportRowData = ref([]);\n\n function addExportRow(data) {\n exportRowData.value = _.unionBy(data, exportRowData.value, \"propertyId\");\n }\n\n const dataEmptyState = {\n buildingCount: {\n interceptableFields: [],\n unlicensedFields: [],\n mapGroupingDataFields: [],\n mapLandCoveringDataFields: [],\n propertyRightLandCoveringDataFields: [],\n },\n sizesUses: {\n fetchRequests: [],\n interceptableFields: [],\n unlicensedFields: [],\n floorAreaDataFields: [],\n propertyUseDataFields: [],\n standardizedAreaDataFields: [],\n useBasedAreaDataFields: [],\n },\n investmentVolume: {\n fetchRequests: [],\n interceptableFields: [],\n unlicensedFields: [],\n investmentFields: [],\n investmentDataFields: [],\n investmentGroupDataFields: [],\n investmentGroupValuationDataFields: [],\n investmentValuationDataFields: [],\n valueDataFields: [],\n loanAmountDataFields: [],\n },\n };\n const optionsEmptyState = {\n investmentVolume: {\n valueTypes: [\"Final\", \"Accepted Offer\", \"Offer\", \"Guidance\"],\n },\n buildingCount: {},\n sizesUses: {\n includeAirRights: true,\n },\n pricePerArea: {\n denominator: \"topLevel\",\n },\n excludedUses: {\n useTypes: [\"Common Area\", \"Mechanical\", \"Parking\"],\n },\n };\n\n const surveyInvestmentCountProxy = ref(0);\n const surveyCompanyCountProxy = ref(0);\n const surveySizeCountProxy = ref(0);\n const surveyLoanCountProxy = ref(0);\n const surveySpaceUsageCountProxy = ref(0);\n const surveySpaceAvailabilityCountProxy = ref(0);\n const surveyHuntCountProxy = ref(0);\n const surveyUnlockableBundleFields = ref({\n standaloneFields: [],\n });\n const surveyUnlockableBundleFieldIds = computed(() => {\n if (checkedCategories.value.length > 0) {\n const hasInvestments =\n investmentsChecked.value && surveyInvestmentCountProxy.value > 0;\n const hasCompanies =\n companiesChecked.value && surveyCompanyCountProxy.value > 0;\n const hasSizes = sizesChecked.value && surveySizeCountProxy.value > 0;\n const hasLoans = loansChecked.value && surveyLoanCountProxy.value > 0;\n const hasSpaceUsages =\n spaceUsagesChecked.value && surveySpaceUsageCountProxy.value > 0;\n const hasSpaceAvailabilities =\n spaceAvailabilitiesChecked.value &&\n surveySpaceAvailabilityCountProxy.value > 0;\n const hasHunts =\n huntsChecked.value &&\n (combinedFilteredInvestorHuntIds.value.length > 0 ||\n combinedFilteredOccupierHuntIds.value.length > 0);\n\n if (\n hasInvestments ||\n hasCompanies ||\n hasSizes ||\n hasLoans ||\n hasSpaceUsages ||\n hasSpaceAvailabilities ||\n hasHunts\n ) {\n const combinedFetchedFields = [\n analyzePropertyFields.value,\n analyzeHuntFields.value,\n analyzeSpaceUsageFields.value,\n analyzeLoanFields.value,\n analyzeInvestmentFields.value,\n analyzeSpaceAvailabilityFields.value,\n ];\n const combinedIds = combinedFetchedFields.flatMap((objCollection) => {\n return _.map(_.compact(objCollection), function (dataField) {\n return dataField.fieldContent?.relatedFieldIds || dataField.localId;\n });\n });\n const combinedCalcIds = _.map(\n calculationData.value,\n function (calcFieldContainerObject) {\n return _.map(calcFieldContainerObject, function (fields, key) {\n if (key === \"fetchRequests\") {\n return [];\n } else {\n return fields.flatMap(\n (dataField) =>\n dataField.fieldContent?.relatedFieldIds ||\n dataField.localId,\n );\n }\n });\n },\n );\n return _.concat(\n _.flattenDeep(combinedIds),\n _.flattenDeep(combinedCalcIds),\n );\n } else {\n return [];\n }\n } else {\n return [];\n }\n });\n function patchUnlockableIds(fields, fieldType) {\n const ids = _.uniq(_.compact(fields.map((df) => df.localId)));\n const relatedFieldIds = _.uniq(\n _.compact(fields.flatMap((df) => df.fieldContent?.relatedFieldIds || [])),\n );\n surveyUnlockableBundleFields.value[fieldType] = _.union(\n ids,\n relatedFieldIds,\n surveyUnlockableBundleFields.value[fieldType],\n );\n }\n\n function dropUnlockableFieldType(fieldType) {\n surveyUnlockableBundleFields.value[fieldType] = [];\n }\n\n function dropUnlockableIds(fields) {\n const ids = fields.map((df) => df.localId);\n _.forEach(\n surveyUnlockableBundleFields.value,\n function (existingIds, fieldType) {\n surveyUnlockableBundleFields.value[fieldType] = _.difference(\n surveyUnlockableBundleFields.value[fieldType],\n ids,\n );\n },\n );\n }\n\n const postpendableFetchKey = computed(\n () => `${asOfMilliseconds.value}_${compositeMapMeta.value}`,\n );\n\n const calculationData = ref(dataEmptyState);\n const contentCalculationData = ref({});\n const calculationOptions = ref(optionsEmptyState);\n const lastCheckedMapMeta = ref({\n lat: null,\n lng: null,\n zoom: null,\n });\n const lastCheckedTime = ref(null);\n const lastCheckedPolygonArea = ref(null);\n const sizesSurveyFetched = computed(() =>\n alreadyFetched(\"sizesUses\", \"survey\"),\n );\n const investmentVolumeSurveyFetched = computed(() =>\n alreadyFetched(\"investmentVolume\", \"survey\"),\n );\n const analyzePropertyFields = ref({});\n const analyzeHuntFields = ref({});\n const fetchedHuntKeys = computed(() => _.keys(analyzeHuntFields.value));\n const analyzeSpaceUsageFields = ref({});\n const fetchedSpaceUsageKeys = computed(() =>\n _.keys(analyzeSpaceUsageFields.value),\n );\n const fetchedSpaceUsageUserFieldKeys = computed(() => {\n return fetchedSpaceUsageKeys.value.filter((key) => _.includes(key, \"User\"));\n });\n const fetchedSpaceUsageUserFields = computed(() => {\n return _.filter(analyzeSpaceUsageFields.value, function (dataField, key) {\n return _.includes(fetchedSpaceUsageUserFieldKeys.value, key);\n });\n });\n const fetchedUsageFloorAreaLayoutFieldKeys = computed(() => {\n return fetchedSpaceUsageKeys.value.filter(\n (key) =>\n (_.includes(key, \"FloorArea\") || _.includes(key, \"LayoutPartition\")) &&\n _.includes(key, \"Layout\"),\n );\n });\n const fetchedUsageFloorAreaLayoutFields = computed(() => {\n return _.filter(analyzeSpaceUsageFields.value, function (dataField, key) {\n return _.includes(fetchedUsageFloorAreaLayoutFieldKeys.value, key);\n });\n });\n const stateFilteredFloorAreaIds = computed(() =>\n stateFilteredFloorAreaFields.value.map((dataFieldStub) => {\n if (dataFieldStub.decoratingContentType === \"FloorArea\") {\n return dataFieldStub.decoratingContentId;\n } else if (dataFieldStub.fieldContentType === \"FloorArea\") {\n return dataFieldStub.fieldContentId;\n } else {\n return null;\n }\n }),\n );\n const useTypeFilteredFloorAreaIds = computed(() =>\n filteredLandCoveringUseTypeFields.value.floorAreas.map(\n (dataField) => dataField.fieldContentId,\n ),\n );\n const stateFilteredEnhancementIds = computed(() =>\n stateFilteredPropertyEnhancementFields.value.map(\n (dataFieldStub) => dataFieldStub.decoratingContentId,\n ),\n );\n const stateFilteredPartitionIds = computed(() =>\n stateFilteredLayoutPartitionFields.value.map(\n (dataFieldStub) => dataFieldStub.fieldContentId,\n ),\n );\n\n const analyzeLoanFields = ref({});\n const analyzeInvestmentFields = ref({});\n const fetchedInvestmentKeys = computed(() =>\n _.keys(analyzeInvestmentFields.value),\n );\n const fetchedInvestmentFieldKeys = computed(() => {\n return fetchedInvestmentKeys.value.filter((key) =>\n _.includes(key, \"Investment\"),\n );\n });\n const fetchedInvestmentGroupFieldKeys = computed(() => {\n return fetchedInvestmentKeys.value.filter((key) =>\n _.includes(key, \"InvestmentGroup\"),\n );\n });\n const fetchedInvestmentFields = computed(() => {\n return _.filter(analyzeInvestmentFields.value, function (dataField, key) {\n return _.includes(fetchedInvestmentFieldKeys.value, key);\n });\n });\n const fetchedInvestmentGroupFields = computed(() => {\n return _.filter(analyzeInvestmentFields.value, function (dataField, key) {\n return (\n _.includes(fetchedInvestmentGroupFieldKeys.value, key) &&\n !!dataField.fieldContent?.propertyIds\n );\n });\n });\n const datedInvestmentPropertyIds = computed(() => {\n const filteredInvestmentIds = combinedTimelineInvestmentFields.value\n .filter((dataField) => {\n return (\n investmentLikeIncluded(\n dataField.fieldContentId,\n dataField.portfolioId,\n ) && combinedFilteredInvestmentIncluded(dataField.fieldContentId)\n );\n })\n .map((dataField) => dataField.fieldContentId);\n const rawIds = fetchedInvestmentFields.value\n .filter((dataField) =>\n _.includes(filteredInvestmentIds, dataField.fieldContentId),\n )\n .map((dataField) => dataField.fieldContent?.topLevelPropertyId);\n const rawPortfolioPropertyIds = fetchedInvestmentGroupFields.value\n .filter(\n (dataField) =>\n _.intersection(\n filteredInvestmentIds,\n dataField.fieldContent?.investmentIds || [],\n ).length > 0,\n )\n .flatMap((dataField) => dataField.fieldContent?.propertyIds);\n const rawLoanInvestmentIds = _.filter(\n analyzeLoanFields.value,\n function (dataField) {\n return !!dataField?.fieldContent?.originationInvestmentId;\n },\n )\n .filter((dataField) =>\n _.includes(\n filteredInvestmentIds,\n dataField?.fieldContent?.originationInvestmentId,\n ),\n )\n .map((dataField) => dataField?.fieldContent?.propertyId);\n\n const combinedPropertyIds = _.uniq(\n _.concat(\n translatePropertyIds(_.compact(rawIds)),\n translatePropertyIds(_.compact(rawPortfolioPropertyIds)),\n translatePropertyIds(_.compact(rawLoanInvestmentIds)),\n ),\n );\n\n return combinedPropertyIds;\n });\n\n const analyzeSpaceAvailabilityFields = ref({});\n const fetchedSpaceAvailabilityKeys = computed(() =>\n _.keys(analyzeSpaceAvailabilityFields.value),\n );\n const fetchedSpaceAvailabilityFieldKeys = computed(() => {\n return fetchedSpaceAvailabilityKeys.value.filter((key) =>\n _.includes(key, \"SpaceAvailability\"),\n );\n });\n const fetchedSpaceAvailabilityGroupFieldKeys = computed(() => {\n return fetchedSpaceAvailabilityKeys.value.filter((key) =>\n _.includes(key, \"SpaceAvailabilityGroup\"),\n );\n });\n const fetchedSpaceAvailabilityFields = computed(() => {\n return _.filter(\n analyzeSpaceAvailabilityFields.value,\n function (dataField, key) {\n return _.includes(fetchedSpaceAvailabilityFieldKeys.value, key);\n },\n );\n });\n const fetchedSpaceAvailabilityGroupFields = computed(() => {\n return _.filter(\n analyzeSpaceAvailabilityFields.value,\n function (dataField, key) {\n return (\n _.includes(fetchedSpaceAvailabilityGroupFieldKeys.value, key) &&\n !!dataField.fieldContent?.propertyIds\n );\n },\n );\n });\n\n const fetchedAvailabilityFloorAreaLayoutFieldKeys = computed(() => {\n return fetchedSpaceAvailabilityKeys.value.filter(\n (key) =>\n (_.includes(key, \"FloorArea\") || _.includes(key, \"LayoutPartition\")) &&\n _.includes(key, \"Layout\"),\n );\n });\n const fetchedAvailabilityFloorAreaLayoutFields = computed(() => {\n return _.filter(\n analyzeSpaceAvailabilityFields.value,\n function (dataField, key) {\n return _.includes(\n fetchedAvailabilityFloorAreaLayoutFieldKeys.value,\n key,\n );\n },\n );\n });\n\n const datedAvailabilityPropertyIds = computed(() => {\n const filteredSpaceAvailabilityIds =\n combinedTimelineSpaceAvailabilityFields.value\n .filter((dataField) => {\n return (\n spaceAvailabilityLikeIncluded(\n dataField.fieldContentId,\n dataField.portfolioId,\n ) &&\n combinedFilteredSpaceAvailabilityIncluded(dataField.fieldContentId)\n );\n })\n .map((dataField) => dataField.fieldContentId);\n const rawIds = fetchedSpaceAvailabilityFields.value\n .filter((dataField) =>\n _.includes(filteredSpaceAvailabilityIds, dataField.fieldContentId),\n )\n .map((dataField) => dataField.fieldContent?.topLevelPropertyId);\n const rawPortfolioPropertyIds = fetchedSpaceAvailabilityGroupFields.value\n .filter(\n (dataField) =>\n _.intersection(\n filteredSpaceAvailabilityIds,\n dataField.fieldContent.availabilityIds,\n ).length > 0,\n )\n .flatMap((dataField) => dataField.fieldContent?.propertyIds);\n const rawUsageAvailabilityIds = _.filter(\n analyzeSpaceUsageFields.value,\n function (dataField) {\n return !!dataField.fieldContent?.availabilityId;\n },\n )\n .filter((dataField) =>\n _.includes(\n filteredSpaceAvailabilityIds,\n dataField.fieldContent.availabilityId,\n ),\n )\n .map((dataField) => dataField.fieldContent?.space?.propertyId);\n\n const combinedPropertyIds = _.uniq(\n _.concat(\n translatePropertyIds(_.compact(rawIds)),\n translatePropertyIds(_.compact(rawPortfolioPropertyIds)),\n translatePropertyIds(_.compact(rawUsageAvailabilityIds)),\n ),\n );\n\n return combinedPropertyIds;\n });\n\n // CONTENT CALCULATION DATA\n\n const fetchedCalculationKeys = computed(() =>\n _.keys(contentCalculationData.value),\n );\n\n async function fetchContentCalculationData({\n contentType,\n contentId,\n override = false,\n }) {\n const contentKey = `${contentType}${contentId}`;\n if (alreadyFetchedCalculations(contentKey) && !override) {\n console.log(\"already fetched\", contentKey);\n } else if (contentType && contentId) {\n try {\n const payload = {\n contentType,\n contentIds: [contentId],\n calculationName: \"sizes_uses\",\n bundle: \"calculation\",\n asOf: asOfMilliseconds.value,\n };\n const key = `sizes_uses-${payload.contentType}-${payload.contentIds}-${payload.asOf}`;\n fetchingAnalyzePanelData.value = true;\n\n const calculationFields =\n await calculationFieldsStore.calculationDataInitialFetch({\n payload,\n key,\n endpoint: `calculation_data_fields`,\n calculationName: payload.calculationName,\n analyzePanelSet: false,\n paginationCount: 10,\n });\n let bundleResponse = null;\n\n if (calculationFields?.data) {\n const bundlePayload = {\n bundleFieldIds: calculationFields.data.map(\n ({ localId }) => localId,\n ),\n bundle: \"calculation\",\n };\n bundleResponse = await api.post(\n `crowdsourced_data_field_calculation_bundles`,\n bundlePayload,\n );\n }\n\n if (bundleResponse?.data) {\n contentCalculationData.value[contentKey] = {\n allFieldsData: bundleResponse.data,\n sizesUses: structuredCalculationDataFor(\n \"sizes_uses\",\n calculationFields.data,\n ),\n };\n }\n } catch (error) {\n console.error(error);\n notificationsStore.addNotification(\"anErrorOccurred\");\n } finally {\n fetchingAnalyzePanelData.value = false;\n }\n }\n }\n\n function structuredCalculationDataFor(calculationName, rawFields) {\n switch (calculationName) {\n case \"sizes_uses\": {\n let tempState = {\n interceptableFields: [],\n floorAreaDataFields: [],\n propertyUseDataFields: [],\n standardizedAreaDataFields: [],\n useBasedAreaDataFields: [],\n };\n\n const interceptableFields = rawFields.filter(\n (df) => df.meteringStatus === \"prompt_to_subscribe\",\n );\n const floorAreaDataFields = rawFields.filter(\n (df) => df.fieldContentType === \"FloorArea\",\n );\n const propertyUseDataFields = rawFields.filter(\n (df) => df.fieldContentType === \"ContentPropertyUse\",\n );\n const standardizedAreaDataFields = rawFields.filter((df) =>\n _.includes(\n [\"standardized_area\", \"minimum_subdivision_standardized_area\"],\n df.fieldName,\n ),\n );\n const useBasedAreaDataFields = rawFields.filter(\n (df) => df.fieldName === \"use_based_area\",\n );\n\n tempState.interceptableFields = interceptableFields;\n tempState.floorAreaDataFields = floorAreaDataFields;\n tempState.propertyUseDataFields = propertyUseDataFields;\n tempState.standardizedAreaDataFields = standardizedAreaDataFields;\n tempState.useBasedAreaDataFields = useBasedAreaDataFields;\n\n return tempState;\n }\n }\n }\n\n function alreadyFetchedCalculations(contentKey) {\n return _.includes(fetchedCalculationKeys.value, contentKey);\n }\n\n function dropContentCalculationData({ contentType, contentId }) {\n const contentKey = `${contentType}${contentId}`;\n\n if (alreadyFetchedCalculations(contentKey)) {\n delete contentCalculationData.value[contentKey];\n }\n }\n\n function contentCalculationDataByKey(contentKey) {\n return _.get(contentCalculationData.value, `[${contentKey}]`, {});\n }\n\n // END CONTENT CALCULATION DATA ^^\n\n function alreadyFetched(dataPath, fetchRequestKey) {\n if (calculationData.value) {\n const keys = calculationData.value[dataPath].fetchRequests.map(\n (request) => request.key,\n );\n\n return _.includes(keys, fetchRequestKey);\n }\n }\n\n function alreadyFetchedFieldIdsFor(dataPath, fetchRequestKey) {\n if (calculationData.value) {\n const request = _.find(calculationData.value[dataPath].fetchRequests, {\n key: fetchRequestKey,\n });\n\n if (request) {\n return request.fieldIds.map((id) => {\n return { localId: id };\n });\n } else {\n return [];\n }\n }\n }\n\n function registerFetchRequest(dataPath, requestKey, dataFields) {\n if (calculationData.value) {\n const payload = {\n key: requestKey,\n fieldIds: dataFields.map((field) => field.localId),\n };\n\n calculationData.value[dataPath].fetchRequests = _.unionBy(\n [payload],\n calculationData.value[dataPath].fetchRequests,\n \"key\",\n );\n }\n }\n\n const latLngMismatch = computed(() => {\n const { lat, lng } = lastCheckedMapMeta.value;\n\n return (\n centerLatLng.value &&\n (lat !== centerLatLng.value[0] || lng !== centerLatLng.value[1])\n );\n });\n const zoomMismatch = computed(() => {\n const localZoom = lastCheckedMapMeta.value.zoom;\n\n return zoom.value && localZoom !== zoom.value;\n });\n const polygonMismatch = computed(() => {\n return (\n polygonArea.value &&\n !editingPolygon.value &&\n lastCheckedPolygonArea.value !== polygonArea.value\n );\n });\n const timeMismatch = computed(() => {\n return (\n asOfMilliseconds.value && lastCheckedTime.value !== asOfMilliseconds.value\n );\n });\n\n const unselectedPropertyDiagram = computed(() => {\n return (\n propertyIdParam.value &&\n !propertySelectedRecordDataField.value &&\n propertyDiagramPropertyIds.value.length > 1\n );\n });\n const propertySelectedPropertyDiagram = computed(() => {\n return (\n propertyIdParam.value &&\n propertyDataField.value &&\n !propertyDiagramSelected.value\n );\n });\n const unselectedCompanyDetail = computed(\n () => companyIdParam.value && !companyDetailSelected.value,\n );\n const unselectedContactDetail = computed(\n () => contactIdParam.value && !contactDetailSelected.value,\n );\n const countable = computed(\n () =>\n _.includes([\"PropertyRight\"], focalDataField.value?.fieldContentType) ||\n propertySelectedPropertyDiagram.value ||\n unselectedPropertyDiagram.value ||\n unselectedCompanyDetail.value ||\n unselectedContactDetail.value,\n );\n const sizeable = computed(\n () =>\n _.includes(\n [\"LandCovering\", \"LandCoveringGrouping\", \"PropertyRight\"],\n focalDataField.value?.fieldContentType,\n ) ||\n propertySelectedPropertyDiagram.value ||\n unselectedPropertyDiagram.value ||\n unselectedCompanyDetail.value ||\n unselectedContactDetail.value ||\n spaceAvailabilitiesChecked.value ||\n spaceUsagesChecked.value,\n );\n\n const focalDataField = computed(() => {\n if (contactIdParam.value) {\n if (\n contactSelectedRecordDataField.value?.fieldContentType ===\n \"CompanyInvolvement\"\n ) {\n return assetDataFieldFor(contactSelectedRecordDataField.value);\n } else {\n return contactSelectedRecordDataField.value;\n }\n } else if (companyIdParam.value) {\n if (\n companySelectedRecordDataField.value?.fieldContentType ===\n \"CompanyInvolvement\"\n ) {\n return assetDataFieldFor(companySelectedRecordDataField.value);\n } else {\n return companySelectedRecordDataField.value;\n }\n } else if (propertyDiagramSelected.value) {\n return propertyDiagramSelected.value.dataField;\n } else {\n return null;\n }\n });\n const analyzeDisplayable = computed(\n () =>\n routeName.value === \"MainMap\" ||\n propertySelectedPropertyDiagram.value ||\n unselectedPropertyDiagram.value ||\n countable.value ||\n sizeable.value ||\n contactIdParam.value ||\n companyIdParam.value,\n );\n\n function selectFilters() {\n router.push({\n name: route.name,\n query: {\n ...route.query,\n horizontalTab: \"Analyze\",\n verticalTab: \"Filter\",\n },\n });\n }\n function selectLayers() {\n router.push({\n name: route.name,\n query: {\n ...route.query,\n horizontalTab: \"Analyze\",\n verticalTab: \"Layer\",\n },\n });\n }\n function zoomIn(to = 15) {\n if (zoom.value < to) {\n map.value.setZoom(to);\n }\n }\n\n watch(mapSearchShortcutAction, async () => {\n if (mapSearchShortcutAction.value) {\n if (_.includes(mapSearchShortcutAction.value, \"analyze\")) {\n resetFilterCategories();\n selectFilters();\n await delay(0.25);\n zoomIn();\n await nextTick();\n switch (mapSearchShortcutAction.value) {\n case \"analyzeHunts\":\n _.find(filters.value.category, { value: \"hunts\" }).checked = true;\n break;\n case \"analyzeCompanies\":\n _.find(filters.value.category, {\n value: \"companies\",\n }).checked = true;\n break;\n case \"analyzeSpaceAvailabilities\":\n _.find(filters.value.category, {\n value: \"space-availabilities\",\n }).checked = true;\n break;\n case \"analyzeSpaceUsages\":\n _.find(filters.value.category, {\n value: \"space-usages\",\n }).checked = true;\n break;\n case \"analyzeInvestments\":\n _.find(filters.value.category, {\n value: \"investments\",\n }).checked = true;\n break;\n case \"analyzeLoans\":\n _.find(filters.value.category, { value: \"loans\" }).checked = true;\n break;\n case \"analyzeSizesUses\":\n _.find(filters.value.category, {\n value: \"sizes-uses\",\n }).checked = true;\n break;\n default:\n break;\n }\n } else if (_.includes(mapSearchShortcutAction.value, \"layer\")) {\n switch (mapSearchShortcutAction.value) {\n case \"layerDataCoverage\":\n selectLayers();\n await nextTick();\n selectedLayer.value = _.find(layers.value, {\n title: \"Data Coverage\",\n });\n break;\n default:\n break;\n }\n }\n mapSearchShortcutAction.value = null;\n }\n });\n\n watch(unselectedPropertyDiagram, () => {\n if (unselectedPropertyDiagram.value) {\n editingMode.value = false;\n }\n });\n\n watch(\n checkedCategories,\n () => {\n if (checkedCategories.value.length === 0) {\n resetUnlockableSurveyIds();\n }\n },\n { deep: true },\n );\n\n watch(sizesChecked, () => {\n if (sizesChecked.value) {\n if (asyncReady.value) {\n debouncedLandCoveringStateFilter();\n debouncedLandCoveringUseTypeFilter();\n }\n } else {\n resetSizeFilter();\n }\n });\n\n watch(investmentsChecked, () => {\n if (investmentsChecked.value) {\n if (asyncReady.value) {\n debouncedInvestmentStateFilter();\n debouncedInvestmentTypeFilter();\n debouncedInvestmentAssetTypeFilter();\n debouncedLandCoveringStateFilter();\n debouncedLandCoveringUseTypeFilter();\n }\n } else {\n resetInvestmentFilter();\n }\n });\n\n watch(companiesChecked, () => {\n if (companiesChecked.value) {\n if (asyncReady.value) {\n debouncedInvestmentStateFilter();\n debouncedSpaceAvailabilityStateFilter();\n debouncedSpaceAvailabilitySpaceTypeFilter();\n debouncedInvestmentTypeFilter();\n debouncedHuntInvestmentTypeFilter();\n debouncedInvestmentAssetTypeFilter();\n debouncedLandCoveringStateFilter();\n debouncedLandCoveringUseTypeFilter();\n debouncedHuntUseTypeFilter();\n }\n } else {\n resetCompanyFilter();\n }\n });\n\n watch(huntsChecked, () => {\n if (huntsChecked.value) {\n if (asyncReady.value) {\n debouncedHuntInvestmentTypeFilter();\n debouncedLandCoveringStateFilter();\n debouncedLandCoveringUseTypeFilter();\n debouncedHuntUseTypeFilter();\n }\n } else {\n resetHuntFilter();\n }\n });\n\n watch(loansChecked, () => {\n if (loansChecked.value) {\n if (asyncReady.value) {\n debouncedLoanStateFilter();\n debouncedLoanMaturityDateFilter();\n debouncedInvestmentAssetTypeFilter();\n debouncedLandCoveringStateFilter();\n debouncedLandCoveringUseTypeFilter();\n }\n } else {\n resetLoanFilter();\n }\n });\n\n watch(spaceAvailabilitiesChecked, () => {\n if (spaceAvailabilitiesChecked.value) {\n filters.value.spaceAvailabilityState = emptyLiveSpaceAvailabilityStates();\n if (asyncReady.value) {\n debouncedSpaceAvailabilityStateFilter();\n debouncedSpaceAvailabilitySpaceTypeFilter();\n debouncedLandCoveringStateFilter();\n debouncedLandCoveringUseTypeFilter();\n }\n } else {\n resetSpaceAvailabilityFilter();\n }\n });\n\n watch(spaceUsagesChecked, () => {\n if (spaceUsagesChecked.value) {\n if (asyncReady.value) {\n debouncedSpaceUsageStateFilter();\n debouncedSpaceUsageExpirationDateFilter();\n debouncedSpaceAvailabilitySpaceTypeFilter();\n debouncedLandCoveringStateFilter();\n debouncedLandCoveringUseTypeFilter();\n }\n } else {\n resetSpaceUsageFilter();\n }\n });\n\n watch(loanCount, () => {\n surveyLoanCountProxy.value = loanCount.value;\n });\n\n watch(loanMaturityDateFilterInput, () => {\n if (loanMaturityDateFilterInput.value && asyncReady.value) {\n debouncedLoanMaturityDateFilter();\n }\n });\n\n watch(\n selectedLoanStates,\n () => {\n if (asyncReady.value) {\n debouncedLoanStateFilter();\n }\n },\n { deep: true },\n );\n\n watch(spaceUsageCount, () => {\n surveySpaceUsageCountProxy.value = spaceUsageCount.value;\n });\n\n watch(spaceUsageExpirationDateFilterInput, () => {\n if (spaceUsageExpirationDateFilterInput.value && asyncReady.value) {\n debouncedSpaceUsageExpirationDateFilter();\n }\n });\n\n watch(\n selectedSpaceUsageStates,\n () => {\n if (asyncReady.value) {\n debouncedSpaceUsageStateFilter();\n }\n },\n { deep: true },\n );\n\n watch(\n selectedSpaceTypes,\n () => {\n if (asyncReady.value) {\n debouncedSpaceAvailabilitySpaceTypeFilter();\n debouncedLandCoveringSpaceAvailabilitiesFetch();\n debouncedSpaceUsagesAvailabilitiesFetch();\n }\n },\n { deep: true },\n );\n\n watch(\n selectedSpaceAvailabilityStates,\n () => {\n if (asyncReady.value) {\n debouncedSpaceAvailabilityStateFilter();\n }\n },\n { deep: true },\n );\n\n watch(\n selectedInvestmentStates,\n () => {\n if (asyncReady.value) {\n debouncedInvestmentStateFilter();\n }\n },\n { deep: true },\n );\n\n watch(\n selectedLandCoveringUseTypes,\n () => {\n if (asyncReady.value) {\n debouncedLandCoveringUseTypeFilter();\n debouncedHuntUseTypeFilter();\n }\n },\n { deep: true },\n );\n\n watch(\n selectedLandCoveringStates,\n () => {\n if (asyncReady.value) {\n debouncedLandCoveringStateFilter();\n }\n },\n { deep: true },\n );\n\n watch(\n selectedInvestmentTypes,\n () => {\n if (asyncReady.value) {\n debouncedInvestmentTypeFilter();\n debouncedHuntInvestmentTypeFilter();\n }\n },\n { deep: true },\n );\n\n watch(\n selectedInvestmentAssetTypes,\n () => {\n if (asyncReady.value) {\n debouncedInvestmentAssetTypeFilter();\n }\n },\n { deep: true },\n );\n\n watch(combinedSpaceAvailabilityIds, (val, oldVal) => {\n if (!_.isEqual(val, oldVal) && asyncReady.value) {\n debouncedSpaceAvailabilityStateFilter();\n debouncedSpaceAvailabilitySpaceTypeFilter();\n debouncedLandCoveringSpaceAvailabilitiesFetch();\n debouncedSpaceUsagesAvailabilitiesFetch();\n }\n });\n\n watch(\n combinedInvestmentIds,\n (val, oldVal) => {\n if (!_.isEqual(val, oldVal) && asyncReady.value) {\n debouncedInvestmentStateFilter();\n debouncedInvestmentTypeFilter();\n debouncedInvestmentAssetTypeFilter();\n debouncedLandCoveringInvestmentsFetch();\n debouncedLoansInvestmentsFetch();\n }\n },\n { deep: true },\n );\n\n watch(\n combinedFilteredLandCoveringIds,\n (val, oldVal) => {\n if (!_.isEqual(val, oldVal) && asyncReady.value) {\n debouncedLandCoveringInvestmentsFetch();\n debouncedLandCoveringSpaceAvailabilitiesFetch();\n debouncedLoansInvestmentsFetch();\n debouncedSpaceUsagesAvailabilitiesFetch();\n }\n },\n { deep: true },\n );\n\n function locationRefetch() {\n if (asyncReady.value) {\n console.log(\"all pagys loaded...\", postpendableFetchKey.value);\n debouncedUpdateLastChecked();\n debouncedSpaceAvailabilityStateFilter();\n debouncedSpaceAvailabilitySpaceTypeFilter();\n debouncedSpaceUsageStateFilter();\n debouncedLoanStateFilter();\n debouncedInvestmentStateFilter();\n debouncedInvestmentTypeFilter();\n debouncedInvestmentAssetTypeFilter();\n debouncedLandCoveringStateFilter();\n debouncedSpaceUsageExpirationDateFilter();\n debouncedLandCoveringUseTypeFilter();\n debouncedHuntUseTypeFilter();\n debouncedHuntInvestmentTypeFilter();\n debouncedLoanMaturityDateFilter();\n debouncedSpaceUsageExpirationDateFilter();\n }\n }\n\n watch(mapPagysLoaded, () => {\n locationRefetch();\n });\n watch(asyncReady, () => {\n locationRefetch();\n });\n watch(\n companyFetchedLocationDataFields,\n (val, oldVal) => {\n if (!_.isEqual(val, oldVal) && asyncReady.value) {\n debouncedLandCoveringStateFilter();\n debouncedLandCoveringUseTypeFilter();\n }\n },\n { deep: true },\n );\n watch(\n contactFetchedLocationDataFields,\n (val, oldVal) => {\n if (!_.isEqual(val, oldVal) && asyncReady.value) {\n debouncedLandCoveringStateFilter();\n debouncedLandCoveringUseTypeFilter();\n }\n },\n { deep: true },\n );\n watch(\n companyFetchedPolygonDataFields,\n (val, oldVal) => {\n if (!_.isEqual(val, oldVal) && asyncReady.value) {\n debouncedHuntUseTypeFilter();\n debouncedHuntInvestmentTypeFilter();\n }\n },\n { deep: true },\n );\n watch(\n contactFetchedPolygonDataFields,\n (val, oldVal) => {\n if (!_.isEqual(val, oldVal) && asyncReady.value) {\n debouncedHuntUseTypeFilter();\n debouncedHuntInvestmentTypeFilter();\n }\n },\n { deep: true },\n );\n watch(companyIdParam, (val, oldVal) => {\n if (val && val !== oldVal) {\n debouncedUpdateLastChecked();\n debouncedSpaceAvailabilityStateFilter();\n debouncedSpaceAvailabilitySpaceTypeFilter();\n debouncedSpaceUsageStateFilter();\n debouncedLoanStateFilter();\n debouncedInvestmentStateFilter();\n debouncedInvestmentTypeFilter();\n debouncedInvestmentAssetTypeFilter();\n debouncedLandCoveringStateFilter();\n debouncedSpaceUsageExpirationDateFilter();\n debouncedLandCoveringUseTypeFilter();\n debouncedHuntUseTypeFilter();\n debouncedHuntInvestmentTypeFilter();\n }\n });\n\n watch(contactIdParam, (val, oldVal) => {\n if (val && val !== oldVal) {\n debouncedUpdateLastChecked();\n debouncedSpaceAvailabilityStateFilter();\n debouncedSpaceAvailabilitySpaceTypeFilter();\n debouncedSpaceUsageStateFilter();\n debouncedLoanStateFilter();\n debouncedInvestmentStateFilter();\n debouncedInvestmentTypeFilter();\n debouncedInvestmentAssetTypeFilter();\n debouncedLandCoveringStateFilter();\n debouncedSpaceUsageExpirationDateFilter();\n debouncedLandCoveringUseTypeFilter();\n debouncedHuntUseTypeFilter();\n debouncedHuntInvestmentTypeFilter();\n }\n });\n\n watch(signedIn, async () => {\n if (!editingPolygon.value && geographyFilterPolygon.value) {\n debouncedUpdateLastChecked();\n fetchPolygonPropertyLocations();\n }\n });\n\n watch(editingPolygon, () => {\n if (!editingPolygon.value && geographyFilterPolygon.value) {\n debouncedUpdateLastChecked();\n fetchPolygonPropertyLocations();\n }\n });\n watch(minValue, () => {\n valueFilterApplied.value = false;\n });\n watch(maxValue, () => {\n valueFilterApplied.value = false;\n });\n watch(minSpaceAvailabilitySize, () => {\n spaceAvailabilitySizeFilterApplied.value = false;\n });\n watch(maxSpaceAvailabilitySize, () => {\n spaceAvailabilitySizeFilterApplied.value = false;\n });\n\n watch(asOfMilliseconds, async () => {\n debouncedUpdateLastChecked();\n debouncedLandCoveringUseTypeFilter();\n debouncedHuntUseTypeFilter();\n debouncedSpaceUsageStateFilter();\n debouncedLandCoveringStateFilter();\n debouncedInvestmentStateFilter();\n debouncedInvestmentTypeFilter();\n debouncedInvestmentAssetTypeFilter();\n debouncedSpaceAvailabilityStateFilter();\n debouncedSpaceAvailabilitySpaceTypeFilter();\n debouncedLoanStateFilter();\n });\n watch(routeName, () => {\n resetFilterCategories();\n });\n\n const debouncedUpdateLastChecked = _.debounce(function () {\n updateLastChecked();\n }, 2000);\n\n function resetFilterCategories() {\n _.find(filters.value.category, {\n value: \"space-availabilities\",\n }).checked = false;\n _.find(filters.value.category, { value: \"space-usages\" }).checked = false;\n _.find(filters.value.category, { value: \"sizes-uses\" }).checked = false;\n _.find(filters.value.category, { value: \"companies\" }).checked = false;\n _.find(filters.value.category, { value: \"investments\" }).checked = false;\n _.find(filters.value.category, { value: \"loans\" }).checked = false;\n _.find(filters.value.category, { value: \"hunts\" }).checked = false;\n setSelectedGeography(\"boundaries\");\n clearLandCoveringStateFilters();\n polygonPropertyLocations.value = [];\n polygonHuntIds.value = [];\n resetInvestmentFilter();\n resetSpaceAvailabilityFilter();\n resetCompanyFilter();\n resetHuntFilter();\n resetSizeFilter();\n resetCalculationData();\n }\n function setSelectedGeography(filterType) {\n selectedGeography.value = _.find(filters.value.geography, {\n value: filterType,\n });\n }\n function resetInvestmentFilter() {\n const emptyInvestments = _.merge({}, dataEmptyState.investmentVolume);\n calculationData.value.investmentVolume = emptyInvestments;\n // mainTimelineCustomForwardDate.value = null;\n // mainTimelineCustomLookbackDate.value = null;\n surveyInvestmentCountProxy.value = 0;\n clearInvestmentStates();\n clearInvestmentAssetTypeFilters();\n clearInvestmentTypeFilters();\n clearValuationFilters();\n }\n\n function setSpaceUsageExpirationDate(date) {\n _.find(filters.value.spaceUsageExpirationDate, {\n value: \"expired_date\",\n }).date = date;\n }\n function clearSpaceUsageExpirationDate() {\n setSpaceUsageExpirationDateEditing(false);\n setSpaceUsageExpirationDate(null);\n fetchingSpaceUsageExpirationDateFilterData.value = false;\n filteredSpaceUsageExpirationDateFields.value = [];\n\n setTimeout(() => {\n setSpaceUsageExpirationDateEditing(true);\n }, 100);\n }\n function setSpaceUsageExpirationDateEditing(bool) {\n _.find(filters.value.spaceUsageExpirationDate, {\n value: \"expired_date\",\n }).editing = bool;\n }\n function resetSpaceUsageFilter() {\n clearSpaceUsageExpirationDate();\n clearSpaceUsageStates();\n if (!spaceAvailabilitiesChecked.value) {\n clearSpaceAvailabilitySpaceTypeFilters();\n }\n if (!investmentsChecked.value) {\n clearInvestmentAssetTypeFilters();\n }\n surveySpaceUsageCountProxy.value = 0;\n }\n\n function resetSpaceAvailabilityFilter() {\n const emptyAvailabilities = _.merge(\n {},\n dataEmptyState.spaceAvailabilityVolume,\n );\n calculationData.value.spaceAvailabilityVolume = emptyAvailabilities;\n surveySpaceAvailabilityCountProxy.value = 0;\n clearSpaceAvailabilityStates();\n clearSpaceAvailabilitySizeFilters();\n clearSpaceAvailabilitySpaceTypeFilters();\n }\n\n function setLoanMaturityDate(date) {\n _.find(filters.value.loanMaturityDate, {\n value: \"maturity_date\",\n }).date = date;\n }\n function clearLoanMaturityDate() {\n setLoanMaturityDateEditing(false);\n setLoanMaturityDate(null);\n fetchingLoanMaturityDateFilterData.value = false;\n filteredLoanMaturityDateFields.value = [];\n\n setTimeout(() => {\n setLoanMaturityDateEditing(true);\n }, 100);\n }\n function setLoanMaturityDateEditing(bool) {\n _.find(filters.value.loanMaturityDate, {\n value: \"maturity_date\",\n }).editing = bool;\n }\n function resetLoanFilter() {\n clearLoanMaturityDate();\n clearLoanStates();\n if (!investmentsChecked.value) {\n clearInvestmentAssetTypeFilters();\n }\n surveyLoanCountProxy.value = 0;\n }\n function resetCompanyFilter() {\n filters.value.companyRole.forEach((role) => (role.checked = true));\n filters.value.companyEventType.forEach(\n (eventType) => (eventType.checked = true),\n );\n filters.value.spaceAvailabilityState = emptySpaceAvailabilityStates();\n surveyCompanyCountProxy.value = 0;\n valueFilteredHuntIds.value = [];\n }\n function resetHuntFilter() {\n filters.value.companyRole.forEach((role) => (role.checked = true));\n filters.value.companyEventType.forEach(\n (eventType) => (eventType.checked = true),\n );\n filters.value.spaceAvailabilityState = emptySpaceAvailabilityStates();\n surveyCompanyCountProxy.value = 0;\n valueFilteredHuntIds.value = [];\n }\n function resetSizeFilter() {\n const emptyBuildings = _.merge({}, dataEmptyState.buildingCount);\n const emptySizes = _.merge({}, dataEmptyState.sizesUses);\n calculationData.value.sizesUses = emptySizes;\n calculationData.value.buildingCount = emptyBuildings;\n analyzePropertyFields.value = {};\n surveySizeCountProxy.value = 0;\n occupierSizeFilteredHuntIds.value = [];\n }\n function resetPolygonFilter() {\n clearPolygon();\n setPolygonEditing(false);\n }\n function setPolygon(layer) {\n _.find(filters.value.geography, {\n value: \"polygon\",\n }).polygon = layer;\n }\n function clearPolygon() {\n _.find(filters.value.geography, {\n value: \"polygon\",\n }).polygon = null;\n lastCheckedPolygonArea.value = null;\n polygonPropertyLocations.value = [];\n polygonHuntIds.value = [];\n polygonInvestmentIds.value = [];\n polygonAvailabilityIds.value = [];\n }\n function setPolygonEditing(bool) {\n _.find(filters.value.geography, {\n value: \"polygon\",\n }).editing = bool;\n }\n function resetCalculationData() {\n calculationData.value = _.merge({}, dataEmptyState);\n lastCheckedTime.value = null;\n lastCheckedPolygonArea.value = null;\n lastCheckedMapMeta.value = {\n lat: null,\n lng: null,\n zoom: null,\n };\n }\n function resetUnlockableSurveyIds() {\n surveyUnlockableBundleFields.value = {\n standaloneFields: [],\n };\n }\n\n function unlockableFieldsFor(rawFields) {\n return rawFields.filter(\n (df) => df.meteringStatus === \"prompt_to_subscribe\",\n );\n }\n\n function unlicensedFieldsFor(rawFields) {\n return rawFields.filter((df) => !!df.price);\n }\n\n function setCalculationDataByName(calculationName, rawFields, requestKey) {\n const interceptableFields = unlockableFieldsFor(rawFields);\n const unlicensedFields = unlicensedFieldsFor(rawFields);\n\n switch (calculationName) {\n case \"sizes_uses\": {\n const floorAreaDataFields = rawFields.filter(\n (df) => df.fieldContentType === \"FloorArea\",\n );\n const propertyUseDataFields = rawFields.filter(\n (df) => df.fieldContentType === \"ContentPropertyUse\",\n );\n const standardizedAreaDataFields = rawFields.filter((df) =>\n _.includes(\n [\"standardized_area\", \"minimum_subdivision_standardized_area\"],\n df.fieldName,\n ),\n );\n const useBasedAreaDataFields = rawFields.filter(\n (df) => df.fieldName === \"use_based_area\",\n );\n\n if (requestKey)\n registerFetchRequest(\"sizesUses\", requestKey, rawFields);\n\n if (requestKey === \"survey\") {\n calculationData.value.sizesUses.interceptableFields =\n interceptableFields;\n calculationData.value.sizesUses.unlicensedFields = unlicensedFields;\n calculationData.value.sizesUses.floorAreaDataFields =\n floorAreaDataFields;\n calculationData.value.sizesUses.propertyUseDataFields =\n propertyUseDataFields;\n calculationData.value.sizesUses.standardizedAreaDataFields =\n standardizedAreaDataFields;\n calculationData.value.sizesUses.useBasedAreaDataFields =\n useBasedAreaDataFields;\n } else {\n const staleFieldIds = alreadyFetchedFieldIdsFor(\n \"sizesUses\",\n requestKey,\n );\n\n const remainingInterceptable = _.differenceBy(\n calculationData.value.sizesUses.interceptableFields,\n staleFieldIds,\n \"localId\",\n );\n calculationData.value.sizesUses.interceptableFields = _.unionBy(\n interceptableFields,\n remainingInterceptable,\n \"localId\",\n );\n\n const remainingUnlicensed = _.differenceBy(\n calculationData.value.sizesUses.unlicensedFields,\n staleFieldIds,\n \"localId\",\n );\n calculationData.value.sizesUses.unlicensedFields = _.unionBy(\n unlicensedFields,\n remainingUnlicensed,\n \"localId\",\n );\n\n const remainingFloorArea = _.differenceBy(\n calculationData.value.sizesUses.floorAreaDataFields,\n staleFieldIds,\n \"localId\",\n );\n calculationData.value.sizesUses.floorAreaDataFields = _.unionBy(\n floorAreaDataFields,\n remainingFloorArea,\n \"localId\",\n );\n\n const remainingPropertyUse = _.differenceBy(\n calculationData.value.sizesUses.propertyUseDataFields,\n staleFieldIds,\n \"localId\",\n );\n calculationData.value.sizesUses.propertyUseDataFields = _.unionBy(\n propertyUseDataFields,\n remainingPropertyUse,\n \"localId\",\n );\n\n const remainingStandardized = _.differenceBy(\n calculationData.value.sizesUses.standardizedAreaDataFields,\n staleFieldIds,\n \"localId\",\n );\n calculationData.value.sizesUses.standardizedAreaDataFields =\n _.unionBy(\n standardizedAreaDataFields,\n remainingStandardized,\n \"localId\",\n );\n\n const remainingUseBased = _.differenceBy(\n calculationData.value.sizesUses.useBasedAreaDataFields,\n staleFieldIds,\n \"localId\",\n );\n calculationData.value.sizesUses.useBasedAreaDataFields = _.unionBy(\n useBasedAreaDataFields,\n remainingUseBased,\n \"localId\",\n );\n }\n\n break;\n }\n case \"building_count\": {\n const landCoveringDataFields = rawFields.filter(\n (df) => df.fieldContentType === \"LandCovering\",\n );\n\n calculationData.value.buildingCount.interceptableFields =\n interceptableFields;\n calculationData.value.buildingCount.unlicensedFields = unlicensedFields;\n calculationData.value.buildingCount.propertyRightLandCoveringDataFields =\n landCoveringDataFields;\n\n break;\n }\n case \"investment_volume\": {\n const investmentDataFields = rawFields.filter(\n (df) => df.fieldContentType === \"Investment\",\n );\n const investmentGroupDataFields = rawFields.filter(\n (df) => df.fieldContentType === \"InvestmentGroup\",\n );\n const investmentGroupValuationDataFields = rawFields.filter(\n (df) =>\n df.decoratingContentType === \"InvestmentGroup\" &&\n df.fieldContentType === \"Valuation\",\n );\n const investmentValuationDataFields = rawFields.filter(\n (df) =>\n df.decoratingContentType === \"Investment\" &&\n df.fieldContentType === \"Valuation\",\n );\n const valueDataFields = rawFields.filter(\n (df) => df.fieldName === \"value\",\n );\n const loanAmountDataFields = rawFields.filter(\n (df) => df.fieldName === \"fully_funded_loan_amount\",\n );\n\n if (requestKey)\n registerFetchRequest(\"investmentVolume\", requestKey, rawFields);\n\n calculationData.value.investmentVolume.interceptableFields =\n interceptableFields;\n calculationData.value.investmentVolume.unlicensedFields =\n unlicensedFields;\n calculationData.value.investmentVolume.investmentDataFields =\n investmentDataFields;\n calculationData.value.investmentVolume.investmentGroupDataFields =\n investmentGroupDataFields;\n calculationData.value.investmentVolume.investmentGroupValuationDataFields =\n investmentGroupValuationDataFields;\n calculationData.value.investmentVolume.investmentValuationDataFields =\n investmentValuationDataFields;\n calculationData.value.investmentVolume.valueDataFields =\n valueDataFields;\n calculationData.value.investmentVolume.loanAmountDataFields =\n loanAmountDataFields;\n break;\n }\n }\n }\n\n async function updateLastChecked() {\n if (timeMismatch.value || latLngMismatch.value || zoomMismatch.value) {\n if (centerLatLng.value) {\n lastCheckedMapMeta.value = {\n lat: centerLatLng.value[0],\n lng: centerLatLng.value[1],\n zoom: zoom.value,\n };\n }\n if (asOfMilliseconds.value) {\n lastCheckedTime.value = asOfMilliseconds.value;\n }\n }\n }\n\n // ANALYZE HUNT DATA FETCHING\n\n async function fetchHuntDataField(huntId) {\n const outerJson = await api.get(\n `hunts/${huntId}?field_output_format=outer_field`,\n );\n\n if (outerJson?.data) {\n analyzeHuntFields.value[`Hunt${huntId}`] = outerJson.data;\n }\n\n const companyJson = await api.get(\n `hunts/${huntId}?field_output_format=company_field`,\n );\n\n if (companyJson?.data) {\n analyzeHuntFields.value[\n `Hunt${huntId}SourceCompanyInvolvement${companyJson.data.decoratingContentId}`\n ] = companyJson.data;\n }\n }\n\n async function fetchHuntGeographyIntents(huntId) {\n const json = await api.get(\n `crowdsourced_data_fields/Hunt/${huntId}?field_name=HuntGeographyIntent`,\n );\n\n if (json?.data) {\n _.forEach(json.data, function (dataField) {\n const fieldKey = `Hunt${huntId}HuntGeographyIntent${dataField.fieldContentId}`;\n analyzeHuntFields.value[fieldKey] = dataField;\n\n analyzeHuntFields.value[fieldKey] = dataField;\n });\n }\n }\n\n // ANALYZE LOAN DATA FETCHING\n\n async function fetchLoanDataField(loanId) {\n const json = await api.get(\n `loans/${loanId}?field_output_format=outer_field`,\n );\n\n if (json?.data) {\n const loanFetchKey = `Loan${loanId}`;\n analyzeLoanFields.value[loanFetchKey] = json.data;\n }\n }\n\n // ANALYZE SPACEUSAGE DATA FETCHING\n\n async function fetchSpaceUsageDataField(spaceUsageId) {\n const json = await api.get(\n `space_usages/${spaceUsageId}?field_output_format=outer_field&json_template=details_page`,\n );\n\n if (json?.data) {\n const spaceUsageFetchKey = `SpaceUsage${spaceUsageId}`;\n analyzeSpaceUsageFields.value[spaceUsageFetchKey] = json.data;\n }\n }\n\n async function fetchSpaceUsageUserDataFields(spaceUsageId) {\n const json = await api.get(`space_usage_timeless_users/${spaceUsageId}`);\n\n if (json?.data) {\n _.forEach(json.data, function (dataField) {\n const fieldKey = `SpaceUsage${spaceUsageId}User${dataField.fieldContentId}`;\n analyzeSpaceUsageFields.value[fieldKey] = dataField;\n });\n }\n }\n\n async function fetchFloorAreaLayouts({\n floorAreaId = null,\n layoutPartitionId = null,\n collection = \"spaceAvailabilityFields\",\n }) {\n let idParam = null;\n\n if (floorAreaId) {\n idParam = `floor_area_id=${floorAreaId}`;\n } else if (layoutPartitionId) {\n idParam = `layout_partition_id=${layoutPartitionId}`;\n }\n\n if (idParam) {\n const json = await api.get(\n `floor_area_layouts/?${idParam}&as_of=${asOfMilliseconds.value}`,\n );\n\n if (json?.data) {\n _.forEach(json.data, function (dataField) {\n let fieldKey = null;\n\n if (floorAreaId) {\n fieldKey = `FloorArea${floorAreaId}Layout${dataField.fieldContentId}`;\n } else if (layoutPartitionId) {\n fieldKey = `LayoutPartition${layoutPartitionId}Layout${dataField.fieldContentId}`;\n }\n\n analyzeSpaceUsageFields.value[fieldKey] = dataField;\n\n switch (collection) {\n case \"spaceAvailabilityFields\":\n analyzeSpaceAvailabilityFields.value[fieldKey] = dataField;\n break;\n case \"spaceUsageFields\":\n analyzeSpaceUsageFields.value[fieldKey] = dataField;\n break;\n }\n });\n }\n }\n }\n\n // ANALYZE SPACEAVAILABILITY DATA FETCHING\n\n async function fetchSpaceAvailabilityDataField(\n availabilityId,\n availabilityFetchKey,\n ) {\n const json = await api.get(\n `space_availabilities/${availabilityId}?json_template=table_row`,\n );\n\n if (json?.data) {\n analyzeSpaceAvailabilityFields.value[availabilityFetchKey] = json.data;\n }\n }\n\n async function fetchSpaceAvailabilityGroupDataField(\n availabilityGroupId,\n availabilityGroupFetchKey,\n collection = \"spaceAvailabilityFields\",\n ) {\n const json = await api.get(\n `space_availability_groups/${availabilityGroupId}?field_output_format=outer_field`,\n );\n\n if (json?.data) {\n switch (collection) {\n case \"spaceAvailabilityFields\":\n analyzeSpaceAvailabilityFields.value[availabilityGroupFetchKey] =\n json.data;\n break;\n case \"spaceUsageFields\":\n analyzeSpaceUsageFields.value[availabilityGroupFetchKey] = json.data;\n break;\n }\n }\n }\n\n async function fetchSpaceAvailabilityGroupTimingDataFields(\n availabilityGroupId,\n collection = \"spaceAvailabilityFields\",\n ) {\n const json = await api.get(\n `availability_group_timing_fields/${availabilityGroupId}`,\n );\n\n if (json?.data) {\n _.forEach(json.data, function (dataField, i) {\n const availabilityGroupFetchKey = `SpaceAvailabilityGroup${availabilityGroupId}Timing${\n i + 1\n }`;\n switch (collection) {\n case \"spaceAvailabilityFields\":\n analyzeSpaceAvailabilityFields.value[availabilityGroupFetchKey] =\n dataField;\n break;\n case \"spaceUsageFields\":\n analyzeLoanFields.value[availabilityGroupFetchKey] = dataField;\n break;\n }\n });\n }\n }\n\n // ANALYZE INVESTMENT DATA FETCHING\n\n async function fetchInvestmentDataField(investmentId, investmentFetchKey) {\n const json = await api.get(`investments/${investmentId}`);\n\n if (json?.data) {\n analyzeInvestmentFields.value[investmentFetchKey] = json.data;\n }\n }\n\n async function fetchInvestmentGroupDataField(\n investmentGroupId,\n investmentGroupFetchKey,\n collection = \"investmentFields\",\n ) {\n const json = await api.get(\n `investment_groups/${investmentGroupId}?field_output_format=outer_field`,\n );\n\n if (json?.data) {\n switch (collection) {\n case \"investmentFields\":\n analyzeInvestmentFields.value[investmentGroupFetchKey] = json.data;\n break;\n case \"loanFields\":\n analyzeLoanFields.value[investmentGroupFetchKey] = json.data;\n break;\n }\n }\n }\n\n async function fetchInvestmentGroupTimingDataFields(\n investmentGroupId,\n collection = \"investmentFields\",\n ) {\n const json = await api.get(\n `investment_group_timing_fields/${investmentGroupId}`,\n );\n\n if (json?.data) {\n _.forEach(json.data, function (dataField, i) {\n const investmentGroupFetchKey = `InvestmentGroup${investmentGroupId}Timing${\n i + 1\n }`;\n switch (collection) {\n case \"investmentFields\":\n analyzeInvestmentFields.value[investmentGroupFetchKey] = dataField;\n break;\n case \"loanFields\":\n analyzeLoanFields.value[investmentGroupFetchKey] = dataField;\n break;\n }\n });\n }\n }\n\n async function fetchValuations(contentType, contentId, valuationFetchKey) {\n const json = await api.get(\n `content_valuations/${contentType}/${contentId}`,\n );\n\n if (json?.data) {\n _.forEach(json.data, function (dataField) {\n const fieldKey = `${valuationFetchKey}${dataField.fieldContentId}`;\n analyzeInvestmentFields.value[fieldKey] = dataField;\n });\n }\n }\n\n async function fetchValueFor(contentType, contentId, valuationId) {\n const fetchKey = `Valuation${valuationId}value`;\n if (!analyzeInvestmentFields.value[fetchKey]) {\n const json = await api.get(\n `crowdsourced_data_fields/Valuation/${valuationId}?field_name=value`,\n );\n if (json?.data) {\n analyzeInvestmentFields.value[fetchKey] = json.data;\n fetchContentCalculationData({\n contentType: contentType,\n contentId: contentId,\n override: false,\n });\n }\n }\n }\n\n async function fetchLoanAmountFor(\n contentType,\n contentId,\n loanId,\n collection = \"investmentFields\",\n ) {\n const fetchKey = `Loan${loanId}fully_funded_loan_amount`;\n switch (collection) {\n case \"investmentFields\": {\n if (!analyzeInvestmentFields.value[fetchKey]) {\n const json = await api.get(\n `crowdsourced_data_fields/Loan/${loanId}?field_name=fully_funded_loan_amount`,\n );\n\n if (json?.data) {\n analyzeInvestmentFields.value[fetchKey] = json.data;\n if (contentType && contentId) {\n fetchContentCalculationData({\n contentType: contentType,\n contentId: contentId,\n override: false,\n });\n }\n }\n }\n break;\n }\n case \"loanFields\": {\n if (!analyzeLoanFields.value[fetchKey]) {\n const json = await api.get(\n `crowdsourced_data_fields/Loan/${loanId}?field_name=fully_funded_loan_amount`,\n );\n\n if (json?.data) {\n analyzeLoanFields.value[fetchKey] = json.data;\n }\n }\n break;\n }\n }\n }\n\n async function fetchSpaceUsageCommencedDateFor(\n contentType,\n contentId,\n spaceUsageId,\n collection = \"spaceUsageFields\",\n ) {\n const fetchKey = `SpaceUsage${spaceUsageId}commenced_date`;\n switch (collection) {\n case \"spaceUsageFields\": {\n if (!analyzeSpaceUsageFields.value[fetchKey]) {\n const json = await api.get(\n `crowdsourced_data_fields/SpaceUsage/${spaceUsageId}?field_name=commenced_date`,\n );\n\n if (json?.data) {\n analyzeSpaceUsageFields.value[fetchKey] = json.data;\n if (contentType && contentId) {\n fetchContentCalculationData({\n contentType: contentType,\n contentId: contentId,\n override: false,\n });\n }\n }\n }\n break;\n }\n }\n }\n\n async function fetchPropertyDataField(\n propertyId,\n collection = \"investmentFields\",\n ) {\n if (propertyId) {\n const fetchKey = `Property${propertyId}`;\n const json = await api.get(`properties/${propertyId}`);\n if (json?.data) {\n switch (collection) {\n case \"spaceUsageFields\":\n analyzeSpaceUsageFields.value[fetchKey] = json.data;\n break;\n case \"spaceAvailabilityFields\":\n analyzeSpaceAvailabilityFields.value[fetchKey] = json.data;\n break;\n case \"investmentFields\":\n analyzeInvestmentFields.value[fetchKey] = json.data;\n break;\n case \"loanFields\":\n analyzeLoanFields.value[fetchKey] = json.data;\n break;\n }\n }\n }\n }\n\n // ANALYZE INVESTMENT DATA FETCHING END\n\n async function fetchPolygonSpaceAvailabilities() {\n if (polygonPropertyIds.value.length > 0) {\n const payload = { propertyIds: polygonPropertyIds.value };\n const response = await api.post(`space_availability_properties`, payload);\n\n if (response?.data) {\n polygonAvailabilityIds.value = response.data;\n lastCheckedPolygonArea.value = polygonArea.value;\n }\n }\n }\n\n async function fetchPolygonInvestments() {\n if (polygonPropertyIds.value.length > 0) {\n const payload = { propertyIds: polygonPropertyIds.value };\n const response = await api.post(`investment_properties`, payload);\n\n if (response?.data) {\n polygonInvestmentIds.value = response.data;\n lastCheckedPolygonArea.value = polygonArea.value;\n }\n }\n }\n\n async function fetchPolygonPropertyLocations() {\n if (geographyFilterPolygon.value) {\n const payload = {\n coordinates: getPolygonCoordinates(),\n zoom: map.value.getZoom(),\n };\n\n const response = await api.post(\n `polygon_filtered_property_locations`,\n payload,\n );\n\n if (response?.data) {\n polygonPropertyLocations.value = response.data;\n\n await fetchPolygonInvestments();\n await fetchPolygonSpaceAvailabilities();\n await fetchPolygonHunts();\n }\n }\n }\n\n const polygonHuntIds = ref([]);\n\n async function fetchPolygonHunts() {\n if (geographyFilterPolygon.value) {\n const payload = {\n coordinates: getPolygonCoordinates(),\n zoom: map.value.getZoom(),\n };\n\n const response = await api.post(`polygon_filtered_hunts`, payload);\n\n if (response?.data) {\n polygonHuntIds.value = response.data;\n\n await fetchPolygonInvestments();\n await fetchPolygonSpaceAvailabilities();\n }\n }\n }\n\n const propertySources = computed(() => {\n const rawSources = contextedPropertiesArray.value.map((df) => {\n const contentId =\n df.decoratingContentType === \"Property\"\n ? df.decoratingContentId\n : df.fieldContentId;\n if (df.fieldContent.airLayerPropertyId) {\n return [\n {\n contentId,\n },\n {\n contentId: df.fieldContent.airLayerPropertyId,\n },\n ];\n } else {\n return {\n contentId,\n };\n }\n });\n\n return _.flatten(rawSources);\n });\n\n const debouncedSpaceUsagesAvailabilitiesFetch = _.debounce(function () {\n fetchSpaceUsageAvailabilities();\n }, 2000);\n\n async function fetchSpaceUsageAvailabilities() {\n if (spaceUsagesChecked.value) {\n spaceUsageAvailabilityFields.value = [];\n fetchingSpaceUsageAvailabilityFields.value = true;\n\n try {\n const payload = {\n enhancementIds: _.includes(\n selectedSpaceTypes.value,\n \"PropertyEnhancement\",\n )\n ? stateFilteredEnhancementIds.value\n : [],\n partitionIds: _.includes(selectedSpaceTypes.value, \"LayoutPartition\")\n ? stateFilteredPartitionIds.value\n : [],\n floorAreaIds: _.includes(selectedSpaceTypes.value, \"FloorArea\")\n ? _.intersection(\n stateFilteredFloorAreaIds.value,\n useTypeFilteredFloorAreaIds.value,\n )\n : [],\n propertySources: propertySources.value,\n };\n const response = await api.post(\n `filtered_space_usage_availabilities`,\n payload,\n );\n\n if (response?.data) {\n spaceUsageAvailabilityFields.value = response.data;\n }\n } catch (error) {\n console.error(error);\n notificationsStore.addNotification(\"anErrorOccurred\");\n } finally {\n fetchingSpaceUsageAvailabilityFields.value = false;\n }\n }\n }\n\n const debouncedLandCoveringSpaceAvailabilitiesFetch = _.debounce(function () {\n fetchLandCoveringSpaceAvailabilities();\n }, 2000);\n\n async function fetchLandCoveringSpaceAvailabilities() {\n if (emptyCategoriesFetchable.value) {\n landCoveringSpaceAvailabilityIds.value = [];\n const payload = {\n enhancementIds: _.includes(\n selectedSpaceTypes.value,\n \"PropertyEnhancement\",\n )\n ? stateFilteredEnhancementIds.value\n : [],\n partitionIds: _.includes(selectedSpaceTypes.value, \"LayoutPartition\")\n ? stateFilteredPartitionIds.value\n : [],\n floorAreaIds: _.includes(selectedSpaceTypes.value, \"FloorArea\")\n ? _.intersection(\n stateFilteredFloorAreaIds.value,\n useTypeFilteredFloorAreaIds.value,\n )\n : [],\n propertySources: propertySources.value,\n };\n const response = await api.post(\n `land_covering_space_availabilities`,\n payload,\n );\n\n if (response?.data) {\n landCoveringSpaceAvailabilityIds.value = response.data;\n }\n }\n }\n\n const debouncedLoansInvestmentsFetch = _.debounce(function () {\n fetchLoanInvestments();\n }, 2000);\n\n async function fetchLoanInvestments() {\n if (emptyCategoriesFetchable.value) {\n loanInvestmentFields.value = [];\n fetchingLoanInvestmentFields.value = true;\n\n try {\n const payload = {\n floorAreaIds: _.intersection(\n stateFilteredFloorAreaIds.value,\n useTypeFilteredFloorAreaIds.value,\n ),\n propertySources: propertySources.value,\n };\n const response = await api.post(`loan_investments`, payload);\n\n if (response?.data) {\n loanInvestmentFields.value = response.data;\n }\n } catch (error) {\n console.error(error);\n notificationsStore.addNotification(\"anErrorOccurred\");\n } finally {\n fetchingLoanInvestmentFields.value = false;\n }\n }\n }\n const debouncedLandCoveringInvestmentsFetch = _.debounce(function () {\n fetchLandCoveringInvestments();\n }, 2000);\n\n async function fetchLandCoveringInvestments() {\n if (emptyCategoriesFetchable.value) {\n landCoveringInvestmentIds.value = [];\n const payload = {\n floorAreaIds: _.intersection(\n stateFilteredFloorAreaIds.value,\n useTypeFilteredFloorAreaIds.value,\n ),\n propertySources: propertySources.value,\n };\n const response = await api.post(`land_covering_investments`, payload);\n\n if (response?.data) {\n landCoveringInvestmentIds.value = response.data;\n }\n }\n }\n\n async function fetchValuationFilteredInvestments() {\n if (validValuationFilters.value && !valueFilterApplied.value) {\n filteredStandaloneValueFields.value = [];\n fetchingValuationFilterData.value = true;\n const payload = {\n minValue: minValue.value,\n maxValue: maxValue.value,\n propertySources: propertySources.value,\n };\n fetchValuationFilteredHunts();\n const response = await api.post(\n `valuation_filtered_investments`,\n payload,\n );\n\n if (response?.data) {\n filteredStandaloneValueFields.value = response.data;\n valueFilterApplied.value = true;\n fetchingValuationFilterData.value = false;\n }\n }\n }\n\n async function fetchSizeFilteredSpaceAvailabilities() {\n if (\n validSpaceAvailabilitySizeFilters.value &&\n !spaceAvailabilitySizeFilterApplied.value\n ) {\n fetchingSpaceAvailabilitySizeFilterData.value = true;\n\n if (spaceAvailabilitiesChecked.value) {\n filteredStandaloneSpaceAvailabilitySizeFields.value = [];\n\n const payload = {\n minSpaceAvailabilitySize: minSpaceAvailabilitySize.value,\n maxSpaceAvailabilitySize: maxSpaceAvailabilitySize.value,\n propertySources: propertySources.value,\n calculationType: \"minimum\",\n };\n const response = await api.post(\n `size_filtered_space_availabilities`,\n payload,\n );\n\n if (response?.data) {\n // [{ availabilityId: X }, { availabilityGroupId: Y }]\n filteredStandaloneSpaceAvailabilitySizeFields.value = response.data;\n }\n }\n\n if (\n spaceUsagesChecked.value ||\n companiesChecked.value ||\n huntsChecked.value ||\n _.includes([\"CompanyShell\", \"ContactShell\"], routeName.value)\n ) {\n filteredStandaloneSpaceUsageAvailabilitySizeFields.value = [];\n\n const payload = {\n minSpaceAvailabilitySize: minSpaceAvailabilitySize.value,\n maxSpaceAvailabilitySize: maxSpaceAvailabilitySize.value,\n propertySources: propertySources.value,\n calculationType: \"actual\",\n };\n fetchOccupierSizeFilteredHunts();\n const response = await api.post(\n `size_filtered_space_availabilities`,\n payload,\n );\n\n if (response?.data) {\n // [{ availabilityId: X }, { availabilityGroupId: Y }]\n filteredStandaloneSpaceUsageAvailabilitySizeFields.value =\n response.data;\n }\n }\n\n spaceAvailabilitySizeFilterApplied.value = true;\n fetchingSpaceAvailabilitySizeFilterData.value = false;\n }\n }\n\n const debouncedLoanMaturityDateFilter = _.debounce(function () {\n if (horizontalIsAnalyze.value) fetchMaturityDateFilteredLoans();\n }, 1000);\n\n async function fetchMaturityDateFilteredLoans() {\n if (filterLoanMaturityDate.value && loanMaturityDateFilterInput.value) {\n fetchingLoanMaturityDateFilterData.value = true;\n const payload = {\n maturityDate: loanMaturityDateFilterInput.value.clone().toDate(),\n propertySources: propertySources.value,\n };\n const response = await api.post(`maturity_date_filtered_loans`, payload);\n\n if (response?.data) {\n filteredLoanMaturityDateFields.value = response.data;\n fetchingLoanMaturityDateFilterData.value = false;\n }\n }\n }\n\n const debouncedLoanStateFilter = _.debounce(function () {\n fetchStateFilteredLoans();\n }, 1000);\n\n async function fetchStateFilteredLoans() {\n if (filterLoanStates.value && selectedLoanStates.value.length > 0) {\n fetchingLoanStateFilterData.value = true;\n const payload = {\n states: selectedLoanStates.value,\n filteringMetadata: selectedLoanStateFilteringMetadata.value,\n propertySources: propertySources.value,\n asOf: asOfMilliseconds.value,\n };\n const response = await api.post(`state_filtered_loans`, payload);\n\n if (response?.data) {\n filteredLoanStateFields.value = response.data;\n fetchingLoanStateFilterData.value = false;\n }\n }\n }\n\n const debouncedSpaceUsageExpirationDateFilter = _.debounce(function () {\n if (horizontalIsAnalyze.value) fetchExpirationDateFilteredLoans();\n }, 1000);\n\n async function fetchExpirationDateFilteredLoans() {\n if (\n filterSpaceUsageExpirationDate.value &&\n spaceUsageExpirationDateFilterInput.value\n ) {\n fetchingSpaceUsageExpirationDateFilterData.value = true;\n const payload = {\n expiredDate: spaceUsageExpirationDateFilterInput.value.clone().toDate(),\n propertySources: propertySources.value,\n };\n const response = await api.post(\n `expiration_date_filtered_space_usages`,\n payload,\n );\n\n if (response?.data) {\n filteredSpaceUsageExpirationDateFields.value = response.data;\n fetchingSpaceUsageExpirationDateFilterData.value = false;\n }\n }\n }\n\n const debouncedSpaceUsageStateFilter = _.debounce(function () {\n fetchStateFilteredSpaceUsages();\n }, 1000);\n\n async function fetchStateFilteredSpaceUsages() {\n if (\n filterSpaceUsageStates.value &&\n selectedSpaceUsageStates.value.length > 0\n ) {\n fetchingSpaceUsageStateFilterData.value = true;\n const payload = {\n states: selectedSpaceUsageStates.value,\n filteringMetadata: selectedSpaceUsageStateFilteringMetadata.value,\n propertySources: propertySources.value,\n asOf: asOfMilliseconds.value,\n };\n const response = await api.post(`state_filtered_space_usages`, payload);\n\n if (response?.data) {\n filteredSpaceUsageStateFields.value = response.data;\n fetchingSpaceUsageStateFilterData.value = false;\n }\n }\n }\n\n const debouncedSpaceAvailabilityStateFilter = _.debounce(function () {\n fetchStateFilteredSpaceAvailabilities();\n }, 1000);\n\n async function fetchStateFilteredSpaceAvailabilities() {\n if (\n filterSpaceAvailabilityStates.value &&\n selectedSpaceAvailabilityStates.value.length > 0\n ) {\n fetchingSpaceAvailabilityStateFilterData.value = true;\n const payload = {\n states: selectedSpaceAvailabilityStates.value,\n filteringMetadata:\n selectedSpaceAvailabilityStateFilteringMetadata.value,\n propertySources: propertySources.value,\n asOf: asOfMilliseconds.value,\n };\n const response = await api.post(\n `state_filtered_space_availabilities`,\n payload,\n );\n\n if (response?.data) {\n filteredSpaceAvailabilityStateFields.value = response.data;\n fetchingSpaceAvailabilityStateFilterData.value = false;\n }\n }\n }\n\n const debouncedSpaceAvailabilitySpaceTypeFilter = _.debounce(function () {\n fetchSpaceTypeFilteredSpaceAvailabilities();\n }, 1000);\n\n async function fetchSpaceTypeFilteredSpaceAvailabilities() {\n if (\n filterSpaceAvailabilitySpaceTypes.value &&\n selectedSpaceTypes.value.length > 0\n ) {\n fetchingSpaceAvailabilitySpaceTypeFilterData.value = true;\n const payload = {\n spaceTypes: selectedSpaceTypes.value,\n propertySources: propertySources.value,\n };\n const response = await api.post(\n `space_type_filtered_space_availabilities`,\n payload,\n );\n\n if (response?.data) {\n filteredSpaceAvailabilitySpaceTypeFields.value = response.data;\n fetchingSpaceAvailabilitySpaceTypeFilterData.value = false;\n }\n }\n }\n\n const debouncedInvestmentStateFilter = _.debounce(function () {\n fetchStateFilteredInvestments();\n }, 1000);\n\n async function fetchStateFilteredInvestments() {\n if (\n filterInvestmentStates.value &&\n selectedInvestmentStates.value.length > 0\n ) {\n fetchingInvestmentStateFilterData.value = true;\n const payload = {\n states: selectedInvestmentStates.value,\n filteringMetadata: selectedInvestmentStateFilteringMetadata.value,\n propertySources: propertySources.value,\n asOf: asOfMilliseconds.value,\n };\n const response = await api.post(`state_filtered_investments`, payload);\n\n if (response?.data) {\n filteredInvestmentStateFields.value = response.data;\n fetchingInvestmentStateFilterData.value = false;\n }\n }\n }\n\n const debouncedLandCoveringUseTypeFilter = _.debounce(function () {\n fetchUseTypeFilteredLandCoverings();\n }, 1000);\n\n async function fetchUseTypeFilteredLandCoverings() {\n if (filterLandCoveringUseTypes.value) {\n fetchingLandCoveringUseTypeFilterData.value = true;\n const payload = {\n useTypes: selectedLandCoveringUseTypes.value,\n propertySources: propertySources.value,\n asOf: asOfMilliseconds.value,\n };\n const response = await api.post(\n `use_type_filtered_land_coverings`,\n payload,\n );\n\n if (response?.data) {\n filteredLandCoveringUseTypeFields.value = response.data;\n fetchingLandCoveringUseTypeFilterData.value = false;\n debouncedLandCoveringInvestmentsFetch();\n debouncedLandCoveringSpaceAvailabilitiesFetch();\n debouncedSpaceUsagesAvailabilitiesFetch();\n debouncedLoansInvestmentsFetch();\n }\n }\n }\n\n const debouncedLandCoveringStateFilter = _.debounce(function () {\n fetchStateFilteredLandCoverings();\n }, 1000);\n\n async function fetchStateFilteredLandCoverings() {\n if (\n filterLandCoveringStates.value &&\n selectedLandCoveringStates.value.length > 0\n ) {\n fetchingLandCoveringStateFilterData.value = true;\n const payload = {\n states: selectedLandCoveringStates.value,\n filteringMetadata: selectedLandCoveringStateFilteringMetadata.value,\n propertySources: propertySources.value,\n asOf: asOfMilliseconds.value,\n };\n const response = await api.post(`state_filtered_land_coverings`, payload);\n\n if (response?.data) {\n filteredLandCoveringStateFields.value = response.data;\n fetchingLandCoveringStateFilterData.value = false;\n debouncedLandCoveringInvestmentsFetch();\n debouncedLandCoveringSpaceAvailabilitiesFetch();\n debouncedSpaceUsagesAvailabilitiesFetch();\n debouncedLoansInvestmentsFetch();\n }\n }\n }\n\n const debouncedInvestmentTypeFilter = _.debounce(function () {\n fetchTypeFilteredInvestments();\n }, 1000);\n\n async function fetchTypeFilteredInvestments() {\n if (\n filterInvestmentTypes.value &&\n selectedInvestmentTypes.value.length > 0\n ) {\n fetchingInvestmentTypeFilterData.value = true;\n const payload = {\n dealActions: selectedInvestmentTypes.value,\n propertySources: propertySources.value,\n };\n const response = await api.post(`type_filtered_investments`, payload);\n\n if (response?.data) {\n filteredInvestmentTypeFields.value = response.data;\n fetchingInvestmentTypeFilterData.value = false;\n }\n }\n }\n\n const debouncedInvestmentAssetTypeFilter = _.debounce(function () {\n fetchAssetTypeFilteredInvestments();\n }, 1000);\n\n async function fetchAssetTypeFilteredInvestments() {\n if (\n filterInvestmentAssetTypes.value &&\n selectedInvestmentAssetTypes.value.length > 0\n ) {\n fetchingInvestmentAssetTypeFilterData.value = true;\n const payload = {\n assetTypes: selectedInvestmentAssetTypes.value,\n propertySources: propertySources.value,\n };\n const response = await api.post(\n `asset_type_filtered_investments`,\n payload,\n );\n\n if (response?.data) {\n filteredInvestmentAssetTypeFields.value = response.data;\n fetchingInvestmentAssetTypeFilterData.value = false;\n }\n }\n }\n\n const valueFilteredHuntIds = ref([]);\n\n async function fetchValuationFilteredHunts() {\n if (validValuationFilters.value) {\n valueFilteredHuntIds.value = [];\n\n const bounds = map.value.getBounds();\n const southwest = bounds.getSouthWest();\n const northeast = bounds.getNorthEast();\n const northeastLatLng = [northeast.lat, northeast.lng];\n const southwestLatLng = [southwest.lat, southwest.lng];\n const payload = {\n minValue: minValue.value,\n maxValue: maxValue.value,\n };\n const response = await api.post(\n `valuation_filtered_hunts/${southwestLatLng}/${northeastLatLng}?zoom=${zoom.value}`,\n payload,\n );\n\n if (response?.data) {\n valueFilteredHuntIds.value = response.data;\n }\n }\n }\n\n const occupierSizeFilteredHuntIds = ref([]);\n\n async function fetchOccupierSizeFilteredHunts() {\n if (validSpaceAvailabilitySizeFilters.value) {\n occupierSizeFilteredHuntIds.value = [];\n\n const bounds = map.value.getBounds();\n const southwest = bounds.getSouthWest();\n const northeast = bounds.getNorthEast();\n const northeastLatLng = [northeast.lat, northeast.lng];\n const southwestLatLng = [southwest.lat, southwest.lng];\n const payload = {\n minValue: minSpaceAvailabilitySize.value,\n maxValue: maxSpaceAvailabilitySize.value,\n };\n const response = await api.post(\n `size_filtered_hunts/${southwestLatLng}/${northeastLatLng}?zoom=${zoom.value}`,\n payload,\n );\n\n if (response?.data) {\n occupierSizeFilteredHuntIds.value = response.data;\n }\n }\n }\n\n const useTypeFilteredHuntIds = ref([]);\n\n const debouncedHuntUseTypeFilter = _.debounce(function () {\n fetchUseTypeFilteredHunts();\n }, 1000);\n\n async function fetchUseTypeFilteredHunts() {\n if (filterLandCoveringUseTypes.value) {\n useTypeFilteredHuntIds.value = [];\n\n const bounds = map.value.getBounds();\n const southwest = bounds.getSouthWest();\n const northeast = bounds.getNorthEast();\n const northeastLatLng = [northeast.lat, northeast.lng];\n const southwestLatLng = [southwest.lat, southwest.lng];\n const payload = {\n useTypes: selectedLandCoveringUseTypes.value,\n };\n const response = await api.post(\n `use_type_filtered_hunts/${southwestLatLng}/${northeastLatLng}?zoom=${zoom.value}`,\n payload,\n );\n\n if (response?.data) {\n useTypeFilteredHuntIds.value = response.data;\n }\n }\n }\n\n const investmentTypeFilteredHuntIds = ref([]);\n\n const debouncedHuntInvestmentTypeFilter = _.debounce(function () {\n fetchInvestmentTypeFilteredHunts();\n }, 1000);\n\n async function fetchInvestmentTypeFilteredHunts() {\n if (filterInvestmentTypes.value) {\n investmentTypeFilteredHuntIds.value = [];\n\n const serverSideFormattedTypes = selectedInvestmentTypeLabels.value.map(\n (rawInvestmentType) => {\n switch (rawInvestmentType) {\n case \"Sale\":\n case \"Recap\":\n return \"hunts_equity\";\n case \"Financing\":\n return \"hunts_debt\";\n default:\n return null;\n }\n },\n );\n\n const bounds = map.value.getBounds();\n const southwest = bounds.getSouthWest();\n const northeast = bounds.getNorthEast();\n const northeastLatLng = [northeast.lat, northeast.lng];\n const southwestLatLng = [southwest.lat, southwest.lng];\n const payload = {\n investmentTypes: _.uniq(_.compact(serverSideFormattedTypes)),\n };\n const response = await api.post(\n `investment_type_filtered_hunts/${southwestLatLng}/${northeastLatLng}?zoom=${zoom.value}`,\n payload,\n );\n\n if (response?.data) {\n investmentTypeFilteredHuntIds.value = response.data;\n }\n }\n }\n\n return {\n calculationData,\n calculationOptions,\n timeMismatch,\n latLngMismatch,\n zoomMismatch,\n polygonMismatch,\n lastCheckedPolygonArea,\n unselectedPropertyDiagram,\n propertySelectedPropertyDiagram,\n contextedPropertiesArray,\n unselectedCompanyDetail,\n unselectedContactDetail,\n countable,\n sizeable,\n sizesSurveyFetched,\n investmentVolumeSurveyFetched,\n focalDataField,\n mapSearchShortcutAction,\n analyzeDisplayable,\n fetchingAnalyzePanelData,\n filters,\n filterCategories,\n filterDates,\n filterGeography,\n filterLandCoveringUseTypes,\n filterLandCoveringStates,\n filterValuations,\n filterCompanyEventTypes,\n filterCompanyRoles,\n filterLoanStates,\n filterSpaceUsageStates,\n filterSpaceAvailabilityStates,\n filterSpaceAvailabilitySpaceTypes,\n filterSpaceAvailabilitySizes,\n filterInvestmentStates,\n filterInvestmentTypes,\n filterInvestmentAssetTypes,\n investmentsChecked,\n loansChecked,\n sizesChecked,\n spaceUsagesChecked,\n spaceAvailabilitiesChecked,\n companiesChecked,\n huntsChecked,\n checkedCategories,\n minValue,\n maxValue,\n valueFilteredHuntIds,\n occupierSizeFilteredHuntIds,\n useTypeFilteredHuntIds,\n investmentTypeFilteredHuntIds,\n validValueRange,\n valueFilterApplied,\n minSpaceAvailabilitySize,\n maxSpaceAvailabilitySize,\n validMinSpaceAvailabilitySize,\n validMaxSpaceAvailabilitySize,\n validSpaceAvailabilitySizeFilters,\n spaceAvailabilitySizeFilterApplied,\n investmentLikeFilterable,\n spaceAvailabilityLikeFilterable,\n spaceUsageAvailabilityLikeFilterable,\n fetchingValuationFilterData,\n fetchingSpaceAvailabilitySizeFilterData,\n fetchingSpaceAvailabilitySpaceTypeFilterData,\n fetchingLoanStateFilterData,\n fetchingSpaceUsageStateFilterData,\n fetchingInvestmentStateFilterData,\n fetchingInvestmentTypeFilterData,\n fetchingInvestmentAssetTypeFilterData,\n fetchingLandCoveringStateFilterData,\n fetchingLandCoveringUseTypeFilterData,\n validMaxValue,\n validMinValue,\n validValuationFilters,\n filteredStandaloneValueFields,\n filteredInvestmentLikes,\n filteredSpaceAvailabilityLikes,\n filteredSpaceUsageAvailabilityLikes,\n filteredLoanStateLoanIds,\n filteredSpaceUsageStateSpaceUsageIds,\n selectedGeography,\n editingPolygon,\n geographyFilterPolygon,\n polygonPropertyLocations,\n polygonHuntIds,\n filteredTypedInvestmentIds,\n filteredAssetTypedInvestmentIds,\n combinedFilteredInvestmentIds,\n combinedFilteredSpaceAvailabilityIds,\n combinedFilteredSpaceUsageIds,\n stateFilteredLandCoveringIds,\n stateFilteredLandCoveringPropertyIds,\n combinedFilteredLandCoveringIds,\n combinedFilteredPropertyIds,\n polygonArea,\n triggerClearMapPolygon,\n sizesCategory,\n companiesCategory,\n investmentsCategory,\n selectedFilterCategories,\n selectedCompanyRoles,\n selectedCompanyEventTypes,\n exportRowData,\n dataEmptyState,\n analyzePropertyFields,\n analyzeLoanFields,\n analyzeHuntFields,\n analyzeInvestmentFields,\n analyzeSpaceAvailabilityFields,\n analyzeSpaceUsageFields,\n fetchedInvestmentKeys,\n fetchedHuntKeys,\n fetchedSpaceAvailabilityKeys,\n fetchedInvestmentFields,\n fetchedInvestmentGroupFields,\n fetchedSpaceAvailabilityFields,\n fetchedSpaceAvailabilityGroupFields,\n fetchedSpaceUsageUserFields,\n fetchedAvailabilityFloorAreaLayoutFields,\n fetchedUsageFloorAreaLayoutFields,\n datedInvestmentPropertyIds,\n datedAvailabilityPropertyIds,\n contentCalculationData,\n selectedLayer,\n layers,\n resetCalculationData,\n setCalculationDataByName,\n unlockableFieldsFor,\n unlicensedFieldsFor,\n alreadyFetched,\n alreadyFetchedFieldIdsFor,\n addExportRow,\n fetchContentCalculationData,\n dropContentCalculationData,\n contentCalculationDataByKey,\n fetchLoanDataField,\n fetchInvestmentDataField,\n fetchHuntDataField,\n fetchHuntGeographyIntents,\n fetchInvestmentGroupDataField,\n fetchInvestmentGroupTimingDataFields,\n fetchSpaceAvailabilityGroupTimingDataFields,\n fetchSpaceAvailabilityDataField,\n fetchSpaceAvailabilityGroupDataField,\n fetchSpaceUsageDataField,\n fetchSpaceUsageUserDataFields,\n fetchFloorAreaLayouts,\n fetchValuations,\n fetchValueFor,\n fetchLoanAmountFor,\n fetchSpaceUsageCommencedDateFor,\n fetchPropertyDataField,\n resetPolygonFilter,\n setPolygonEditing,\n setPolygon,\n setSelectedGeography,\n clearPolygon,\n resetFilterCategories,\n getPolygonCoordinates,\n combinedFilteredInvestmentIncluded,\n combinedFilteredSpaceAvailabilityIncluded,\n combinedFilteredHuntIncluded,\n investmentLikeIncluded,\n spaceAvailabilityLikeIncluded,\n spaceUsageAvailabilityLikeIncluded,\n fetchValuationFilteredInvestments,\n clearValueRange,\n clearValuationFilters,\n fetchSizeFilteredSpaceAvailabilities,\n clearSpaceAvailabilitySizeRange,\n clearSpaceAvailabilitySizeFilters,\n fetchTypeFilteredInvestments,\n surveyInvestmentCountProxy,\n surveySpaceAvailabilityCountProxy,\n surveySpaceUsageCountProxy,\n surveyCompanyCountProxy,\n surveySizeCountProxy,\n surveyLoanCountProxy,\n surveyHuntCountProxy,\n surveyUnlockableBundleFieldIds,\n patchUnlockableIds,\n dropUnlockableFieldType,\n dropUnlockableIds,\n loansTableAssemblyContent,\n loanInvestmentFields,\n portfolioAssetLoans,\n filteredPortfolioAssetLoans,\n filteredPortfolioSpaceUsages,\n portfolioSpaceTypeSpaceUsages,\n portfolioInvestmentFields,\n combinedFilteredLoanInvestmentIds,\n displayableLoanTableRows,\n loanCount,\n spaceUsageCount,\n fetchingLoanInvestmentFields,\n fetchingSpaceUsageAvailabilityFields,\n loanMaturityDateFilterInput,\n editingLoanMaturityDate,\n filterLoanMaturityDate,\n setLoanMaturityDate,\n clearLoanMaturityDate,\n setLoanMaturityDateEditing,\n spaceUsageAvailabilityFields,\n displayableSpaceUsageTableRows,\n filterSpaceUsageExpirationDate,\n spaceUsageExpirationDateFilterInput,\n editingSpaceUsageExpirationDate,\n setSpaceUsageExpirationDate,\n clearSpaceUsageExpirationDate,\n setSpaceUsageExpirationDateEditing,\n hoveringTableRowContent,\n routeName,\n asyncReady,\n };\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useAnalyzePanelStore, import.meta.hot),\n );\n}\n","import { useAnalyzePanelStore } from \"@/stores/analyzePanel\";\nimport { useNotificationsStore } from \"@/stores/notifications\";\nimport { defineStore, acceptHMRUpdate } from \"pinia\";\nimport { ref, computed } from \"vue\";\nimport api from \"@/router/api\";\nimport _ from \"lodash\";\n\nexport const useCalculationFieldsStore = defineStore(\n \"calculationFields\",\n () => {\n const notificationsStore = useNotificationsStore();\n const calculationFetchData = ref({});\n const allPagysLoaded = computed(() =>\n _.every(calculationFetchData.value, function (fetchObject) {\n if (fetchObject.loaded) {\n return true;\n } else {\n return false;\n }\n }),\n );\n const fetchedFields = computed(() => {\n const rawFetches = _.filter(\n calculationFetchData.value,\n function (fetchData) {\n return fetchData.data;\n },\n );\n\n const rawFields = rawFetches.flatMap(({ data }) => data);\n const filteredFields = rawFields.filter(\n (maybeField) => _.isObject(maybeField) && maybeField.fieldContentId,\n );\n\n return _.uniqBy(filteredFields, \"fieldContentId\");\n });\n\n const analyzePanelStore = useAnalyzePanelStore();\n\n async function calculationDataInitialFetch({\n payload,\n key,\n endpoint,\n calculationName,\n analyzePanelRequestKey = null,\n analyzePanelSet = true,\n paginationCount,\n }) {\n if (calculationFetchData.value) {\n let fetchObject = null;\n fetchObject = calculationFetchData.value[key];\n\n console.log(\"calculation initial fetch\", key);\n\n if (fetchObject?.loadingEvents) return;\n else if (!fetchObject) {\n fetchObject = setFetchObject(key, paginationCount);\n }\n\n if (fetchObject) {\n if (!fetchObject?.loaded) {\n fetchObject.loadingEvents = true;\n const response = await api.post(endpoint, payload);\n\n if (response?.data) {\n const { data, pagy } = response.data;\n fetchObject.loadingEvents = false;\n fetchObject.loaded = !pagy.next;\n fetchObject.data = data;\n fetchObject.pagy = pagy;\n\n do {\n await loadCalculationData(key, fetchObject, payload);\n } while (!fetchObject.loaded);\n }\n } else {\n console.log(\"already loaded!\", key);\n }\n\n if (analyzePanelSet) {\n analyzePanelStore.setCalculationDataByName(\n calculationName,\n fetchObject.data,\n analyzePanelRequestKey,\n );\n }\n\n return fetchObject;\n }\n }\n }\n\n function setFetchObject(key, count) {\n calculationFetchData.value[key] = {\n loadingEvents: false,\n loaded: false,\n count,\n data: [],\n pagy: null,\n fetchedAt: null,\n };\n return calculationFetchData.value[key];\n }\n\n function cleanUrl(url) {\n return url.replace(\"/api/v1/\", \"\");\n }\n\n async function loadCalculationData(key, fetchObject, existingPayload) {\n if (!fetchObject.pagy?.next) return;\n\n fetchObject.loadingEvents = true;\n const endpoint = cleanUrl(fetchObject.pagy.next_url);\n const payload = _.merge({}, existingPayload, {\n preLoadedFieldContent: fetchedFields.value,\n });\n\n try {\n if (fetchObject.pagy.next === 2) {\n notificationsStore.addNotification(\"paginatedDataLoading\", 9999, {\n paginationKey: key,\n keyType: \"calculation\",\n });\n }\n\n const response = await api.post(endpoint, payload);\n\n if (response?.data) {\n const { data, pagy } = response.data;\n console.log(\"paginated\", key, data);\n\n fetchObject.data = _.uniqBy(\n _.concat(fetchObject.data, data),\n function (maybeField) {\n if (_.isObject(maybeField)) {\n return maybeField.localId;\n } else {\n return maybeField;\n }\n },\n );\n fetchObject.pagy = pagy;\n\n if (data.length < fetchObject.count || !pagy.next) {\n fetchObject.loadingEvents = false;\n fetchObject.loaded = true;\n console.log(\"loaded!\", key);\n } else {\n fetchObject.loadingEvents = false;\n }\n }\n } catch (error) {\n fetchObject.loadingEvents = false;\n }\n }\n\n function actionableFetchObjectFor(key) {\n return calculationFetchData.value[key];\n }\n function fetchProgressFor(key) {\n const fetchObject = actionableFetchObjectFor(key);\n\n if (fetchObject?.pagy && !fetchObject.loaded) {\n const { pagy } = fetchObject;\n const { page, last } = pagy;\n const rawPercentage = page / last;\n\n return _.round(rawPercentage * 100);\n } else {\n return null;\n }\n }\n function fetchLabelFor(key) {\n if (fetchProgressFor(key)) {\n const { pagy } = actionableFetchObjectFor(key);\n const { count } = pagy;\n\n return `${fetchProgressFor(key)}% (${count} datapoints)`;\n } else {\n return null;\n }\n }\n\n return {\n calculationFetchData,\n fetchedFields,\n allPagysLoaded,\n setFetchObject,\n loadCalculationData,\n calculationDataInitialFetch,\n actionableFetchObjectFor,\n fetchProgressFor,\n fetchLabelFor,\n };\n },\n);\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useCalculationFieldsStore, import.meta.hot),\n );\n}\n","import { defineStore, acceptHMRUpdate } from \"pinia\";\nimport { useMainMapStore } from \"@/stores/mainMap\";\nimport { useTimeTravelStore } from \"@/stores/timeTravel\";\nimport { useNotificationsStore } from \"@/stores/notifications\";\nimport { useAnalyzePanelStore } from \"@/stores/analyzePanel\";\nimport { storeToRefs } from \"pinia\";\nimport { ref, computed, watch, nextTick } from \"vue\";\nimport { useRoute } from \"vue-router\";\nimport stateAbbreviationsUS from \"@/assets/stateAbbreviationsUS\";\nimport {\n staticInvolvementGroupings,\n isEquity,\n isUser,\n isDebt,\n isAdvisory,\n isProspect,\n isHunt,\n isHuntAdvisory,\n assetTypeFor,\n assetIdFor,\n propertyIdFor,\n uniqueEquity,\n propertyGrouped,\n analyzedInvolvements,\n} from \"@/components/company-detail/companyInvolvementGroups\";\nimport api from \"@/router/api\";\nimport _ from \"lodash\";\nimport moment from \"moment\";\nimport { usePropertyFieldsStore } from \"./propertyFields\";\n\nexport const useNearbyCompaniesStore = defineStore(\"nearbyCompanies\", () => {\n const mapStore = useMainMapStore();\n const notificationsStore = useNotificationsStore();\n const { map, zoom, allPagysLoaded: mapPagysLoaded } = storeToRefs(mapStore);\n const timeTravelStore = useTimeTravelStore();\n const { asOfMilliseconds } = storeToRefs(timeTravelStore);\n const analyzePanelStore = useAnalyzePanelStore();\n const { companiesCategory } = storeToRefs(analyzePanelStore);\n const propertyFieldsStore = usePropertyFieldsStore();\n const route = useRoute();\n const routeName = computed(() => route.name);\n\n const fetchedPropertyDataFields = ref([]);\n const companyFields = ref([]);\n const heroImages = ref([]);\n const companyFetchData = ref({});\n const allPagysLoaded = computed(() =>\n _.every(companyFetchData.value, function (fetchObject) {\n if (fetchObject.loaded) {\n return true;\n } else {\n return false;\n }\n }),\n );\n const pagysLoading = computed(() =>\n _.some(companyFetchData.value, function (fetchObject) {\n return fetchObject.loadingEvents;\n }),\n );\n const pagysFetching = computed(() =>\n _.some(companyFetchData.value, function (fetchObject) {\n return fetchObject.loadingEvents && !fetchObject.pagy;\n }),\n );\n const fetchedInvolvementFields = computed(() => {\n const rawFetches = _.filter(companyFetchData.value, function (fetchData) {\n return fetchData.data;\n });\n\n const rawFields = rawFetches.flatMap(({ data }) => data);\n const filteredFields = rawFields.filter(\n (maybeField) => _.isObject(maybeField) && maybeField.fieldContentId,\n );\n\n return _.uniqBy(filteredFields, \"fieldContentId\");\n });\n const fetchedFieldIds = computed(() => {\n return fetchedInvolvementFields.value.map(({ localId }) => localId);\n });\n const activeFetchObject = computed(() => {\n const ordered = _.orderBy(\n companyFetchData.value,\n [\n function ({ fetchedAt }) {\n if (fetchedAt) {\n return fetchedAt.valueOf();\n } else {\n return -100;\n }\n },\n ],\n [\"desc\"],\n );\n\n return _.head(ordered);\n });\n const deduplicatedActiveFetchInvolvements = computed(() => {\n if (activeFetchObject.value?.data) {\n const composited = activeFetchObject.value.data.map((maybeField) => {\n if (_.isObject(maybeField)) {\n return maybeField;\n } else {\n return _.find(fetchedInvolvementFields.value, {\n localId: maybeField,\n });\n }\n });\n\n return _.compact(composited);\n } else {\n return [];\n }\n });\n const rawFilteredInvolvements = computed(() => {\n return analyzedInvolvements(\n deduplicatedActiveFetchInvolvements.value,\n analyzePanelStore,\n \"mainMap\",\n );\n });\n const surveyUnlockableCompanyFieldIds = computed(() => {\n return rawFilteredInvolvements.value.flatMap(\n (dataField) =>\n dataField.fieldContent?.relatedFieldIds || dataField.localId,\n );\n });\n const rawGroupedInvolvements = computed(() => {\n return _.groupBy(rawFilteredInvolvements.value, function (field) {\n if (field.unmasked) {\n return field.fieldContent.companyId;\n } else {\n return \"Unlockable\";\n }\n });\n });\n const groupedInvolvements = computed(() => {\n const mappedObj = _.mapValues(\n rawGroupedInvolvements.value,\n function (fields, label) {\n if (label === \"Unlockable\") {\n return fields;\n } else {\n const rawEquityFields = fields.filter((field) => {\n return isEquity(field);\n });\n const orderedEquityFields = _.orderBy(\n rawEquityFields,\n [\"fieldContentSubType\", \"decoratingContentType\"],\n [\"desc\", \"desc\"],\n );\n const equityFields = _.uniqBy(orderedEquityFields, uniqueEquity);\n const nonEquityFields = fields.filter((field) => {\n return (\n isHunt(field) ||\n isUser(field) ||\n isDebt(field) ||\n isAdvisory(field) ||\n (isProspect(field) && !isEquity(field))\n );\n });\n\n return _.concat(equityFields, nonEquityFields);\n }\n },\n );\n const mappedArr = _.map(mappedObj, function (fields, label) {\n const hunts = fields.filter((field) => isHunt(field));\n const huntAdvisories = fields.filter((field) => isHuntAdvisory(field));\n const propertyGroupable = fields.filter(\n (field) => !isHunt(field) && !isHuntAdvisory(field),\n );\n return {\n companyId: label,\n involvements: fields,\n hunts,\n huntAdvisories,\n propertyGrouped:\n label === \"Unlockable\" ? null : propertyGrouped(propertyGroupable),\n };\n });\n return _.orderBy(\n mappedArr,\n [\n function (obj) {\n return obj.companyId === \"Unlockable\" ? 1 : 0;\n },\n function (obj) {\n return obj.involvements.length;\n },\n \"companyId\",\n ],\n [\"desc\", \"desc\", \"desc\"],\n );\n });\n\n const displayable = computed(() => routeName.value === \"MainMap\");\n\n watch(asOfMilliseconds, async () => {\n debouncedRefetchCompanies();\n });\n watch(mapPagysLoaded, () => {\n if (mapPagysLoaded.value) {\n debouncedRefetchCompanies();\n }\n });\n\n const debouncedRefetchCompanies = _.debounce(function () {\n fetchCompanies();\n }, 1000);\n\n function groupFor(field) {\n if (!field.unmasked) {\n return stylingPropFor(\"Unlockable\", \"name\");\n } else if (isEquity(field)) {\n return stylingPropFor(\"Owner\", \"name\");\n } else if (isUser(field)) {\n return stylingPropFor(\"User\", \"name\");\n } else if (isDebt(field)) {\n return stylingPropFor(\"Lender\", \"name\");\n } else if (isAdvisory(field) || (isProspect(field) && !isEquity(field))) {\n return stylingPropFor(\"Advisor\", \"name\");\n } else if (isHunt(field)) {\n return stylingPropFor(\"Hunting\", \"name\");\n }\n }\n\n function badgeFor(field) {\n if (!field.unmasked) {\n return stylingPropFor(\"Unlockable\", \"badge\");\n } else if (isEquity(field)) {\n return stylingPropFor(\"Owner\", \"badge\");\n } else if (isUser(field)) {\n return stylingPropFor(\"User\", \"badge\");\n } else if (isDebt(field)) {\n return stylingPropFor(\"Lender\", \"badge\");\n } else if (isAdvisory(field) || (isProspect(field) && !isEquity(field))) {\n return stylingPropFor(\"Advisor\", \"badge\");\n } else if (isHunt(field)) {\n return stylingPropFor(\"Hunting\", \"badge\");\n }\n }\n\n function shadowColorFor(field) {\n if (!field.unmasked) {\n return stylingPropFor(\"Unlockable\", \"shadowColor\");\n } else if (isEquity(field)) {\n return stylingPropFor(\"Owner\", \"shadowColor\");\n } else if (isUser(field)) {\n return stylingPropFor(\"User\", \"shadowColor\");\n } else if (isDebt(field)) {\n return stylingPropFor(\"Lender\", \"shadowColor\");\n } else if (isAdvisory(field) || (isProspect(field) && !isEquity(field))) {\n return stylingPropFor(\"Advisor\", \"shadowColor\");\n } else if (isHunt(field)) {\n return stylingPropFor(\"Hunting\", \"shadowColor\");\n }\n }\n function borderColorFor(field) {\n if (!field.unmasked) {\n return stylingPropFor(\"Unlockable\", \"borderColor\");\n } else if (isEquity(field)) {\n return stylingPropFor(\"Owner\", \"borderColor\");\n } else if (isUser(field)) {\n return stylingPropFor(\"User\", \"borderColor\");\n } else if (isDebt(field)) {\n return stylingPropFor(\"Lender\", \"borderColor\");\n } else if (isAdvisory(field) || (isProspect(field) && !isEquity(field))) {\n return stylingPropFor(\"Advisor\", \"borderColor\");\n } else if (isHunt(field)) {\n return stylingPropFor(\"Hunting\", \"borderColor\");\n }\n }\n\n function stylingPropFor(group, styleName) {\n const staticGroup = _.find(staticInvolvementGroupings, { name: group });\n\n if (staticGroup) {\n return staticGroup[styleName];\n } else {\n return \"\";\n }\n }\n\n function patchCompanyDataFields(newFields) {\n companyFields.value = _.unionBy(newFields, companyFields.value, \"localId\");\n }\n function patchHeroImages(newFields) {\n heroImages.value = _.unionBy(newFields, heroImages.value, \"localId\");\n }\n async function propertyDataFieldFor(involvementDataField) {\n const field = await propertyFieldsStore.fetchPropertyDataField(\n propertyIdFor(involvementDataField),\n );\n\n return field;\n }\n async function propertyNameFor(involvementDataField) {\n const field = await propertyDataFieldFor(involvementDataField);\n\n return _.get(field, \"fieldContent.name\") || \"Unlock\";\n }\n async function propertyLocationFor(involvementDataField) {\n const field = await propertyDataFieldFor(involvementDataField);\n const city = _.get(\n field,\n \"fieldContent.locationDataField.fieldContent.city\",\n );\n const state = _.get(\n field,\n \"fieldContent.locationDataField.fieldContent.state\",\n );\n const abbreviatedState = stateAbbreviationsUS[state];\n const combined =\n city && state ? `${city}, ${abbreviatedState || state}` : \"to reveal\";\n\n return combined;\n }\n function companyFieldFor(maybeId) {\n if (maybeId === \"Unlockable\") {\n return null;\n } else {\n return _.find(companyFields.value, {\n fieldContentId: _.toNumber(maybeId),\n });\n }\n }\n function heroImageFor(dataField) {\n if (assetTypeFor(dataField)) {\n let heroImageField = null;\n let photo = null;\n heroImageField = _.find(heroImages.value, {\n decoratingContentType: assetTypeFor(dataField),\n decoratingContentId: assetIdFor(dataField),\n });\n\n if (heroImageField) {\n photo = _.get(heroImageField, \"fieldContent\");\n } else if (propertyIdFor(dataField)) {\n heroImageField = _.find(heroImages.value, {\n joiningContentType: \"Property\",\n joiningContentId: propertyIdFor(dataField),\n });\n photo = _.get(heroImageField, \"fieldContent\");\n }\n\n return _.get(photo, \"link\");\n } else {\n return null;\n }\n }\n async function fetchCompany(maybeId) {\n if (maybeId !== \"Unlockable\" && !companyFieldFor(maybeId)) {\n const response = await api.get(`companies/${maybeId}`);\n\n if (response?.data) {\n patchCompanyDataFields([response.data]);\n }\n }\n }\n async function fetchHeroImage(isVisible, dataField) {\n if (isVisible && assetTypeFor(dataField)) {\n const heroResponse = await api.get(\n `newest_content_photo/${assetTypeFor(dataField)}/${assetIdFor(\n dataField,\n )}?asset_hero=true`,\n );\n\n if (heroResponse.data) {\n patchHeroImages([heroResponse.data]);\n }\n return true;\n } else {\n return false;\n }\n }\n\n async function fetchCompanies() {\n if (\n displayable.value &&\n companiesCategory.value?.checked &&\n zoom.value >= 13\n ) {\n // console.log(\"fetch companies\");\n const bounds = map.value.getBounds();\n const southwest = bounds.getSouthWest();\n const northeast = bounds.getNorthEast();\n const northeastLatLng = [northeast.lat, northeast.lng];\n const southwestLatLng = [southwest.lat, southwest.lng];\n const payload = {\n alreadyFetchedFieldIds: fetchedFieldIds.value,\n };\n const key = `${northeastLatLng}_${southwestLatLng}`;\n let fetchObject = companyFetchData.value[key];\n if (!fetchObject) {\n companyFetchData.value[key] = {\n loadingEvents: false,\n loaded: false,\n count: 5,\n data: [],\n pagy: null,\n fetchedAt: null,\n };\n fetchObject = companyFetchData.value[key];\n }\n\n if (mapPagysLoaded.value && !fetchObject.loaded) {\n fetchObject.loadingEvents = true;\n try {\n const response = await api.post(\n `nearby_companies/${southwestLatLng}/${northeastLatLng}?zoom=${zoom.value}&as_of=${asOfMilliseconds.value}`,\n payload,\n );\n const { data, pagy } = response.data;\n // console.log(\"fetched\", data);\n fetchObject.loadingEvents = false;\n fetchObject.loaded = !pagy.next;\n fetchObject.data = data;\n fetchObject.pagy = pagy;\n fetchObject.fetchedAt = moment();\n\n await nextTick();\n } catch (error) {\n console.error(error);\n notificationsStore.addNotification(\"anErrorOccurred\");\n } finally {\n // console.log(\"finally fetched companies\");\n }\n } else {\n console.log(\"fetch not actionable.\");\n }\n }\n }\n\n function actionableFetchObjectFor(key) {\n return companyFetchData.value[key];\n }\n function fetchProgressFor(key) {\n const fetchObject = actionableFetchObjectFor(key);\n\n if (fetchObject?.pagy && !fetchObject.loaded) {\n const { pagy } = fetchObject;\n const { page, last } = pagy;\n const rawPercentage = page / last;\n\n return _.round(rawPercentage * 100);\n } else {\n return null;\n }\n }\n function fetchLabelFor(key) {\n if (fetchProgressFor(key)) {\n const { pagy } = actionableFetchObjectFor(key);\n const { count } = pagy;\n\n return `${fetchProgressFor(key)}% (${count} datapoints)`;\n } else {\n return null;\n }\n }\n\n return {\n rawFilteredInvolvements,\n surveyUnlockableCompanyFieldIds,\n groupedInvolvements,\n debouncedRefetchCompanies,\n fetchedPropertyDataFields,\n companyFetchData,\n allPagysLoaded,\n pagysLoading,\n pagysFetching,\n fetchedInvolvementFields,\n fetchedFieldIds,\n activeFetchObject,\n deduplicatedActiveFetchInvolvements,\n fetchCompanies,\n fetchCompany,\n fetchHeroImage,\n companyFieldFor,\n propertyDataFieldFor,\n propertyNameFor,\n propertyLocationFor,\n heroImageFor,\n patchCompanyDataFields,\n shadowColorFor,\n borderColorFor,\n groupFor,\n badgeFor,\n actionableFetchObjectFor,\n fetchProgressFor,\n fetchLabelFor,\n };\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useNearbyCompaniesStore, import.meta.hot),\n );\n}\n","\n \n \n
\n
\n
\n \n
\n
\n
\n {{ paginationTypeLabel\n }} ({{ contentType }}) \n loading\n
\n
\n
\n Datapoints finished loading. This notification will disappear\n shortly.\n
\n
\n Awaiting initial loading status...\n
\n
\n
\n \n Close \n \n \n
\n
\n
\n
\n \n \n\n\n","\n \n \n
\n
\n
\n \n
\n
\n
\n Password reset successful\n
\n
\n Please sign in with your new password.\n
\n
\n
\n \n Close \n \n \n
\n
\n
\n
\n \n \n\n\n","\n \n \n
\n
\n
\n \n
\n
\n
\n Password reset submitted\n
\n
\n You will receive an email within the next few minutes. It contains\n instructions for changing your password.\n
\n
\n
\n \n Close \n \n \n
\n
\n
\n
\n \n \n\n\n","\n \n \n
\n
\n
\n \n
\n
\n
An error occurred
\n
\n We're looking into it. Sorry for the inconvenience.\n
\n
\n
\n \n Close \n \n \n
\n
\n
\n
\n \n \n\n\n","\n \n \n
\n
\n
\n \n
\n
\n
Permission denied
\n
Authentication failed.
\n
\n
\n \n Close \n \n \n
\n
\n
\n
\n \n \n\n\n","\n \n \n
\n
\n
\n \n
\n
\n
\n Account already exists\n
\n
\n This email address belongs to another account. Try signing in or\n resetting your password. Or, use another address.\n
\n
\n
\n \n Close \n \n \n
\n
\n
\n
\n \n \n\n\n","\n \n \n
\n
\n
\n \n
\n
\n
\n Link request submitted\n
\n
\n We received your request to link your user account to this\n contact. We will be in touch to confirm.\n
\n
\n
\n \n Close \n \n \n
\n
\n
\n
\n \n \n\n\n","\n \n \n
\n
\n
\n \n
\n
\n
\n Email reset submitted\n
\n
\n We received your request. Please look for a verification email at\n your new address.\n
\n
\n
\n \n Close \n \n \n
\n
\n
\n
\n \n \n\n\n","\n \n \n
\n
\n
\n \n
\n
\n
Air Rights Diagram
\n
\n This property includes an air rights layer in addition to the\n ground layer. We opened both layers to help you see the whole\n picture.\n
\n
\n
\n \n Close \n \n \n
\n
\n
\n
\n \n \n\n\n","import { markRaw } from \"vue\";\nimport EasyDataInviteAccepted from \"@/components/notifications/EasyDataInviteAccepted.vue\";\nimport EasyDataInviteSent from \"@/components/notifications/EasyDataInviteSent.vue\";\nimport ProofAccepted from \"@/components/notifications/ProofAccepted.vue\";\nimport ProofRejected from \"@/components/notifications/ProofRejected.vue\";\nimport EmailVerified from \"@/components/notifications/EmailVerified.vue\";\nimport UnlockSuccessful from \"@/components/notifications/UnlockSuccessful.vue\";\nimport UnlockNotAllowed from \"@/components/notifications/UnlockNotAllowed.vue\";\nimport NameUpdated from \"@/components/notifications/NameUpdated.vue\";\nimport EasyDataContributed from \"@/components/notifications/EasyDataContributed.vue\";\nimport DigestConsentUpdated from \"@/components/notifications/DigestConsentUpdated.vue\";\nimport DisplayingDraftFields from \"@/components/notifications/DisplayingDraftFields.vue\";\nimport PaginatedLoadingProgress from \"@/components/notifications/PaginatedLoadingProgress.vue\";\nimport PasswordResetSuccessful from \"@/components/notifications/PasswordResetSuccessful.vue\";\nimport PasswordResetSubmitted from \"@/components/notifications/PasswordResetSubmitted.vue\";\nimport AnErrorOccurred from \"@/components/notifications/AnErrorOccurred.vue\";\nimport PermissionDenied from \"@/components/notifications/PermissionDenied.vue\";\nimport AccountAlreadyExists from \"@/components/notifications/AccountAlreadyExists.vue\";\nimport LinkRequestSubmitted from \"@/components/notifications/LinkRequestSubmitted.vue\";\nimport EmailResetSubmitted from \"@/components/notifications/EmailResetSubmitted.vue\";\nimport AirGroundDiagramOpened from \"@/components/notifications/AirGroundDiagramOpened.vue\";\n\nexport default [\n {\n id: \"paginatedDataLoading\",\n component: markRaw(PaginatedLoadingProgress),\n props: {},\n },\n {\n id: \"displayingDraftFields\",\n component: markRaw(DisplayingDraftFields),\n props: {},\n },\n {\n id: \"proofAccepted\",\n component: markRaw(ProofAccepted),\n props: {},\n },\n {\n id: \"proofRejected\",\n component: markRaw(ProofRejected),\n props: {},\n },\n {\n id: \"emailVerified\",\n component: markRaw(EmailVerified),\n props: {},\n },\n {\n id: \"linkRequestSubmitted\",\n component: markRaw(LinkRequestSubmitted),\n props: {},\n },\n {\n id: \"passwordResetSubmitted\",\n component: markRaw(PasswordResetSubmitted),\n props: {},\n },\n {\n id: \"passwordResetSuccessful\",\n component: markRaw(PasswordResetSuccessful),\n props: {},\n },\n {\n id: \"emailResetSubmitted\",\n component: markRaw(EmailResetSubmitted),\n props: {},\n },\n {\n id: \"nameUpdated\",\n component: markRaw(NameUpdated),\n props: {},\n },\n {\n id: \"digestConsentUpdated\",\n component: markRaw(DigestConsentUpdated),\n props: {},\n },\n {\n id: \"anErrorOccurred\",\n component: markRaw(AnErrorOccurred),\n props: {},\n },\n {\n id: \"permissionDenied\",\n component: markRaw(PermissionDenied),\n props: {},\n },\n {\n id: \"accountAlreadyExists\",\n component: markRaw(AccountAlreadyExists),\n props: {},\n },\n {\n id: \"unlockSuccessful\",\n component: markRaw(UnlockSuccessful),\n props: {},\n },\n {\n id: \"adminModeUnlockNotAllowed\",\n component: markRaw(UnlockNotAllowed),\n props: {},\n },\n {\n id: \"airGroundDiagramOpened\",\n component: markRaw(AirGroundDiagramOpened),\n props: {},\n },\n {\n id: \"easyDataContributed\",\n component: markRaw(EasyDataContributed),\n props: {},\n },\n {\n id: \"easyDataInviteSent\",\n component: markRaw(EasyDataInviteSent),\n props: {},\n },\n {\n id: \"easyDataInviteAccepted\",\n component: markRaw(EasyDataInviteAccepted),\n props: {},\n },\n];\n","import { ref } from \"vue\";\nimport { defineStore, acceptHMRUpdate } from \"pinia\";\nimport notificationComponents from \"@/components/notifications/manifest\";\nimport _ from \"lodash\";\n\nexport const useNotificationsStore = defineStore(\"notifications\", () => {\n const activeNotifications = ref([]);\n\n function addNotification(id, autoHideSeconds = 10, props = {}) {\n let newNotification = _.find(notificationComponents, { id });\n\n if (newNotification) {\n if (autoHideSeconds) {\n newNotification.props = _.merge({}, newNotification.props, {\n autoHideSeconds,\n }, props);\n }\n activeNotifications.value.push(newNotification);\n }\n }\n\n return { activeNotifications, addNotification };\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useNotificationsStore, import.meta.hot),\n );\n}\n","\n \n
\n
\n
\n \n
\n
\n
\n Verify your email\n \n
\n
\n To provide a safe and enjoyable experience for everyone on Tower\n Hunt, the use of certain features requires a verified email.\n
\n
\n
\n
\n
\n
\n \n Resend confirmation\n \n \n Change email\n \n
\n
\n \n\n\n","import { ref, computed, watch, markRaw } from \"vue\";\nimport { defineStore, acceptHMRUpdate } from \"pinia\";\nimport { useGuestProfileStore } from \"@/stores/guestProfile\";\nimport { useModalStore } from \"@/stores/modal\";\nimport { useWorkspaceLayoutStore } from \"@/stores/workspaceLayout\";\nimport { useNotificationsStore } from \"@/stores/notifications\";\nimport { useRoute, useRouter } from \"vue-router\";\nimport { storeToRefs } from \"pinia\";\nimport VerifyEmailPrompt from \"@/components/users/subscribe-prompts/VerifyEmailPrompt.vue\";\nimport api from \"@/router/api\";\nimport _ from \"lodash\";\n\nexport const useUserStore = defineStore(\"user\", () => {\n const layoutStore = useWorkspaceLayoutStore();\n const { isDesktop } = storeToRefs(layoutStore);\n const notificationsStore = useNotificationsStore();\n const adminMode = ref(false);\n const currentUser = ref(null);\n const confirmationResent = ref(false);\n const userGeographyIntents = ref([]);\n const isAdmin = computed(\n () => !!_.get(currentUser.value, \"admin\") || adminMode.value,\n );\n const signedIn = computed(() => !!_.get(currentUser.value, \"signedIn\"));\n const emailUnverified = computed(\n () =>\n signedIn.value &&\n _.get(currentUser.value, \"emailVerificationState\") === \"unverified\",\n );\n const emailVerified = computed(\n () =>\n signedIn.value &&\n _.get(currentUser.value, \"emailVerificationState\") === \"verified\",\n );\n const firstName = computed(() => _.get(currentUser.value, \"firstName\"));\n const activeEasyDataInputPayloadItem = computed({\n get() {\n return _.get(currentUser.value, \"activeEasyDataInputPayloadItem\");\n },\n set(newItem) {\n currentUser.value.activeEasyDataInputPayloadItem = newItem;\n },\n });\n const activePayloadItemPaused = computed(\n () => activeEasyDataInputPayloadItem.value?.paused,\n );\n const availableBalance = computed({\n get() {\n return _.get(currentUser.value, \"availableBalance\");\n },\n set(newBalance) {\n currentUser.value.availableBalance = newBalance;\n },\n });\n const reputation = computed({\n get() {\n return _.get(currentUser.value, \"reputation\");\n },\n set(newReputation) {\n currentUser.value.reputation = newReputation;\n },\n });\n const reputationLevel = computed({\n get() {\n return _.get(currentUser.value, \"reputationLevel\");\n },\n set(newLevel) {\n currentUser.value.reputationLevel = newLevel;\n },\n });\n const reputable = computed({\n get() {\n return _.get(currentUser.value, \"reputable\");\n },\n set(newReputable) {\n currentUser.value.reputable = newReputable;\n },\n });\n const correctPercentage = computed({\n get() {\n return _.get(currentUser.value, \"correctPercentage\");\n },\n set(newCorrectPercentage) {\n currentUser.value.correctPercentage = newCorrectPercentage;\n },\n });\n const validationSkips = computed({\n get() {\n return _.get(currentUser.value, \"validationSkips\");\n },\n set(newSkips) {\n currentUser.value.validationSkips = newSkips;\n },\n });\n const sessionGeographyIntents = computed({\n get() {\n return _.get(currentUser.value, \"sessionGeographyIntents\");\n },\n set(newCount) {\n currentUser.value.sessionGeographyIntents = newCount;\n },\n });\n const linked = computed({\n get() {\n return _.get(currentUser.value, \"linked\");\n },\n set(bool) {\n currentUser.value.linked = bool;\n },\n });\n const linkRequestPending = computed({\n get() {\n return _.get(currentUser.value, \"linkRequestPending\");\n },\n set(bool) {\n currentUser.value.linkRequestPending = bool;\n },\n });\n const digestConsent = computed({\n get() {\n return _.get(currentUser.value, \"digestConsent\");\n },\n set(bool) {\n persistDigestConsent(bool);\n },\n });\n\n watch(activePayloadItemPaused, () => {\n if (activePayloadItemPaused.value) {\n api.post(`payload_item_inputter_pausings`);\n } else {\n api.delete(`payload_item_inputter_pausings`);\n }\n });\n\n const linkable = computed(() => !linked.value && !linkRequestPending.value);\n const availableCollectibleCardCount = ref(0);\n\n const guestProfile = useGuestProfileStore();\n const { geographyIntents, discoverySearches, completedCardIds } =\n storeToRefs(guestProfile);\n function fetchAvailableCollectibleCardCount() {\n return new Promise((resolve) => {\n const payload = {\n cardIds: signedIn.value ? [] : completedCardIds.value,\n geographyIntents: signedIn.value ? [] : geographyIntents.value,\n discoverySearches: signedIn.value ? [] : discoverySearches.value,\n mobile: !isDesktop.value,\n };\n api.post(`my_collectible_cards_count`, payload).then((json) => {\n availableCollectibleCardCount.value = json.data;\n resolve();\n });\n });\n }\n function resendConfirmation() {\n api.post(\"email_verifications\").then(() => {\n confirmationResent.value = true;\n\n setTimeout(() => {\n confirmationResent.value = false;\n }, 30000);\n });\n }\n async function persistDigestConsent(bool) {\n const response = await api.patch(`digest_consents`, {\n digestConsent: bool,\n });\n\n if (\n (response?.data === true || response?.data === false) &&\n currentUser.value\n ) {\n currentUser.value.digestConsent = response.data;\n notificationsStore.addNotification(\"digestConsentUpdated\");\n }\n }\n\n const emailRegex = RegExp(\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/,\n );\n\n const router = useRouter();\n const route = useRoute();\n\n function viewAccount() {\n router.push({\n name: route.name,\n query: {\n horizontalTab: \"Account\",\n verticalTab: \"Settings\",\n },\n });\n }\n const modalStore = useModalStore();\n const { modalPayload } = storeToRefs(modalStore);\n\n function promptToVerify() {\n modalPayload.value = {\n size: \"base\",\n theme: \"light\",\n component: markRaw(VerifyEmailPrompt),\n props: {},\n };\n }\n\n async function linkContact(contactId) {\n if (emailUnverified.value) {\n promptToVerify();\n } else if (!linked.value && !linkRequestPending.value) {\n const response = await api.post(`contact_user_link_requests`, {\n contactId,\n });\n\n if (response?.data) {\n linkRequestPending.value = true;\n notificationsStore.addNotification(\"linkRequestSubmitted\");\n }\n }\n }\n\n async function refreshActiveInputPayloadItem() {\n if (activeEasyDataInputPayloadItem.value) {\n const response = await api.get(`my_active_easy_data_input_payload_item`);\n\n if (response?.data) {\n activeEasyDataInputPayloadItem.value = response.data;\n }\n }\n }\n\n function setAdminMode() {\n adminMode.value = localStorage.getItem(\"adminToken\");\n }\n\n return {\n adminMode,\n currentUser,\n confirmationResent,\n firstName,\n isAdmin,\n signedIn,\n userGeographyIntents,\n emailUnverified,\n emailVerified,\n activeEasyDataInputPayloadItem,\n availableBalance,\n reputation,\n reputationLevel,\n reputable,\n linked,\n linkRequestPending,\n linkable,\n digestConsent,\n correctPercentage,\n validationSkips,\n sessionGeographyIntents,\n availableCollectibleCardCount,\n fetchAvailableCollectibleCardCount,\n refreshActiveInputPayloadItem,\n resendConfirmation,\n viewAccount,\n promptToVerify,\n linkContact,\n setAdminMode,\n emailRegex,\n };\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept(acceptHMRUpdate(useUserStore, import.meta.hot));\n}\n","import _ from \"lodash\";\n\nexport default class Guest {\n constructor(data) {\n this.host = _.get(data, \"host\");\n this.cypress = _.get(data, \"cypress\");\n this.admin = false;\n this.signedIn = false;\n this.sessionFetchedAt = null;\n }\n}\n","/* global analytics */\nimport { useUserStore } from \"@/stores/user\";\nimport { useSecondaryPanelStore } from \"@/stores/secondaryPanel\";\nimport { useTasksStore } from \"@/stores/tasks\";\nimport { ref } from \"vue\";\nimport { storeToRefs, defineStore, acceptHMRUpdate } from \"pinia\";\nimport { useRoute, useRouter } from \"vue-router\";\nimport User from \"@/stores/models/user\";\nimport Guest from \"@/stores/models/guest\";\nimport api from \"@/router/api\";\n\nexport const useAuthStore = defineStore(\"auth\", () => {\n const userStore = useUserStore();\n const { adminMode, currentUser, isAdmin } = storeToRefs(userStore);\n const secondaryPanelStore = useSecondaryPanelStore();\n const { myAccountActive, validationsActive } =\n storeToRefs(secondaryPanelStore);\n const tasksStore = useTasksStore();\n const { selectedTaskList } = storeToRefs(tasksStore);\n const identityChecked = ref(false);\n async function getCurrentUser() {\n fetchUser().then(\n (fetchedUser) => {\n adminMode.value = false;\n if (fetchedUser.data.signedIn) {\n signIn(new User(fetchedUser.data));\n\n if (localStorage[\"token\"]) {\n // this.$cable.connection.connect();\n }\n } else if (localStorage[\"token\"]) {\n localStorage.removeItem(\"token\");\n // this.$cable.connection.disconnect();\n } else {\n signIn(new Guest(fetchedUser.data));\n }\n identityChecked.value = true;\n },\n () => {\n adminMode.value = false;\n if (localStorage[\"token\"]) {\n localStorage.removeItem(\"token\");\n // this.$cable.connection.disconnect();\n location.reload();\n }\n identityChecked.value = true;\n },\n );\n }\n async function fetchUser() {\n return api.get(\"whoami\");\n }\n\n const router = useRouter();\n const route = useRoute();\n\n async function signIn(userModel) {\n return new Promise((resolve) => {\n currentUser.value = userModel;\n setAnalytics();\n selectedTaskList.value = null;\n tasksStore.fetchLists();\n if (isAdmin.value) {\n resolve(\"admin\");\n } else {\n resolve();\n }\n });\n }\n\n function setAnalytics() {\n if (!adminMode.value && currentUser.value.id) {\n if (window.LogRocket) {\n console.log(\"set LogRocket\", window.LogRocket);\n window.LogRocket.identify(currentUser.value.id, {\n name: currentUser.value.name,\n email: currentUser.value.email,\n createdAt: currentUser.value.userCreatedAt,\n });\n }\n\n if (analytics) {\n analytics.identify(currentUser.value.id, {\n name: currentUser.value.name,\n email: currentUser.value.email,\n createdAt: currentUser.value.userCreatedAt,\n signupMonthYear: currentUser.value.signupMonthYear,\n });\n }\n }\n }\n\n async function signOut() {\n localStorage.removeItem(\"token\");\n // this.$cable.connection.disconnect();\n\n const adminToken = localStorage.getItem(\"adminToken\");\n\n if (adminToken) {\n api.delete(`admin/masquerades/${currentUser.value.id}`).then(() => {\n localStorage.setItem(\"token\", adminToken);\n localStorage.removeItem(\"adminToken\");\n adminMode.value = false;\n api.defaults.headers.common[\"Authorization\"] = `Bearer ${adminToken}`;\n api.get(\"whoami\").then((user) => {\n // this.$cable.connection.connect();\n signIn(new User(user.data)).then(() => {\n router.push({ name: \"AdminStats\" });\n });\n });\n });\n } else {\n currentUser.value = new Guest();\n myAccountActive.value = false;\n validationsActive.value = false;\n secondaryPanelStore.setAuthenticate();\n secondaryPanelStore.revertPanel();\n\n if (route.name !== \"HelpCenter\") {\n router.push({\n name: \"MainMap\",\n query: null,\n });\n }\n\n setTimeout(() => {\n location.reload();\n }, 500);\n }\n }\n\n return {\n identityChecked,\n fetchUser,\n getCurrentUser,\n signIn,\n signOut,\n setAnalytics,\n };\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept(acceptHMRUpdate(useAuthStore, import.meta.hot));\n}\n","\n \n \n \n
\n \n\n \n
\n
\n \n \n
\n \n
\n
\n
{{ confirmationTitle }} \n
\n
\n {{ confirmationMessage }}\n
\n
\n
\n
\n \n
\n \n \n {{ confirmationAffirmText }}\n \n \n
\n Cancel\n \n
\n \n \n
\n
\n \n \n \n\n\n","\n \n \n \n
\n \n\n \n
\n
\n \n \n \n \n \n
\n \n \n
\n \n \n
\n
\n \n \n \n\n\n","\n \n \n \n\n\n","\n \n \n \n \n \n
\n \n\n\n\n\n","import { defineStore, acceptHMRUpdate } from \"pinia\";\nimport { ref } from \"vue\";\n\nexport const useCardContainerStore = defineStore(\n \"collectibleCardContainer\",\n () => {\n const actioningCard = ref(false);\n\n return { actioningCard };\n }\n);\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useCardContainerStore, import.meta.hot)\n );\n}\n","\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
1 ? 'mt-8' : 'mt-3'\"\n class=\"flex flex-col\"\n >\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n \n \n \n
\n
\n
\n \n\n\n\n\n","\n 0 && displayCardContainer\"\n :class=\"context === 'panel' ? 'items-center mx-auto' : 'items-end justify-self-center'\"\n class=\"h-full flex\"\n >\n \n
\n\n \n Source: Katie Moum via Unsplash \n \n
\n You're all caught up for now.\n \n
\n Keep exploring to discover new intel.\n
\n
\n \n Go to We\n \n \n Go to Tasks\n \n
\n
\n \n \n\n\n","import _ from \"lodash\";\nexport const todayViewSortOptions = [\n {\n name: \"Due Date\",\n apiValue: \"due_date\",\n directions: [\n { name: \"Earliest First\", apiValue: \"asc\" },\n { name: \"Latest First\", apiValue: \"desc\" },\n ],\n },\n {\n name: \"Creation Date\",\n apiValue: \"sort_date\",\n directions: [\n { name: \"Oldest First\", apiValue: \"asc\" },\n { name: \"Newest First\", apiValue: \"desc\" },\n ],\n },\n {\n name: \"Priority\",\n apiValue: \"priority\",\n directions: [\n { name: \"Highest First\", apiValue: \"asc\" },\n { name: \"Lowest First\", apiValue: \"desc\" },\n ],\n },\n {\n name: \"Title\",\n apiValue: \"name\",\n directions: [\n { name: \"Ascending\", apiValue: \"asc\" },\n { name: \"Descending\", apiValue: \"desc\" },\n ],\n },\n];\n\nexport const standaloneListSortOptions = _.concat(\n [\n {\n name: \"Manual\",\n apiValue: \"manual\",\n directions: [],\n },\n ],\n todayViewSortOptions\n);\n","\n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n
\n \n\n\n","\n \n \n\n\n","\n \n \n Subscribe to view \n \n \n \n
\n
\n
\n \n \n
\n
\n \n
\n
\n {{ displayPriority }} \n {{ task.name }} \n
\n
\n {{ task.note }}\n
\n
\n \n {{ task.taskListName }} \n ‐ {{ displayDate }} ‐ {{ displayTime }} , {{ displayRepeat?.name }} \n
\n \n Completed: {{ completedDisplayDate }}\n
\n \n
\n {{ displayDate\n }}, {{ displayRepeat?.name }} \n
\n
\n
\n
\n
\n
\n \n \n\n\n","\n \n
\n \n \n 0\">\n {{ batchTasks.length }} Selected\n \n Select Reminders \n Today \n \n \n \n\n
\n
\n
\n
\n 0\">\n {{ batchTasks.length }} Selected\n \n Select Reminders \n Today \n \n \n
\n\n
\n
\n
\n
\n \n \n
\n \n \n
\n
\n
\n\n
\n \n \n \n
\n \n\n\n","import moment from \"moment\";\nimport _ from \"lodash\";\n\nexport default function scheduleTimes() {\n const startOfToday = moment().startOf(\"day\").add(8, \"hours\");\n const effectiveToday = moment().isAfter(startOfToday)\n ? moment().add(1, \"hour\").startOf(\"minute\")\n : startOfToday;\n let times = [\n {\n name: \"Past Due\",\n importance: \"major\",\n unit: null,\n date: null,\n },\n {\n name: \"Today\",\n importance: \"major\",\n unit: \"day\",\n date: startOfToday,\n },\n {\n name: \"Tomorrow\",\n importance: \"minor\",\n unit: \"day\",\n date: moment().add(1, \"day\").startOf(\"day\").add(8, \"hours\"),\n },\n {\n name: moment()\n .add(2, \"days\")\n .startOf(\"day\")\n .add(8, \"hours\")\n .format(\"ddd MMM D\"),\n importance: \"minor\",\n unit: \"day\",\n date: moment().add(2, \"days\").startOf(\"day\").add(8, \"hours\"),\n },\n {\n name: moment()\n .add(3, \"days\")\n .startOf(\"day\")\n .add(8, \"hours\")\n .format(\"ddd MMM D\"),\n importance: \"minor\",\n unit: \"day\",\n date: moment().add(3, \"days\").startOf(\"day\").add(8, \"hours\"),\n },\n {\n name: moment()\n .add(4, \"days\")\n .startOf(\"day\")\n .add(8, \"hours\")\n .format(\"ddd MMM D\"),\n importance: \"minor\",\n unit: \"day\",\n date: moment().add(4, \"days\").startOf(\"day\").add(8, \"hours\"),\n },\n {\n name: moment()\n .add(5, \"days\")\n .startOf(\"day\")\n .add(8, \"hours\")\n .format(\"ddd MMM D\"),\n importance: \"minor\",\n unit: \"day\",\n date: moment().add(5, \"days\").startOf(\"day\").add(8, \"hours\"),\n },\n {\n name: moment()\n .add(6, \"days\")\n .startOf(\"day\")\n .add(8, \"hours\")\n .format(\"ddd MMM D\"),\n importance: \"minor\",\n unit: \"day\",\n date: moment().add(6, \"days\").startOf(\"day\").add(8, \"hours\"),\n },\n {\n name: `Rest of ${moment().add(7, \"days\").startOf(\"day\").format(\"MMMM\")}`,\n importance: \"major\",\n unit: \"month\",\n date: moment().add(7, \"days\").startOf(\"day\").add(8, \"hours\"),\n },\n ];\n const nextMonth = moment()\n .add(7, \"days\")\n .endOf(\"month\")\n .add(1, \"minute\")\n .startOf(\"day\");\n const forwardMonths = _.times(11, function (i) {\n let newMonth = nextMonth\n .clone()\n .add(i, \"months\")\n .startOf(\"day\")\n .add(8, \"hours\");\n return {\n name: newMonth.format(\"MMMM\"),\n importance: \"submajor\",\n unit: \"month\",\n date: newMonth,\n };\n });\n\n return _.concat(times, forwardMonths);\n}\n","\n \n
\n \n \n 0\">\n {{ batchTasks.length }} Selected\n \n Select Reminders \n Scheduled \n \n \n \n\n
\n
\n
\n
\n 0\">\n {{ batchTasks.length }} Selected\n \n Select Reminders \n Scheduled \n \n \n
\n\n
\n
\n
\n \n {{ timeObject.name }}\n \n \n {{ timeObject.name }}\n \n \n {{ timeObject.name }}\n \n \n \n {{ dateLabel }}\n \n \n \n \n \n \n \n \n
\n
\n
\n\n
\n
\n \n\n\n","import _ from \"lodash\";\n\nexport default function sortedTasksFor({\n signedIn,\n useStandaloneShowCompleted = false,\n standaloneShowCompleted = false,\n taskListObject,\n allTasks,\n incompleteTasks,\n}) {\n const effectiveShowCompleted = useStandaloneShowCompleted\n ? standaloneShowCompleted\n : taskListObject.showCompleted;\n\n if (signedIn) {\n if (taskListObject.sortBy === \"manual\") {\n if (effectiveShowCompleted) return _.orderBy(allTasks, [\"createdAt\"]);\n else return _.orderBy(incompleteTasks, [\"createdAt\"]);\n } else if (taskListObject.sortBy === \"priority\") {\n const sortingFunction = (task) => {\n if (taskListObject.sortDirection === \"asc\") {\n switch (task.priority) {\n case \"high\":\n return 1;\n case \"medium\":\n return 2;\n case \"low\":\n return 3;\n default:\n return 4;\n }\n } else {\n switch (task.priority) {\n case \"high\":\n return 4;\n case \"medium\":\n return 3;\n case \"low\":\n return 2;\n default:\n return 1;\n }\n }\n };\n\n if (effectiveShowCompleted) {\n return _.sortBy(allTasks, [sortingFunction]);\n } else {\n return _.sortBy(incompleteTasks, [sortingFunction]);\n }\n } else {\n if (effectiveShowCompleted)\n return _.orderBy(\n allTasks,\n [_.camelCase(taskListObject.sortBy)],\n [taskListObject.sortDirection]\n );\n else {\n return _.orderBy(\n incompleteTasks,\n [_.camelCase(taskListObject.sortBy)],\n [taskListObject.sortDirection]\n );\n }\n }\n } else {\n if (effectiveShowCompleted) return _.orderBy(allTasks, [\"id\"]);\n else return _.orderBy(incompleteTasks, [\"id\"]);\n }\n}\n","\n \n
\n \n \n 0\">\n {{ batchTasks.length }} Selected\n \n Select Reminders \n All \n \n \n \n\n
\n
\n
\n
\n 0\">\n {{ batchTasks.length }} Selected\n \n Select Reminders \n All \n \n
\n
\n {{ completedLength }} completed\n
\n
·
\n
\n \n Clear\n \n \n \n \n \n
\n
\n
\n\n
\n
0\"\n class=\"mt-2 flex-grow space-y-2\"\n >\n
\n fetchTasksFor(isVisible, entry, listObject),\n once: true,\n }\"\n role=\"list\"\n class=\"flex flex-col divide-y divide-gray-200\"\n >\n \n {{ listObject.name }}\n \n \n loadTasksFor($state, listObject)\"\n />\n \n \n \n
\n
\n\n
\n
\n \n\n\n","\n \n
\n \n \n 0\">\n {{ batchTasks.length }} Selected\n \n Select Reminders \n Nearby \n \n \n
0\n \"\n class=\"flex items-center\"\n >\n \n \n \n\n \n \n \n \n
\n Done\n \n
\n Done\n \n
\n \n\n
\n
\n
\n
\n 0\">\n {{ batchTasks.length }} Selected\n \n Select Reminders \n Nearby \n \n
\n
\n {{ completedTasks.length }} completed\n
\n
·
\n
\n \n Clear\n \n \n \n \n \n
\n
\n
\n\n
\n
\n \n \n \n Zoom in more\n \n
\n \n
\n \n
\n
0\"\n class=\"mt-2 flex-grow space-y-2\"\n >\n
\n fetchTasksFor(isVisible, entry, listObject),\n once: true,\n }\"\n role=\"list\"\n class=\"flex flex-col divide-y divide-gray-200\"\n >\n \n {{ listObject.name }}\n \n \n loadTasksFor($state, listObject)\"\n />\n \n
\n
\n \n \n \n No tasks nearby.\n \n
\n \n
\n
\n \n\n\n","\n \n
\n \n \n 0\">\n {{ batchTasks.length }} Selected\n \n Select Reminders \n Completed \n \n \n \n\n
\n
\n
\n
\n 0\">\n {{ batchTasks.length }} Selected\n \n Select Reminders \n Completed \n \n
\n
\n {{ completedLength }} completed\n
\n
·
\n
\n \n Clear\n \n \n \n \n \n
\n
\n
\n\n
\n
\n
\n \n {{ timeGroupLabel }}\n \n \n \n
\n
\n
\n\n
\n
\n \n\n\n","\n \n List \n \n
\n \n \n {{ list.name }} \n \n \n \n \n \n\n
\n \n \n \n \n \n \n {{ list.name }}\n \n
\n\n \n \n \n \n \n \n \n
\n \n \n\n\n","\n \n Priority \n \n \n {{ priority.name }} \n \n \n \n \n\n \n \n \n \n {{ priority.name }} \n\n \n \n \n \n \n \n \n
\n \n \n\n\n","\n \n Repeat \n \n \n {{ repeat.name }} \n \n \n \n \n\n \n \n \n \n {{ pattern.name }} \n\n \n \n \n \n \n \n \n
\n \n \n\n\n","\n \n End Repeat \n \n \n {{ repeatEnds.name }} \n \n \n \n \n\n \n \n \n \n {{ option.name }} \n\n \n \n \n \n \n \n \n
\n \n\n \n \n\n\n","\n \n \n \n \n
\n Timing \n \n \n \n \n \n \n\n\n","\n \n \n \n\n \n\n \n \n \n \n\n\n","\n \n \n\n \n
\n
\n {{ selectedTask ? \"Edit Task\" : \"New Task\" }}\n \n \n\n
\n \n
\n Name \n \n
\n
\n Note \n \n
\n
\n \n\n
\n Linked To \n \n \n\n
\n\n
\n \n \n\n
\n \n \n\n
\n Delete Task\n \n
\n\n \n
\n \n Cancel\n \n \n Save\n \n
\n
\n \n \n\n\n","\n \n \n\n \n
\n
\n {{ selectedTaskList?.accessTokenId ? \"Edit List\" : \"New List\" }}\n \n \n\n
\n \n \n\n
\n \n Choose a list color \n \n
\n \n {{\n color.name\n }} \n \n
\n \n
\n \n \n
\n\n \n
\n \n Cancel\n \n \n {{ selectedTaskList ? \"Done\" : \"Add\" }}\n \n
\n
\n \n \n\n\n","\n \n \n\n\n","\n \n \n\n \n
\n
Share List \n \n\n
\n
\n \n \n
\n Search by name or email address\n
\n
\n
0\" class=\"mt-2 mx-2 space-x-1 space-y-2\">\n \n {{ recipient.name }}\n \n Remove \n \n \n \n \n \n \n
\n \n
\n
\n
\n\n
0\" class=\"space-y-1\">\n
Shared With
\n
\n
\n
\n\n
\n +{{ sharingOverflow }} \n\n \n \n
\n \n \n\n \n \n \n \n
\n
\n \n \n
\n\n
1\" class=\"flex items-center\">\n \n \n \n\n \n \n \n \n
\n
\n
\n \n
\n
\n\n \n
\n \n Cancel\n \n \n Share\n \n
\n
\n \n \n\n\n","\n \n \n\n\n","\n \n
\n \n \n \n {{ batchTasks.length }} Selected\n \n \n {{ selectedTaskList.name }}\n \n \n \n \n\n
\n
\n
\n
\n \n {{ batchTasks.length }} Selected\n \n \n {{ selectedTaskList.name }}\n \n \n
\n
\n {{ complete.length }} completed\n
\n
·
\n
\n \n Clear\n \n \n \n \n \n
\n
\n
\n
\n\n
\n
\n
\n\n
\n \n \n \n
\n \n\n\n","\n \n \n\n\n","\n \n \n\n\n","\n \n \n\n\n","\n \n
\n My Lists\n \n
\n \n Add List \n \n
\n
\n \n \n\n\n\n\n","\n \n \n\n\n","\n \n \n\n\n","\n \n
\n Subscribe to view \n \n
\n
\n
\n
\n
\n
\n \n
\n
\n {{ displayPriorityFor(task) }} \n {{ task.name }} \n
\n
\n {{ task.note }}\n
\n
\n {{ displayDateFor(task)\n }}, {{ displayRepeatFor(task)?.name }} \n
\n
\n
\n
\n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n
\n
Search \n
\n
\n \n
\n
0\"\n class=\"block w-full rounded-md border border-gray-300 bg-white py-2 pl-10 pr-3 text-sm placeholder-gray-500 focus:border-indigo-500 focus:text-gray-900 focus:placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-indigo-500 sm:text-sm\"\n >\n
\n Related tasks\n \n Clear related task search \n \n \n
\n
\n
\n
\n
\n
\n
\n Cancel\n \n
\n
\n\n
\n
\n\n
\n \n {{ listFor(accessTokenId).name }}\n \n \n \n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n
\n
\n Instant Upload Mode!\n
\n
\n Upload to ...\n
\n
\n
Drop the file to upload immediately.
\n
\n You can add comments before uploading.
\n Hold shift to upload directly.
\n \n
\n
\n
\n \n
\n
Only upload files that you have permission to use. \n
\n
\n
\n
\n
\n \n\n\n","\n \n \n \n \n \n
\n \n \n \n\n\n","\n \n \n \n \n \n \n
\n \n \n\n \n \n \n \n \n \n
\n \n \n \n\n\n","\n \n \n \n \n \n \n
\n \n \n \n\n\n","\n \n
\n\n \n
\n\n \n
\n\n \n
\n\n
\n
\n \n \n \n\n \n \n
\n \n
\n
\n \n\n\n","\n \n \n \n \n\n \n \n \n \n \n\n\n","\n Sign in \n Sign up \n \n \n Open menu \n \n \n\n \n \n
\n
\n
\n
\n Tower Hunt\n \n
\n
\n
\n \n Close menu \n \n \n
\n
\n
\n
\n
\n
\n \n \n \n\n\n","\n \n \n Add Data (Earn $) \n Add Data \n \n \n\n\n","\n \n \n\n\n\n\n\n\n","\n \n
\n \n
\n
\n
\n \n
\n
\n \n \n
\n
\n
\n \n\n
\n \n \n \n \n
\n
\n \n\n\n","var numeric = function (value, unit) { return Number(value.slice(0, -1 * unit.length)); };\n\nvar parseValue = function (value) {\n if (value.endsWith('px'))\n { return { value: value, type: 'px', numeric: numeric(value, 'px') } }\n if (value.endsWith('fr'))\n { return { value: value, type: 'fr', numeric: numeric(value, 'fr') } }\n if (value.endsWith('%'))\n { return { value: value, type: '%', numeric: numeric(value, '%') } }\n if (value === 'auto') { return { value: value, type: 'auto' } }\n return null\n};\n\nvar parse = function (rule) { return rule.split(' ').map(parseValue); };\n\nvar getSizeAtTrack = function (index, tracks, gap, end) {\n if ( gap === void 0 ) { gap = 0; }\n if ( end === void 0 ) { end = false; }\n\n var newIndex = end ? index + 1 : index;\n var trackSum = tracks\n .slice(0, newIndex)\n .reduce(function (accum, value) { return accum + value.numeric; }, 0);\n var gapSum = gap ? index * gap : 0;\n\n return trackSum + gapSum\n};\n\nvar getStyles = function (rule, ownRules, matchedRules) { return ownRules.concat( matchedRules)\n .map(function (r) { return r.style[rule]; })\n .filter(function (style) { return style !== undefined && style !== ''; }); };\n\nvar getGapValue = function (unit, size) {\n if (size.endsWith(unit)) {\n return Number(size.slice(0, -1 * unit.length))\n }\n return null\n};\n\nvar firstNonZero = function (tracks) {\n // eslint-disable-next-line no-plusplus\n for (var i = 0; i < tracks.length; i++) {\n if (tracks[i].numeric > 0) {\n return i\n }\n }\n return null\n};\n\nvar NOOP = function () { return false; };\n\nvar defaultWriteStyle = function (element, gridTemplateProp, style) {\n // eslint-disable-next-line no-param-reassign\n element.style[gridTemplateProp] = style;\n};\n\nvar getOption = function (options, propName, def) {\n var value = options[propName];\n if (value !== undefined) {\n return value\n }\n return def\n};\n\nfunction getMatchedCSSRules (el) {\n var ref;\n\n return (ref = [])\n .concat.apply(\n ref, Array.from(el.ownerDocument.styleSheets).map(function (s) {\n var rules = [];\n\n try {\n rules = Array.from(s.cssRules || []);\n } catch (e) {\n // Ignore results on security error\n }\n\n return rules\n })\n )\n .filter(function (r) {\n var matches = false;\n try {\n matches = el.matches(r.selectorText);\n } catch (e) {\n // Ignore matching erros\n }\n\n return matches\n });\n}\n\nvar gridTemplatePropColumns = 'grid-template-columns';\nvar gridTemplatePropRows = 'grid-template-rows';\n\nvar Gutter = function Gutter(direction, options, parentOptions) {\n this.direction = direction;\n this.element = options.element;\n this.track = options.track;\n\n if (direction === 'column') {\n this.gridTemplateProp = gridTemplatePropColumns;\n this.gridGapProp = 'grid-column-gap';\n this.cursor = getOption(\n parentOptions,\n 'columnCursor',\n getOption(parentOptions, 'cursor', 'col-resize')\n );\n this.snapOffset = getOption(\n parentOptions,\n 'columnSnapOffset',\n getOption(parentOptions, 'snapOffset', 30)\n );\n this.dragInterval = getOption(\n parentOptions,\n 'columnDragInterval',\n getOption(parentOptions, 'dragInterval', 1)\n );\n this.clientAxis = 'clientX';\n this.optionStyle = getOption(parentOptions, 'gridTemplateColumns');\n } else if (direction === 'row') {\n this.gridTemplateProp = gridTemplatePropRows;\n this.gridGapProp = 'grid-row-gap';\n this.cursor = getOption(\n parentOptions,\n 'rowCursor',\n getOption(parentOptions, 'cursor', 'row-resize')\n );\n this.snapOffset = getOption(\n parentOptions,\n 'rowSnapOffset',\n getOption(parentOptions, 'snapOffset', 30)\n );\n this.dragInterval = getOption(\n parentOptions,\n 'rowDragInterval',\n getOption(parentOptions, 'dragInterval', 1)\n );\n this.clientAxis = 'clientY';\n this.optionStyle = getOption(parentOptions, 'gridTemplateRows');\n }\n\n this.onDragStart = getOption(parentOptions, 'onDragStart', NOOP);\n this.onDragEnd = getOption(parentOptions, 'onDragEnd', NOOP);\n this.onDrag = getOption(parentOptions, 'onDrag', NOOP);\n this.writeStyle = getOption(\n parentOptions,\n 'writeStyle',\n defaultWriteStyle\n );\n\n this.startDragging = this.startDragging.bind(this);\n this.stopDragging = this.stopDragging.bind(this);\n this.drag = this.drag.bind(this);\n\n this.minSizeStart = options.minSizeStart;\n this.minSizeEnd = options.minSizeEnd;\n\n if (options.element) {\n this.element.addEventListener('mousedown', this.startDragging);\n this.element.addEventListener('touchstart', this.startDragging);\n }\n};\n\nGutter.prototype.getDimensions = function getDimensions () {\n var ref = this.grid.getBoundingClientRect();\n var width = ref.width;\n var height = ref.height;\n var top = ref.top;\n var bottom = ref.bottom;\n var left = ref.left;\n var right = ref.right;\n\n if (this.direction === 'column') {\n this.start = top;\n this.end = bottom;\n this.size = height;\n } else if (this.direction === 'row') {\n this.start = left;\n this.end = right;\n this.size = width;\n }\n};\n\nGutter.prototype.getSizeAtTrack = function getSizeAtTrack$1 (track, end) {\n return getSizeAtTrack(\n track,\n this.computedPixels,\n this.computedGapPixels,\n end\n )\n};\n\nGutter.prototype.getSizeOfTrack = function getSizeOfTrack (track) {\n return this.computedPixels[track].numeric\n};\n\nGutter.prototype.getRawTracks = function getRawTracks () {\n var tracks = getStyles(\n this.gridTemplateProp,\n [this.grid],\n getMatchedCSSRules(this.grid)\n );\n if (!tracks.length) {\n if (this.optionStyle) { return this.optionStyle }\n\n throw Error('Unable to determine grid template tracks from styles.')\n }\n return tracks[0]\n};\n\nGutter.prototype.getGap = function getGap () {\n var gap = getStyles(\n this.gridGapProp,\n [this.grid],\n getMatchedCSSRules(this.grid)\n );\n if (!gap.length) {\n return null\n }\n return gap[0]\n};\n\nGutter.prototype.getRawComputedTracks = function getRawComputedTracks () {\n return window.getComputedStyle(this.grid)[this.gridTemplateProp]\n};\n\nGutter.prototype.getRawComputedGap = function getRawComputedGap () {\n return window.getComputedStyle(this.grid)[this.gridGapProp]\n};\n\nGutter.prototype.setTracks = function setTracks (raw) {\n this.tracks = raw.split(' ');\n this.trackValues = parse(raw);\n};\n\nGutter.prototype.setComputedTracks = function setComputedTracks (raw) {\n this.computedTracks = raw.split(' ');\n this.computedPixels = parse(raw);\n};\n\nGutter.prototype.setGap = function setGap (raw) {\n this.gap = raw;\n};\n\nGutter.prototype.setComputedGap = function setComputedGap (raw) {\n this.computedGap = raw;\n this.computedGapPixels = getGapValue('px', this.computedGap) || 0;\n};\n\nGutter.prototype.getMousePosition = function getMousePosition (e) {\n if ('touches' in e) { return e.touches[0][this.clientAxis] }\n return e[this.clientAxis]\n};\n\nGutter.prototype.startDragging = function startDragging (e) {\n if ('button' in e && e.button !== 0) {\n return\n }\n\n // Don't actually drag the element. We emulate that in the drag function.\n e.preventDefault();\n\n if (this.element) {\n this.grid = this.element.parentNode;\n } else {\n this.grid = e.target.parentNode;\n }\n\n this.getDimensions();\n this.setTracks(this.getRawTracks());\n this.setComputedTracks(this.getRawComputedTracks());\n this.setGap(this.getGap());\n this.setComputedGap(this.getRawComputedGap());\n\n var trackPercentage = this.trackValues.filter(\n function (track) { return track.type === '%'; }\n );\n var trackFr = this.trackValues.filter(function (track) { return track.type === 'fr'; });\n\n this.totalFrs = trackFr.length;\n\n if (this.totalFrs) {\n var track = firstNonZero(trackFr);\n\n if (track !== null) {\n this.frToPixels =\n this.computedPixels[track].numeric / trackFr[track].numeric;\n }\n }\n\n if (trackPercentage.length) {\n var track$1 = firstNonZero(trackPercentage);\n\n if (track$1 !== null) {\n this.percentageToPixels =\n this.computedPixels[track$1].numeric /\n trackPercentage[track$1].numeric;\n }\n }\n\n // get start of gutter track\n var gutterStart = this.getSizeAtTrack(this.track, false) + this.start;\n this.dragStartOffset = this.getMousePosition(e) - gutterStart;\n\n this.aTrack = this.track - 1;\n\n if (this.track < this.tracks.length - 1) {\n this.bTrack = this.track + 1;\n } else {\n throw Error(\n (\"Invalid track index: \" + (this.track) + \". Track must be between two other tracks and only \" + (this.tracks.length) + \" tracks were found.\")\n )\n }\n\n this.aTrackStart = this.getSizeAtTrack(this.aTrack, false) + this.start;\n this.bTrackEnd = this.getSizeAtTrack(this.bTrack, true) + this.start;\n\n // Set the dragging property of the pair object.\n this.dragging = true;\n\n // All the binding. `window` gets the stop events in case we drag out of the elements.\n window.addEventListener('mouseup', this.stopDragging);\n window.addEventListener('touchend', this.stopDragging);\n window.addEventListener('touchcancel', this.stopDragging);\n window.addEventListener('mousemove', this.drag);\n window.addEventListener('touchmove', this.drag);\n\n // Disable selection. Disable!\n this.grid.addEventListener('selectstart', NOOP);\n this.grid.addEventListener('dragstart', NOOP);\n\n this.grid.style.userSelect = 'none';\n this.grid.style.webkitUserSelect = 'none';\n this.grid.style.MozUserSelect = 'none';\n this.grid.style.pointerEvents = 'none';\n\n // Set the cursor at multiple levels\n this.grid.style.cursor = this.cursor;\n window.document.body.style.cursor = this.cursor;\n\n this.onDragStart(this.direction, this.track);\n};\n\nGutter.prototype.stopDragging = function stopDragging () {\n this.dragging = false;\n\n // Remove the stored event listeners. This is why we store them.\n this.cleanup();\n\n this.onDragEnd(this.direction, this.track);\n\n if (this.needsDestroy) {\n if (this.element) {\n this.element.removeEventListener(\n 'mousedown',\n this.startDragging\n );\n this.element.removeEventListener(\n 'touchstart',\n this.startDragging\n );\n }\n this.destroyCb();\n this.needsDestroy = false;\n this.destroyCb = null;\n }\n};\n\nGutter.prototype.drag = function drag (e) {\n var mousePosition = this.getMousePosition(e);\n\n var gutterSize = this.getSizeOfTrack(this.track);\n var minMousePosition =\n this.aTrackStart +\n this.minSizeStart +\n this.dragStartOffset +\n this.computedGapPixels;\n var maxMousePosition =\n this.bTrackEnd -\n this.minSizeEnd -\n this.computedGapPixels -\n (gutterSize - this.dragStartOffset);\n var minMousePositionOffset = minMousePosition + this.snapOffset;\n var maxMousePositionOffset = maxMousePosition - this.snapOffset;\n\n if (mousePosition < minMousePositionOffset) {\n mousePosition = minMousePosition;\n }\n\n if (mousePosition > maxMousePositionOffset) {\n mousePosition = maxMousePosition;\n }\n\n if (mousePosition < minMousePosition) {\n mousePosition = minMousePosition;\n } else if (mousePosition > maxMousePosition) {\n mousePosition = maxMousePosition;\n }\n\n var aTrackSize =\n mousePosition -\n this.aTrackStart -\n this.dragStartOffset -\n this.computedGapPixels;\n var bTrackSize =\n this.bTrackEnd -\n mousePosition +\n this.dragStartOffset -\n gutterSize -\n this.computedGapPixels;\n\n if (this.dragInterval > 1) {\n var aTrackSizeIntervaled =\n Math.round(aTrackSize / this.dragInterval) * this.dragInterval;\n bTrackSize -= aTrackSizeIntervaled - aTrackSize;\n aTrackSize = aTrackSizeIntervaled;\n }\n\n if (aTrackSize < this.minSizeStart) {\n aTrackSize = this.minSizeStart;\n }\n\n if (bTrackSize < this.minSizeEnd) {\n bTrackSize = this.minSizeEnd;\n }\n\n if (this.trackValues[this.aTrack].type === 'px') {\n this.tracks[this.aTrack] = aTrackSize + \"px\";\n } else if (this.trackValues[this.aTrack].type === 'fr') {\n if (this.totalFrs === 1) {\n this.tracks[this.aTrack] = '1fr';\n } else {\n var targetFr = aTrackSize / this.frToPixels;\n this.tracks[this.aTrack] = targetFr + \"fr\";\n }\n } else if (this.trackValues[this.aTrack].type === '%') {\n var targetPercentage = aTrackSize / this.percentageToPixels;\n this.tracks[this.aTrack] = targetPercentage + \"%\";\n }\n\n if (this.trackValues[this.bTrack].type === 'px') {\n this.tracks[this.bTrack] = bTrackSize + \"px\";\n } else if (this.trackValues[this.bTrack].type === 'fr') {\n if (this.totalFrs === 1) {\n this.tracks[this.bTrack] = '1fr';\n } else {\n var targetFr$1 = bTrackSize / this.frToPixels;\n this.tracks[this.bTrack] = targetFr$1 + \"fr\";\n }\n } else if (this.trackValues[this.bTrack].type === '%') {\n var targetPercentage$1 = bTrackSize / this.percentageToPixels;\n this.tracks[this.bTrack] = targetPercentage$1 + \"%\";\n }\n\n var style = this.tracks.join(' ');\n this.writeStyle(this.grid, this.gridTemplateProp, style);\n this.onDrag(this.direction, this.track, style);\n};\n\nGutter.prototype.cleanup = function cleanup () {\n window.removeEventListener('mouseup', this.stopDragging);\n window.removeEventListener('touchend', this.stopDragging);\n window.removeEventListener('touchcancel', this.stopDragging);\n window.removeEventListener('mousemove', this.drag);\n window.removeEventListener('touchmove', this.drag);\n\n if (this.grid) {\n this.grid.removeEventListener('selectstart', NOOP);\n this.grid.removeEventListener('dragstart', NOOP);\n\n this.grid.style.userSelect = '';\n this.grid.style.webkitUserSelect = '';\n this.grid.style.MozUserSelect = '';\n this.grid.style.pointerEvents = '';\n\n this.grid.style.cursor = '';\n }\n\n window.document.body.style.cursor = '';\n};\n\nGutter.prototype.destroy = function destroy (immediate, cb) {\n if ( immediate === void 0 ) immediate = true;\n\n if (immediate || this.dragging === false) {\n this.cleanup();\n if (this.element) {\n this.element.removeEventListener(\n 'mousedown',\n this.startDragging\n );\n this.element.removeEventListener(\n 'touchstart',\n this.startDragging\n );\n }\n\n if (cb) {\n cb();\n }\n } else {\n this.needsDestroy = true;\n if (cb) {\n this.destroyCb = cb;\n }\n }\n};\n\nvar getTrackOption = function (options, track, defaultValue) {\n if (track in options) {\n return options[track]\n }\n\n return defaultValue\n};\n\nvar createGutter = function (direction, options) { return function (gutterOptions) {\n if (gutterOptions.track < 1) {\n throw Error(\n (\"Invalid track index: \" + (gutterOptions.track) + \". Track must be between two other tracks.\")\n )\n }\n\n var trackMinSizes =\n direction === 'column'\n ? options.columnMinSizes || {}\n : options.rowMinSizes || {};\n var trackMinSize = direction === 'column' ? 'columnMinSize' : 'rowMinSize';\n\n return new Gutter(\n direction,\n Object.assign({}, {minSizeStart: getTrackOption(\n trackMinSizes,\n gutterOptions.track - 1,\n getOption(\n options,\n trackMinSize,\n getOption(options, 'minSize', 0)\n )\n ),\n minSizeEnd: getTrackOption(\n trackMinSizes,\n gutterOptions.track + 1,\n getOption(\n options,\n trackMinSize,\n getOption(options, 'minSize', 0)\n )\n )},\n gutterOptions),\n options\n )\n}; };\n\nvar Grid = function Grid(options) {\n var this$1 = this;\n\n this.columnGutters = {};\n this.rowGutters = {};\n\n this.options = Object.assign({}, {columnGutters: options.columnGutters || [],\n rowGutters: options.rowGutters || [],\n columnMinSizes: options.columnMinSizes || {},\n rowMinSizes: options.rowMinSizes || {}},\n options);\n\n this.options.columnGutters.forEach(function (gutterOptions) {\n this$1.columnGutters[gutterOptions.track] = createGutter(\n 'column',\n this$1.options\n )(gutterOptions);\n });\n\n this.options.rowGutters.forEach(function (gutterOptions) {\n this$1.rowGutters[gutterOptions.track] = createGutter(\n 'row',\n this$1.options\n )(gutterOptions);\n });\n};\n\nGrid.prototype.addColumnGutter = function addColumnGutter (element, track) {\n if (this.columnGutters[track]) {\n this.columnGutters[track].destroy();\n }\n\n this.columnGutters[track] = createGutter(\n 'column',\n this.options\n )({\n element: element,\n track: track,\n });\n};\n\nGrid.prototype.addRowGutter = function addRowGutter (element, track) {\n if (this.rowGutters[track]) {\n this.rowGutters[track].destroy();\n }\n\n this.rowGutters[track] = createGutter(\n 'row',\n this.options\n )({\n element: element,\n track: track,\n });\n};\n\nGrid.prototype.removeColumnGutter = function removeColumnGutter (track, immediate) {\n var this$1 = this;\n if ( immediate === void 0 ) immediate = true;\n\n if (this.columnGutters[track]) {\n this.columnGutters[track].destroy(immediate, function () {\n delete this$1.columnGutters[track];\n });\n }\n};\n\nGrid.prototype.removeRowGutter = function removeRowGutter (track, immediate) {\n var this$1 = this;\n if ( immediate === void 0 ) immediate = true;\n\n if (this.rowGutters[track]) {\n this.rowGutters[track].destroy(immediate, function () {\n delete this$1.rowGutters[track];\n });\n }\n};\n\nGrid.prototype.handleDragStart = function handleDragStart (e, direction, track) {\n if (direction === 'column') {\n if (this.columnGutters[track]) {\n this.columnGutters[track].destroy();\n }\n\n this.columnGutters[track] = createGutter(\n 'column',\n this.options\n )({\n track: track,\n });\n this.columnGutters[track].startDragging(e);\n } else if (direction === 'row') {\n if (this.rowGutters[track]) {\n this.rowGutters[track].destroy();\n }\n\n this.rowGutters[track] = createGutter(\n 'row',\n this.options\n )({\n track: track,\n });\n this.rowGutters[track].startDragging(e);\n }\n};\n\nGrid.prototype.destroy = function destroy (immediate) {\n var this$1 = this;\n if ( immediate === void 0 ) immediate = true;\n\n Object.keys(this.columnGutters).forEach(function (track) { return this$1.columnGutters[track].destroy(immediate, function () {\n delete this$1.columnGutters[track];\n }); }\n );\n Object.keys(this.rowGutters).forEach(function (track) { return this$1.rowGutters[track].destroy(immediate, function () {\n delete this$1.rowGutters[track];\n }); }\n );\n};\n\nfunction index (options) { return new Grid(options); }\n\nexport default index;\n","\n \n
\n Switch to vertical split layout \n \n \n \n \n \n
\n Switch to horizontal split layout \n \n \n \n \n \n
\n Switch to full-screen layout \n \n \n \n \n
\n \n\n\n","import { ref } from \"vue\";\nimport { defineStore, acceptHMRUpdate } from \"pinia\";\nimport _ from \"lodash\";\n\nexport const useTasksChannelStore = defineStore(\"tasksChannel\", () => {\n const TasksChannel = ref(null);\n const tasksChannelDataQueue = ref([]);\n\n function pushAndTrim(data) {\n tasksChannelDataQueue.value.push(data);\n tasksChannelDataQueue.value = _.takeRight(tasksChannelDataQueue.value, 3);\n }\n\n return {\n TasksChannel,\n tasksChannelDataQueue,\n pushAndTrim,\n };\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept(\n acceptHMRUpdate(useTasksChannelStore, import.meta.hot)\n );\n}\n","\n \n
\n
\n
\n \n \n
\n Reset your password\n \n
\n
\n \n \n\n \n
\n \n \n \n \n \n Reset password\n \n
\n \n
\n
\n \n\n\n","\n \n
\n
\n
\n \n \n
\n Join {{ teamInvitation.teamName }}\n \n
\n Sign up for an account\n \n
\n Already registered?\n \n Sign in\n \n to your account.\n
\n
\n\n
\n
\n \n
\n Your name\n \n
\n \n
\n
\n\n \n
\n Email address\n \n
\n \n
\n
\n\n \n
\n Password\n \n
\n \n
\n
\n\n \n By clicking Join, you agree to the\n Terms of Service .\n \n\n \n \n Join\n \n
\n \n
\n
\n
\n \n\n\n","\n \n
\n
\n
\n \n \n
\n Sign in to your account\n \n
\n Or\n \n sign up\n \n
\n
\n
\n \n \n\n \n\n \n
\n \n \n \n \n \n Sign in\n \n
\n \n
\n
\n \n\n\n","\n \n \n \n \n \n \n
\n \n \n\n\n","\n \n
\n
\n
\n
\n Setup Personal Payouts\n \n
\n
\n
\n This one-time onboarding process allows you to receive payouts to\n a personal account. Once complete, you'll be able to earn revenue\n across the platform.\n
\n
\n
\n
\n
\n
\n
\n
\n \n\n\n","\n \n
\n Personal Payouts Dashboard\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n Your payout account is active.\n
\n
\n
\n
\n
\n Tower Hunt partners with\n Stripe \n to manage payments and payouts. Use the button below to visit your\n personal dashboard.\n
\n
\n
\n \n \n Payout settings\n \n \n
\n
\n
\n \n\n\n","\n \n
Change email \n
\n
Replace the email address on your account.
\n
\n
\n \n Email \n \n
\n \n \n Cancel\n \n \n Submit\n \n
\n \n
\n \n\n\n","\n \n \n \n \n\n \n \n
\n \n Account type:\n \n
\n
\n
\n
\n
\n
\n \n \n \n\n\n","\n \n \n \n \n\n\n","\n \n
\n Shared Payout Accounts\n \n
\n Payout accounts that can be connected to a\n team , allowing\n multiple users to pool earnings. Tower Hunt partners with\n Stripe \n to manage payments and payouts.\n
\n
0\" class=\"flow-root mt-6\">\n
\n
\n
\n
\n \n\n\n","\n \n
Identity verification \n
\n
Masquerading admins not allowed.
\n
To continue, first verify it's you.
\n
\n
\n \n Password \n \n
\n \n \n Cancel\n \n \n Submit\n \n
\n \n
\n \n\n\n","\n \n
Change name \n
\n
\n \n Name \n \n
\n \n \n Cancel\n \n \n Submit\n \n
\n \n
\n \n\n\n","\n \n \n Weekly News update \n \n \n \n \n \n \n \n\n\n","\n \n \n Your Tower Hunt Plan\n \n \n Pricing plans \n \n
\n \n \n \n \n \n {{ plan.name }} \n \n \n {{ plan.price }} \n \n {{ plan.description }} \n
\n \n
\n \n \n \n Save\n \n
\n \n \n\n\n","\n \n
\n
\n \n
\n
\n
Team billing \n
\n
\n {{ subsidizingTeam.name }} is paying for your use of Tower Hunt.\n
\n
\n
\n
\n \n View teams\n \n
\n
\n
\n
\n
\n \n\n\n","\n \n \n Add a payout account \n \n \n
\n
\n
\n
\n {{ selectedAccountLabel }}\n
\n
\n
\n \n Choose account \n \n \n \n \n \n \n
\n \n\n\n","\n \n
\n
\n Personal Info\n \n
Manage your contact info.
\n
\n \n \n \n
Name \n \n {{ currentUser.name }} \n \n \n Update\n \n \n \n \n \n \n \n
Email \n \n {{\n currentUser.email\n }} \n \n \n Update\n \n \n \n \n \n \n
\n\n
\n\n
\n
\n
\n Spending on Tower Hunt\n \n
\n Manage your payment method(s) and spending.\n
\n
\n
\n
\n
\n\n
\n\n
\n
\n
\n Earning on Tower Hunt\n \n
\n Manage your Tower Hunt earnings across personal and shared payout\n accounts.\n
\n
\n
\n
\n
\n
\n
\n Default Payout Account\n \n
\n Designate where future earnings will flow by default. You can change\n this on a case-by-case basis in\n My Contributions .\n
\n
\n
\n
\n
\n
\n
\n \n\n\n","\n \n \n \n \n \n \n
\n \n \n\n\n","\n \n
\n
0\"\n class=\"flex-shrink-0 px-3 py-4 self-start sticky top-0 rounded-lg border border-gray-200 shadow-lg\"\n >\n
\n In this article\n
\n
\n \n \n {{ el.innerText }}\n \n \n \n
\n
\n \n\n\n\n\n","\n \n \n\n\n","\n \n
\n \n \n \n {{ subcategory.name }}\n \n \n
\n
\n \n\n\n","\n \n
\n
\n {{ category.shortName || category.name }}\n \n \n
\n
\n \n\n\n","\n \n \n \n \n
\n\n 0\"\n static\n class=\"max-h-72 scroll-py-2 overflow-y-auto py-2 text-sm text-gray-800\"\n >\n \n \n {{ article.name }}\n \n \n \n\n \n Sorry! We looked everywhere, but could not find {{ helpQuery }}. 💔 🔍\n
\n \n \n\n\n","\n \n
\n
Find answers quickly \n
\n \n
\n
\n
\n
\n \n
Explore help topics \n \n
\n
\n
\n
\n \n
Help categories \n \n
\n
\n
\n\n \n \n
\n \n\n\n","\n \n \n\n \n \n Tower Hunt updates and changes\n
\n \n \n \n \n\n\n","\n \n \n
\n\n \n \n \n \n {{ _.truncate(validationContextMetaData?.summary, { length: 50 }) }} \n \n {{ fieldDecoratingType }}\n
\n \n \n \n \n
\n \n \n
\n {{ fieldType }} ·\n {{ moment(field?.createdAt).format(\"MM/DD/YYYY, h:mm a\") }}\n
\n
\n \n \n {{ field.latestChangeGroupId }} \n \n \n \n
\n
\n \n Share \n \n \n \n Share \n \n \n \n
\n Share \n \n \n \n \n \n\n
\n\n
\n +{{ sharingOverflow }} \n\n \n \n
\n \n \n\n \n \n \n \n
\n
\n \n \n
\n\n
1\" class=\"flex items-center\">\n \n \n \n\n \n \n \n \n
\n \n \n \n\n\n","\n \n \n \n \n \n
\n
\n
\n Showing\n {{ \" \" }}\n {{ paginationMeta.from }} \n {{ \" \" }}\n to\n {{ \" \" }}\n {{ paginationMeta.to }} \n {{ \" \" }}\n of\n {{ \" \" }}\n {{ paginationMeta.count }} \n {{ \" \" }}\n results\n
\n
\n
\n
\n \n \n \n \n\n\n","\n \n
\n
\n
\n My Safezone\n \n
\n This data is only visible to you and the people you share it with.\n
\n
\n
\n \n \n
\n
\n
0\" class=\"-my-2 -mx-4 overflow-x-auto\">\n
\n
\n \n
0\"\n class=\"absolute top-0 left-12 flex h-12 items-center space-x-3 bg-gray-50\"\n >\n
\n \n Declassify \n \n
\n Share\n \n
\n \n Bulk unlock: ${{ currencyAmount(batchPrice, 2) }} \n \n
\n\n
\n
\n
\n
\n
\n
\n
No data \n
\n Your safezone intel will appear here.\n
\n
\n
\n
\n \n\n\n","/**\n* plotly.js v2.35.3\n* Copyright 2012-2024, Plotly, Inc.\n* All rights reserved.\n* Licensed under the MIT license\n*/\n/*! For license information please see plotly.min.js.LICENSE.txt */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.Plotly=e():t.Plotly=e()}(self,(function(){return function(){var t={6713:function(t,e,r){\"use strict\";var n=r(34809),i={\"X,X div\":'direction:ltr;font-family:\"Open Sans\",verdana,arial,sans-serif;margin:0;padding:0;',\"X input,X button\":'font-family:\"Open Sans\",verdana,arial,sans-serif;',\"X input:focus,X button:focus\":\"outline:none;\",\"X a\":\"text-decoration:none;\",\"X a:hover\":\"text-decoration:none;\",\"X .crisp\":\"shape-rendering:crispEdges;\",\"X .user-select-none\":\"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;\",\"X svg\":\"overflow:hidden;\",\"X svg a\":\"fill:#447adb;\",\"X svg a:hover\":\"fill:#3c6dc5;\",\"X .main-svg\":\"position:absolute;top:0;left:0;pointer-events:none;\",\"X .main-svg .draglayer\":\"pointer-events:all;\",\"X .cursor-default\":\"cursor:default;\",\"X .cursor-pointer\":\"cursor:pointer;\",\"X .cursor-crosshair\":\"cursor:crosshair;\",\"X .cursor-move\":\"cursor:move;\",\"X .cursor-col-resize\":\"cursor:col-resize;\",\"X .cursor-row-resize\":\"cursor:row-resize;\",\"X .cursor-ns-resize\":\"cursor:ns-resize;\",\"X .cursor-ew-resize\":\"cursor:ew-resize;\",\"X .cursor-sw-resize\":\"cursor:sw-resize;\",\"X .cursor-s-resize\":\"cursor:s-resize;\",\"X .cursor-se-resize\":\"cursor:se-resize;\",\"X .cursor-w-resize\":\"cursor:w-resize;\",\"X .cursor-e-resize\":\"cursor:e-resize;\",\"X .cursor-nw-resize\":\"cursor:nw-resize;\",\"X .cursor-n-resize\":\"cursor:n-resize;\",\"X .cursor-ne-resize\":\"cursor:ne-resize;\",\"X .cursor-grab\":\"cursor:-webkit-grab;cursor:grab;\",\"X .modebar\":\"position:absolute;top:2px;right:2px;\",\"X .ease-bg\":\"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;\",\"X .modebar--hover>:not(.watermark)\":\"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;\",\"X:hover .modebar--hover .modebar-group\":\"opacity:1;\",\"X .modebar-group\":\"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;\",\"X .modebar-btn\":\"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;\",\"X .modebar-btn svg\":\"position:relative;top:2px;\",\"X .modebar.vertical\":\"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;\",\"X .modebar.vertical svg\":\"top:-1px;\",\"X .modebar.vertical .modebar-group\":\"display:block;float:none;padding-left:0px;padding-bottom:8px;\",\"X .modebar.vertical .modebar-group .modebar-btn\":\"display:block;text-align:center;\",\"X [data-title]:before,X [data-title]:after\":\"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;\",\"X [data-title]:hover:before,X [data-title]:hover:after\":\"display:block;opacity:1;\",\"X [data-title]:before\":'content:\"\";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',\"X [data-title]:after\":\"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;\",\"X .vertical [data-title]:before,X .vertical [data-title]:after\":\"top:0%;right:200%;\",\"X .vertical [data-title]:before\":\"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;\",Y:'font-family:\"Open Sans\",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',\"Y p\":\"margin:0;\",\"Y .notifier-note\":\"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;\",\"Y .notifier-close\":\"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;\",\"Y .notifier-close:hover\":\"color:#444;text-decoration:none;cursor:pointer;\"};for(var a in i){var o=a.replace(/^,/,\" ,\").replace(/X/g,\".js-plotly-plot .plotly\").replace(/Y/g,\".plotly-notifier\");n.addStyleRule(o,i[a])}},14187:function(t,e,r){\"use strict\";t.exports=r(47908)},20273:function(t,e,r){\"use strict\";t.exports=r(58218)},6457:function(t,e,r){\"use strict\";t.exports=r(89362)},15849:function(t,e,r){\"use strict\";t.exports=r(53794)},38847:function(t,e,r){\"use strict\";t.exports=r(29698)},7659:function(t,e,r){\"use strict\";t.exports=r(51252)},60089:function(t,e,r){\"use strict\";t.exports=r(48050)},22084:function(t,e,r){\"use strict\";t.exports=r(58075)},35892:function(t,e,r){\"use strict\";t.exports=r(9419)},81204:function(t,e,r){\"use strict\";t.exports=r(28128)},55857:function(t,e,r){\"use strict\";t.exports=r(47050)},12862:function(t,e,r){\"use strict\";t.exports=r(91405)},97629:function(t,e,r){\"use strict\";t.exports=r(34406)},67549:function(t,e,r){\"use strict\";t.exports=r(17430)},2660:function(t,e,r){\"use strict\";t.exports=r(91995)},86071:function(t,e,r){\"use strict\";t.exports=r(81264)},66200:function(t,e,r){\"use strict\";t.exports=r(42849)},53446:function(t,e,r){\"use strict\";t.exports=r(52213)},86899:function(t,e,r){\"use strict\";t.exports=r(91132)},13430:function(t,e,r){\"use strict\";t.exports=r(50453)},21548:function(t,e,r){\"use strict\";t.exports=r(29251)},53939:function(t,e,r){\"use strict\";t.exports=r(72892)},1902:function(t,e,r){\"use strict\";t.exports=r(74461)},29096:function(t,e,r){\"use strict\";t.exports=r(66143)},23820:function(t,e,r){\"use strict\";t.exports=r(81955)},82017:function(t,e,r){\"use strict\";t.exports=r(36858)},113:function(t,e,r){\"use strict\";t.exports=r(92106)},20260:function(t,e,r){\"use strict\";var n=r(67549);n.register([r(20273),r(15849),r(21548),r(1902),r(29096),r(23820),r(12862),r(1639),r(10067),r(53446),r(31014),r(113),r(78170),r(8202),r(92382),r(82017),r(86899),r(54357),r(66903),r(90594),r(71680),r(7412),r(55857),r(784),r(74221),r(22084),r(44001),r(97281),r(12345),r(53939),r(29117),r(5410),r(5057),r(81204),r(86071),r(14226),r(35892),r(2660),r(96599),r(28573),r(76832),r(60089),r(51469),r(97629),r(27700),r(7659),r(11780),r(27195),r(6457),r(84639),r(14187),r(66200),r(13430),r(90590),r(38847)]),t.exports=n},28573:function(t,e,r){\"use strict\";t.exports=r(25638)},90594:function(t,e,r){\"use strict\";t.exports=r(75297)},7412:function(t,e,r){\"use strict\";t.exports=r(58859)},27700:function(t,e,r){\"use strict\";t.exports=r(12683)},5410:function(t,e,r){\"use strict\";t.exports=r(6305)},29117:function(t,e,r){\"use strict\";t.exports=r(83910)},78170:function(t,e,r){\"use strict\";t.exports=r(49913)},12345:function(t,e,r){\"use strict\";t.exports=r(15186)},96599:function(t,e,r){\"use strict\";t.exports=r(71760)},54357:function(t,e,r){\"use strict\";t.exports=r(17822)},51469:function(t,e,r){\"use strict\";t.exports=r(56534)},74221:function(t,e,r){\"use strict\";t.exports=r(18070)},44001:function(t,e,r){\"use strict\";t.exports=r(52378)},14226:function(t,e,r){\"use strict\";t.exports=r(30929)},5057:function(t,e,r){\"use strict\";t.exports=r(83866)},11780:function(t,e,r){\"use strict\";t.exports=r(66939)},27195:function(t,e,r){\"use strict\";t.exports=r(23748)},84639:function(t,e,r){\"use strict\";t.exports=r(73304)},1639:function(t,e,r){\"use strict\";t.exports=r(12864)},90590:function(t,e,r){\"use strict\";t.exports=r(99855)},97281:function(t,e,r){\"use strict\";t.exports=r(91450)},784:function(t,e,r){\"use strict\";t.exports=r(51943)},8202:function(t,e,r){\"use strict\";t.exports=r(80809)},66903:function(t,e,r){\"use strict\";t.exports=r(95984)},76832:function(t,e,r){\"use strict\";t.exports=r(51671)},92382:function(t,e,r){\"use strict\";t.exports=r(47181)},10067:function(t,e,r){\"use strict\";t.exports=r(37276)},71680:function(t,e,r){\"use strict\";t.exports=r(75703)},31014:function(t,e,r){\"use strict\";t.exports=r(38261)},11645:function(t){\"use strict\";t.exports=[{path:\"\",backoff:0},{path:\"M-2.4,-3V3L0.6,0Z\",backoff:.6},{path:\"M-3.7,-2.5V2.5L1.3,0Z\",backoff:1.3},{path:\"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z\",backoff:1.55},{path:\"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z\",backoff:1.6},{path:\"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z\",backoff:2},{path:\"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z\",backoff:0,noRotate:!0},{path:\"M2,2V-2H-2V2Z\",backoff:0,noRotate:!0}]},50222:function(t,e,r){\"use strict\";var n=r(11645),i=r(80337),a=r(54826),o=r(78032).templatedArray;r(35081),t.exports=o(\"annotation\",{visible:{valType:\"boolean\",dflt:!0,editType:\"calc+arraydraw\"},text:{valType:\"string\",editType:\"calc+arraydraw\"},textangle:{valType:\"angle\",dflt:0,editType:\"calc+arraydraw\"},font:i({editType:\"calc+arraydraw\",colorEditType:\"arraydraw\"}),width:{valType:\"number\",min:1,dflt:null,editType:\"calc+arraydraw\"},height:{valType:\"number\",min:1,dflt:null,editType:\"calc+arraydraw\"},opacity:{valType:\"number\",min:0,max:1,dflt:1,editType:\"arraydraw\"},align:{valType:\"enumerated\",values:[\"left\",\"center\",\"right\"],dflt:\"center\",editType:\"arraydraw\"},valign:{valType:\"enumerated\",values:[\"top\",\"middle\",\"bottom\"],dflt:\"middle\",editType:\"arraydraw\"},bgcolor:{valType:\"color\",dflt:\"rgba(0,0,0,0)\",editType:\"arraydraw\"},bordercolor:{valType:\"color\",dflt:\"rgba(0,0,0,0)\",editType:\"arraydraw\"},borderpad:{valType:\"number\",min:0,dflt:1,editType:\"calc+arraydraw\"},borderwidth:{valType:\"number\",min:0,dflt:1,editType:\"calc+arraydraw\"},showarrow:{valType:\"boolean\",dflt:!0,editType:\"calc+arraydraw\"},arrowcolor:{valType:\"color\",editType:\"arraydraw\"},arrowhead:{valType:\"integer\",min:0,max:n.length,dflt:1,editType:\"arraydraw\"},startarrowhead:{valType:\"integer\",min:0,max:n.length,dflt:1,editType:\"arraydraw\"},arrowside:{valType:\"flaglist\",flags:[\"end\",\"start\"],extras:[\"none\"],dflt:\"end\",editType:\"arraydraw\"},arrowsize:{valType:\"number\",min:.3,dflt:1,editType:\"calc+arraydraw\"},startarrowsize:{valType:\"number\",min:.3,dflt:1,editType:\"calc+arraydraw\"},arrowwidth:{valType:\"number\",min:.1,editType:\"calc+arraydraw\"},standoff:{valType:\"number\",min:0,dflt:0,editType:\"calc+arraydraw\"},startstandoff:{valType:\"number\",min:0,dflt:0,editType:\"calc+arraydraw\"},ax:{valType:\"any\",editType:\"calc+arraydraw\"},ay:{valType:\"any\",editType:\"calc+arraydraw\"},axref:{valType:\"enumerated\",dflt:\"pixel\",values:[\"pixel\",a.idRegex.x.toString()],editType:\"calc\"},ayref:{valType:\"enumerated\",dflt:\"pixel\",values:[\"pixel\",a.idRegex.y.toString()],editType:\"calc\"},xref:{valType:\"enumerated\",values:[\"paper\",a.idRegex.x.toString()],editType:\"calc\"},x:{valType:\"any\",editType:\"calc+arraydraw\"},xanchor:{valType:\"enumerated\",values:[\"auto\",\"left\",\"center\",\"right\"],dflt:\"auto\",editType:\"calc+arraydraw\"},xshift:{valType:\"number\",dflt:0,editType:\"calc+arraydraw\"},yref:{valType:\"enumerated\",values:[\"paper\",a.idRegex.y.toString()],editType:\"calc\"},y:{valType:\"any\",editType:\"calc+arraydraw\"},yanchor:{valType:\"enumerated\",values:[\"auto\",\"top\",\"middle\",\"bottom\"],dflt:\"auto\",editType:\"calc+arraydraw\"},yshift:{valType:\"number\",dflt:0,editType:\"calc+arraydraw\"},clicktoshow:{valType:\"enumerated\",values:[!1,\"onoff\",\"onout\"],dflt:!1,editType:\"arraydraw\"},xclick:{valType:\"any\",editType:\"arraydraw\"},yclick:{valType:\"any\",editType:\"arraydraw\"},hovertext:{valType:\"string\",editType:\"arraydraw\"},hoverlabel:{bgcolor:{valType:\"color\",editType:\"arraydraw\"},bordercolor:{valType:\"color\",editType:\"arraydraw\"},font:i({editType:\"arraydraw\"}),editType:\"arraydraw\"},captureevents:{valType:\"boolean\",editType:\"arraydraw\"},editType:\"calc\",_deprecated:{ref:{valType:\"string\",editType:\"calc\"}}})},60317:function(t,e,r){\"use strict\";var n=r(34809),i=r(29714),a=r(3377).draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),a=i.getRefType(e.xref),o=i.getRefType(e.yref);e._extremes={},\"range\"===a&&s(e,r),\"range\"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t[\"a\"+a],l=t[a+\"ref\"],c=t[\"a\"+a+\"ref\"],u=t[\"_\"+a+\"padplus\"],h=t[\"_\"+a+\"padminus\"],f={x:1,y:-1}[a]*t[a+\"shift\"],p=3*t.arrowsize*t.arrowwidth||0,d=p+f,m=p-f,g=3*t.startarrowsize*t.arrowwidth||0,y=g+f,v=g-f;if(c===l){var x=i.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),_=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,y),ppadminus:Math.max(h,v)});r={min:[x.min[0],_.min[0]],max:[x.max[0],_.max[0]]}}else y=s?y+s:y,v=s?v-s:v,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,d,y),ppadminus:Math.max(h,m,v)});t._extremes[n]=r}t.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},6035:function(t,e,r){\"use strict\";var n=r(34809),i=r(33626),a=r(78032).arrayEditor;function o(t,e){var r,n,i,a,o,l,c,u=t._fullLayout.annotations,h=[],f=[],p=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),h={},f=t._fullLayout.annotations;if(c.length||u.length){for(r=0;r2/3?\"right\":\"center\"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,Y=[\"x\",\"y\"],X=0;X1)&&(nt===rt?((pt=it.r2fraction(e[\"a\"+et]))<0||pt>1)&&(W=!0):W=!0),$=it._offset+it.r2p(e[et]),Q=.5}else{var dt=\"domain\"===ft;\"x\"===et?(K=e[et],$=dt?it._offset+it._length*K:$=T.l+T.w*K):(K=1-e[et],$=dt?it._offset+it._length*K:$=T.t+T.h*K),Q=e.showarrow?.5:K}if(e.showarrow){ht.head=$;var mt=e[\"a\"+et];if(tt=ot*H(.5,e.xanchor)-st*H(.5,e.yanchor),nt===rt){var gt=l.getRefType(nt);\"domain\"===gt?(\"y\"===et&&(mt=1-mt),ht.tail=it._offset+it._length*mt):\"paper\"===gt?\"y\"===et?(mt=1-mt,ht.tail=T.t+T.h*mt):ht.tail=T.l+T.w*mt:ht.tail=it._offset+it.r2p(mt),J=tt}else ht.tail=$+mt,J=tt+mt;ht.text=ht.tail+tt;var yt=w[\"x\"===et?\"width\":\"height\"];if(\"paper\"===rt&&(ht.head=o.constrain(ht.head,1,yt-1)),\"pixel\"===nt){var vt=-Math.max(ht.tail-3,ht.text),xt=Math.min(ht.tail+3,ht.text)-yt;vt>0?(ht.tail+=vt,ht.text+=vt):xt>0&&(ht.tail-=xt,ht.text-=xt)}ht.tail+=ut,ht.head+=ut}else J=tt=lt*H(Q,ct),ht.text=$+tt;ht.text+=ut,tt+=ut,J+=ut,e[\"_\"+et+\"padplus\"]=lt/2+J,e[\"_\"+et+\"padminus\"]=lt/2-J,e[\"_\"+et+\"size\"]=lt,e[\"_\"+et+\"shift\"]=tt}if(W)R.remove();else{var _t=0,bt=0;if(\"left\"!==e.align&&(_t=(A-_)*(\"center\"===e.align?.5:1)),\"top\"!==e.valign&&(bt=(D-b)*(\"middle\"===e.valign?.5:1)),h)n.select(\"svg\").attr({x:N+_t-1,y:N+bt}).call(u.setClipUrl,U?C:null,t);else{var wt=N+bt-m.top,Tt=N+_t-m.left;G.call(f.positionText,Tt,wt).call(u.setClipUrl,U?C:null,t)}V.select(\"rect\").call(u.setRect,N,N,A,D),j.call(u.setRect,F/2,F/2,B-F,q-F),R.call(u.setTranslate,Math.round(L.x.text-B/2),Math.round(L.y.text-q/2)),z.attr({transform:\"rotate(\"+I+\",\"+L.x.text+\",\"+L.y.text+\")\"});var kt,At=function(r,n){P.selectAll(\".annotation-arrow-g\").remove();var l=L.x.head,h=L.y.head,f=L.x.tail+r,p=L.y.tail+n,m=L.x.text+r,_=L.y.text+n,b=o.rotationXYMatrix(I,m,_),w=o.apply2DTransform(b),A=o.apply2DTransform2(b),C=+j.attr(\"width\"),O=+j.attr(\"height\"),D=m-.5*C,F=D+C,B=_-.5*O,N=B+O,U=[[D,B,D,N],[D,N,F,N],[F,N,F,B],[F,B,D,B]].map(A);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,h,l+1e6,h+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(f,p,l,h,t[0],t[1],t[2],t[3]);e&&(f=e.x,p=e.y)}));var V=e.arrowwidth,q=e.arrowcolor,H=e.arrowside,G=P.append(\"g\").style({opacity:c.opacity(q)}).classed(\"annotation-arrow-g\",!0),Z=G.append(\"path\").attr(\"d\",\"M\"+f+\",\"+p+\"L\"+l+\",\"+h).style(\"stroke-width\",V+\"px\").call(c.stroke,c.rgb(q));if(g(Z,H,e),k.annotationPosition&&Z.node().parentNode&&!a){var W=l,Y=h;if(e.standoff){var X=Math.sqrt(Math.pow(l-f,2)+Math.pow(h-p,2));W+=e.standoff*(f-l)/X,Y+=e.standoff*(p-h)/X}var $,J,K=G.append(\"path\").classed(\"annotation-arrow\",!0).classed(\"anndrag\",!0).classed(\"cursor-move\",!0).attr({d:\"M3,3H-3V-3H3ZM0,0L\"+(f-W)+\",\"+(p-Y),transform:s(W,Y)}).style(\"stroke-width\",V+6+\"px\").call(c.stroke,\"rgba(0,0,0,0)\").call(c.fill,\"rgba(0,0,0,0)\");d.init({element:K.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);$=t.x,J=t.y,y&&y.autorange&&M(y._name+\".autorange\",!0),x&&x.autorange&&M(x._name+\".autorange\",!0)},moveFn:function(t,r){var n=w($,J),i=n[0]+t,a=n[1]+r;R.call(u.setTranslate,i,a),S(\"x\",v(y,t,\"x\",T,e)),S(\"y\",v(x,r,\"y\",T,e)),e.axref===e.xref&&S(\"ax\",v(y,t,\"ax\",T,e)),e.ayref===e.yref&&S(\"ay\",v(x,r,\"ay\",T,e)),G.attr(\"transform\",s(t,r)),z.attr({transform:\"rotate(\"+I+\",\"+i+\",\"+a+\")\"})},doneFn:function(){i.call(\"_guiRelayout\",t,E());var e=document.querySelector(\".js-notes-box-panel\");e&&e.redraw(e.selectedObj)}})}}};e.showarrow&&At(0,0),O&&d.init({element:R.node(),gd:t,prepFn:function(){kt=z.attr(\"transform\")},moveFn:function(t,r){var n=\"pointer\";if(e.showarrow)e.axref===e.xref?S(\"ax\",v(y,t,\"ax\",T,e)):S(\"ax\",e.ax+t),e.ayref===e.yref?S(\"ay\",v(x,r,\"ay\",T.w,e)):S(\"ay\",e.ay+r),At(t,r);else{if(a)return;var i,o;if(y)i=v(y,t,\"x\",T,e);else{var l=e._xsize/T.w,c=e.x+(e._xshift-e.xshift)/T.w-l/2;i=d.align(c+t/T.w,l,0,1,e.xanchor)}if(x)o=v(x,r,\"y\",T,e);else{var u=e._ysize/T.h,h=e.y-(e._yshift+e.yshift)/T.h-u/2;o=d.align(h-r/T.h,u,0,1,e.yanchor)}S(\"x\",i),S(\"y\",o),y&&x||(n=d.getCursor(y?.5:i,x?.5:o,e.xanchor,e.yanchor))}z.attr({transform:s(t,r)+kt}),p(R,n)},clickFn:function(r,n){e.captureevents&&t.emit(\"plotly_clickannotation\",Z(n))},doneFn:function(){p(R),i.call(\"_guiRelayout\",t,E());var e=document.querySelector(\".js-notes-box-panel\");e&&e.redraw(e.selectedObj)}})}}}t.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(\".annotation\").remove();for(var r=0;r=0,x=e.indexOf(\"end\")>=0,_=d.backoff*g+r.standoff,b=m.backoff*y+r.startstandoff;if(\"line\"===p.nodeName){o={x:+t.attr(\"x1\"),y:+t.attr(\"y1\")},u={x:+t.attr(\"x2\"),y:+t.attr(\"y2\")};var w=o.x-u.x,T=o.y-u.y;if(f=(h=Math.atan2(T,w))+Math.PI,_&&b&&_+b>Math.sqrt(w*w+T*T))return void O();if(_){if(_*_>w*w+T*T)return void O();var k=_*Math.cos(h),A=_*Math.sin(h);u.x+=k,u.y+=A,t.attr({x2:u.x,y2:u.y})}if(b){if(b*b>w*w+T*T)return void O();var M=b*Math.cos(h),S=b*Math.sin(h);o.x-=M,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if(\"path\"===p.nodeName){var E=p.getTotalLength(),C=\"\";if(E<_+b)return void O();var L=p.getPointAtLength(0),I=p.getPointAtLength(.1);h=Math.atan2(L.y-I.y,L.x-I.x),o=p.getPointAtLength(Math.min(b,E)),C=\"0px,\"+b+\"px,\";var P=p.getPointAtLength(E),z=p.getPointAtLength(E-.1);f=Math.atan2(P.y-z.y,P.x-z.x),u=p.getPointAtLength(Math.max(0,E-_)),C+=E-(C?b+_:_)+\"px,\"+E+\"px\",t.style(\"stroke-dasharray\",C)}function O(){t.style(\"stroke-dasharray\",\"0px,100px\")}function D(e,a,o,u){e.path&&(e.noRotate&&(o=0),n.select(p.parentNode).append(\"path\").attr({class:t.attr(\"class\"),d:e.path,transform:c(a.x,a.y)+l(180*o/Math.PI)+s(u)}).style({fill:i.rgb(r.arrowcolor),\"stroke-width\":0}))}v&&D(m,o,h,y),x&&D(d,u,f,g)}},3599:function(t,e,r){\"use strict\";var n=r(3377),i=r(6035);t.exports={moduleType:\"component\",name:\"annotations\",layoutAttributes:r(50222),supplyLayoutDefaults:r(63737),includeBasePlot:r(20706)(\"annotations\"),calcAutorange:r(60317),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:i.hasClickToShow,onClick:i.onClick,convertCoords:r(59741)}},38239:function(t,e,r){\"use strict\";var n=r(50222),i=r(13582).overrideAll,a=r(78032).templatedArray;t.exports=i(a(\"annotation\",{visible:n.visible,x:{valType:\"any\"},y:{valType:\"any\"},z:{valType:\"any\"},ax:{valType:\"number\"},ay:{valType:\"number\"},xanchor:n.xanchor,xshift:n.xshift,yanchor:n.yanchor,yshift:n.yshift,text:n.text,textangle:n.textangle,font:n.font,width:n.width,height:n.height,opacity:n.opacity,align:n.align,valign:n.valign,bgcolor:n.bgcolor,bordercolor:n.bordercolor,borderpad:n.borderpad,borderwidth:n.borderwidth,showarrow:n.showarrow,arrowcolor:n.arrowcolor,arrowhead:n.arrowhead,startarrowhead:n.startarrowhead,arrowside:n.arrowside,arrowsize:n.arrowsize,startarrowsize:n.startarrowsize,arrowwidth:n.arrowwidth,standoff:n.standoff,startstandoff:n.startstandoff,hovertext:n.hovertext,hoverlabel:n.hoverlabel,captureevents:n.captureevents}),\"calc\",\"from-root\")},47979:function(t,e,r){\"use strict\";var n=r(34809),i=r(29714);function a(t,e){var r=e.fullSceneLayout.domain,a=e.fullLayout._size,o={pdata:null,type:\"linear\",autorange:!1,range:[-1/0,1/0]};t._xa={},n.extendFlat(t._xa,o),i.setConvert(t._xa),t._xa._offset=a.l+r.x[0]*a.w,t._xa.l2p=function(){return.5*(1+t._pdata[0]/t._pdata[3])*a.w*(r.x[1]-r.x[0])},t._ya={},n.extendFlat(t._ya,o),i.setConvert(t._ya),t._ya._offset=a.t+(1-r.y[1])*a.h,t._ya.l2p=function(){return.5*(1-t._pdata[1]/t._pdata[3])*a.h*(r.y[1]-r.y[0])}}t.exports=function(t){for(var e=t.fullSceneLayout.annotations,r=0;r1){c=!0;break}}c?t.fullLayout._infolayer.select(\".annotation-\"+t.id+'[data-index=\"'+s+'\"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},83348:function(t,e,r){\"use strict\";var n=r(33626),i=r(34809);t.exports={moduleType:\"component\",name:\"annotations3d\",schema:{subplots:{scene:{annotations:r(38239)}}},layoutAttributes:r(38239),handleDefaults:r(34232),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(r)for(var a=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+\", \"+Math.round(255*n[1])+\", \"+Math.round(255*n[2]);return a?\"rgba(\"+s+\", \"+n[3]+\")\":\"rgb(\"+s+\")\"}o.tinyRGB=function(t){var e=t.toRgb();return\"rgb(\"+Math.round(e.r)+\", \"+Math.round(e.g)+\", \"+Math.round(e.b)+\")\"},o.rgb=function(t){return o.tinyRGB(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return\"rgba(\"+Math.round(r.r)+\", \"+Math.round(r.g)+\", \"+Math.round(r.b)+\", \"+e+\")\"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||c).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.interpolate=function(t,e,r){var i=n(t).toRgb(),a=n(e).toRgb(),o={r:r*i.r+(1-r)*a.r,g:r*i.g+(1-r)*a.g,b:r*i.b+(1-r)*a.b};return n(o).toRgbString()},o.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(o.combine(t,c))),(i.isDark()?e?i.lighten(e):c:r?i.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),\"stroke-opacity\":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),\"fill-opacity\":r.getAlpha()})},o.clean=function(t){if(t&&\"object\"==typeof t){var e,r,n,i,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var pt=Math.pow(10,Math.floor(Math.log(ft)/Math.LN10));ut*=pt*c.roundUp(ft/pt,[2,5,10]),(Math.abs(Z.start)/Z.size+1e-6)%1<2e-6&&(lt.tick0=0)}lt.dtick=ut}lt.domain=o?[ot+P/B.h,ot+Q-P/B.h]:[ot+I/B.w,ot+Q-I/B.w],lt.setScale(),t.attr(\"transform\",u(Math.round(B.l),Math.round(B.t)));var dt,mt=t.select(\".\"+A.cbtitleunshift).attr(\"transform\",u(-Math.round(B.l),-Math.round(B.t))),gt=lt.ticklabelposition,yt=lt.title.font.size,vt=t.select(\".\"+A.cbaxis),xt=0,_t=0;function bt(n,i){var a={propContainer:lt,propName:e._propPrefix+\"title\",traceIndex:e._traceIndex,_meta:e._meta,placeholder:F._dfltTitle.colorbar,containerGroup:t.select(\".\"+A.cbtitle)},o=\"h\"===n.charAt(0)?n.substr(1):\"h\"+n;t.selectAll(\".\"+o+\",.\"+o+\"-math-group\").remove(),m.draw(r,n,h(a,i||{}))}return c.syncOrAsync([a.previousPromises,function(){var t,e;(o&&ct||!o&&!ct)&&(\"top\"===V&&(t=I+B.l+tt*z,e=P+B.t+et*(1-ot-Q)+3+.75*yt),\"bottom\"===V&&(t=I+B.l+tt*z,e=P+B.t+et*(1-ot)-3-.25*yt),\"right\"===V&&(e=P+B.t+et*O+3+.75*yt,t=I+B.l+tt*ot),bt(lt._id+\"title\",{attributes:{x:t,y:e,\"text-anchor\":o?\"start\":\"middle\"}}))},function(){if(!o&&!ct||o&&ct){var a,l=t.select(\".\"+A.cbtitle),h=l.select(\"text\"),f=[-M/2,M/2],d=l.select(\".h\"+lt._id+\"title-math-group\").node(),m=15.6;if(h.node()&&(m=parseInt(h.node().style.fontSize,10)*w),d?(a=p.bBox(d),_t=a.width,(xt=a.height)>m&&(f[1]-=(xt-m)/2)):h.node()&&!h.classed(A.jsPlaceholder)&&(a=p.bBox(h.node()),_t=a.width,xt=a.height),o){if(xt){if(xt+=5,\"top\"===V)lt.domain[1]-=xt/B.h,f[1]*=-1;else{lt.domain[0]+=xt/B.h;var y=g.lineCount(h);f[1]+=(1-y)*m}l.attr(\"transform\",u(f[0],f[1])),lt.setScale()}}else _t&&(\"right\"===V&&(lt.domain[0]+=(_t+yt/2)/B.w),l.attr(\"transform\",u(f[0],f[1])),lt.setScale())}t.selectAll(\".\"+A.cbfills+\",.\"+A.cblines).attr(\"transform\",o?u(0,Math.round(B.h*(1-lt.domain[1]))):u(Math.round(B.w*lt.domain[0]),0)),vt.attr(\"transform\",o?u(0,Math.round(-B.t)):u(Math.round(-B.l),0));var v=t.select(\".\"+A.cbfills).selectAll(\"rect.\"+A.cbfill).attr(\"style\",\"\").data(Y);v.enter().append(\"rect\").classed(A.cbfill,!0).attr(\"style\",\"\"),v.exit().remove();var x=q.map(lt.c2p).map(Math.round).sort((function(t,e){return t-e}));v.each((function(t,a){var s=[0===a?q[0]:(Y[a]+Y[a-1])/2,a===Y.length-1?q[1]:(Y[a]+Y[a+1])/2].map(lt.c2p).map(Math.round);o&&(s[1]=c.constrain(s[1]+(s[1]>s[0])?1:-1,x[0],x[1]));var l=n.select(this).attr(o?\"x\":\"y\",rt).attr(o?\"y\":\"x\",n.min(s)).attr(o?\"width\":\"height\",Math.max($,2)).attr(o?\"height\":\"width\",Math.max(n.max(s)-n.min(s),2));if(e._fillgradient)p.gradient(l,r,e._id,o?\"vertical\":\"horizontalreversed\",e._fillgradient,\"fill\");else{var u=G(t).replace(\"e-\",\"\");l.attr(\"fill\",i(u).toHexString())}}));var _=t.select(\".\"+A.cblines).selectAll(\"path.\"+A.cbline).data(j.color&&j.width?X:[]);_.enter().append(\"path\").classed(A.cbline,!0),_.exit().remove(),_.each((function(t){var e=rt,r=Math.round(lt.c2p(t))+j.width/2%1;n.select(this).attr(\"d\",\"M\"+(o?e+\",\"+r:r+\",\"+e)+(o?\"h\":\"v\")+$).call(p.lineGroupStyle,j.width,H(t),j.dash)})),vt.selectAll(\"g.\"+lt._id+\"tick,path\").remove();var b=rt+$+(M||0)/2-(\"outside\"===e.ticks?1:0),T=s.calcTicks(lt),k=s.getTickSigns(lt)[2];return s.drawTicks(r,lt,{vals:\"inside\"===lt.ticks?s.clipEnds(lt,T):T,layer:vt,path:s.makeTickPath(lt,b,k),transFn:s.makeTransTickFn(lt)}),s.drawLabels(r,lt,{vals:T,layer:vt,transFn:s.makeTransTickLabelFn(lt),labelFns:s.makeLabelFns(lt,b)})},function(){if(o&&!ct||!o&&ct){var t,i,a=lt.position||0,s=lt._offset+lt._length/2;if(\"right\"===V)i=s,t=B.l+tt*a+10+yt*(lt.showticklabels?1:.5);else if(t=s,\"bottom\"===V&&(i=B.t+et*a+10+(-1===gt.indexOf(\"inside\")?lt.tickfont.size:0)+(\"intside\"!==lt.ticks&&e.ticklen||0)),\"top\"===V){var l=U.text.split(\" \").length;i=B.t+et*a+10-$-w*yt*l}bt((o?\"h\":\"v\")+lt._id+\"title\",{avoid:{selection:n.select(r).selectAll(\"g.\"+lt._id+\"tick\"),side:V,offsetTop:o?0:B.t,offsetLeft:o?B.l:0,maxShift:o?F.width:F.height},attributes:{x:t,y:i,\"text-anchor\":\"middle\"},transform:{rotate:o?-90:0,offset:0}})}},a.previousPromises,function(){var n,s=$+M/2;-1===gt.indexOf(\"inside\")&&(n=p.bBox(vt.node()),s+=o?n.width:n.height),dt=mt.select(\"text\");var c=0,h=o&&\"top\"===V,m=!o&&\"right\"===V,g=0;if(dt.node()&&!dt.classed(A.jsPlaceholder)){var v,x=mt.select(\".h\"+lt._id+\"title-math-group\").node();x&&(o&&ct||!o&&!ct)?(c=(n=p.bBox(x)).width,v=n.height):(c=(n=p.bBox(mt.node())).right-B.l-(o?rt:st),v=n.bottom-B.t-(o?st:rt),o||\"top\"!==V||(s+=n.height,g=n.height)),m&&(dt.attr(\"transform\",u(c/2+yt/2,0)),c*=2),s=Math.max(s,o?c:v)}var _=2*(o?I:P)+s+S+M/2,w=0;!o&&U.text&&\"bottom\"===L&&O<=0&&(_+=w=_/2,g+=w),F._hColorbarMoveTitle=w,F._hColorbarMoveCBTitle=g;var N=S+M,j=(o?rt:st)-N/2-(o?I:0),q=(o?st:rt)-(o?K:P+g-w);t.select(\".\"+A.cbbg).attr(\"x\",j).attr(\"y\",q).attr(o?\"width\":\"height\",Math.max(_-w,2)).attr(o?\"height\":\"width\",Math.max(K+N,2)).call(d.fill,E).call(d.stroke,e.bordercolor).style(\"stroke-width\",S);var H=m?Math.max(c-10,0):0;t.selectAll(\".\"+A.cboutline).attr(\"x\",(o?rt:st+I)+H).attr(\"y\",(o?st+P-K:rt)+(h?xt:0)).attr(o?\"width\":\"height\",Math.max($,2)).attr(o?\"height\":\"width\",Math.max(K-(o?2*P+xt:2*I+H),2)).call(d.stroke,e.outlinecolor).style({fill:\"none\",\"stroke-width\":M});var G=o?nt*_:0,Z=o?0:(1-it)*_-g;if(G=R?B.l-G:-G,Z=D?B.t-Z:-Z,t.attr(\"transform\",u(G,Z)),!o&&(S||i(E).getAlpha()&&!i.equals(F.paper_bgcolor,E))){var W=vt.selectAll(\"text\"),Y=W[0].length,X=t.select(\".\"+A.cbbg).node(),J=p.bBox(X),Q=p.getTranslate(t);W.each((function(t,e){var r=Y-1;if(0===e||e===r){var n,i=p.bBox(this),a=p.getTranslate(this);if(e===r){var o=i.right+a.x;(n=J.right+Q.x+st-S-2+z-o)>0&&(n=0)}else if(0===e){var s=i.left+a.x;(n=J.left+Q.x+st+S+2-s)<0&&(n=0)}n&&(Y<3?this.setAttribute(\"transform\",\"translate(\"+n+\",0) \"+this.getAttribute(\"transform\")):this.setAttribute(\"visibility\",\"hidden\"))}}))}var tt={},et=T[C],at=k[C],ot=T[L],ut=k[L],ht=_-$;o?(\"pixels\"===f?(tt.y=O,tt.t=K*ot,tt.b=K*ut):(tt.t=tt.b=0,tt.yt=O+l*ot,tt.yb=O-l*ut),\"pixels\"===b?(tt.x=z,tt.l=_*et,tt.r=_*at):(tt.l=ht*et,tt.r=ht*at,tt.xl=z-y*et,tt.xr=z+y*at)):(\"pixels\"===f?(tt.x=z,tt.l=K*et,tt.r=K*at):(tt.l=tt.r=0,tt.xl=z+l*et,tt.xr=z-l*at),\"pixels\"===b?(tt.y=1-O,tt.t=_*ot,tt.b=_*ut):(tt.t=ht*ot,tt.b=ht*ut,tt.yt=O-y*ot,tt.yb=O+y*ut));var ft=e.y<.5?\"b\":\"t\",pt=e.x<.5?\"l\":\"r\";r._fullLayout._reservedMargin[e._id]={};var _t={r:F.width-j-G,l:j+tt.r,b:F.height-q-Z,t:q+tt.b};R&&D?a.autoMargin(r,e._id,tt):R?r._fullLayout._reservedMargin[e._id][ft]=_t[ft]:D||o?r._fullLayout._reservedMargin[e._id][pt]=_t[pt]:r._fullLayout._reservedMargin[e._id][ft]=_t[ft]}],r)}(r,e,t);y&&y.then&&(t._promises||[]).push(y),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s=\"v\"===e.orientation,c=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr(\"transform\"),f(t)},moveFn:function(r,o){t.attr(\"transform\",n+u(r,o)),i=l.align((s?e._uFrac:e._vFrac)+r/c.w,s?e._thickFrac:e._lenFrac,0,1,e.xanchor),a=l.align((s?e._vFrac:1-e._uFrac)-o/c.h,s?e._lenFrac:e._thickFrac,0,1,e.yanchor);var h=l.getCursor(i,a,e.xanchor,e.yanchor);f(t,h)},doneFn:function(){if(f(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+\"x\"]=i,n[e._propPrefix+\"y\"]=a,void 0!==e._traceIndex?o.call(\"_guiRestyle\",r,n,e._traceIndex):o.call(\"_guiRelayout\",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},91362:function(t,e,r){\"use strict\";var n=r(34809);t.exports=function(t){return n.isPlainObject(t.colorbar)}},96919:function(t,e,r){\"use strict\";t.exports={moduleType:\"component\",name:\"colorbar\",attributes:r(25158),supplyDefaults:r(42097),draw:r(5881).draw,hasColorbar:r(91362)}},87163:function(t,e,r){\"use strict\";var n=r(25158),i=r(90694).counter,a=r(62994),o=r(19017).scales;function s(t){return\"`\"+t+\"`\"}a(o),t.exports=function(t,e){t=t||\"\";var r,a=(e=e||{}).cLetter||\"c\",l=(\"onlyIfNumerical\"in e?e.onlyIfNumerical:Boolean(t),\"noScale\"in e?e.noScale:\"marker.line\"===t),c=\"showScaleDflt\"in e?e.showScaleDflt:\"z\"===a,u=\"string\"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,h=e.editTypeOverride||\"\",f=t?t+\".\":\"\";\"colorAttr\"in e?(r=e.colorAttr,e.colorAttr):s(f+(r={z:\"z\",c:\"color\"}[a]));var p=a+\"auto\",d=a+\"min\",m=a+\"max\",g=a+\"mid\",y=(s(f+p),s(f+d),s(f+m),{});y[d]=y[m]=void 0;var v={};v[p]=!1;var x={};return\"color\"===r&&(x.color={valType:\"color\",arrayOk:!0,editType:h||\"style\"},e.anim&&(x.color.anim=!0)),x[p]={valType:\"boolean\",dflt:!0,editType:\"calc\",impliedEdits:y},x[d]={valType:\"number\",dflt:null,editType:h||\"plot\",impliedEdits:v},x[m]={valType:\"number\",dflt:null,editType:h||\"plot\",impliedEdits:v},x[g]={valType:\"number\",dflt:null,editType:\"calc\",impliedEdits:y},x.colorscale={valType:\"colorscale\",editType:\"calc\",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:\"boolean\",dflt:!1!==e.autoColorDflt,editType:\"calc\",impliedEdits:{colorscale:void 0}},x.reversescale={valType:\"boolean\",dflt:!1,editType:\"plot\"},l||(x.showscale={valType:\"boolean\",dflt:c,editType:\"calc\"},x.colorbar=n),e.noColorAxis||(x.coloraxis={valType:\"subplotid\",regex:i(\"coloraxis\"),dflt:null,editType:\"calc\"}),x}},28379:function(t,e,r){\"use strict\";var n=r(10721),i=r(34809),a=r(65477).extractOpts;t.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?i.nestedProperty(e,c).get():e,h=a(u),f=!1!==h.auto,p=h.min,d=h.max,m=h.mid,g=function(){return i.aggNums(Math.min,null,l)},y=function(){return i.aggNums(Math.max,null,l)};void 0===p?p=g():f&&(p=u._colorAx&&n(p)?Math.min(p,g()):g()),void 0===d?d=y():f&&(d=u._colorAx&&n(d)?Math.max(d,y()):y()),f&&void 0!==m&&(d-m>m-p?p=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,h._sync(\"colorscale\",o))}},67623:function(t,e,r){\"use strict\";var n=r(34809),i=r(65477).hasColorscale,a=r(65477).extractOpts;t.exports=function(t,e){function r(t,e){var r=t[\"_\"+e];void 0!==r&&(t[e]=r)}function o(t,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,\"colorscale\")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,c=new Array(l),u=0;u4/3-s?o:s}},4001:function(t,e,r){\"use strict\";var n=r(34809),i=[[\"sw-resize\",\"s-resize\",\"se-resize\"],[\"w-resize\",\"move\",\"e-resize\"],[\"nw-resize\",\"n-resize\",\"ne-resize\"]];t.exports=function(t,e,r,a){return t=\"left\"===r?0:\"center\"===r?1:\"right\"===r?2:n.constrain(Math.floor(3*t),0,2),e=\"bottom\"===a?0:\"middle\"===a?1:\"top\"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},70414:function(t,e){\"use strict\";e.selectMode=function(t){return\"lasso\"===t||\"select\"===t},e.drawMode=function(t){return\"drawclosedpath\"===t||\"drawopenpath\"===t||\"drawline\"===t||\"drawrect\"===t||\"drawcircle\"===t},e.openMode=function(t){return\"drawline\"===t||\"drawopenpath\"===t},e.rectMode=function(t){return\"select\"===t||\"drawline\"===t||\"drawrect\"===t||\"drawcircle\"===t},e.freeMode=function(t){return\"lasso\"===t||\"drawclosedpath\"===t||\"drawopenpath\"===t},e.selectingOrDrawing=function(t){return e.freeMode(t)||e.rectMode(t)}},14751:function(t,e,r){\"use strict\";var n=r(44039),i=r(39784),a=r(74043),o=r(34809).removeElement,s=r(54826),l=t.exports={};l.align=r(53770),l.getCursor=r(4001);var c=r(60148);function u(){var t=document.createElement(\"div\");t.className=\"dragcover\";var e=t.style;return e.position=\"fixed\",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background=\"none\",document.body.appendChild(t),t}function h(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,f,p,d,m,g=t.gd,y=1,v=g._context.doubleClickDelay,x=t.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents=\"all\",x.onmousedown=b,a?(x._ontouchstart&&x.removeEventListener(\"touchstart\",x._ontouchstart),x._ontouchstart=b,x.addEventListener(\"touchstart\",b,{passive:!1})):x.ontouchstart=b;var _=t.clampFn||function(t,e,r){return Math.abs(t)v&&(y=Math.max(y-1,1)),g._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(y,p),!m){var r;try{r=new MouseEvent(\"click\",e)}catch(t){var n=h(e);(r=document.createEvent(\"MouseEvents\")).initMouseEvent(\"click\",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}d.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},l.coverSlip=u},60148:function(t,e,r){\"use strict\";var n=r(68596),i=r(64025),a=r(95425).getGraphDiv,o=r(85988),s=t.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===n.triggerHandler(t,\"plotly_beforehover\",e)||(r._hoverlayer.selectAll(\"g\").remove(),r._hoverlayer.selectAll(\"line\").remove(),r._hoverlayer.selectAll(\"circle\").remove(),t._hoverdata=void 0,e.target&&i&&t.emit(\"plotly_unhover\",{event:e,points:i}))}},94850:function(t,e){\"use strict\";e.T={valType:\"string\",values:[\"solid\",\"dot\",\"dash\",\"longdash\",\"dashdot\",\"longdashdot\"],dflt:\"solid\",editType:\"style\"},e.k={shape:{valType:\"enumerated\",values:[\"\",\"/\",\"\\\\\",\"x\",\"-\",\"|\",\"+\",\".\"],dflt:\"\",arrayOk:!0,editType:\"style\"},fillmode:{valType:\"enumerated\",values:[\"replace\",\"overlay\"],dflt:\"replace\",editType:\"style\"},bgcolor:{valType:\"color\",arrayOk:!0,editType:\"style\"},fgcolor:{valType:\"color\",arrayOk:!0,editType:\"style\"},fgopacity:{valType:\"number\",editType:\"style\",min:0,max:1},size:{valType:\"number\",min:0,dflt:8,arrayOk:!0,editType:\"style\"},solidity:{valType:\"number\",min:0,max:1,dflt:.3,arrayOk:!0,editType:\"style\"},editType:\"style\"}},62203:function(t,e,r){\"use strict\";var n=r(45568),i=r(34809),a=i.numberFormat,o=r(10721),s=r(65657),l=r(33626),c=r(78766),u=r(88856),h=i.strTranslate,f=r(30635),p=r(62972),d=r(4530).LINE_SPACING,m=r(20438).DESELECTDIM,g=r(64726),y=r(92527),v=r(36040).appendArrayPointValue,x=t.exports={};function _(t){return\"none\"===t?void 0:t}x.font=function(t,e){var r=e.variant,n=e.style,i=e.weight,a=e.color,o=e.size,s=e.family,l=e.shadow,u=e.lineposition,h=e.textcase;s&&t.style(\"font-family\",s),o+1&&t.style(\"font-size\",o+\"px\"),a&&t.call(c.fill,a),i&&t.style(\"font-weight\",i),n&&t.style(\"font-style\",n),r&&t.style(\"font-variant\",r),h&&t.style(\"text-transform\",_(function(t){return b[t]}(h))),l&&t.style(\"text-shadow\",\"auto\"===l?f.makeTextShadow(c.contrast(a)):_(l)),u&&t.style(\"text-decoration-line\",_(function(t){return t.replace(\"under\",\"underline\").replace(\"over\",\"overline\").replace(\"through\",\"line-through\").split(\"+\").join(\" \")}(u)))};var b={normal:\"none\",lower:\"lowercase\",upper:\"uppercase\",\"word caps\":\"capitalize\"};function w(t,e,r,n){var i=e.fillpattern,a=e.fillgradient,o=i&&x.getPatternAttr(i.shape,0,\"\");if(o){var s=x.getPatternAttr(i.bgcolor,0,null),l=x.getPatternAttr(i.fgcolor,0,null),u=i.fgopacity,h=x.getPatternAttr(i.size,0,8),f=x.getPatternAttr(i.solidity,0,.3),p=e.uid;x.pattern(t,\"point\",r,p,o,h,f,void 0,i.fillmode,s,l,u)}else if(a&&\"none\"!==a.type){var d,m,g=a.type,y=\"scatterfill-\"+e.uid;n&&(y=\"legendfill-\"+e.uid),n||void 0===a.start&&void 0===a.stop?(\"horizontal\"===g&&(g+=\"reversed\"),t.call(x.gradient,r,y,g,a.colorscale,\"fill\")):(\"horizontal\"===g?(d={x:a.start,y:0},m={x:a.stop,y:0}):\"vertical\"===g&&(d={x:0,y:a.start},m={x:0,y:a.stop}),d.x=e._xA.c2p(void 0===d.x?e._extremes.x.min[0].val:d.x,!0),d.y=e._yA.c2p(void 0===d.y?e._extremes.y.min[0].val:d.y,!0),m.x=e._xA.c2p(void 0===m.x?e._extremes.x.max[0].val:m.x,!0),m.y=e._yA.c2p(void 0===m.y?e._extremes.y.max[0].val:m.y,!0),t.call(E,r,y,\"linear\",a.colorscale,\"fill\",d,m,!0,!1))}else e.fillcolor&&t.call(c.fill,e.fillcolor)}x.setPosition=function(t,e,r){t.attr(\"x\",e).attr(\"y\",r)},x.setSize=function(t,e,r){t.attr(\"width\",e).attr(\"height\",r)},x.setRect=function(t,e,r,n,i){t.call(x.setPosition,e,r).call(x.setSize,n,i)},x.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(o(i)&&o(a)&&e.node())&&(\"text\"===e.node().nodeName?e.attr(\"x\",i).attr(\"y\",a):e.attr(\"transform\",h(i,a)),!0)},x.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);x.translatePoint(t,i,e,r)}))},x.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr(\"display\",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:\"none\")},x.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,c=l.traceIs(a,\"bar-like\")?\".bartext\":\".point,.textpoint\";t.selectAll(c).each((function(t){x.hideOutsideRangePoint(t,n.select(this),r,i,o,s)}))}))}},x.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},x.singleLineStyle=function(t,e,r,n,i){e.style(\"fill\",\"none\");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||\"\";c.stroke(e,n||a.color),x.dashLine(e,s,o)},x.lineGroupStyle=function(t,e,r,i){t.style(\"fill\",\"none\").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,s=i||a.dash||\"\";n.select(this).call(c.stroke,r||a.color).call(x.dashLine,s,o)}))},x.dashLine=function(t,e,r){r=+r||0,e=x.dashStyle(e,r),t.style({\"stroke-dasharray\":e,\"stroke-width\":r+\"px\"})},x.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return\"solid\"===t?t=\"\":\"dot\"===t?t=r+\"px,\"+r+\"px\":\"dash\"===t?t=3*r+\"px,\"+3*r+\"px\":\"longdash\"===t?t=5*r+\"px,\"+5*r+\"px\":\"dashdot\"===t?t=3*r+\"px,\"+r+\"px,\"+r+\"px,\"+r+\"px\":\"longdashdot\"===t&&(t=5*r+\"px,\"+2*r+\"px,\"+r+\"px,\"+2*r+\"px\"),t},x.singleFillStyle=function(t,e){var r=n.select(t.node());w(t,((r.data()[0]||[])[0]||{}).trace||{},e,!1)},x.fillGroupStyle=function(t,e,r){t.style(\"stroke-width\",0).each((function(t){var i=n.select(this);t[0].trace&&w(i,t[0].trace,e,r)}))};var T=r(38882);x.symbolNames=[],x.symbolFuncs=[],x.symbolBackOffs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(T).forEach((function(t){var e=T[t],r=e.n;x.symbolList.push(r,String(r),t,r+100,String(r+100),t+\"-open\"),x.symbolNames[r]=t,x.symbolFuncs[r]=e.f,x.symbolBackOffs[r]=e.backoff||0,e.needLine&&(x.symbolNeedLines[r]=!0),e.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),t+\"-dot\",r+300,String(r+300),t+\"-open-dot\"),e.noFill&&(x.symbolNoFill[r]=!0)}));var k=x.symbolNames.length;function A(t,e,r,n){var i=t%100;return x.symbolFuncs[i](e,r,n)+(t>=200?\"M0,0.5L0.5,0L0,-0.5L-0.5,0Z\":\"\")}x.symbolNumber=function(t){if(o(t))t=+t;else if(\"string\"==typeof t){var e=0;t.indexOf(\"-open\")>0&&(e=100,t=t.replace(\"-open\",\"\")),t.indexOf(\"-dot\")>0&&(e+=200,t=t.replace(\"-dot\",\"\")),(t=x.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=k||t>=400?0:Math.floor(Math.max(t,0))};var M=a(\"~f\"),S={radial:{type:\"radial\"},radialreversed:{type:\"radial\",reversed:!0},horizontal:{type:\"linear\",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:\"linear\",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:\"linear\",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:\"linear\",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};function E(t,e,r,a,o,l,u,h,f,p){var d,m=o.length;\"linear\"===a?d={node:\"linearGradient\",attrs:{x1:u.x,y1:u.y,x2:h.x,y2:h.y,gradientUnits:f?\"userSpaceOnUse\":\"objectBoundingBox\"},reversed:p}:\"radial\"===a&&(d={node:\"radialGradient\",reversed:p});for(var g=new Array(m),y=0;y=0&&void 0===t.i&&(t.i=o.i),e.style(\"opacity\",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?s.opacity:t.mo),n.ms2mrc){var u;u=\"various\"===t.ms||\"various\"===s.size?3:n.ms2mrc(t.ms),t.mrc=u,n.selectedSizeFn&&(u=t.mrc=n.selectedSizeFn(t));var h=x.symbolNumber(t.mx||s.symbol)||0;t.om=h%200>=100;var f=nt(t,r),p=Z(t,r);e.attr(\"d\",A(h,u,f,p))}var d,m,g,y=!1;if(t.so)g=l.outlierwidth,m=l.outliercolor,d=s.outliercolor;else{var v=(l||{}).width;g=(t.mlw+1||v+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,m=\"mlc\"in t?t.mlcc=n.lineScale(t.mlc):i.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,i.isArrayOrTypedArray(s.color)&&(d=c.defaultLine,y=!0),d=\"mc\"in t?t.mcc=n.markerScale(t.mc):s.color||s.colors||\"rgba(0,0,0,0)\",n.selectedColorFn&&(d=n.selectedColorFn(t))}if(t.om)e.call(c.stroke,d).style({\"stroke-width\":(g||1)+\"px\",fill:\"none\"});else{e.style(\"stroke-width\",(t.isBlank?0:g)+\"px\");var _=s.gradient,b=t.mgt;b?y=!0:b=_&&_.type,i.isArrayOrTypedArray(b)&&(b=b[0],S[b]||(b=0));var w=s.pattern,T=w&&x.getPatternAttr(w.shape,t.i,\"\");if(b&&\"none\"!==b){var k=t.mgc;k?y=!0:k=_.color;var M=r.uid;y&&(M+=\"-\"+t.i),x.gradient(e,a,M,b,[[0,k],[1,d]],\"fill\")}else if(T){var E=!1,C=w.fgcolor;!C&&o&&o.color&&(C=o.color,E=!0);var L=x.getPatternAttr(C,t.i,o&&o.color||null),I=x.getPatternAttr(w.bgcolor,t.i,null),P=w.fgopacity,z=x.getPatternAttr(w.size,t.i,8),O=x.getPatternAttr(w.solidity,t.i,.3);E=E||t.mcc||i.isArrayOrTypedArray(w.shape)||i.isArrayOrTypedArray(w.bgcolor)||i.isArrayOrTypedArray(w.fgcolor)||i.isArrayOrTypedArray(w.size)||i.isArrayOrTypedArray(w.solidity);var D=r.uid;E&&(D+=\"-\"+t.i),x.pattern(e,\"point\",a,D,T,z,O,t.mcc,w.fillmode,I,L,P)}else i.isArrayOrTypedArray(d)?c.fill(e,d[t.i]):c.fill(e,d);g&&c.stroke(e,m)}},x.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=x.tryColorscale(r,\"\"),e.lineScale=x.tryColorscale(r,\"line\"),l.traceIs(t,\"symbols\")&&(e.ms2mrc=g.isBubble(t)?y(t):function(){return(r.size||6)/2}),t.selectedpoints&&i.extendFlat(e,x.makeSelectedPointStyleFns(t)),e},x.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},o=r.marker||{},s=n.marker||{},c=a.opacity,u=o.opacity,h=s.opacity,f=void 0!==u,p=void 0!==h;(i.isArrayOrTypedArray(c)||f||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?f?u:e:p?h:m*e});var d=a.color,g=o.color,y=s.color;(g||y)&&(e.selectedColorFn=function(t){var e=t.mcc||d;return t.selected?g||e:y||e});var v=a.size,x=o.size,_=s.size,b=void 0!==x,w=void 0!==_;return l.traceIs(t,\"symbols\")&&(b||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?b?x/2:e:w?_/2:e}),e},x.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:u||(l?e:c.addOpacity(e,m))},e},x.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style(\"opacity\",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){c.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,n){var a=n.mx||i.symbol||0,o=r.selectedSizeFn(n);t.attr(\"d\",A(x.symbolNumber(a),o,nt(n,e),Z(n,e))),n.mrc2=o})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}function O(t,e,r){return r&&(t=j(t)),e?R(t[1]):D(t[0])}function D(t){var e=n.round(t,2);return C=e,e}function R(t){var e=n.round(t,2);return L=e,e}function F(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,f=3*c*(l+c),p=3*l*(l+c);return[[D(e[0]+(f&&u/f)),R(e[1]+(f&&h/f))],[D(e[0]-(p&&u/p)),R(e[1]-(p&&h/p))]]}x.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var o=x.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),c=s?i.extractOption(t,e,\"txt\",\"texttemplate\"):i.extractOption(t,e,\"tx\",\"text\");if(c||0===c){if(s){var u=e._module.formatLabels,h=u?u(t,e,l):{},p={};v(p,e,t.i);var d=e._meta||{};c=i.texttemplateString(c,h,l._d3locale,p,t,d)}var m=t.tp||e.textposition,g=z(t,e),y=a?a(t):t.tc||e.textfont.color;o.call(x.font,{family:t.tf||e.textfont.family,weight:t.tw||e.textfont.weight,style:t.ty||e.textfont.style,variant:t.tv||e.textfont.variant,textcase:t.tC||e.textfont.textcase,lineposition:t.tE||e.textfont.lineposition,shadow:t.tS||e.textfont.shadow,size:g,color:y}).text(c).call(f.convertToTspans,r).call(P,m,g,t.mrc)}else o.remove()}))}},x.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=z(t,e);c.fill(i,a);var u=l.traceIs(e,\"bar-like\");P(i,o,s,t.mrc2||t.mrc,u)}))}},x.smoothopen=function(t,e){if(t.length<3)return\"M\"+t.join(\"L\");var r,n=\"M\"+t[0],i=[];for(r=1;r=c||w>=h&&w<=c)&&(T<=f&&T>=u||T>=f&&T<=u)&&(t=[w,T])}return t}x.steps=function(t){var e=B[t]||N;return function(t){for(var r=\"M\"+D(t[0][0])+\",\"+R(t[0][1]),n=t.length,i=1;i=1e4&&(x.savedBBoxes={},U=0),r&&(x.savedBBoxes[r]=g),U++,i.extendFlat({},g)},x.setClipUrl=function(t,e,r){t.attr(\"clip-path\",q(e,r))},x.getTranslate=function(t){var e=(t[t.attr?\"attr\":\"getAttribute\"](\"transform\")||\"\").replace(/.*\\btranslate\\((-?\\d*\\.?\\d*)[^-\\d]*(-?\\d*\\.?\\d*)[^\\d].*/,(function(t,e,r){return[e,r].join(\" \")})).split(\" \");return{x:+e[0]||0,y:+e[1]||0}},x.setTranslate=function(t,e,r){var n=t.attr?\"attr\":\"getAttribute\",i=t.attr?\"attr\":\"setAttribute\",a=t[n](\"transform\")||\"\";return e=e||0,r=r||0,a=a.replace(/(\\btranslate\\(.*?\\);?)/,\"\").trim(),a=(a+=h(e,r)).trim(),t[i](\"transform\",a),a},x.getScale=function(t){var e=(t[t.attr?\"attr\":\"getAttribute\"](\"transform\")||\"\").replace(/.*\\bscale\\((\\d*\\.?\\d*)[^\\d]*(\\d*\\.?\\d*)[^\\d].*/,(function(t,e,r){return[e,r].join(\" \")})).split(\" \");return{x:+e[0]||1,y:+e[1]||1}},x.setScale=function(t,e,r){var n=t.attr?\"attr\":\"getAttribute\",i=t.attr?\"attr\":\"setAttribute\",a=t[n](\"transform\")||\"\";return e=e||1,r=r||1,a=a.replace(/(\\bscale\\(.*?\\);?)/,\"\").trim(),a=(a+=\"scale(\"+e+\",\"+r+\")\").trim(),t[i](\"transform\",a),a};var H=/\\s*sc.*/;x.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?\"\":\"scale(\"+e+\",\"+r+\")\";t.each((function(){var t=(this.getAttribute(\"transform\")||\"\").replace(H,\"\");t=(t+=n).trim(),this.setAttribute(\"transform\",t)}))}};var G=/translate\\([^)]*\\)\\s*$/;function Z(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}x.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select(\"text\");if(a.node()){var o=parseFloat(a.attr(\"x\")||0),s=parseFloat(a.attr(\"y\")||0),l=(i.attr(\"transform\")||\"\").match(G);t=1===e&&1===r?[]:[h(o,s),\"scale(\"+e+\",\"+r+\")\",h(-o,-s)],l&&t.push(l),i.attr(\"transform\",t.join(\"\"))}}))},x.getMarkerStandoff=Z;var W,Y,X,$,J,K,Q=Math.atan2,tt=Math.cos,et=Math.sin;function rt(t,e){var r=e[0],n=e[1];return[r*tt(t)-n*et(t),r*et(t)+n*tt(t)]}function nt(t,e){var r,n,a=t.ma;void 0===a&&((a=e.marker.angle)&&!i.isArrayOrTypedArray(a)||(a=0));var s=e.marker.angleref;if(\"previous\"===s||\"north\"===s){if(e._geo){var l=e._geo.project(t.lonlat);r=l[0],n=l[1]}else{var c=e._xA,u=e._yA;if(!c||!u)return 90;r=c.c2p(t.x),n=u.c2p(t.y)}if(e._geo){var h,f=t.lonlat[0],p=t.lonlat[1],d=e._geo.project([f,p+1e-5]),m=e._geo.project([f+1e-5,p]),g=Q(m[1]-n,m[0]-r),y=Q(d[1]-n,d[0]-r);if(\"north\"===s)h=a/180*Math.PI;else if(\"previous\"===s){var v=f/180*Math.PI,x=p/180*Math.PI,_=W/180*Math.PI,b=Y/180*Math.PI,w=_-v,T=tt(b)*et(w),k=et(b)*tt(x)-tt(b)*et(x)*tt(w);h=-Q(T,k)-Math.PI,W=f,Y=p}var A=rt(g,[tt(h),0]),M=rt(y,[et(h),0]);a=Q(A[1]+M[1],A[0]+M[0])/Math.PI*180,\"previous\"!==s||K===e.uid&&t.i===J+1||(a=null)}if(\"previous\"===s&&!e._geo)if(K===e.uid&&t.i===J+1&&o(r)&&o(n)){var S=r-X,E=n-$,C=e.line&&e.line.shape||\"\",L=C.slice(C.length-1);\"h\"===L&&(E=0),\"v\"===L&&(S=0),a+=Q(E,S)/Math.PI*180+90}else a=null}return X=r,$=n,J=t.i,K=e.uid,a}x.getMarkerAngle=nt},38882:function(t,e,r){\"use strict\";var n,i,a,o,s=r(26953),l=r(45568).round,c=\"M0,0Z\",u=Math.sqrt(2),h=Math.sqrt(3),f=Math.PI,p=Math.cos,d=Math.sin;function m(t){return null===t}function g(t,e,r){if(!(t&&t%360!=0||e))return r;if(a===t&&o===e&&n===r)return i;function l(t,r){var n=p(t),i=d(t),a=r[0],o=r[1]+(e||0);return[a*n-o*i,a*i+o*n]}a=t,o=e,n=r;for(var c=t/180*f,u=0,h=0,m=s(r),g=\"\",y=0;y0,h=t._context.staticPlot;e.each((function(e){var f,p=e[0].trace,d=p.error_x||{},m=p.error_y||{};p.ids&&(f=function(t){return t.id});var g=o.hasMarkers(p)&&p.marker.maxdisplayed>0;m.visible||d.visible||(e=[]);var y=n.select(this).selectAll(\"g.errorbar\").data(e,f);if(y.exit().remove(),e.length){d.visible||y.selectAll(\"path.xerror\").remove(),m.visible||y.selectAll(\"path.yerror\").remove(),y.style(\"opacity\",1);var v=y.enter().append(\"g\").classed(\"errorbar\",!0);u&&v.style(\"opacity\",0).transition().duration(s.duration).style(\"opacity\",1),a.setClipUrl(y,r.layerClipId,t),y.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}(t,l,c);if(!g||t.vis){var a,o=e.select(\"path.yerror\");if(m.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var f=m.width;a=\"M\"+(r.x-f)+\",\"+r.yh+\"h\"+2*f+\"m-\"+f+\",0V\"+r.ys,r.noYS||(a+=\"m-\"+f+\",0h\"+2*f),o.size()?u&&(o=o.transition().duration(s.duration).ease(s.easing)):o=e.append(\"path\").style(\"vector-effect\",h?\"none\":\"non-scaling-stroke\").classed(\"yerror\",!0),o.attr(\"d\",a)}else o.remove();var p=e.select(\"path.xerror\");if(d.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var y=(d.copy_ystyle?m:d).width;a=\"M\"+r.xh+\",\"+(r.y-y)+\"v\"+2*y+\"m0,-\"+y+\"H\"+r.xs,r.noXS||(a+=\"m0,-\"+y+\"v\"+2*y),p.size()?u&&(p=p.transition().duration(s.duration).ease(s.easing)):p=e.append(\"path\").style(\"vector-effect\",h?\"none\":\"non-scaling-stroke\").classed(\"xerror\",!0),p.attr(\"d\",a)}else p.remove()}}))}}))}},22800:function(t,e,r){\"use strict\";var n=r(45568),i=r(78766);t.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll(\"path.yerror\").style(\"stroke-width\",r.thickness+\"px\").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll(\"path.xerror\").style(\"stroke-width\",a.thickness+\"px\").call(i.stroke,a.color)}))}},70192:function(t,e,r){\"use strict\";var n=r(80337),i=r(6811).hoverlabel,a=r(93049).extendFlat;t.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:\"none\"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:\"none\"}}},83552:function(t,e,r){\"use strict\";var n=r(34809),i=r(33626);function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}t.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.index$[0]._length||bt<0||bt>J[0]._length)return m.unhoverRaw(t,e)}else _t=\"xpx\"in e?e.xpx:$[0]._length/2,bt=\"ypx\"in e?e.ypx:J[0]._length/2;if(e.pointerX=_t+$[0]._offset,e.pointerY=bt+J[0]._offset,nt=\"xval\"in e?x.flat(_,e.xval):x.p2c($,_t),it=\"yval\"in e?x.flat(_,e.yval):x.p2c(J,bt),!i(nt[0])||!i(it[0]))return o.warn(\"Fx.hover failed\",e,t),m.unhoverRaw(t,e)}var At=1/0;function Mt(r,n){for(ot=0;otmt&&(gt.splice(0,mt),At=gt[0].distance),M&&0!==rt&&0===gt.length){dt.distance=rt,dt.index=!1;var u=lt._module.hoverPoints(dt,ft,pt,\"closest\",{hoverLayer:b._hoverlayer});if(u&&(u=u.filter((function(t){return t.spikeDistance<=rt}))),u&&u.length){var h,f=u.filter((function(t){return t.xa.showspikes&&\"hovered data\"!==t.xa.spikesnap}));if(f.length){var p=f[0];i(p.x0)&&i(p.y0)&&(h=Et(p),(!vt.vLinePoint||vt.vLinePoint.spikeDistance>h.spikeDistance)&&(vt.vLinePoint=h))}var m=u.filter((function(t){return t.ya.showspikes&&\"hovered data\"!==t.ya.spikesnap}));if(m.length){var g=m[0];i(g.x0)&&i(g.y0)&&(h=Et(g),(!vt.hLinePoint||vt.hLinePoint.spikeDistance>h.spikeDistance)&&(vt.hLinePoint=h))}}}}}function St(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)Nt-1;jt--)Ht(gt[jt]);gt=Ut,Pt()}var Gt=t._hoverdata,Zt=[],Wt=H(t),Yt=G(t);for(at=0;at1||gt.length>1)||\"closest\"===S&&xt&>.length>1,se=d.combine(b.plot_bgcolor||d.background,b.paper_bgcolor),le=D(gt,{gd:t,hovermode:S,rotateLabels:oe,bgColor:se,container:b._hoverlayer,outerContainer:b._paper.node(),commonLabelOpts:b.hoverlabel,hoverdistance:b.hoverdistance}),ce=le.hoverLabels;if(x.isUnifiedHover(S)||(function(t,e,r,n){var i,a,o,s,l,c,u,h=e?\"xa\":\"ya\",f=e?\"ya\":\"xa\",p=0,d=1,m=t.size(),g=new Array(m),y=0,v=n.minX,x=n.maxX,_=n.minY,b=n.maxY,w=function(t){return t*r._invScaleX},T=function(t){return t*r._invScaleY};function k(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;i=!1}if(!(o<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=o;i=!1}if(i){var n=0;for(s=0;se.pmax&&n++;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos>e.pmax-1&&(c.del=!0,n--);for(s=0;s=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos+c.dp+c.size>e.pmax&&(c.del=!0,n--)}}}for(t.each((function(t){var n=t[h],i=t[f],a=\"x\"===n._id.charAt(0),o=n.range;0===y&&o&&o[0]>o[1]!==a&&(d=-1);var s=0,l=a?r.width:r.height;if(\"x\"===r.hovermode||\"y\"===r.hovermode){var c,u,p=F(t,e),m=t.anchor,k=\"end\"===m?-1:1;if(\"middle\"===m)u=(c=t.crossPos+(a?T(p.y-t.by/2):w(t.bx/2+t.tx2width/2)))+(a?T(t.by):w(t.bx));else if(a)u=(c=t.crossPos+T(E+p.y)-T(t.by/2-E))+T(t.by);else{var M=w(k*E+p.x),S=M+w(k*t.bx);c=t.crossPos+Math.min(M,S),u=t.crossPos+Math.max(M,S)}a?void 0!==_&&void 0!==b&&Math.min(u,b)-Math.max(c,_)>1&&(\"left\"===i.side?(s=i._mainLinePosition,l=r.width):l=i._mainLinePosition):void 0!==v&&void 0!==x&&Math.min(u,x)-Math.max(c,v)>1&&(\"top\"===i.side?(s=i._mainLinePosition,l=r.height):l=i._mainLinePosition)}g[y++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?A:1)/2,pmin:s,pmax:l}]})),g.sort((function(t,e){return t[0].posref-e[0].posref||d*(e[0].traceIndex-t[0].traceIndex)}));!i&&p<=m;){for(p++,i=!0,s=0;s.01){for(l=S.length-1;l>=0;l--)S[l].dp+=a;for(M.push.apply(M,S),g.splice(s+1,1),u=0,l=M.length-1;l>=0;l--)u+=M[l].dp;for(o=u/M.length,l=M.length-1;l>=0;l--)M[l].dp-=o;i=!1}else s++}g.forEach(k)}for(s=g.length-1;s>=0;s--){var I=g[s];for(l=I.length-1;l>=0;l--){var P=I[l],z=P.datum;z.offset=P.dp,z.del=P.del}}}(ce,oe,b,le.commonLabelBoundingBox),B(ce,oe,b._invScaleX,b._invScaleY)),l&&l.tagName){var ue=v.getComponentMethod(\"annotations\",\"hasClickToShow\")(t,Zt);f(n.select(l),ue?\"pointer\":\"\")}l&&!a&&function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Gt)&&(Gt&&t.emit(\"plotly_unhover\",{event:e,points:Gt}),t.emit(\"plotly_hover\",{event:e,points:t._hoverdata,xaxes:$,yaxes:J,xvals:nt,yvals:it}))}(t,e,r,a,l)}))},e.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=e.gd,a=H(i),o=G(i),s=D(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(r,n),h=Math.max(r,n),f=Math.min(s,l),p=Math.max(s,l),m=t.trace;if(v.traceIs(m,\"gl3d\")){var g=i._fullLayout[m.scene]._scene.container,y=g.offsetLeft,x=g.offsetTop;u+=y,h+=y,f+=x,p+=x}c.bbox={x0:u+o,x1:h+o,y0:f+a,y1:p+a},e.inOut_bbox&&e.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||d.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontVariant:t.fontVariant,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:\"\"},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:\"closest\",rotateLabels:!1,bgColor:e.bgColor||d.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}).hoverLabels,l=0,c=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\\s\\S]*)<\\/extra>/;function D(t,e){var r=e.gd,i=r._fullLayout,a=e.hovermode,s=e.rotateLabels,u=e.bgColor,f=e.container,m=e.outerContainer,g=e.commonLabelOpts||{};if(0===t.length)return[[]];var y=e.fontFamily||_.HOVERFONT,k=e.fontSize||_.HOVERFONTSIZE,A=e.fontWeight||i.font.weight,M=e.fontStyle||i.font.style,S=e.fontVariant||i.font.variant,L=e.fontTextcase||i.font.textcase,I=e.fontLineposition||i.font.lineposition,P=e.fontShadow||i.font.shadow,O=t[0],D=O.xa,F=O.ya,B=a.charAt(0),N=B+\"Label\",j=O[N];if(void 0===j&&\"multicategory\"===D.type)for(var U=0;Ui.width-T&&(z=i.width-T),e.attr(\"d\",\"M\"+(x-z)+\",0L\"+(x-z+E)+\",\"+w+E+\"H\"+T+\"v\"+w+(2*C+b.height)+\"H\"+-T+\"V\"+w+E+\"H\"+(x-z-E)+\"Z\"),x=z,Q.minX=x-T,Q.maxX=x+T,\"top\"===D.side?(Q.minY=_-(2*C+b.height),Q.maxY=_-C):(Q.minY=_+C,Q.maxY=_+(2*C+b.height))}else{var R,B,N;\"right\"===F.side?(R=\"start\",B=1,N=\"\",x=D._offset+D._length):(R=\"end\",B=-1,N=\"-\",x=D._offset),_=F._offset+(O.y0+O.y1)/2,s.attr(\"text-anchor\",R),e.attr(\"d\",\"M0,0L\"+N+E+\",\"+E+\"V\"+(C+b.height/2)+\"h\"+N+(2*C+b.width)+\"V-\"+(C+b.height/2)+\"H\"+N+E+\"V-\"+E+\"Z\"),Q.minY=_-(C+b.height/2),Q.maxY=_+(C+b.height/2),\"right\"===F.side?(Q.minX=x+E,Q.maxX=x+E+(2*C+b.width)):(Q.minX=x-E-(2*C+b.width),Q.maxX=x-E);var U,V=b.height/2,H=q-b.top-V,G=\"clip\"+i._uid+\"commonlabel\"+F._id;if(x=0?dt:mt+vt=0?mt:Mt+vt=0?ft:pt+xt=0?pt:St+xt=0,\"top\"!==t.idealAlign&&J||!K?J?(N+=V/2,t.anchor=\"start\"):t.anchor=\"middle\":(N-=V/2,t.anchor=\"end\"),t.crossPos=N;else{if(t.pos=N,J=B+U/2+Q<=H,K=B-U/2-Q>=0,\"left\"!==t.idealAlign&&J||!K)if(J)B+=U/2,t.anchor=\"start\";else{t.anchor=\"middle\";var tt=Q/2,et=B+tt-H,rt=B-tt;et>0&&(B-=et),rt<0&&(B+=-rt)}else B-=U/2,t.anchor=\"end\";t.crossPos=B}w.attr(\"text-anchor\",t.anchor),O&&z.attr(\"text-anchor\",t.anchor),e.attr(\"transform\",l(B,N)+(s?c(T):\"\"))})),{hoverLabels:Et,commonLabelBoundingBox:Q}}function R(t,e,r,n,i,a){var s=\"\",l=\"\";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=V(t.name,t.nameLength));var c=r.charAt(0),u=\"x\"===c?\"y\":\"x\";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+=\"x: \"+t.xLabel+\" \"),void 0!==t.yLabel&&(l+=\"y: \"+t.yLabel+\" \"),\"choropleth\"!==t.trace.type&&\"choroplethmapbox\"!==t.trace.type&&\"choroplethmap\"!==t.trace.type&&(l+=(l?\"z: \":\"\")+t.zLabel)):e&&t[c+\"Label\"]===i?l=t[u+\"Label\"]||\"\":void 0===t.xLabel?void 0!==t.yLabel&&\"scattercarpet\"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:\"(\"+t.xLabel+\", \"+t.yLabel+\")\",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?\" \":\"\")+t.text),void 0!==t.extraText&&(l+=(l?\" \":\"\")+t.extraText),a&&\"\"===l&&!t.hovertemplate&&(\"\"===s&&a.remove(),l=s);var h=t.hovertemplate||!1;if(h){var f=t.hovertemplateLabels||t;t[c+\"Label\"]!==i&&(f[c+\"other\"]=f[c+\"Val\"],f[c+\"otherLabel\"]=f[c+\"Label\"]),l=(l=o.hovertemplateString(h,f,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(O,(function(e,r){return s=V(r,t.nameLength),\"\"}))}return[l,s]}function F(t,e){var r=0,n=t.offset;return e&&(n*=-S,r=t.offset*M),{x:r,y:n}}function B(t,e,r,i){var a=function(t){return t*r},o=function(t){return t*i};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i,s,l,c,u=r.select(\"text.nums\"),f=t.anchor,d=\"end\"===f?-1:1,m=(c=(l=(s={start:1,end:-1,middle:0}[(i=t).anchor])*(E+C))+s*(i.txwidth+C),\"middle\"===i.anchor&&(l-=i.tx2width/2,c+=i.txwidth/2+C),{alignShift:s,textShiftX:l,text2ShiftX:c}),g=F(t,e),y=g.x,v=g.y,x=\"middle\"===f;r.select(\"path\").attr(\"d\",x?\"M-\"+a(t.bx/2+t.tx2width/2)+\",\"+o(v-t.by/2)+\"h\"+a(t.bx)+\"v\"+o(t.by)+\"h-\"+a(t.bx)+\"Z\":\"M0,0L\"+a(d*E+y)+\",\"+o(E+v)+\"v\"+o(t.by/2-E)+\"h\"+a(d*t.bx)+\"v-\"+o(t.by)+\"H\"+a(d*E+y)+\"V\"+o(v-E)+\"Z\");var _=y+m.textShiftX,b=v+t.ty0-t.by/2+C,w=t.textAlign||\"auto\";\"auto\"!==w&&(\"left\"===w&&\"start\"!==f?(u.attr(\"text-anchor\",\"start\"),_=x?-t.bx/2-t.tx2width/2+C:-t.bx-C):\"right\"===w&&\"end\"!==f&&(u.attr(\"text-anchor\",\"end\"),_=x?t.bx/2-t.tx2width/2-C:t.bx+C)),u.call(h.positionText,a(_),o(b)),t.tx2width&&(r.select(\"text.name\").call(h.positionText,a(m.text2ShiftX+m.alignShift*C+y),o(v+t.ty0-t.by/2+C)),r.select(\"rect\").call(p.setRect,a(m.text2ShiftX+(m.alignShift-1)*t.tx2width/2+y),o(v-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function N(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var c=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,\"\",e)}:function(t,e){return o.extractOption(s,n,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}if(u(\"hoverinfo\",\"hi\",\"hoverinfo\"),u(\"bgcolor\",\"hbg\",\"hoverlabel.bgcolor\"),u(\"borderColor\",\"hbc\",\"hoverlabel.bordercolor\"),u(\"fontFamily\",\"htf\",\"hoverlabel.font.family\"),u(\"fontSize\",\"hts\",\"hoverlabel.font.size\"),u(\"fontColor\",\"htc\",\"hoverlabel.font.color\"),u(\"fontWeight\",\"htw\",\"hoverlabel.font.weight\"),u(\"fontStyle\",\"hty\",\"hoverlabel.font.style\"),u(\"fontVariant\",\"htv\",\"hoverlabel.font.variant\"),u(\"nameLength\",\"hnl\",\"hoverlabel.namelength\"),u(\"textAlign\",\"hta\",\"hoverlabel.align\"),t.posref=\"y\"===e||\"closest\"===e&&\"h\"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel=\"xLabel\"in t?t.xLabel:g.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel=\"yLabel\"in t?t.yLabel:g.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||\"log\"===t.xa.type&&t.xerr<=0)){var h=g.tickText(t.xa,t.xa.c2l(t.xerr),\"hover\").text;void 0!==t.xerrneg?t.xLabel+=\" +\"+h+\" / -\"+g.tickText(t.xa,t.xa.c2l(t.xerrneg),\"hover\").text:t.xLabel+=\" ± \"+h,\"x\"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||\"log\"===t.ya.type&&t.yerr<=0)){var f=g.tickText(t.ya,t.ya.c2l(t.yerr),\"hover\").text;void 0!==t.yerrneg?t.yLabel+=\" +\"+f+\" / -\"+g.tickText(t.ya,t.ya.c2l(t.yerrneg),\"hover\").text:t.yLabel+=\" ± \"+f,\"y\"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return p&&\"all\"!==p&&(-1===(p=Array.isArray(p)?p:p.split(\"+\")).indexOf(\"x\")&&(t.xLabel=void 0),-1===p.indexOf(\"y\")&&(t.yLabel=void 0),-1===p.indexOf(\"z\")&&(t.zLabel=void 0),-1===p.indexOf(\"text\")&&(t.text=void 0),-1===p.indexOf(\"name\")&&(t.name=void 0)),t}function j(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,h=!!e.vLinePoint;if(o.selectAll(\".spikeline\").remove(),h||u){var f=d.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var m,y,v=e.hLinePoint;n=v&&v.xa,\"cursor\"===(i=v&&v.ya).spikesnap?(m=c.pointerX,y=c.pointerY):(m=n._offset+v.x,y=i._offset+v.y);var x,_,b=a.readability(v.color,f)<1.5?d.contrast(f):v.color,w=i.spikemode,T=i.spikethickness,k=i.spikecolor||b,A=g.getPxPosition(t,i);if(-1!==w.indexOf(\"toaxis\")||-1!==w.indexOf(\"across\")){if(-1!==w.indexOf(\"toaxis\")&&(x=A,_=m),-1!==w.indexOf(\"across\")){var M=i._counterDomainMin,S=i._counterDomainMax;\"free\"===i.anchor&&(M=Math.min(M,i.position),S=Math.max(S,i.position)),x=l.l+M*l.w,_=l.l+S*l.w}o.insert(\"line\",\":first-child\").attr({x1:x,x2:_,y1:y,y2:y,\"stroke-width\":T,stroke:k,\"stroke-dasharray\":p.dashStyle(i.spikedash,T)}).classed(\"spikeline\",!0).classed(\"crisp\",!0),o.insert(\"line\",\":first-child\").attr({x1:x,x2:_,y1:y,y2:y,\"stroke-width\":T+2,stroke:f}).classed(\"spikeline\",!0).classed(\"crisp\",!0)}-1!==w.indexOf(\"marker\")&&o.insert(\"circle\",\":first-child\").attr({cx:A+(\"right\"!==i.side?T:-T),cy:y,r:T,fill:k}).classed(\"spikeline\",!0)}if(h){var E,C,L=e.vLinePoint;n=L&&L.xa,i=L&&L.ya,\"cursor\"===n.spikesnap?(E=c.pointerX,C=c.pointerY):(E=n._offset+L.x,C=i._offset+L.y);var I,P,z=a.readability(L.color,f)<1.5?d.contrast(f):L.color,O=n.spikemode,D=n.spikethickness,R=n.spikecolor||z,F=g.getPxPosition(t,n);if(-1!==O.indexOf(\"toaxis\")||-1!==O.indexOf(\"across\")){if(-1!==O.indexOf(\"toaxis\")&&(I=F,P=C),-1!==O.indexOf(\"across\")){var B=n._counterDomainMin,N=n._counterDomainMax;\"free\"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),I=l.t+(1-N)*l.h,P=l.t+(1-B)*l.h}o.insert(\"line\",\":first-child\").attr({x1:E,x2:E,y1:I,y2:P,\"stroke-width\":D,stroke:R,\"stroke-dasharray\":p.dashStyle(n.spikedash,D)}).classed(\"spikeline\",!0).classed(\"crisp\",!0),o.insert(\"line\",\":first-child\").attr({x1:E,x2:E,y1:I,y2:P,\"stroke-width\":D+2,stroke:f}).classed(\"spikeline\",!0).classed(\"crisp\",!0)}-1!==O.indexOf(\"marker\")&&o.insert(\"circle\",\":first-child\").attr({cx:E,cy:F-(\"top\"!==n.side?D:-D),r:D,fill:R}).classed(\"spikeline\",!0)}}}function U(t,e){return!e||e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint}function V(t,e){return h.plainText(t||\"\",{len:e,allowedTags:[\"br\",\"sub\",\"sup\",\"b\",\"i\",\"em\",\"s\",\"u\"]})}function q(t,e,r){var n=e[t+\"a\"],i=e[t+\"Val\"],a=e.cd[0];if(\"category\"===n.type||\"multicategory\"===n.type)i=n._categoriesMap[i];else if(\"date\"===n.type){var o=e.trace[t+\"periodalignment\"];if(o){var s=e.cd[e.index],l=s[t+\"Start\"];void 0===l&&(l=s[t]);var c=s[t+\"End\"];void 0===c&&(c=s[t]);var u=c-l;\"end\"===o?i+=u:\"middle\"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&(\"group\"!==r.boxmode&&\"group\"!==r.violinmode||(i+=a.t.dPos)),i}function H(t){return t.offsetTop+t.clientTop}function G(t){return t.offsetLeft+t.clientLeft}function Z(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),i=n.left,a=n.top,s=i+n.width,l=a+n.height,c=o.apply3DTransform(r._invTransform)(i,a),u=o.apply3DTransform(r._invTransform)(s,l),h=c[0],f=c[1],p=u[0],d=u[1];return{x:h,y:f,width:p-h,height:d-f,top:Math.min(f,d),left:Math.min(h,p),right:Math.max(h,p),bottom:Math.max(f,d)}}},26430:function(t,e,r){\"use strict\";var n=r(34809),i=r(78766),a=r(36040).isUnifiedHover;t.exports=function(t,e,r,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&a(e.hovermode)&&(o.font||(o.font={}),l(\"size\"),l(\"family\"),l(\"color\"),l(\"weight\"),l(\"style\"),l(\"variant\"),s?(o.bgcolor||(o.bgcolor=i.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r(\"hoverlabel.bgcolor\",o.bgcolor),r(\"hoverlabel.bordercolor\",o.bordercolor),r(\"hoverlabel.namelength\",o.namelength),n.coerceFont(r,\"hoverlabel.font\",o.font),r(\"hoverlabel.align\",o.align)}},45265:function(t,e,r){\"use strict\";var n=r(34809),i=r(6811);t.exports=function(t,e){function r(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}return r(\"clickmode\"),r(\"hoversubplots\"),r(\"hovermode\")}},32141:function(t,e,r){\"use strict\";var n=r(45568),i=r(34809),a=r(14751),o=r(36040),s=r(6811),l=r(38103);t.exports={moduleType:\"component\",name:\"fx\",constants:r(85988),schema:{layout:s},attributes:r(70192),layoutAttributes:s,supplyLayoutGlobalDefaults:r(5358),supplyDefaults:r(3239),supplyLayoutDefaults:r(8412),calc:r(83552),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,\"hoverlabel.\"+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,\"hoverinfo\",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll(\"g.hovertext\").remove(),e.selectAll(\".spikeline\").remove()},click:r(94225)}},6811:function(t,e,r){\"use strict\";var n=r(85988),i=r(80337),a=i({editType:\"none\"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:\"flaglist\",flags:[\"event\",\"select\"],dflt:\"event\",editType:\"plot\",extras:[\"none\"]},dragmode:{valType:\"enumerated\",values:[\"zoom\",\"pan\",\"select\",\"lasso\",\"drawclosedpath\",\"drawopenpath\",\"drawline\",\"drawrect\",\"drawcircle\",\"orbit\",\"turntable\",!1],dflt:\"zoom\",editType:\"modebar\"},hovermode:{valType:\"enumerated\",values:[\"x\",\"y\",\"closest\",!1,\"x unified\",\"y unified\"],dflt:\"closest\",editType:\"modebar\"},hoversubplots:{valType:\"enumerated\",values:[\"single\",\"overlaying\",\"axis\"],dflt:\"overlaying\",editType:\"none\"},hoverdistance:{valType:\"integer\",min:-1,dflt:20,editType:\"none\"},spikedistance:{valType:\"integer\",min:-1,dflt:-1,editType:\"none\"},hoverlabel:{bgcolor:{valType:\"color\",editType:\"none\"},bordercolor:{valType:\"color\",editType:\"none\"},font:a,grouptitlefont:i({editType:\"none\"}),align:{valType:\"enumerated\",values:[\"left\",\"right\",\"auto\"],dflt:\"auto\",editType:\"none\"},namelength:{valType:\"integer\",min:-1,dflt:15,editType:\"none\"},editType:\"none\"},selectdirection:{valType:\"enumerated\",values:[\"h\",\"v\",\"d\",\"any\"],dflt:\"any\",editType:\"none\"}}},8412:function(t,e,r){\"use strict\";var n=r(34809),i=r(6811),a=r(45265),o=r(26430);t.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}a(t,e)&&(r(\"hoverdistance\"),r(\"spikedistance\")),\"select\"===r(\"dragmode\")&&r(\"selectdirection\");var s=e._has(\"mapbox\"),l=e._has(\"map\"),c=e._has(\"geo\"),u=e._basePlotModules.length;\"zoom\"===e.dragmode&&((s||l||c)&&1===u||(s||l)&&c&&2===u)&&(e.dragmode=\"pan\"),o(t,e,r),n.coerceFont(r,\"hoverlabel.grouptitlefont\",e.hoverlabel.font)}},5358:function(t,e,r){\"use strict\";var n=r(34809),i=r(26430),a=r(6811);t.exports=function(t,e){i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}))}},83595:function(t,e,r){\"use strict\";var n=r(34809),i=r(90694).counter,a=r(13792).u,o=r(54826).idRegex,s=r(78032),l={rows:{valType:\"integer\",min:1,editType:\"plot\"},roworder:{valType:\"enumerated\",values:[\"top to bottom\",\"bottom to top\"],dflt:\"top to bottom\",editType:\"plot\"},columns:{valType:\"integer\",min:1,editType:\"plot\"},subplots:{valType:\"info_array\",freeLength:!0,dimensions:2,items:{valType:\"enumerated\",values:[i(\"xy\").toString(),\"\"],editType:\"plot\"},editType:\"plot\"},xaxes:{valType:\"info_array\",freeLength:!0,items:{valType:\"enumerated\",values:[o.x.toString(),\"\"],editType:\"plot\"},editType:\"plot\"},yaxes:{valType:\"info_array\",freeLength:!0,items:{valType:\"enumerated\",values:[o.y.toString(),\"\"],editType:\"plot\"},editType:\"plot\"},pattern:{valType:\"enumerated\",values:[\"independent\",\"coupled\"],dflt:\"coupled\",editType:\"plot\"},xgap:{valType:\"number\",min:0,max:1,editType:\"plot\"},ygap:{valType:\"number\",min:0,max:1,editType:\"plot\"},domain:a({name:\"grid\",editType:\"plot\",noGridCell:!0},{}),xside:{valType:\"enumerated\",values:[\"bottom\",\"bottom plot\",\"top plot\",\"top\"],dflt:\"bottom plot\",editType:\"plot\"},yside:{valType:\"enumerated\",values:[\"left\",\"left plot\",\"right plot\",\"right\"],dflt:\"left plot\",editType:\"plot\"},editType:\"plot\"};function c(t,e,r){var n=e[r+\"axes\"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function u(t,e,r,n,i,a){var o=e(t+\"gap\",r),s=e(\"domain.\"+t);e(t+\"side\",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-o),h=u*(1-o),f=0;f1){f||p||d||\"independent\"===k(\"pattern\")&&(f=!0),g._hasSubplotGrid=f;var x,_,b=\"top to bottom\"===k(\"roworder\"),w=f?.2:.1,T=f?.3:.1;m&&e._splomGridDflt&&(x=e._splomGridDflt.xside,_=e._splomGridDflt.yside),g._domains={x:u(\"x\",k,w,x,v),y:u(\"y\",k,T,_,y,b)}}else delete e.grid}function k(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,u,f=t.grid||{},p=e._subplots,d=r._hasSubplotGrid,m=r.rows,g=r.columns,y=\"independent\"===r.pattern,v=r._axisMap={};if(d){var x=f.subplots||[];l=r.subplots=new Array(m);var _=1;for(n=0;n(\"legend\"===t?1:0));if(!1===M&&(r[t]=void 0),(!1!==M||h.uirevision)&&(p(\"uirevision\",r.uirevision),!1!==M)){p(\"borderwidth\");var S,E,C,L=\"h\"===p(\"orientation\"),I=\"paper\"===p(\"yref\"),P=\"paper\"===p(\"xref\"),z=\"left\";if(L?(S=0,n.getComponentMethod(\"rangeslider\",\"isVisible\")(e.xaxis)?I?(E=1.1,C=\"bottom\"):(E=1,C=\"top\"):I?(E=-.1,C=\"top\"):(E=0,C=\"bottom\")):(E=1,C=\"auto\",P?S=1.02:(S=1,z=\"right\")),i.coerce(h,f,{x:{valType:\"number\",editType:\"legend\",min:P?-2:0,max:P?3:1,dflt:S}},\"x\"),i.coerce(h,f,{y:{valType:\"number\",editType:\"legend\",min:I?-2:0,max:I?3:1,dflt:E}},\"y\"),p(\"traceorder\",b),c.isGrouped(r[t])&&p(\"tracegroupgap\"),p(\"entrywidth\"),p(\"entrywidthmode\"),p(\"indentation\"),p(\"itemsizing\"),p(\"itemwidth\"),p(\"itemclick\"),p(\"itemdoubleclick\"),p(\"groupclick\"),p(\"xanchor\",z),p(\"yanchor\",C),p(\"valign\"),i.noneOrAll(h,f,[\"x\",\"y\"]),p(\"title.text\")){p(\"title.side\",L?\"left\":\"top\");var O=i.extendFlat({},d,{size:i.bigFont(d.size)});i.coerceFont(p,\"title.font\",O)}}}}t.exports=function(t,e,r){var n,a=r.slice(),o=e.shapes;if(o)for(n=0;n1)}var B=d.hiddenlabels||[];if(!(T||d.showlegend&&S.length))return s.selectAll(\".\"+w).remove(),d._topdefs.select(\"#\"+r).remove(),a.autoMargin(t,w);var N=i.ensureSingle(s,\"g\",w,(function(t){T||t.attr(\"pointer-events\",\"all\")})),j=i.ensureSingleById(d._topdefs,\"clipPath\",r,(function(t){t.append(\"rect\")})),U=i.ensureSingle(N,\"rect\",\"bg\",(function(t){t.attr(\"shape-rendering\",\"crispEdges\")}));U.call(u.stroke,f.bordercolor).call(u.fill,f.bgcolor).style(\"stroke-width\",f.borderwidth+\"px\");var V,q=i.ensureSingle(N,\"g\",\"scrollbox\"),H=f.title;f._titleWidth=0,f._titleHeight=0,H.text?((V=i.ensureSingle(q,\"text\",w+\"titletext\")).attr(\"text-anchor\",\"start\").call(c.font,H.font).text(H.text),C(V,q,t,f,b)):q.selectAll(\".\"+w+\"titletext\").remove();var G=i.ensureSingle(N,\"rect\",\"scrollbar\",(function(t){t.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),Z=q.selectAll(\"g.groups\").data(S);Z.enter().append(\"g\").attr(\"class\",\"groups\"),Z.exit().remove();var W=Z.selectAll(\"g.traces\").data(i.identity);W.enter().append(\"g\").attr(\"class\",\"traces\"),W.exit().remove(),W.style(\"opacity\",(function(t){var e=t[0].trace;return o.traceIs(e,\"pie-like\")?-1!==B.indexOf(t[0].label)?.5:1:\"legendonly\"===e.visible?.5:1})).each((function(){n.select(this).call(M,t,f)})).call(x,t,f).each((function(){T||n.select(this).call(E,t,w)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout,o=P(i);i||(i=a[o]);var s=a._size,l=_.isVertical(i),u=_.isGrouped(i),h=\"fraction\"===i.entrywidthmode,f=i.borderwidth,d=2*f,m=p.itemGap,g=i.indentation+i.itemwidth+2*m,y=2*(f+m),v=I(i),x=i.y<0||0===i.y&&\"top\"===v,b=i.y>1||1===i.y&&\"bottom\"===v,w=i.tracegroupgap,T={};i._maxHeight=Math.max(x||b?a.height/2:s.h,30);var A=0;i._width=0,i._height=0;var M=function(t){var e=0,r=0,n=t.title.side;return n&&(-1!==n.indexOf(\"left\")&&(e=t._titleWidth),-1!==n.indexOf(\"top\")&&(r=t._titleHeight)),[e,r]}(i);if(l)r.each((function(t){var e=t[0].height;c.setTranslate(this,f+M[0],f+M[1]+i._height+e/2+m),i._height+=e,i._width=Math.max(i._width,t[0].width)})),A=g+i._width,i._width+=m+g+d,i._height+=y,u&&(e.each((function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var S=L(i),E=i.x<0||0===i.x&&\"right\"===S,C=i.x>1||1===i.x&&\"left\"===S,z=b||x,O=a.width/2;i._maxWidth=Math.max(E?z&&\"left\"===S?s.l+s.w:O:C?z&&\"right\"===S?s.r+s.w:O:s.w,2*g);var D=0,R=0;r.each((function(t){var e=k(t,i,g);D=Math.max(D,e),R+=e})),A=null;var F=0;if(u){var B=0,N=0,j=0;e.each((function(){var t=0,e=0;n.select(this).selectAll(\"g.traces\").each((function(r){var n=k(r,i,g),a=r[0].height;c.setTranslate(this,M[0],M[1]+f+m+a/2+e),e+=a,t=Math.max(t,n),T[r[0].trace.legendgroup]=t}));var r=t+m;N>0&&r+f+N>i._maxWidth?(F=Math.max(F,N),N=0,j+=B+w,B=e):B=Math.max(B,e),c.setTranslate(this,N,j),N+=r})),i._width=Math.max(F,N)+f,i._height=j+B+y}else{var U=r.size(),V=R+d+(U-1)*m=i._maxWidth&&(F=Math.max(F,Z),H=0,G+=q,i._height+=q,q=0),c.setTranslate(this,M[0]+f+H,M[1]+f+G+e/2+m),Z=H+r+m,H+=n,q=Math.max(q,e)})),V?(i._width=H+d,i._height=q+y):(i._width=Math.max(F,Z)+d,i._height+=q+y)}}i._width=Math.ceil(Math.max(i._width+M[0],i._titleWidth+2*(f+p.titlePad))),i._height=Math.ceil(Math.max(i._height+M[1],i._titleHeight+2*(f+p.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var W=t._context.edits,Y=W.legendText||W.legendPosition;r.each((function(t){var e=n.select(this).select(\".\"+o+\"toggle\"),r=t[0].height,a=t[0].trace.legendgroup,s=k(t,i,g);u&&\"\"!==a&&(s=T[a]);var f=Y?g:A||s;l||h||(f+=m/2),c.setRect(e,0,-r/2,f,r)}))}(t,Z,W,f)},function(){var e,u,v,x,_=d._size,b=f.borderwidth,k=\"paper\"===f.xref,M=\"paper\"===f.yref;if(H.text&&function(t,e,r){if(\"top center\"===e.title.side||\"top right\"===e.title.side){var n=e.title.font.size*m,i=0,a=t.node(),o=c.bBox(a).width;\"top center\"===e.title.side?i=.5*(e._width-2*r-2*p.titlePad-o):\"top right\"===e.title.side&&(i=e._width-2*r-2*p.titlePad-o),h.positionText(t,r+p.titlePad+i,r+n)}}(V,f,b),!T){var S,E;S=k?_.l+_.w*f.x-g[L(f)]*f._width:d.width*f.x-g[L(f)]*f._width,E=M?_.t+_.h*(1-f.y)-g[I(f)]*f._effHeight:d.height*(1-f.y)-g[I(f)]*f._effHeight;var C=function(t,e,r,n){var i=t._fullLayout,o=i[e],s=L(o),l=I(o),c=\"paper\"===o.xref,u=\"paper\"===o.yref;t._fullLayout._reservedMargin[e]={};var h=o.y<.5?\"b\":\"t\",f=o.x<.5?\"l\":\"r\",p={r:i.width-r,l:r+o._width,b:i.height-n,t:n+o._effHeight};if(c&&u)return a.autoMargin(t,e,{x:o.x,y:o.y,l:o._width*g[s],r:o._width*y[s],b:o._effHeight*y[l],t:o._effHeight*g[l]});c?t._fullLayout._reservedMargin[e][h]=p[h]:u||\"v\"===o.orientation?t._fullLayout._reservedMargin[e][f]=p[f]:t._fullLayout._reservedMargin[e][h]=p[h]}(t,w,S,E);if(C)return;if(d.margin.autoexpand){var P=S,z=E;S=k?i.constrain(S,0,d.width-f._width):P,E=M?i.constrain(E,0,d.height-f._effHeight):z,S!==P&&i.log(\"Constrain \"+w+\".x to make legend fit inside graph\"),E!==z&&i.log(\"Constrain \"+w+\".y to make legend fit inside graph\")}c.setTranslate(N,S,E)}if(G.on(\".drag\",null),N.on(\"wheel\",null),T||f._height<=f._maxHeight||t._context.staticPlot){var O=f._effHeight;T&&(O=f._height),U.attr({width:f._width-b,height:O-b,x:b/2,y:b/2}),c.setTranslate(q,0,0),j.select(\"rect\").attr({width:f._width-2*b,height:O-2*b,x:b,y:b}),c.setClipUrl(q,r,t),c.setRect(G,0,0,0,0),delete f._scrollY}else{var D,R,F,B=Math.max(p.scrollBarMinHeight,f._effHeight*f._effHeight/f._height),Z=f._effHeight-B-2*p.scrollBarMargin,W=f._height-f._effHeight,Y=Z/W,X=Math.min(f._scrollY||0,W);U.attr({width:f._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:f._effHeight-b,x:b/2,y:b/2}),j.select(\"rect\").attr({width:f._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:f._effHeight-2*b,x:b,y:b+X}),c.setClipUrl(q,r,t),K(X,B,Y),N.on(\"wheel\",(function(){K(X=i.constrain(f._scrollY+n.event.deltaY/Z*W,0,W),B,Y),0!==X&&X!==W&&n.event.preventDefault()}));var $=n.behavior.drag().on(\"dragstart\",(function(){var t=n.event.sourceEvent;D=\"touchstart\"===t.type?t.changedTouches[0].clientY:t.clientY,F=X})).on(\"drag\",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(R=\"touchmove\"===t.type?t.changedTouches[0].clientY:t.clientY,X=function(t,e,r){var n=(r-e)/Y+t;return i.constrain(n,0,W)}(F,D,R),K(X,B,Y))}));G.call($);var J=n.behavior.drag().on(\"dragstart\",(function(){var t=n.event.sourceEvent;\"touchstart\"===t.type&&(D=t.changedTouches[0].clientY,F=X)})).on(\"drag\",(function(){var t=n.event.sourceEvent;\"touchmove\"===t.type&&(R=t.changedTouches[0].clientY,X=function(t,e,r){var n=(e-r)/Y+t;return i.constrain(n,0,W)}(F,D,R),K(X,B,Y))}));q.call(J)}function K(e,r,n){f._scrollY=t._fullLayout[w]._scrollY=e,c.setTranslate(q,0,-e),c.setRect(G,f._width,p.scrollBarMargin+e*n,p.scrollBarWidth,r),j.select(\"rect\").attr(\"y\",b+e)}t._context.edits.legendPosition&&(N.classed(\"cursor-move\",!0),l.init({element:N.node(),gd:t,prepFn:function(t){if(t.target!==G.node()){var e=c.getTranslate(N);v=e.x,x=e.y}},moveFn:function(t,r){if(void 0!==v&&void 0!==x){var n=v+t,i=x+r;c.setTranslate(N,n,i),e=l.align(n,f._width,_.l,_.l+_.w,f.xanchor),u=l.align(i+f._height,-f._height,_.t+_.h,_.t,f.yanchor)}},doneFn:function(){if(void 0!==e&&void 0!==u){var r={};r[w+\".x\"]=e,r[w+\".y\"]=u,o.call(\"_guiRelayout\",t,r)}},clickFn:function(e,r){var n=s.selectAll(\"g.traces\").filter((function(){var t=this.getBoundingClientRect();return r.clientX>=t.left&&r.clientX<=t.right&&r.clientY>=t.top&&r.clientY<=t.bottom}));n.size()>0&&A(t,N,n,e,r)}}))}],t)}}function k(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return\"fraction\"===a?e._maxWidth*o:r+(o||i)}function A(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};a._group&&(l.group=a._group),o.traceIs(a,\"pie-like\")&&(l.label=r.datum()[0].label);var c=s.triggerHandler(t,\"plotly_legendclick\",l);if(1===n){if(!1===c)return;e._clickTimeout=setTimeout((function(){t._fullLayout&&f(r,t,n)}),t._context.doubleClickDelay)}else 2===n&&(e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,\"plotly_legenddoubleclick\",l)&&!1!==c&&f(r,t,n))}function M(t,e,r){var n,a,s=P(r),l=t.data()[0][0],u=l.trace,f=o.traceIs(u,\"pie-like\"),d=!r._inHover&&e._context.edits.legendText&&!f,m=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,a=l.groupTitle.font):(a=r.font,r.entries?n=l.text:(n=f?l.label:u.name,u._meta&&(n=i.templateString(n,u._meta))));var g=i.ensureSingle(t,\"text\",s+\"text\");g.attr(\"text-anchor\",\"start\").call(c.font,a).text(d?S(n,m):n);var y=r.indentation+r.itemwidth+2*p.itemGap;h.positionText(g,y,0),d?g.call(h.makeEditable,{gd:e,text:n}).call(C,t,e,r).on(\"edit\",(function(n){this.text(S(n,m)).call(C,t,e,r);var a=l.trace._fullInput||{},s={};if(o.hasTransform(a,\"groupby\")){var c=o.getTransformIndices(a,\"groupby\"),h=c[c.length-1],f=i.keyedContainer(a,\"transforms[\"+h+\"].styles\",\"target\",\"value.name\");f.set(l.trace._group,n),s=f.constructUpdate()}else s.name=n;return a._isShape?o.call(\"_guiRelayout\",e,\"shapes[\"+u.index+\"].name\",s.name):o.call(\"_guiRestyle\",e,s,u.index)})):C(g,t,e,r)}function S(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||\"\").length;n>0;n--)t+=\" \";return t}function E(t,e,r){var a,o=e._context.doubleClickDelay,s=1,l=i.ensureSingle(t,\"rect\",r+\"toggle\",(function(t){e._context.staticPlot||t.style(\"cursor\",\"pointer\").attr(\"pointer-events\",\"all\"),t.call(u.fill,\"rgba(0,0,0,0)\")}));e._context.staticPlot||(l.on(\"mousedown\",(function(){(a=(new Date).getTime())-e._legendMouseDownTimeo&&(s=Math.max(s-1,1)),A(e,i,t,s,n.event)}})))}function C(t,e,r,n,i){n._inHover&&t.attr(\"data-notex\",!0),h.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(r._inHover||!i||i.trace.showlegend){var a=t.select(\"g[class*=math-group]\"),o=a.node(),s=P(r);r||(r=e._fullLayout[s]);var l,u,f=r.borderwidth,d=(n===b?r.title.font:i.groupTitle?i.groupTitle.font:r.font).size*m;if(o){var g=c.bBox(o);l=g.height,u=g.width,n===b?c.setTranslate(a,f,f+.75*l):c.setTranslate(a,0,.25*l)}else{var y=\".\"+s+(n===b?\"title\":\"\")+\"text\",v=t.select(y),x=h.lineCount(v),_=v.node();if(l=d*x,u=_?c.bBox(_).width:0,n===b)\"left\"===r.title.side&&(u+=2*p.itemGap),h.positionText(v,f+p.titlePad,f+d);else{var w=2*p.itemGap+r.indentation+r.itemwidth;i.groupTitle&&(w=p.itemGap,u-=r.indentation+r.itemwidth),h.positionText(v,w,-d*((x-1)/2-.3))}}n===b?(r._titleWidth=u,r._titleHeight=l):(i.lineHeight=d,i.height=Math.max(l,16)+3,i.width=u)}else t.remove()}(e,r,n,i)}))}function L(t){return i.isRightAnchor(t)?\"right\":i.isCenterAnchor(t)?\"center\":\"left\"}function I(t){return i.isBottomAnchor(t)?\"bottom\":i.isMiddleAnchor(t)?\"middle\":\"top\"}function P(t){return t._id||\"legend\"}t.exports=function(t,e){if(e)T(t,e);else{var r=t._fullLayout,i=r._legends;r._infolayer.selectAll('[class^=\"legend\"]').each((function(){var t=n.select(this),e=t.attr(\"class\").split(\" \")[0];e.match(w)&&-1===i.indexOf(e)&&t.remove()}));for(var a=0;aS&&(M=S)}k[a][0]._groupMinRank=M,k[a][0]._preGroupSort=a}var E=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(k.forEach((function(t,e){t[0]._preGroupSort=e})),k.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),a=0;ar?r:t}t.exports=function(t,e,r){var y=e._fullLayout;r||(r=y.legend);var v=\"constant\"===r.itemsizing,x=r.itemwidth,_=(x+2*p.itemGap)/2,b=o(_,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return v?n:Math.min(i,r)};function T(t,a,o){var u=t[0].trace,h=u.marker||{},f=h.line||{},p=h.cornerradius?\"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z\":\"M6,6H-6V-6H6Z\",d=o?u.visible&&u.type===o:i.traceIs(u,\"bar\"),m=n.select(a).select(\"g.legendpoints\").selectAll(\"path.legend\"+o).data(d?[t]:[]);m.enter().append(\"path\").classed(\"legend\"+o,!0).attr(\"d\",p).attr(\"transform\",b),m.exit().remove(),m.each((function(t){var i=n.select(this),a=t[0],o=w(a.mlw,h.line,5,2);i.style(\"stroke-width\",o+\"px\");var p=a.mcc;if(!r._inHover&&\"mc\"in a){var d=c(h),m=d.mid;void 0===m&&(m=(d.max+d.min)/2),p=s.tryColorscale(h,\"\")(m)}var y=p||a.mc||h.color,v=h.pattern,x=v&&s.getPatternAttr(v.shape,0,\"\");if(x){var _=s.getPatternAttr(v.bgcolor,0,null),b=s.getPatternAttr(v.fgcolor,0,null),T=v.fgopacity,k=g(v.size,8,10),A=g(v.solidity,.5,1),M=\"legend-\"+u.uid;i.call(s.pattern,\"legend\",e,M,x,k,A,p,v.fillmode,_,b,T)}else i.call(l.fill,y);o&&l.stroke(i,a.mlc||f.color)}))}function k(t,r,o){var s=t[0],l=s.trace,c=o?l.visible&&l.type===o:i.traceIs(l,o),u=n.select(r).select(\"g.legendpoints\").selectAll(\"path.legend\"+o).data(c?[t]:[]);if(u.enter().append(\"path\").classed(\"legend\"+o,!0).attr(\"d\",\"M6,6H-6V-6H6Z\").attr(\"transform\",b),u.exit().remove(),u.size()){var p=l.marker||{},d=w(f(p.line.width,s.pts),p.line,5,2),m=\"pieLike\",g=a.minExtend(l,{marker:{line:{width:d}}},m),y=a.minExtend(s,{trace:g},m);h(u,y,g,e)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,\"g\",\"layers\");i.style(\"opacity\",t[0].trace.opacity);var s=r.indentation,l=r.valign,c=t[0].lineHeight,u=t[0].height;if(\"middle\"===l&&0===s||!c||!u)i.attr(\"transform\",null);else{var h={top:1,bottom:-1}[l]*(.5*(c-u+3))||0,f=r.indentation;i.attr(\"transform\",o(f,h))}i.selectAll(\"g.legendfill\").data([t]).enter().append(\"g\").classed(\"legendfill\",!0),i.selectAll(\"g.legendlines\").data([t]).enter().append(\"g\").classed(\"legendlines\",!0);var p=i.selectAll(\"g.legendsymbols\").data([t]);p.enter().append(\"g\").classed(\"legendsymbols\",!0),p.selectAll(\"g.legendpoints\").data([t]).enter().append(\"g\").classed(\"legendpoints\",!0)})).each((function(t){var r,i=t[0].trace,o=[];if(i.visible)switch(i.type){case\"histogram2d\":case\"heatmap\":o=[[\"M-15,-2V4H15V-2Z\"]],r=!0;break;case\"choropleth\":case\"choroplethmapbox\":case\"choroplethmap\":o=[[\"M-6,-6V6H6V-6Z\"]],r=!0;break;case\"densitymapbox\":case\"densitymap\":o=[[\"M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0\"]],r=\"radial\";break;case\"cone\":o=[[\"M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z\"],[\"M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z\"],[\"M-6,-2 A2,2 0 0,0 -6,2 L6,0Z\"]],r=!1;break;case\"streamtube\":o=[[\"M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z\"],[\"M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z\"],[\"M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z\"]],r=!1;break;case\"surface\":o=[[\"M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z\"],[\"M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z\"]],r=!0;break;case\"mesh3d\":o=[[\"M-6,6H0L-6,-6Z\"],[\"M6,6H0L6,-6Z\"],[\"M-6,-6H6L0,6Z\"]],r=!1;break;case\"volume\":o=[[\"M-6,6H0L-6,-6Z\"],[\"M6,6H0L6,-6Z\"],[\"M-6,-6H6L0,6Z\"]],r=!0;break;case\"isosurface\":o=[[\"M-6,6H0L-6,-6Z\"],[\"M6,6H0L6,-6Z\"],[\"M-6,-6 A12,24 0 0,0 6,-6 L0,6Z\"]],r=!1}var u=n.select(this).select(\"g.legendpoints\").selectAll(\"path.legend3dandfriends\").data(o);u.enter().append(\"path\").classed(\"legend3dandfriends\",!0).attr(\"transform\",b).style(\"stroke-miterlimit\",1),u.exit().remove(),u.each((function(t,o){var u,h=n.select(this),f=c(i),p=f.colorscale,m=f.reversescale;if(p){if(!r){var g=p.length;u=0===o?p[m?g-1:0][1]:1===o?p[m?0:g-1][1]:p[Math.floor((g-1)/2)][1]}}else{var y=i.vertexcolor||i.facecolor||i.color;u=a.isArrayOrTypedArray(y)?y[o]||y[0]:y}h.attr(\"d\",t[0]),u?h.call(l.fill,u):h.call((function(t){if(t.size()){var n=\"legendfill-\"+i.uid;s.gradient(t,e,n,d(m,\"radial\"===r),p,\"fill\")}}))}))})).each((function(t){var e=t[0].trace,r=\"waterfall\"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,T(t,this,\"waterfall\")}var a=[];e.visible&&r&&(a=t[0].hasTotals?[[\"increasing\",\"M-6,-6V6H0Z\"],[\"totals\",\"M6,6H0L-6,-6H-0Z\"],[\"decreasing\",\"M6,6V-6H0Z\"]]:[[\"increasing\",\"M-6,-6V6H6Z\"],[\"decreasing\",\"M6,6V-6H-6Z\"]]);var o=n.select(this).select(\"g.legendpoints\").selectAll(\"path.legendwaterfall\").data(a);o.enter().append(\"path\").classed(\"legendwaterfall\",!0).attr(\"transform\",b).style(\"stroke-miterlimit\",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);r.attr(\"d\",t[1]).style(\"stroke-width\",a+\"px\").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(t){T(t,this,\"funnel\")})).each((function(t){T(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select(\"g.legendpoints\").selectAll(\"path.legendbox\").data(r.visible&&i.traceIs(r,\"box-violin\")?[t]:[]);o.enter().append(\"path\").classed(\"legendbox\",!0).attr(\"d\",\"M6,6H-6V-6H6Z\").attr(\"transform\",b),o.exit().remove(),o.each((function(){var t=n.select(this);if(\"all\"!==r.boxpoints&&\"all\"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);t.style(\"stroke-width\",i+\"px\").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var c=a.minExtend(r,{marker:{size:v?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:\"diameter\"}});o.call(s.pointStyle,c,e)}}))})).each((function(t){k(t,this,\"funnelarea\")})).each((function(t){k(t,this,\"pie\")})).each((function(t){var r,i,o=m(t),l=o.showFill,h=o.showLine,f=o.showGradientLine,p=o.showGradientFill,g=o.anyFill,y=o.anyLine,v=t[0],_=v.trace,b=c(_),T=b.colorscale,k=b.reversescale,A=u.hasMarkers(_)||!g?\"M5,0\":y?\"M5,-2\":\"M5,-3\",M=n.select(this),S=M.select(\".legendfill\").selectAll(\"path\").data(l||p?[t]:[]);if(S.enter().append(\"path\").classed(\"js-fill\",!0),S.exit().remove(),S.attr(\"d\",A+\"h\"+x+\"v6h-\"+x+\"z\").call((function(t){if(t.size())if(l)s.fillGroupStyle(t,e,!0);else{var r=\"legendfill-\"+_.uid;s.gradient(t,e,r,d(k),T,\"fill\")}})),h||f){var E=w(void 0,_.line,10,5);i=a.minExtend(_,{line:{width:E}}),r=[a.minExtend(v,{trace:i})]}var C=M.select(\".legendlines\").selectAll(\"path\").data(h||f?[r]:[]);C.enter().append(\"path\").classed(\"js-line\",!0),C.exit().remove(),C.attr(\"d\",A+(f?\"l\"+x+\",0.0001\":\"h\"+x)).call(h?s.lineGroupStyle:function(t){if(t.size()){var r=\"legendline-\"+_.uid;s.lineGroupStyle(t),s.gradient(t,e,r,d(k),T,\"stroke\")}})})).each((function(t){var r,i,o=m(t),l=o.anyFill,c=o.anyLine,h=o.showLine,f=o.showMarker,p=t[0],d=p.trace,g=!f&&!c&&!l&&u.hasText(d);function y(t,e,r,n){var i=a.nestedProperty(d,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(t){return p._distinct&&p.index&&t[p.index]?t[p.index]:t[0]}if(f||g||h){var _={},w={};if(f){_.mc=y(\"marker.color\",x),_.mx=y(\"marker.symbol\",x),_.mo=y(\"marker.opacity\",a.mean,[.2,1]),_.mlc=y(\"marker.line.color\",x),_.mlw=y(\"marker.line.width\",a.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:\"diameter\"};var T=y(\"marker.size\",a.mean,[2,16],12);_.ms=T,w.marker.size=T}h&&(w.line={width:y(\"line.width\",x,[0,10],5)}),g&&(_.tx=\"Aa\",_.tp=y(\"textposition\",x),_.ts=10,_.tc=y(\"textfont.color\",x),_.tf=y(\"textfont.family\",x),_.tw=y(\"textfont.weight\",x),_.ty=y(\"textfont.style\",x),_.tv=y(\"textfont.variant\",x),_.tC=y(\"textfont.textcase\",x),_.tE=y(\"textfont.lineposition\",x),_.tS=y(\"textfont.shadow\",x)),r=[a.minExtend(p,_)],(i=a.minExtend(d,w)).selectedpoints=null,i.texttemplate=null}var k=n.select(this).select(\"g.legendpoints\"),A=k.selectAll(\"path.scatterpts\").data(f?r:[]);A.enter().insert(\"path\",\":first-child\").classed(\"scatterpts\",!0).attr(\"transform\",b),A.exit().remove(),A.call(s.pointStyle,i,e),f&&(r[0].mrc=3);var M=k.selectAll(\"g.pointtext\").data(g?r:[]);M.enter().append(\"g\").classed(\"pointtext\",!0).append(\"text\").attr(\"transform\",b),M.exit().remove(),M.selectAll(\"text\").call(s.textPointStyle,i,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select(\"g.legendpoints\").selectAll(\"path.legendcandle\").data(e.visible&&\"candlestick\"===e.type?[t,t]:[]);r.enter().append(\"path\").classed(\"legendcandle\",!0).attr(\"d\",(function(t,e){return e?\"M-15,0H-8M-8,6V-6H8Z\":\"M15,0H8M8,-6V6H-8Z\"})).attr(\"transform\",b).style(\"stroke-miterlimit\",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?\"increasing\":\"decreasing\"],o=w(void 0,a.line,5,2);i.style(\"stroke-width\",o+\"px\").call(l.fill,a.fillcolor),o&&l.stroke(i,a.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select(\"g.legendpoints\").selectAll(\"path.legendohlc\").data(e.visible&&\"ohlc\"===e.type?[t,t]:[]);r.enter().append(\"path\").classed(\"legendohlc\",!0).attr(\"d\",(function(t,e){return e?\"M-15,0H0M-8,-6V0\":\"M15,0H0M8,6V0\"})).attr(\"transform\",b).style(\"stroke-miterlimit\",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?\"increasing\":\"decreasing\"],o=w(void 0,a.line,5,2);i.style(\"fill\",\"none\").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},50308:function(t,e,r){\"use strict\";r(87632),t.exports={editType:\"modebar\",orientation:{valType:\"enumerated\",values:[\"v\",\"h\"],dflt:\"h\",editType:\"modebar\"},bgcolor:{valType:\"color\",editType:\"modebar\"},color:{valType:\"color\",editType:\"modebar\"},activecolor:{valType:\"color\",editType:\"modebar\"},uirevision:{valType:\"any\",editType:\"none\"},add:{valType:\"string\",arrayOk:!0,dflt:\"\",editType:\"modebar\"},remove:{valType:\"string\",arrayOk:!0,dflt:\"\",editType:\"modebar\"}}},5832:function(t,e,r){\"use strict\";var n=r(33626),i=r(44122),a=r(5975),o=r(35188),s=r(28231).eraseActiveShape,l=r(34809),c=l._,u=t.exports={};function h(t,e){var r,i,o=e.currentTarget,s=o.getAttribute(\"data-attr\"),l=o.getAttribute(\"data-val\")||!0,c=t._fullLayout,u={},h=a.list(t,null,!0),f=c._cartesianSpikesEnabled;if(\"zoom\"===s){var p,d=\"in\"===l?.5:2,m=(1+d)/2,g=(1-d)/2;for(i=0;i1?(z=[\"toggleHover\"],O=[\"resetViews\"]):y?(P=[\"zoomInGeo\",\"zoomOutGeo\"],z=[\"hoverClosestGeo\"],O=[\"resetGeo\"]):g?(z=[\"hoverClosest3d\"],O=[\"resetCameraDefault3d\",\"resetCameraLastSave3d\"]):w?(P=[\"zoomInMapbox\",\"zoomOutMapbox\"],z=[\"toggleHover\"],O=[\"resetViewMapbox\"]):T?(P=[\"zoomInMap\",\"zoomOutMap\"],z=[\"toggleHover\"],O=[\"resetViewMap\"]):_?z=[\"hoverClosestGl2d\"]:v?z=[\"hoverClosestPie\"]:M?(z=[\"hoverClosestCartesian\",\"hoverCompareCartesian\"],O=[\"resetViewSankey\"]):z=[\"toggleHover\"],m&&z.push(\"toggleSpikelines\",\"hoverClosestCartesian\",\"hoverCompareCartesian\"),(function(t){for(var e=0;e0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a0?t.touches[0].clientX:0}function y(t,e,r,n){var i=o.ensureSingle(t,\"rect\",m.bgClassName,(function(t){t.attr({x:0,y:0,\"shape-rendering\":\"crispEdges\"})})),a=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,u=-n._offsetShift,h=l.crispRound(e,n.borderwidth);i.attr({width:n._width+a,height:n._height+a,transform:s(u,u),\"stroke-width\":h}).call(c.stroke,n.bordercolor).call(c.fill,n.bgcolor)}function v(t,e,r,n){var i=e._fullLayout;o.ensureSingleById(i._topdefs,\"clipPath\",n._clipId,(function(t){t.append(\"rect\").attr({x:0,y:0})})).select(\"rect\").attr({width:n._width,height:n._height})}function x(t,e,r,i){var s,c=e.calcdata,u=t.selectAll(\"g.\"+m.rangePlotClassName).data(r._subplotsWith,o.identity);u.enter().append(\"g\").attr(\"class\",(function(t){return m.rangePlotClassName+\" \"+t})).call(l.setClipUrl,i._clipId,e),u.order(),u.exit().remove(),u.each((function(t,o){var l=n.select(this),u=0===o,p=f.getFromId(e,t,\"y\"),d=p._name,m=i[d],g={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:i.range.slice(),calendar:r.calendar},width:i._width,height:i._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};r.rangebreaks&&(g.layout.xaxis.rangebreaks=r.rangebreaks),g.layout[d]={type:p.type,domain:[0,1],range:\"match\"!==m.rangemode?m.range.slice():p.range.slice(),calendar:p.calendar},p.rangebreaks&&(g.layout[d].rangebreaks=p.rangebreaks),a.supplyDefaults(g);var y=g._fullLayout.xaxis,v=g._fullLayout[d];y.clearCalc(),y.setScale(),v.clearCalc(),v.setScale();var x={id:t,plotgroup:l,xaxis:y,yaxis:v,isRangePlot:!0};u?s=x:(x.mainplot=\"xy\",x.mainplotinfo=s),h.rangePlot(e,x,function(t,e){for(var r=[],n=0;n=n.max)e=B[r+1];else if(t=n.pmax)e=B[r+1];else if(tr._length||v+b<0)return;u=y+b,p=v+b;break;case l:if(_=\"col-resize\",y+b>r._length)return;u=y+b,p=v;break;case c:if(_=\"col-resize\",v+b<0)return;u=y,p=v+b;break;default:_=\"ew-resize\",u=m,p=m+b}if(p=0;k--){var A=r.append(\"path\").attr(g).style(\"opacity\",k?.1:y).call(o.stroke,x).call(o.fill,v).call(s.dashLine,k?\"solid\":b,k?4+_:_);if(d(A,t,a),w){var M=l(t.layout,\"selections\",a);A.style({cursor:\"move\"});var S={element:A.node(),plotinfo:p,gd:t,editHelpers:M,isActiveSelection:!0},E=n(c,t);i(E,A,S)}else A.style(\"pointer-events\",k?\"all\":\"none\");T[k]=A}var C=T[0];T[1].node().addEventListener(\"click\",(function(){return function(t,e){if(f(t)){var r=+e.node().getAttribute(\"data-index\");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void m(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=m,h(t)}}}(t,C)}))}(t._fullLayout._selectionLayer)}function d(t,e,r){var n=r.xref+r.yref;s.setClipUrl(t,\"clip\"+e._fullLayout._uid+n,e)}function m(t){f(t)&&t._fullLayout._activeSelectionIndex>=0&&(a(t),delete t._fullLayout._activeSelectionIndex,h(t))}t.exports={draw:h,drawOne:p,activateLastSelection:function(t){if(f(t)){var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=m,h(t)}}}},52307:function(t,e,r){\"use strict\";var n=r(94850).T,i=r(93049).extendFlat;t.exports={newselection:{mode:{valType:\"enumerated\",values:[\"immediate\",\"gradual\"],dflt:\"immediate\",editType:\"none\"},line:{color:{valType:\"color\",editType:\"none\"},width:{valType:\"number\",min:1,dflt:1,editType:\"none\"},dash:i({},n,{dflt:\"dot\",editType:\"none\"}),editType:\"none\"},editType:\"none\"},activeselection:{fillcolor:{valType:\"color\",dflt:\"rgba(0,0,0,0)\",editType:\"none\"},opacity:{valType:\"number\",min:0,max:1,dflt:.5,editType:\"none\"},editType:\"none\"}}},43028:function(t){\"use strict\";t.exports=function(t,e,r){r(\"newselection.mode\"),r(\"newselection.line.width\")&&(r(\"newselection.line.color\"),r(\"newselection.line.dash\")),r(\"activeselection.fillcolor\"),r(\"activeselection.opacity\")}},51817:function(t,e,r){\"use strict\";var n=r(70414).selectMode,i=r(78534).clearOutline,a=r(81055),o=a.readPaths,s=a.writePaths,l=a.fixDatesForPaths;t.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var a=r.getAttribute(\"d\"),c=e.gd,u=c._fullLayout.newselection,h=e.plotinfo,f=h.xaxis,p=h.yaxis,d=e.isActiveSelection,m=e.dragmode,g=(c.layout||{}).selections||[];if(!n(m)&&void 0!==d){var y=c._fullLayout._activeSelectionIndex;if(y-1,_=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){Z(t,e,a);var b=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((n+=e.selectedpoints.length)>1)return!1}return 1===n}(s)&&(f=J(b))){for(o&&o.remove(),g=0;g=0})(i)&&i._fullLayout._deactivateShape(i),function(t){return t._fullLayout._activeSelectionIndex>=0}(i)&&i._fullLayout._deactivateSelection(i);var o=i._fullLayout._zoomlayer,s=p(r),l=m(r);if(s||l){var c,u,h=o.selectAll(\".select-outline-\"+n.id);h&&i._fullLayout._outlining&&(s&&(c=T(h,t)),c&&a.call(\"_guiRelayout\",i,{shapes:c}),l&&!U(t)&&(u=k(h,t)),u&&(i._fullLayout._noEmitSelectedAtStart=!0,a.call(\"_guiRelayout\",i,{selections:u}).then((function(){e&&A(i)}))),i._fullLayout._outlining=!1)}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function Y(t){return t._id}function X(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(Y),c=r.map(Y);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function K(t,e,r){var n,i;for(n=0;n-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,pt=et[0].yref;if(nt&&pt){var dt=ct(et);ut([L(t,nt,\"x\"),L(t,pt,\"y\")])(Q,dt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ht(t,Q),f._reselect=!1}if(!a&&f._deselect){var mt=f._deselect;(function(t,e,r){for(var n=0;n=0)k._fullLayout._deactivateShape(k);else if(!x){var r=A.clickmode;C.done(Mt).then((function(){if(C.clear(Mt),2===t){for(_t.remove(),J=0;J-1&&V(e,k,n.xaxes,n.yaxes,n.subplot,n,_t),\"event\"===r&&ht(k,void 0);l.click(k,e,I.id)})).catch(M.error)}},n.doneFn=function(){kt.remove(),C.done(Mt).then((function(){C.clear(Mt),!S&&$&&n.selectionDefs&&($.subtract=xt,n.selectionDefs.push($),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Y)),(S||x)&&W(n,S),n.doneFnCompleted&&n.doneFnCompleted(St),_&&ht(k,at)})).catch(M.error)}},clearOutline:x,clearSelectionsCache:W,selectOnClick:V}},43144:function(t,e,r){\"use strict\";var n=r(50222),i=r(80337),a=r(36640).line,o=r(94850).T,s=r(93049).extendFlat,l=r(78032).templatedArray,c=(r(35081),r(9829)),u=r(3208).LF,h=r(41235);t.exports=l(\"shape\",{visible:s({},c.visible,{editType:\"calc+arraydraw\"}),showlegend:{valType:\"boolean\",dflt:!1,editType:\"calc+arraydraw\"},legend:s({},c.legend,{editType:\"calc+arraydraw\"}),legendgroup:s({},c.legendgroup,{editType:\"calc+arraydraw\"}),legendgrouptitle:{text:s({},c.legendgrouptitle.text,{editType:\"calc+arraydraw\"}),font:i({editType:\"calc+arraydraw\"}),editType:\"calc+arraydraw\"},legendrank:s({},c.legendrank,{editType:\"calc+arraydraw\"}),legendwidth:s({},c.legendwidth,{editType:\"calc+arraydraw\"}),type:{valType:\"enumerated\",values:[\"circle\",\"rect\",\"path\",\"line\"],editType:\"calc+arraydraw\"},layer:{valType:\"enumerated\",values:[\"below\",\"above\",\"between\"],dflt:\"above\",editType:\"arraydraw\"},xref:s({},n.xref,{}),xsizemode:{valType:\"enumerated\",values:[\"scaled\",\"pixel\"],dflt:\"scaled\",editType:\"calc+arraydraw\"},xanchor:{valType:\"any\",editType:\"calc+arraydraw\"},x0:{valType:\"any\",editType:\"calc+arraydraw\"},x1:{valType:\"any\",editType:\"calc+arraydraw\"},x0shift:{valType:\"number\",dflt:0,min:-1,max:1,editType:\"calc\"},x1shift:{valType:\"number\",dflt:0,min:-1,max:1,editType:\"calc\"},yref:s({},n.yref,{}),ysizemode:{valType:\"enumerated\",values:[\"scaled\",\"pixel\"],dflt:\"scaled\",editType:\"calc+arraydraw\"},yanchor:{valType:\"any\",editType:\"calc+arraydraw\"},y0:{valType:\"any\",editType:\"calc+arraydraw\"},y1:{valType:\"any\",editType:\"calc+arraydraw\"},y0shift:{valType:\"number\",dflt:0,min:-1,max:1,editType:\"calc\"},y1shift:{valType:\"number\",dflt:0,min:-1,max:1,editType:\"calc\"},path:{valType:\"string\",editType:\"calc+arraydraw\"},opacity:{valType:\"number\",min:0,max:1,dflt:1,editType:\"arraydraw\"},line:{color:s({},a.color,{editType:\"arraydraw\"}),width:s({},a.width,{editType:\"calc+arraydraw\"}),dash:s({},o,{editType:\"arraydraw\"}),editType:\"calc+arraydraw\"},fillcolor:{valType:\"color\",dflt:\"rgba(0,0,0,0)\",editType:\"arraydraw\"},fillrule:{valType:\"enumerated\",values:[\"evenodd\",\"nonzero\"],dflt:\"evenodd\",editType:\"arraydraw\"},editable:{valType:\"boolean\",dflt:!1,editType:\"calc+arraydraw\"},label:{text:{valType:\"string\",dflt:\"\",editType:\"arraydraw\"},texttemplate:u({},{keys:Object.keys(h)}),font:i({editType:\"calc+arraydraw\",colorEditType:\"arraydraw\"}),textposition:{valType:\"enumerated\",values:[\"top left\",\"top center\",\"top right\",\"middle left\",\"middle center\",\"middle right\",\"bottom left\",\"bottom center\",\"bottom right\",\"start\",\"middle\",\"end\"],editType:\"arraydraw\"},textangle:{valType:\"angle\",dflt:\"auto\",editType:\"calc+arraydraw\"},xanchor:{valType:\"enumerated\",values:[\"auto\",\"left\",\"center\",\"right\"],dflt:\"auto\",editType:\"calc+arraydraw\"},yanchor:{valType:\"enumerated\",values:[\"top\",\"middle\",\"bottom\"],editType:\"calc+arraydraw\"},padding:{valType:\"number\",dflt:3,min:0,editType:\"arraydraw\"},editType:\"arraydraw\"},editType:\"arraydraw\"})},44959:function(t,e,r){\"use strict\";var n=r(34809),i=r(29714),a=r(2956),o=r(49728);function s(t){return c(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return c(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function c(t,e,r,i,s,l){var c=t/2,u=l;if(\"pixel\"===e){var h=s?o.extractPathCoords(s,l?a.paramIsY:a.paramIsX):[r,i],f=n.aggNums(Math.max,null,h),p=n.aggNums(Math.min,null,h),d=p<0?Math.abs(p)+c:c,m=f>0?f+c:c;return{ppad:c,ppadplus:u?d:m,ppadminus:u?m:d}}return{ppad:c}}function u(t,e,r){var n,i,s=\"x\"===t._id.charAt(0)?\"x\":\"y\",l=\"category\"===t.type||\"multicategory\"===t.type,c=0,u=0,h=l?t.r2c:t.d2c;if(\"scaled\"===e[s+\"sizemode\"]?(n=e[s+\"0\"],i=e[s+\"1\"],l&&(c=e[s+\"0shift\"],u=e[s+\"1shift\"])):(n=e[s+\"anchor\"],i=e[s+\"anchor\"]),void 0!==n)return[h(n)+c,h(i)+u];if(e.path){var f,p,d,m,g=1/0,y=-1/0,v=e.path.match(a.segmentRE);for(\"date\"===t.type&&(h=o.decodeDate(h)),f=0;fy&&(y=m)));return y>=g?[g,y]:void 0}}t.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o=t?e-n:n-e,-180/Math.PI*Math.atan2(i,a)}(x,b,_,w):0),A.call((function(e){return e.call(o.font,k).attr({}),a.convertToTspans(e,t),e}));var G=function(t,e,r,n,i,a,o){var s,l,c,u,f=i.label.textposition,p=i.label.textangle,d=i.label.padding,m=i.type,g=Math.PI/180*a,y=Math.sin(g),v=Math.cos(g),x=i.label.xanchor,_=i.label.yanchor;if(\"line\"===m){\"start\"===f?(s=t,l=e):\"end\"===f?(s=r,l=n):(s=(t+r)/2,l=(e+n)/2),\"auto\"===x&&(x=\"start\"===f?\"auto\"===p?r>t?\"left\":rt?\"right\":rt?\"right\":rt?\"left\":r1&&(2!==t.length||\"Z\"!==t[1][0])&&(0===L&&(t[0][0]=\"M\"),e[C]=t,A(),M())}}()}}function V(t,r){!function(t,r){if(e.length)for(var n=0;nb?(M=p,L=\"y0\",S=b,I=\"y1\"):(M=b,L=\"y1\",S=p,I=\"y0\"),it(n),st(l,r),function(t,e,r){var n=e.xref,i=e.yref,a=o.getFromId(r,n),s=o.getFromId(r,i),l=\"\";\"paper\"===n||a.autorange||(l+=n),\"paper\"===i||s.autorange||(l+=i),f.setClipUrl(t,l?\"clip\"+r._fullLayout._uid+l:null,r)}(e,r,t),nt.moveFn=\"move\"===D?at:ot,nt.altKey=n.altKey)},doneFn:function(){_(t)||(m(e),lt(l),T(e,t,r),i.call(\"_guiRelayout\",t,u.getUpdateObj()))},clickFn:function(){_(t)||lt(l)}};function it(r){if(_(t))D=null;else if(j)D=\"path\"===r.target.tagName?\"move\":\"start-point\"===r.target.attributes[\"data-line-point\"].value?\"resize-over-start-point\":\"resize-over-end-point\";else{var n=nt.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!U&&i>R&&a>F&&!r.shiftKey?d.getCursor(o/i,1-s/a):\"move\";m(e,l),D=l.split(\"-\")[0]}}function at(n,i){if(\"path\"===r.type){var a=function(t){return t},o=a,u=a;B?V(\"xanchor\",r.xanchor=tt(w+n)):(o=function(t){return tt(K(t)+n)},H&&\"date\"===H.type&&(o=y.encodeDate(o))),N?V(\"yanchor\",r.yanchor=et(A+i)):(u=function(t){return et(Q(t)+i)},Z&&\"date\"===Z.type&&(u=y.encodeDate(u))),V(\"path\",r.path=k(O,o,u))}else B?V(\"xanchor\",r.xanchor=tt(w+n)):(V(\"x0\",r.x0=tt(h+n)),V(\"x1\",r.x1=tt(x+n))),N?V(\"yanchor\",r.yanchor=et(A+i)):(V(\"y0\",r.y0=et(p+i)),V(\"y1\",r.y1=et(b+i)));e.attr(\"d\",v(t,r)),st(l,r),c(t,s,r,q)}function ot(n,i){if(U){var a=function(t){return t},o=a,u=a;B?V(\"xanchor\",r.xanchor=tt(w+n)):(o=function(t){return tt(K(t)+n)},H&&\"date\"===H.type&&(o=y.encodeDate(o))),N?V(\"yanchor\",r.yanchor=et(A+i)):(u=function(t){return et(Q(t)+i)},Z&&\"date\"===Z.type&&(u=y.encodeDate(u))),V(\"path\",r.path=k(O,o,u))}else if(j){if(\"resize-over-start-point\"===D){var f=h+n,d=N?p-i:p+i;V(\"x0\",r.x0=B?f:tt(f)),V(\"y0\",r.y0=N?d:et(d))}else if(\"resize-over-end-point\"===D){var m=x+n,g=N?b-i:b+i;V(\"x1\",r.x1=B?m:tt(m)),V(\"y1\",r.y1=N?g:et(g))}}else{var _=function(t){return-1!==D.indexOf(t)},T=_(\"n\"),G=_(\"s\"),W=_(\"w\"),Y=_(\"e\"),X=T?M+i:M,$=G?S+i:S,J=W?E+n:E,rt=Y?C+n:C;N&&(T&&(X=M-i),G&&($=S-i)),(!N&&$-X>F||N&&X-$>F)&&(V(L,r[L]=N?X:et(X)),V(I,r[I]=N?$:et($))),rt-J>R&&(V(P,r[P]=B?J:tt(J)),V(z,r[z]=B?rt:tt(rt)))}e.attr(\"d\",v(t,r)),st(l,r),c(t,s,r,q)}function st(t,e){(B||N)&&function(){var r=\"path\"!==e.type,n=t.selectAll(\".visual-cue\").data([0]);n.enter().append(\"path\").attr({fill:\"#fff\",\"fill-rule\":\"evenodd\",stroke:\"#000\",\"stroke-width\":1}).classed(\"visual-cue\",!0);var i=K(B?e.xanchor:a.midRange(r?[e.x0,e.x1]:y.extractPathCoords(e.path,g.paramIsX))),o=Q(N?e.yanchor:a.midRange(r?[e.y0,e.y1]:y.extractPathCoords(e.path,g.paramIsY)));if(i=y.roundPositionForSharpStrokeRendering(i,1),o=y.roundPositionForSharpStrokeRendering(o,1),B&&N){var s=\"M\"+(i-1-1)+\",\"+(o-1-1)+\"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z\";n.attr(\"d\",s)}else if(B){var l=\"M\"+(i-1-1)+\",\"+(o-9-1)+\"v18 h2 v-18 Z\";n.attr(\"d\",l)}else{var c=\"M\"+(i-9-1)+\",\"+(o-1-1)+\"h18 v2 h-18 Z\";n.attr(\"d\",c)}}()}function lt(t){t.selectAll(\".visual-cue\").remove()}d.init(nt),rt.node().onmousemove=it}(t,F,u,e,r,D):!0===u.editable&&F.style(\"pointer-events\",z||h.opacity(C)*E<=.5?\"stroke\":\"all\");F.node().addEventListener(\"click\",(function(){return function(t,e){if(b(t)){var r=+e.node().getAttribute(\"data-index\");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void A(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=A,x(t)}}}(t,F)}))}u._input&&!0===u.visible&&(\"above\"===u.layer?M(t._fullLayout._shapeUpperLayer):\"paper\"===u.xref||\"paper\"===u.yref?M(t._fullLayout._shapeLowerLayer):\"between\"===u.layer?M(w.shapelayerBetween):w._hadPlotinfo?M((w.mainplotinfo||w).shapelayer):M(t._fullLayout._shapeLowerLayer))}function T(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,\"\").replace(/[xyz][1-9]* *domain/g,\"\");f.setClipUrl(t,n?\"clip\"+e._fullLayout._uid+n:null,e)}function k(t,e,r){return t.replace(g.segmentRE,(function(t){var n=0,i=t.charAt(0),a=g.paramIsX[i],o=g.paramIsY[i],s=g.numParams[i];return i+t.substr(1).replace(g.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function A(t){b(t)&&t._fullLayout._activeShapeIndex>=0&&(u(t),delete t._fullLayout._activeShapeIndex,x(t))}t.exports={draw:x,drawOne:w,eraseActiveShape:function(t){if(b(t)){u(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e0&&lp&&(t=\"X\"),t}));return a>p&&(d=d.replace(/[\\s,]*X.*/,\"\"),i.log(\"Ignoring extra params in segment \"+t)),u+d}))}(r,l,u);if(\"pixel\"===r.xsizemode){var A=l(r.xanchor);h=A+r.x0+b,f=A+r.x1+w}else h=l(r.x0)+b,f=l(r.x1)+w;if(\"pixel\"===r.ysizemode){var M=u(r.yanchor);p=M-r.y0+T,d=M-r.y1+k}else p=u(r.y0)+T,d=u(r.y1)+k;if(\"line\"===m)return\"M\"+h+\",\"+p+\"L\"+f+\",\"+d;if(\"rect\"===m)return\"M\"+h+\",\"+p+\"H\"+f+\"V\"+d+\"H\"+h+\"Z\";var S=(h+f)/2,E=(p+d)/2,C=Math.abs(S-h),L=Math.abs(E-p),I=\"A\"+C+\",\"+L,P=S+C+\",\"+E;return\"M\"+P+I+\" 0 1,1 \"+S+\",\"+(E-L)+I+\" 0 0,1 \"+P+\"Z\"}},43701:function(t,e,r){\"use strict\";var n=r(28231);t.exports={moduleType:\"component\",name:\"shapes\",layoutAttributes:r(43144),supplyLayoutDefaults:r(74367),supplyDrawNewShapeDefaults:r(85522),includeBasePlot:r(20706)(\"shapes\"),calcAutorange:r(44959),draw:n.draw,drawOne:n.drawOne}},41235:function(t){\"use strict\";function e(t,e){return e?e.d2l(t):t}function r(t,e){return e?e.l2d(t):t}function n(t){return t.x0shift||0}function i(t){return t.x1shift||0}function a(t){return t.y0shift||0}function o(t){return t.y1shift||0}function s(t,r){return e(t.x1,r)+i(t)-e(t.x0,r)-n(t)}function l(t,r,n){return e(t.y1,n)+o(t)-e(t.y0,n)-a(t)}t.exports={x0:function(t){return t.x0},x1:function(t){return t.x1},y0:function(t){return t.y0},y1:function(t){return t.y1},slope:function(t,e,r){return\"line\"!==t.type?void 0:l(t,0,r)/s(t,e)},dx:s,dy:l,width:function(t,e){return Math.abs(s(t,e))},height:function(t,e,r){return Math.abs(l(t,0,r))},length:function(t,e,r){return\"line\"!==t.type?void 0:Math.sqrt(Math.pow(s(t,e),2)+Math.pow(l(t,0,r),2))},xcenter:function(t,a){return r((e(t.x1,a)+i(t)+e(t.x0,a)+n(t))/2,a)},ycenter:function(t,n,i){return r((e(t.y1,i)+o(t)+e(t.y0,i)+a(t))/2,i)}}},8606:function(t,e,r){\"use strict\";var n=r(80337),i=r(57891),a=r(93049).extendDeepAll,o=r(13582).overrideAll,s=r(49722),l=r(78032).templatedArray,c=r(64194),u=l(\"step\",{visible:{valType:\"boolean\",dflt:!0},method:{valType:\"enumerated\",values:[\"restyle\",\"relayout\",\"animate\",\"update\",\"skip\"],dflt:\"restyle\"},args:{valType:\"info_array\",freeLength:!0,items:[{valType:\"any\"},{valType:\"any\"},{valType:\"any\"}]},label:{valType:\"string\"},value:{valType:\"string\"},execute:{valType:\"boolean\",dflt:!0}});t.exports=o(l(\"slider\",{visible:{valType:\"boolean\",dflt:!0},active:{valType:\"number\",min:0,dflt:0},steps:u,lenmode:{valType:\"enumerated\",values:[\"fraction\",\"pixels\"],dflt:\"fraction\"},len:{valType:\"number\",min:0,dflt:1},x:{valType:\"number\",min:-2,max:3,dflt:0},pad:a(i({editType:\"arraydraw\"}),{},{t:{dflt:20}}),xanchor:{valType:\"enumerated\",values:[\"auto\",\"left\",\"center\",\"right\"],dflt:\"left\"},y:{valType:\"number\",min:-2,max:3,dflt:0},yanchor:{valType:\"enumerated\",values:[\"auto\",\"top\",\"middle\",\"bottom\"],dflt:\"top\"},transition:{duration:{valType:\"number\",min:0,dflt:150},easing:{valType:\"enumerated\",values:s.transition.easing.values,dflt:\"cubic-in-out\"}},currentvalue:{visible:{valType:\"boolean\",dflt:!0},xanchor:{valType:\"enumerated\",values:[\"left\",\"center\",\"right\"],dflt:\"left\"},offset:{valType:\"number\",dflt:10},prefix:{valType:\"string\"},suffix:{valType:\"string\"},font:n({})},font:n({}),activebgcolor:{valType:\"color\",dflt:c.gripBgActiveColor},bgcolor:{valType:\"color\",dflt:c.railBgColor},bordercolor:{valType:\"color\",dflt:c.railBorderColor},borderwidth:{valType:\"number\",min:0,dflt:c.railBorderWidth},ticklen:{valType:\"number\",min:0,dflt:c.tickLength},tickcolor:{valType:\"color\",dflt:c.tickColor},tickwidth:{valType:\"number\",min:0,dflt:1},minorticklen:{valType:\"number\",min:0,dflt:c.minorTickLength}}),\"arraydraw\",\"from-root\")},64194:function(t){\"use strict\";t.exports={name:\"sliders\",containerClassName:\"slider-container\",groupClassName:\"slider-group\",inputAreaClass:\"slider-input-area\",railRectClass:\"slider-rail-rect\",railTouchRectClass:\"slider-rail-touch-rect\",gripRectClass:\"slider-grip-rect\",tickRectClass:\"slider-tick-rect\",inputProxyClass:\"slider-input-proxy\",labelsClass:\"slider-labels\",labelGroupClass:\"slider-label-group\",labelClass:\"slider-label\",currentValueClass:\"slider-current-value\",railHeight:5,menuIndexAttrName:\"slider-active-index\",autoMarginIdRoot:\"slider-\",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:\"#bec8d9\",railBgColor:\"#f8fafc\",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:\"#bec8d9\",gripBgColor:\"#f6f8fa\",gripBgActiveColor:\"#dbdde0\",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:\"#333\",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:\"#333\",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},74537:function(t,e,r){\"use strict\";var n=r(34809),i=r(59008),a=r(8606),o=r(64194).name,s=a.steps;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=i(t,e,{name:\"steps\",handleItemDefaults:c}),l=0,u=0;u0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr(\"transform\",l(o-.5*h.gripWidth,e._dims.currentValueTotalHeight))}}function E(t,e){var r=t._dims;return r.inputAreaStart+h.stepInset+(r.inputAreaLength-2*h.stepInset)*Math.min(1,Math.max(0,e))}function C(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-h.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*h.stepInset-2*r.inputAreaStart)))}function L(t,e,r){var n=r._dims,i=s.ensureSingle(t,\"rect\",h.railTouchRectClass,(function(n){n.call(A,e,t,r).style(\"pointer-events\",\"all\")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,h.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr(\"opacity\",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function I(t,e){var r=e._dims,n=r.inputAreaLength-2*h.railInset,i=s.ensureSingle(t,\"rect\",h.railRectClass);i.attr({width:n,height:h.railWidth,rx:h.railRadius,ry:h.railRadius,\"shape-rendering\":\"crispEdges\"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style(\"stroke-width\",e.borderwidth+\"px\"),o.setTranslate(i,h.railInset,.5*(r.inputAreaWidth-h.railWidth)+r.currentValueTotalHeight)}t.exports=function(t){var e=t._context.staticPlot,r=t._fullLayout,a=function(t,e){for(var r=t[h.name],n=[],i=0;i0?[0]:[]);function l(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(s.enter().append(\"g\").classed(h.containerClassName,!0).style(\"cursor\",e?null:\"ew-resize\"),s.exit().each((function(){n.select(this).selectAll(\"g.\"+h.groupClassName).each(l)})).remove(),0!==a.length){var c=s.selectAll(\"g.\"+h.groupClassName).data(a,y);c.enter().append(\"g\").classed(h.groupClassName,!0),c.exit().each(l).remove();for(var u=0;u0||T<0){var E={left:[-k,0],right:[k,0],top:[0,-k],bottom:[0,k]}[b.side];a.attr(\"transform\",l(E[0],E[1]))}}}function ft(t,e){t.text(e).on(\"mouseover.opacity\",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style(\"opacity\",1)})).on(\"mouseout.opacity\",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style(\"opacity\",0)}))}if(at.call(ct,ot),et&&(S?at.on(\".opacity\",null):(ft(at,x),E=!0),at.call(h.makeEditable,{gd:t}).on(\"edit\",(function(e){void 0!==_?o.call(\"_guiRestyle\",t,v,e,_):o.call(\"_guiRelayout\",t,v,e)})).on(\"cancel\",(function(){this.text(this.attr(\"data-unformatted\")).call(ct)})).on(\"input\",(function(t){this.text(t||\" \").call(h.positionText,w.x,w.y)})),N)){if(N&&!S){var pt=at.node().getBBox(),dt=pt.y+pt.height+1.6*W;ot.attr(\"y\",dt)}V?ot.on(\".opacity\",null):(ft(ot,j),q=!0),ot.call(h.makeEditable,{gd:t}).on(\"edit\",(function(e){o.call(\"_guiRelayout\",t,\"title.subtitle.text\",e)})).on(\"cancel\",(function(){this.text(this.attr(\"data-unformatted\")).call(ct)})).on(\"input\",(function(t){this.text(t||\" \").call(h.positionText,ot.attr(\"x\"),ot.attr(\"y\"))}))}return at.classed(\"js-placeholder\",E),ot&&ot.classed(\"js-placeholder\",q),k},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}},85389:function(t,e,r){\"use strict\";var n=r(80337),i=r(10229),a=r(93049).extendFlat,o=r(13582).overrideAll,s=r(57891),l=r(78032).templatedArray,c=l(\"button\",{visible:{valType:\"boolean\"},method:{valType:\"enumerated\",values:[\"restyle\",\"relayout\",\"animate\",\"update\",\"skip\"],dflt:\"restyle\"},args:{valType:\"info_array\",freeLength:!0,items:[{valType:\"any\"},{valType:\"any\"},{valType:\"any\"}]},args2:{valType:\"info_array\",freeLength:!0,items:[{valType:\"any\"},{valType:\"any\"},{valType:\"any\"}]},label:{valType:\"string\",dflt:\"\"},execute:{valType:\"boolean\",dflt:!0}});t.exports=o(l(\"updatemenu\",{_arrayAttrRegexps:[/^updatemenus\\[(0|[1-9][0-9]+)\\]\\.buttons/],visible:{valType:\"boolean\"},type:{valType:\"enumerated\",values:[\"dropdown\",\"buttons\"],dflt:\"dropdown\"},direction:{valType:\"enumerated\",values:[\"left\",\"right\",\"up\",\"down\"],dflt:\"down\"},active:{valType:\"integer\",min:-1,dflt:0},showactive:{valType:\"boolean\",dflt:!0},buttons:c,x:{valType:\"number\",min:-2,max:3,dflt:-.05},xanchor:{valType:\"enumerated\",values:[\"auto\",\"left\",\"center\",\"right\"],dflt:\"right\"},y:{valType:\"number\",min:-2,max:3,dflt:1},yanchor:{valType:\"enumerated\",values:[\"auto\",\"top\",\"middle\",\"bottom\"],dflt:\"top\"},pad:a(s({editType:\"arraydraw\"}),{}),font:n({}),bgcolor:{valType:\"color\"},bordercolor:{valType:\"color\",dflt:i.borderLine},borderwidth:{valType:\"number\",min:0,dflt:1,editType:\"arraydraw\"}}),\"arraydraw\",\"from-root\")},71559:function(t){\"use strict\";t.exports={name:\"updatemenus\",containerClassName:\"updatemenu-container\",headerGroupClassName:\"updatemenu-header-group\",headerClassName:\"updatemenu-header\",headerArrowClassName:\"updatemenu-header-arrow\",dropdownButtonGroupClassName:\"updatemenu-dropdown-button-group\",dropdownButtonClassName:\"updatemenu-dropdown-button\",buttonClassName:\"updatemenu-button\",itemRectClassName:\"updatemenu-item-rect\",itemTextClassName:\"updatemenu-item-text\",menuIndexAttrName:\"updatemenu-active-index\",autoMarginIdRoot:\"updatemenu-\",blankHeaderOpts:{label:\" \"},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:\"#F4FAFF\",hoverColor:\"#F4FAFF\",arrowSymbol:{left:\"◄\",right:\"►\",up:\"▲\",down:\"▼\"}}},42746:function(t,e,r){\"use strict\";var n=r(34809),i=r(59008),a=r(85389),o=r(71559).name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o(\"visible\",i(t,e,{name:\"buttons\",handleItemDefaults:c}).length>0)&&(o(\"active\"),o(\"direction\"),o(\"type\"),o(\"showactive\"),o(\"x\"),o(\"y\"),n.noneOrAll(t,e,[\"x\",\"y\"]),o(\"xanchor\"),o(\"yanchor\"),o(\"pad.t\"),o(\"pad.r\"),o(\"pad.b\"),o(\"pad.l\"),n.coerceFont(o,\"font\",r.font),o(\"bgcolor\",r.paper_bgcolor),o(\"bordercolor\"),o(\"borderwidth\"))}function c(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}r(\"visible\",\"skip\"===t.method||Array.isArray(t.args))&&(r(\"method\"),r(\"args\"),r(\"args2\"),r(\"label\"),r(\"execute\"))}t.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},40974:function(t,e,r){\"use strict\";var n=r(45568),i=r(44122),a=r(78766),o=r(62203),s=r(34809),l=r(30635),c=r(78032).arrayEditor,u=r(4530).LINE_SPACING,h=r(71559),f=r(21736);function p(t){return t._index}function d(t,e){return+t.attr(h.menuIndexAttrName)===e._index}function m(t,e,r,n,i,a,o,s){e.active=o,c(t.layout,h.name,e).applyUpdate(\"active\",o),\"buttons\"===e.type?y(t,n,null,null,e):\"dropdown\"===e.type&&(i.attr(h.menuIndexAttrName,\"-1\"),g(t,n,i,a,e),s||y(t,n,i,a,e))}function g(t,e,r,n,i){var a=s.ensureSingle(e,\"g\",h.headerClassName,(function(t){t.style(\"pointer-events\",\"all\")})),l=i._dims,c=i.active,u=i.buttons[c]||h.blankHeaderOpts,f={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},p={width:l.headerWidth,height:l.headerHeight};a.call(v,i,u,t).call(M,i,f,p),s.ensureSingle(e,\"text\",h.headerArrowClassName,(function(t){t.attr(\"text-anchor\",\"end\").call(o.font,i.font).text(h.arrowSymbol[i.direction])})).attr({x:l.headerWidth-h.arrowOffsetX+i.pad.l,y:l.headerHeight/2+h.textOffsetY+i.pad.t}),a.on(\"click\",(function(){r.call(S,String(d(r,i)?-1:i._index)),y(t,e,r,n,i)})),a.on(\"mouseover\",(function(){a.call(w)})),a.on(\"mouseout\",(function(){a.call(T,i)})),o.setTranslate(e,l.lx,l.ly)}function y(t,e,r,a,o){r||(r=e).attr(\"pointer-events\",\"all\");var l=function(t){return-1==+t.attr(h.menuIndexAttrName)}(r)&&\"buttons\"!==o.type?[]:o.buttons,c=\"dropdown\"===o.type?h.dropdownButtonClassName:h.buttonClassName,u=r.selectAll(\"g.\"+c).data(s.filterVisible(l)),f=u.enter().append(\"g\").classed(c,!0),p=u.exit();\"dropdown\"===o.type?(f.attr(\"opacity\",\"0\").transition().attr(\"opacity\",\"1\"),p.transition().attr(\"opacity\",\"0\").remove()):p.remove();var d=0,g=0,y=o._dims,x=-1!==[\"up\",\"down\"].indexOf(o.direction);\"dropdown\"===o.type&&(x?g=y.headerHeight+h.gapButtonHeader:d=y.headerWidth+h.gapButtonHeader),\"dropdown\"===o.type&&\"up\"===o.direction&&(g=-h.gapButtonHeader+h.gapButton-y.openHeight),\"dropdown\"===o.type&&\"left\"===o.direction&&(d=-h.gapButtonHeader+h.gapButton-y.openWidth);var _={x:y.lx+d+o.pad.l,y:y.ly+g+o.pad.t,yPad:h.gapButton,xPad:h.gapButton,index:0},k={l:_.x+o.borderwidth,t:_.y+o.borderwidth};u.each((function(s,l){var c=n.select(this);c.call(v,o,s,t).call(M,o,_),c.on(\"click\",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit(\"plotly_buttonclicked\",{menu:o,button:s,active:o.active}))})),c.on(\"mouseover\",(function(){c.call(w)})),c.on(\"mouseout\",(function(){c.call(T,o),u.call(b,o)}))})),u.call(b,o),x?(k.w=Math.max(y.openWidth,y.headerWidth),k.h=_.y-k.t):(k.w=_.x-k.l,k.h=Math.max(y.openHeight,y.headerHeight)),k.direction=o.direction,a&&(u.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u=\"up\"===c||\"down\"===c,f=i._dims,p=i.active;if(u)for(s=0,l=0;l0?[0]:[]);if(o.enter().append(\"g\").classed(h.containerClassName,!0).style(\"cursor\",\"pointer\"),o.exit().each((function(){n.select(this).selectAll(\"g.\"+h.headerGroupClassName).each(a)})).remove(),0!==r.length){var l=o.selectAll(\"g.\"+h.headerGroupClassName).data(r,p);l.enter().append(\"g\").classed(h.headerGroupClassName,!0);for(var c=s.ensureSingle(o,\"g\",h.dropdownButtonGroupClassName,(function(t){t.style(\"pointer-events\",\"all\")})),u=0;uw,A=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,S=d,E=g+y;E+M>c&&(E=c-M);var C=this.container.selectAll(\"rect.scrollbar-horizontal\").data(k?[0]:[]);C.exit().on(\".drag\",null).remove(),C.enter().append(\"rect\").classed(\"scrollbar-horizontal\",!0).call(i.fill,s.barColor),k?(this.hbar=C.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:E,width:A,height:M}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=y>T,I=s.barWidth+2*s.barPad,P=s.barLength+2*s.barPad,z=d+m,O=g;z+I>l&&(z=l-I);var D=this.container.selectAll(\"rect.scrollbar-vertical\").data(L?[0]:[]);D.exit().on(\".drag\",null).remove(),D.enter().append(\"rect\").classed(\"scrollbar-vertical\",!0).call(i.fill,s.barColor),L?(this.vbar=D.attr({rx:s.barRadius,ry:s.barRadius,x:z,y:O,width:I,height:P}),this._vbarYMin=O+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,B=L?h+I+.5:h+.5,N=f-.5,j=k?p+M+.5:p+.5,U=o._topdefs.selectAll(\"#\"+R).data(k||L?[0]:[]);if(U.exit().remove(),U.enter().append(\"clipPath\").attr(\"id\",R).append(\"rect\"),k||L?(this._clipRect=U.select(\"rect\").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(N)}),this.container.call(a.setClipUrl,R,this.gd),this.bg.attr({x:d,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on(\"wheel\",null).on(\".drag\",null).call(a.setClipUrl,null),delete this._clipRect),k||L){var V=n.behavior.drag().on(\"dragstart\",(function(){n.event.sourceEvent.preventDefault()})).on(\"drag\",this._onBoxDrag.bind(this));this.container.on(\"wheel\",null).on(\"wheel\",this._onBoxWheel.bind(this)).on(\".drag\",null).call(V);var q=n.behavior.drag().on(\"dragstart\",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on(\"drag\",this._onBarDrag.bind(this));k&&this.hbar.on(\".drag\",null).call(q),L&&this.vbar.on(\".drag\",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on(\"wheel\",null).on(\".drag\",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(\".drag\",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(\".drag\",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},4530:function(t){\"use strict\";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:\"right\",right:\"left\",top:\"bottom\",bottom:\"top\"}}},35081:function(t){\"use strict\";t.exports={axisRefDescription:function(t,e,r){return[\"If set to a\",t,\"axis id (e.g. *\"+t+\"* or\",\"*\"+t+\"2*), the `\"+t+\"` position refers to a\",t,\"coordinate. If set to *paper*, the `\"+t+\"`\",\"position refers to the distance from the\",e,\"of the plotting\",\"area in normalized coordinates where *0* (*1*) corresponds to the\",e,\"(\"+r+\"). If set to a\",t,\"axis ID followed by\",\"*domain* (separated by a space), the position behaves like for\",\"*paper*, but refers to the distance in fractions of the domain\",\"length from the\",e,\"of the domain of that axis: e.g.,\",\"*\"+t+\"2 domain* refers to the domain of the second\",t,\" axis and a\",t,\"position of 0.5 refers to the\",\"point between the\",e,\"and the\",r,\"of the domain of the\",\"second\",t,\"axis.\"].join(\" \")}}},20909:function(t){\"use strict\";t.exports={INCREASING:{COLOR:\"#3D9970\",SYMBOL:\"▲\"},DECREASING:{COLOR:\"#FF4136\",SYMBOL:\"▼\"}}},87296:function(t){\"use strict\";t.exports={FORMAT_LINK:\"https://github.com/d3/d3-format/tree/v1.4.5#d3-format\",DATE_FORMAT_LINK:\"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format\"}},20726:function(t){\"use strict\";t.exports={COMPARISON_OPS:[\"=\",\"!=\",\"<\",\">=\",\">\",\"<=\"],COMPARISON_OPS2:[\"=\",\"<\",\">=\",\">\",\"<=\"],INTERVAL_OPS:[\"[]\",\"()\",\"[)\",\"(]\",\"][\",\")(\",\"](\",\")[\"],SET_OPS:[\"{}\",\"}{\"],CONSTRAINT_REDUCTION:{\"=\":\"=\",\"<\":\"<\",\"<=\":\"<\",\">\":\">\",\">=\":\">\",\"[]\":\"[]\",\"()\":\"[]\",\"[)\":\"[]\",\"(]\":\"[]\",\"][\":\"][\",\")(\":\"][\",\"](\":\"][\",\")[\":\"][\"}}},84770:function(t){\"use strict\";t.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},49467:function(t){\"use strict\";t.exports={circle:\"●\",\"circle-open\":\"○\",square:\"■\",\"square-open\":\"□\",diamond:\"◆\",\"diamond-open\":\"◇\",cross:\"+\",x:\"❌\"}},20438:function(t){\"use strict\";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},63821:function(t){\"use strict\";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:\"−\"}},1837:function(t,e){\"use strict\";e.CSS_DECLARATIONS=[[\"image-rendering\",\"optimizeSpeed\"],[\"image-rendering\",\"-moz-crisp-edges\"],[\"image-rendering\",\"-o-crisp-edges\"],[\"image-rendering\",\"-webkit-optimize-contrast\"],[\"image-rendering\",\"optimize-contrast\"],[\"image-rendering\",\"crisp-edges\"],[\"image-rendering\",\"pixelated\"]],e.STYLE=e.CSS_DECLARATIONS.map((function(t){return t.join(\": \")+\"; \"})).join(\"\")},62972:function(t,e){\"use strict\";e.xmlns=\"http://www.w3.org/2000/xmlns/\",e.svg=\"http://www.w3.org/2000/svg\",e.xlink=\"http://www.w3.org/1999/xlink\",e.svgAttrs={xmlns:e.svg,\"xmlns:xlink\":e.xlink}},17430:function(t,e,r){\"use strict\";e.version=r(29697).version,r(71116),r(6713);for(var n=r(33626),i=e.register=n.register,a=r(90742),o=Object.keys(a),s=0;s\",\"\",\" \",\" \",\" plotly-logomark \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\"\"].join(\"\")}}},32546:function(t,e){\"use strict\";e.isLeftAnchor=function(t){return\"left\"===t.xanchor||\"auto\"===t.xanchor&&t.x<=1/3},e.isCenterAnchor=function(t){return\"center\"===t.xanchor||\"auto\"===t.xanchor&&t.x>1/3&&t.x<2/3},e.isRightAnchor=function(t){return\"right\"===t.xanchor||\"auto\"===t.xanchor&&t.x>=2/3},e.isTopAnchor=function(t){return\"top\"===t.yanchor||\"auto\"===t.yanchor&&t.y>=2/3},e.isMiddleAnchor=function(t){return\"middle\"===t.yanchor||\"auto\"===t.yanchor&&t.y>1/3&&t.y<2/3},e.isBottomAnchor=function(t){return\"bottom\"===t.yanchor||\"auto\"===t.yanchor&&t.y<=1/3}},44313:function(t,e,r){\"use strict\";var n=r(98953),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return a(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function h(t,e,r,n,i,a,c){i=i||0,a=a||0;var u,h,f,p,d,m=l([r,n]);function g(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}m?(u=0,h=o,f=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return h(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return h(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return h(t,e,r,n,i,a,1)}}},87800:function(t,e,r){\"use strict\";var n=r(93229).decode,i=r(56174),a=Array.isArray,o=ArrayBuffer,s=DataView;function l(t){return o.isView(t)&&!(t instanceof s)}function c(t){return a(t)||l(t)}e.isTypedArray=l,e.isArrayOrTypedArray=c,e.isArray1D=function(t){return!c(t[0])},e.ensureArray=function(t,e){return a(t)||(t=[]),t.length=e,t};var u={u1c:\"undefined\"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,i1:\"undefined\"==typeof Int8Array?void 0:Int8Array,u1:\"undefined\"==typeof Uint8Array?void 0:Uint8Array,i2:\"undefined\"==typeof Int16Array?void 0:Int16Array,u2:\"undefined\"==typeof Uint16Array?void 0:Uint16Array,i4:\"undefined\"==typeof Int32Array?void 0:Int32Array,u4:\"undefined\"==typeof Uint32Array?void 0:Uint32Array,f4:\"undefined\"==typeof Float32Array?void 0:Float32Array,f8:\"undefined\"==typeof Float64Array?void 0:Float64Array};function h(t){return t.constructor===ArrayBuffer}function f(t,e,r){if(c(t)){if(c(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){-1===(i.extras||[]).indexOf(t)?(d(t)&&(t=m(t)),t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)):e.set(t)}},string:{coerceFunction:function(t,e,r,n){if(\"string\"!=typeof t){var i=\"number\"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){d(t)&&(t=m(t)),i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(s.get(t,r))}},angle:{coerceFunction:function(t,e,r){d(t)&&(t=m(t)),\"auto\"===t?e.set(\"auto\"):n(t)?e.set(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||h(r);\"string\"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||\"string\"==typeof t&&!!h(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if(\"string\"==typeof t){for(var i=t.split(\"+\"),a=0;a=n&&t<=i?t:u}if(\"string\"!=typeof t&&\"number\"!=typeof t)return u;t=String(t);var c=b(r),y=t.charAt(0);!c||\"G\"!==y&&\"g\"!==y||(t=t.substr(1),r=\"\");var w=c&&\"chinese\"===r.substr(0,7),T=t.match(w?x:v);if(!T)return u;var k=T[1],A=T[3]||\"1\",M=Number(T[5]||1),S=Number(T[7]||0),E=Number(T[9]||0),C=Number(T[11]||0);if(c){if(2===k.length)return u;var L;k=Number(k);try{var I=g.getComponentMethod(\"calendars\",\"getCal\")(r);if(w){var P=\"i\"===A.charAt(A.length-1);A=parseInt(A,10),L=I.newDate(k,I.toMonthIndex(k,A,P),M)}else L=I.newDate(k,Number(A),M)}catch(t){return u}return L?(L.toJD()-m)*h+S*f+E*p+C*d:u}k=2===k.length?(Number(k)+2e3-_)%100+_:Number(k),A-=1;var z=new Date(Date.UTC(2e3,A,M,S,E));return z.setUTCFullYear(k),z.getUTCMonth()!==A||z.getUTCDate()!==M?u:z.getTime()+C*d},n=e.MIN_MS=e.dateTime2ms(\"-9999\"),i=e.MAX_MS=e.dateTime2ms(\"9999-12-31 23:59:59.9999\"),e.isDateTime=function(t,r){return e.dateTime2ms(t,r)!==u};var T=90*h,k=3*f,A=5*p;function M(t,e,r,n,i){if((e||r||n||i)&&(t+=\" \"+w(e,2)+\":\"+w(r,2),(n||i)&&(t+=\":\"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+=\".\"+w(i,a)}return t}e.ms2DateTime=function(t,e,r){if(\"number\"!=typeof t||!(t>=n&&t<=i))return u;e||(e=0);var a,o,s,c,v,x,_=Math.floor(10*l(t+.05,1)),w=Math.round(t-_/10);if(b(r)){var S=Math.floor(w/h)+m,E=Math.floor(l(t,h));try{a=g.getComponentMethod(\"calendars\",\"getCal\")(r).fromJD(S).formatDate(\"yyyy-mm-dd\")}catch(t){a=y(\"G%Y-%m-%d\")(new Date(w))}if(\"-\"===a.charAt(0))for(;a.length<11;)a=\"-0\"+a.substr(1);else for(;a.length<10;)a=\"0\"+a;o=e=n+h&&t<=i-h))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(a(\"%Y-%m-%d\")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},e.cleanDate=function(t,r,n){if(t===u)return r;if(e.isJSDate(t)||\"number\"==typeof t&&isFinite(t)){if(b(n))return s.error(\"JS Dates and milliseconds are incompatible with world calendars\",t),r;if(!(t=e.ms2DateTimeLocal(+t))&&void 0!==r)return r}else if(!e.isDateTime(t,n))return s.error(\"unrecognized date\",t),r;return t};var S=/%\\d?f/g,E=/%h/g,C={1:\"1\",2:\"1\",3:\"2\",4:\"2\"};function L(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,\"\")||\"0\"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(E,(function(){return C[r(\"%q\")(i)]})),b(n))try{t=g.getComponentMethod(\"calendars\",\"worldCalFmt\")(t,e,n)}catch(t){return\"Invalid\"}return r(t)(i)}var I=[59,59.9,59.99,59.999,59.9999];e.formatDate=function(t,e,r,n,i,a){if(i=b(i)&&i,!e)if(\"y\"===r)e=a.year;else if(\"m\"===r)e=a.month;else{if(\"d\"!==r)return function(t,e){var r=l(t+.05,h),n=w(Math.floor(r/f),2)+\":\"+w(l(Math.floor(r/p),60),2);if(\"M\"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/d,60),I[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,\"\").replace(/[\\.]$/,\"\")),n+=\":\"+i}return n}(t,r)+\"\\n\"+L(a.dayMonthYear,t,n,i);e=a.dayMonth+\"\\n\"+a.year}return L(e,t,n,i)};var P=3*h;e.incrementMonth=function(t,e,r){r=b(r)&&r;var n=l(t,h);if(t=Math.round(t-n),r)try{var i=Math.round(t/h)+m,a=g.getComponentMethod(\"calendars\",\"getCal\")(r),o=a.fromJD(i);return e%12?a.add(o,e,\"m\"):a.add(o,e/12,\"y\"),(o.toJD()-m)*h+n}catch(e){s.error(\"invalid ms \"+t+\" in calendar \"+r)}var c=new Date(t+P);return c.setUTCMonth(c.getUTCMonth()+e)+n-P},e.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,c=b(e)&&g.getComponentMethod(\"calendars\",\"getCal\")(e),u=0;u0&&t[e+1][0]<0)return e;return null}switch(e=\"RUS\"===s||\"FJI\"===s?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=f.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(f.tester(t))},a.type){case\"MultiPolygon\":for(r=0;r0?u.properties.ct=function(t){var e,r=t.geometry;if(\"MultiPolygon\"===r.type)for(var n=r.coordinates,i=0,s=0;si&&(i=c,e=l)}else e=r;return o(e).geometry.coordinates}(u):u.properties.ct=[NaN,NaN],n.fIn=t,n.fOut=u,s.push(u)}else c.log([\"Location\",n.loc,\"does not have a valid GeoJSON geometry.\",\"Traces with locationmode *geojson-id* only support\",\"*Polygon* and *MultiPolygon* geometries.\"].join(\" \"))}delete i[r]}switch(r.type){case\"FeatureCollection\":var f=r.features;for(n=0;n100?(clearInterval(a),n(\"Unexpected error while fetching from \"+t)):void i++}),50)}))}for(var o=0;o0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},e.makeLine=function(t){return 1===t.length?{type:\"LineString\",coordinates:t[0]}:{type:\"MultiLineString\",coordinates:t}},e.makePolygon=function(t){if(1===t.length)return{type:\"Polygon\",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}e.segmentsIntersect=s,e.segmentDistance=function(t,e,r,n,i,a,o,c){if(s(t,e,r,n,i,a,o,c))return 0;var u=r-t,h=n-e,f=o-i,p=c-a,d=u*u+h*h,m=f*f+p*p,g=Math.min(l(u,h,d,i-t,a-e),l(u,h,d,o-t,c-e),l(f,p,m,t-i,e-a),l(f,p,m,r-i,n-a));return Math.sqrt(g)},e.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),h=t.getPointAtLength(o(r,e)),f={x:(4*h.x+l.x+c.x)/6,y:(4*h.y+l.y+c.y)/6,theta:u};return n[r]=f,f},e.clearLocationCache=function(){i=null},e.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),h=u;function f(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,h=r.yl?r.y-l:0;return Math.sqrt(c*c+h*h)}for(var p=f(c);p;){if((c+=p+r)>h)return;p=f(c)}for(p=f(h);p;){if(c>(h-=p+r))return;p=f(h)}return{min:c,max:h,len:h-c,total:u,isClosed:0===c&&h===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},e.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,h=0,f=0,p=s;h0?p=i:f=i,h++}return a}},46998:function(t,e,r){\"use strict\";var n=r(10721),i=r(65657),a=r(162),o=r(88856),s=r(10229).defaultLine,l=r(87800).isArrayOrTypedArray,c=a(s);function u(t,e){var r=t;return r[3]*=e,r}function h(t){if(n(t))return c;var e=a(t);return e.length?e:c}function f(t){return n(t)?t:1}t.exports={formatColor:function(t,e,r){var n=t.color;n&&n._inputArray&&(n=n._inputArray);var i,s,p,d,m,g=l(n),y=l(e),v=o.extractOpts(t),x=[];if(i=void 0!==v.colorscale?o.makeColorScaleFuncFromTrace(t):h,s=g?function(t,e){return void 0===t[e]?c:a(i(t[e]))}:h,p=y?function(t,e){return void 0===t[e]?1:f(t[e])}:f,g||y)for(var _=0;_1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf(\"e+\")&&(n=+o)}}return n}},34809:function(t,e,r){\"use strict\";var n=r(45568),i=r(42696).aL,a=r(36464).GP,o=r(10721),s=r(63821),l=s.FP_SAFE,c=-l,u=s.BADNUM,h=t.exports={};h.adjustFormat=function(t){return!t||/^\\d[.]\\df/.test(t)||/[.]\\d%/.test(t)?t:\"0.f\"===t?\"~f\":/^\\d%/.test(t)?\"~%\":/^\\ds/.test(t)?\"~s\":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?\"~\"+t:t};var f={};h.warnBadFormat=function(t){var e=String(t);f[e]||(f[e]=1,h.warn('encountered bad format: \"'+e+'\"'))},h.noFormat=function(t){return String(t)},h.numberFormat=function(t){var e;try{e=a(h.adjustFormat(t))}catch(e){return h.warnBadFormat(t),h.noFormat}return e},h.nestedProperty=r(35632),h.keyedContainer=r(34967),h.relativeAttr=r(82047),h.isPlainObject=r(56174),h.toLogRange=r(8083),h.relinkPrivateKeys=r(80428);var p=r(87800);h.isArrayBuffer=p.isArrayBuffer,h.isTypedArray=p.isTypedArray,h.isArrayOrTypedArray=p.isArrayOrTypedArray,h.isArray1D=p.isArray1D,h.ensureArray=p.ensureArray,h.concat=p.concat,h.maxRowLength=p.maxRowLength,h.minRowLength=p.minRowLength;var d=r(98953);h.mod=d.mod,h.modHalf=d.modHalf;var m=r(34220);h.valObjectMeta=m.valObjectMeta,h.coerce=m.coerce,h.coerce2=m.coerce2,h.coerceFont=m.coerceFont,h.coercePattern=m.coercePattern,h.coerceHoverinfo=m.coerceHoverinfo,h.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,h.validate=m.validate;var g=r(92596);h.dateTime2ms=g.dateTime2ms,h.isDateTime=g.isDateTime,h.ms2DateTime=g.ms2DateTime,h.ms2DateTimeLocal=g.ms2DateTimeLocal,h.cleanDate=g.cleanDate,h.isJSDate=g.isJSDate,h.formatDate=g.formatDate,h.incrementMonth=g.incrementMonth,h.dateTick0=g.dateTick0,h.dfltRange=g.dfltRange,h.findExactDates=g.findExactDates,h.MIN_MS=g.MIN_MS,h.MAX_MS=g.MAX_MS;var y=r(98813);h.findBin=y.findBin,h.sorterAsc=y.sorterAsc,h.sorterDes=y.sorterDes,h.distinctVals=y.distinctVals,h.roundUp=y.roundUp,h.sort=y.sort,h.findIndexOfMin=y.findIndexOfMin,h.sortObjectKeys=r(62994);var v=r(89258);h.aggNums=v.aggNums,h.len=v.len,h.mean=v.mean,h.geometricMean=v.geometricMean,h.median=v.median,h.midRange=v.midRange,h.variance=v.variance,h.stdev=v.stdev,h.interp=v.interp;var x=r(15236);h.init2dArray=x.init2dArray,h.transposeRagged=x.transposeRagged,h.dot=x.dot,h.translationMatrix=x.translationMatrix,h.rotationMatrix=x.rotationMatrix,h.rotationXYMatrix=x.rotationXYMatrix,h.apply3DTransform=x.apply3DTransform,h.apply2DTransform=x.apply2DTransform,h.apply2DTransform2=x.apply2DTransform2,h.convertCssMatrix=x.convertCssMatrix,h.inverseTransformMatrix=x.inverseTransformMatrix;var _=r(44313);h.deg2rad=_.deg2rad,h.rad2deg=_.rad2deg,h.angleDelta=_.angleDelta,h.angleDist=_.angleDist,h.isFullCircle=_.isFullCircle,h.isAngleInsideSector=_.isAngleInsideSector,h.isPtInsideSector=_.isPtInsideSector,h.pathArc=_.pathArc,h.pathSector=_.pathSector,h.pathAnnulus=_.pathAnnulus;var b=r(32546);h.isLeftAnchor=b.isLeftAnchor,h.isCenterAnchor=b.isCenterAnchor,h.isRightAnchor=b.isRightAnchor,h.isTopAnchor=b.isTopAnchor,h.isMiddleAnchor=b.isMiddleAnchor,h.isBottomAnchor=b.isBottomAnchor;var w=r(3447);h.segmentsIntersect=w.segmentsIntersect,h.segmentDistance=w.segmentDistance,h.getTextLocation=w.getTextLocation,h.clearLocationCache=w.clearLocationCache,h.getVisibleSegment=w.getVisibleSegment,h.findPointOnPath=w.findPointOnPath;var T=r(93049);h.extendFlat=T.extendFlat,h.extendDeep=T.extendDeep,h.extendDeepAll=T.extendDeepAll,h.extendDeepNoArrays=T.extendDeepNoArrays;var k=r(48636);h.log=k.log,h.warn=k.warn,h.error=k.error;var A=r(90694);h.counterRegex=A.counter;var M=r(64025);h.throttle=M.throttle,h.throttleDone=M.done,h.clearThrottle=M.clear;var S=r(95425);function E(t){var e={};for(var r in t)for(var n=t[r],i=0;il||t=e)&&o(t)&&t>=0&&t%1==0},h.noop=r(4969),h.identity=r(29527),h.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},h.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},h.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(h.warn(\"randstr failed uniqueness\"),l):t(e,r,n,(i||0)+1):l},h.OptionControl=function(t,e){t||(t={}),e||(e=\"opt\");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r[\"_\"+e]=t,r},h.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},h.syncOrAsync=function(t,e,r){var n;function i(){return h.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},h.stripTrailingSlash=function(t){return\"/\"===t.substr(-1)?t.substr(0,t.length-1):t},h.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},h.fillArray=function(t,e,r,n){if(n=n||h.identity,h.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:\"\";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,\"$1\"+a+\"$2\");return s+l},h.TEMPLATE_STRING_REGEX=/%{([^\\s%{}:]*)([:|\\|][^}]*)?}/g;var D=/^\\w*$/;h.templateString=function(t,e){var r={};return t.replace(h.TEMPLATE_STRING_REGEX,(function(t,n){var i;return D.test(n)?i=e[n]:(r[n]=r[n]||h.nestedProperty(e,n).get,i=r[n]()),h.isValidTextValue(i)?i:\"\"}))};var R={max:10,count:0,name:\"hovertemplate\"};h.hovertemplateString=function(){return U.apply(R,arguments)};var F={max:10,count:0,name:\"texttemplate\"};h.texttemplateString=function(){return U.apply(F,arguments)};var B=/^(\\S+)([\\*\\/])(-?\\d+(\\.\\d+)?)$/,N={max:10,count:0,name:\"texttemplate\",parseMultDiv:!0};h.texttemplateStringForShapes=function(){return U.apply(N,arguments)};var j=/^[:|\\|]/;function U(t,e,r){var n=this,a=arguments;e||(e={});var o={};return t.replace(h.TEMPLATE_STRING_REGEX,(function(t,s,l){var c=\"_xother\"===s||\"_yother\"===s,u=\"_xother_\"===s||\"_yother_\"===s,f=\"xother_\"===s||\"yother_\"===s,p=\"xother\"===s||\"yother\"===s||c||f||u,d=s;(c||u)&&(d=d.substring(1)),(f||u)&&(d=d.substring(0,d.length-1));var m,g,y,v=null,x=null;if(n.parseMultDiv){var _=function(t){var e=t.match(B);return e?{key:e[1],op:e[2],number:Number(e[3])}:{key:t,op:null,number:null}}(d);d=_.key,v=_.op,x=_.number}if(p){if(void 0===(m=e[d]))return\"\"}else for(y=3;y=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var V=2e9;h.seedPseudoRandom=function(){V=2e9},h.pseudoRandom=function(){var t=V;return V=(69069*V+1)%4294967296,Math.abs(V-t)<429496729?h.pseudoRandom():V/4294967296},h.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=h.extractOption(t,e,\"htx\",\"hovertext\");if(h.isValidTextValue(i))return n(i);var a=h.extractOption(t,e,\"tx\",\"text\");return h.isValidTextValue(a)?n(a):void 0},h.isValidTextValue=function(t){return t||0===t},h.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+\"%\",n=0;n1&&(c=1):c=0,h.strTranslate(i-c*(r+o),a-c*(n+s))+h.strScale(c)+(l?\"rotate(\"+l+(e?\"\":\" \"+r+\" \"+n)+\")\":\"\")},h.setTransormAndDisplay=function(t,e){t.attr(\"transform\",h.getTextTransform(e)),t.style(\"display\",e.scale?null:\"none\")},h.ensureUniformFontSize=function(t,e){var r=h.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},h.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},h.bigFont=function(t){return Math.round(1.2*t)};var q=h.getFirefoxVersion(),H=null!==q&&q<86;h.getPositionFromD3Event=function(){return H?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},56174:function(t){\"use strict\";t.exports=function(t){return window&&window.process&&window.process.versions?\"[object Object]\"===Object.prototype.toString.call(t):\"[object Object]\"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t).hasOwnProperty(\"hasOwnProperty\")}},34967:function(t,e,r){\"use strict\";var n=r(35632),i=/^\\w*$/;t.exports=function(t,e,r,a){var o,s,l;r=r||\"name\",a=a||\"value\";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||\"\";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],f.set(t,null);if(h){for(o=e;o1){var e=[\"LOG:\"];for(t=0;t1){var r=[];for(t=0;t\"),\"long\")}},a.warn=function(){var t;if(n.logging>0){var e=[\"WARN:\"];for(t=0;t0){var r=[];for(t=0;t\"),\"stick\")}},a.error=function(){var t;if(n.logging>0){var e=[\"ERROR:\"];for(t=0;t0){var r=[];for(t=0;t\"),\"stick\")}}},75944:function(t,e,r){\"use strict\";var n=r(45568);t.exports=function(t,e,r){var i=t.selectAll(\"g.\"+r.replace(/\\s/g,\".\")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append(\"g\").attr(\"class\",r),i.order();var a=t.classed(\"rangeplot\")?\"nodeRangePlot3\":\"node3\";return i.each((function(t){t[0][a]=n.select(this)})),i}},15236:function(t,e,r){\"use strict\";var n=r(11191);e.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},35632:function(t,e,r){\"use strict\";var n=r(10721),i=r(87800).isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,c=t;for(s=0;s/g),l=0;la||c===i||cs||e&&l(t))}:function(t,e){var l=t[0],c=t[1];if(l===i||la||c===i||cs)return!1;var u,h,f,p,d,m=r.length,g=r[0][0],y=r[0][1],v=0;for(u=1;uMath.max(h,g)||c>Math.max(f,y)))if(cu||Math.abs(n(o,f))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var c=l+1;c1&&o(t.pop()),{addPt:o,raw:t,filtered:r}}},22459:function(t,e,r){\"use strict\";var n=r(97464),i=r(81330);t.exports=function(t,e,a){var o=t._fullLayout,s=!0;return o._glcanvas.each((function(n){if(n.regl)n.regl.preloadCachedCode(a);else if(!n.pick||o._has(\"parcoords\")){try{n.regl=i({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.g.devicePixelRatio,extensions:e||[],cachedCode:a||{}})}catch(t){s=!1}n.regl||(s=!1),s&&this.addEventListener(\"webglcontextlost\",(function(e){t&&t.emit&&t.emit(\"plotly_webglcontextlost\",{event:e,layer:n.key})}),!1)}})),s||n({container:o._glcontainer.node()}),s}},32521:function(t,e,r){\"use strict\";var n=r(10721),i=r(13087);t.exports=function(t){var e;if(\"string\"!=typeof(e=t&&t.hasOwnProperty(\"userAgent\")?t.userAgent:function(){var t;return\"undefined\"!=typeof navigator&&(t=navigator.userAgent),t&&t.headers&&\"string\"==typeof t.headers[\"user-agent\"]&&(t=t.headers[\"user-agent\"]),t}()))return!0;var r=i({ua:{headers:{\"user-agent\":e}},tablet:!0,featureDetect:!1});if(!r)for(var a=e.split(\" \"),o=1;o-1;s--){var l=a[s];if(\"Version/\"===l.substr(0,8)){var c=l.substr(8).split(\".\")[0];if(n(c)&&(c=+c),c>=13)return!0}}return r}},36539:function(t){\"use strict\";t.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function h(t,e){return t>=e}e.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-s)-1:Math.floor((t-e.start)/e.size+s);var a,o,f=0,p=e.length,d=0,m=p>1?(e[p-1]-e[0])/(p-1):1;for(o=m>=0?r?l:c:r?h:u,t+=m*s*(r?-1:1)*(m>=0?1:-1);f90&&i.log(\"Long binary search...\"),f-1},e.sorterAsc=function(t,e){return t-e},e.sorterDes=function(t,e){return e-t},e.distinctVals=function(t){var r,n=t.slice();for(n.sort(e.sorterAsc),r=n.length-1;r>-1&&n[r]===o;r--);for(var i,a=n[r]-n[0]||1,s=a/(r||1)/1e4,l=[],c=0;c<=r;c++){var u=n[c],h=u-i;void 0===i?(l.push(u),i=u):h>s&&(a=Math.min(a,h),l.push(u),i=u)}return{vals:l,minDiff:a}},e.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},e.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(r)||(r=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},55010:function(t,e,r){\"use strict\";var n=r(162);t.exports=function(t){return t?n(t):[0,0,0,1]}},95544:function(t,e,r){\"use strict\";var n=r(1837),i=r(62203),a=r(34809),o=null;t.exports=function(){if(null!==o)return o;o=!1;var t=a.isIE()||a.isSafari()||a.isIOS();if(window.navigator.userAgent&&!t){var e=Array.from(n.CSS_DECLARATIONS).reverse(),r=window.CSS&&window.CSS.supports||window.supportsCSS;if(\"function\"==typeof r)o=e.some((function(t){return r.apply(null,t)}));else{var s=i.tester.append(\"image\").attr(\"style\",n.STYLE),l=window.getComputedStyle(s.node()).imageRendering;o=e.some((function(t){var e=t[1];return l===e||l===e.toLowerCase()})),s.remove()}}return o}},30635:function(t,e,r){\"use strict\";var n=r(45568),i=r(34809),a=i.strTranslate,o=r(62972),s=r(4530).LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;e.convertToTspans=function(t,r,g){var S=t.text(),E=!t.attr(\"data-notex\")&&r&&r._context.typesetMath&&\"undefined\"!=typeof MathJax&&S.match(l),I=n.select(t.node().parentNode);if(!I.empty()){var P=t.attr(\"class\")?t.attr(\"class\").split(\" \")[0]:\"text\";return P+=\"-math\",I.selectAll(\"svg.\"+P).remove(),I.selectAll(\"g.\"+P+\"-group\").remove(),t.style(\"display\",null).attr({\"data-unformatted\":S,\"data-math\":\"N\"}),E?(r&&r._promises||[]).push(new Promise((function(e){t.style(\"display\",\"none\");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var a,o,s,l,f=parseInt((MathJax.version||\"\").split(\".\")[0]);if(2===f||3===f){var p=function(){var r=\"math-output-\"+i.randstr({},64),a=(l=n.select(\"body\").append(\"div\").attr({id:r}).style({visibility:\"hidden\",position:\"absolute\",\"font-size\":e.fontSize+\"px\"}).text(t.replace(c,\"\\\\lt \").replace(u,\"\\\\gt \"))).node();return 2===f?MathJax.Hub.Typeset(a):MathJax.typeset([a])},d=function(){var e=l.select(2===f?\".MathJax_SVG\":\".MathJax\"),a=!e.empty()&&l.select(\"svg\").node();if(a){var o,s=a.getBoundingClientRect();o=2===f?n.select(\"body\").select(\"#MathJax_SVG_glyphs\"):e.select(\"defs\"),r(e,o,s)}else i.log(\"There was an error in the tex syntax.\",t),r();l.remove()};2===f?MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:\"none\",tex2jax:{inlineMath:h},displayAlign:\"left\"})}),(function(){if(\"SVG\"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer(\"SVG\")}),p,d,(function(){if(\"SVG\"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)})):3===f&&(o=i.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=h,\"svg\"!==(a=MathJax.config.startup.output)&&(MathJax.config.startup.output=\"svg\"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){p(),d(),\"svg\"!==a&&(MathJax.config.startup.output=a),MathJax.config=o})))}else i.warn(\"No MathJax version:\",MathJax.version)}(E[2],o,(function(n,i,o){I.selectAll(\"svg.\"+P).remove(),I.selectAll(\"g.\"+P+\"-group\").remove();var s=n&&n.select(\"svg\");if(!s||!s.node())return z(),void e();var l=I.append(\"g\").classed(P+\"-group\",!0).attr({\"pointer-events\":\"none\",\"data-unformatted\":S,\"data-math\":\"Y\"});l.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild);var c=o.width,u=o.height;s.attr({class:P,height:u,preserveAspectRatio:\"xMinYMin meet\"}).style({overflow:\"visible\",\"pointer-events\":\"none\"});var h=t.node().style.fill||\"black\",f=s.select(\"g\");f.attr({fill:h,stroke:h});var p=f.node().getBoundingClientRect(),d=p.width,m=p.height;(d>c||m>u)&&(s.style(\"overflow\",\"hidden\"),d=(p=s.node().getBoundingClientRect()).width,m=p.height);var y=+t.attr(\"x\"),v=+t.attr(\"y\"),x=-(r||t.node().getBoundingClientRect().height)/4;if(\"y\"===P[0])l.attr({transform:\"rotate(\"+[-90,y,v]+\")\"+a(-d/2,x-m/2)});else if(\"l\"===P[0])v=x-m/2;else if(\"a\"===P[0]&&0!==P.indexOf(\"atitle\"))y=0,v=x;else{var _=t.attr(\"text-anchor\");y-=d*(\"middle\"===_?.5:\"end\"===_?1:0),v=v+x-m/2}s.attr({x:y,y:v}),g&&g.call(t,l),e(l)}))}))):z(),t}function z(){I.empty()||(P=t.attr(\"class\")+\"-math\",I.select(\"svg.\"+P).remove()),t.text(\"\").style(\"white-space\",\"pre\");var r=function(t,e){e=e.replace(y,\" \");var r,a=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(o.svg,\"tspan\");n.select(e).attr({class:\"line\",dy:c*s+\"em\"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var a=1;a doesnt match end tag <\"+t+\">. Pretending it did match.\",e),r=l[l.length-1].node}else i.log(\"Ignoring unexpected end tag \"+t+\">.\",e)}_.test(e)?u():(r=t,l=[{node:t}]);for(var E=e.split(v),I=0;I|>|>)/g,h=[[\"$\",\"$\"],[\"\\\\(\",\"\\\\)\"]],f={sup:\"font-size:70%\",sub:\"font-size:70%\",s:\"text-decoration:line-through\",u:\"text-decoration:underline\",b:\"font-weight:bold\",i:\"font-style:italic\",a:\"cursor:pointer\",span:\"\",em:\"font-style:italic;font-weight:bold\"},p={sub:\"0.3em\",sup:\"-0.6em\"},d={sub:\"-0.21em\",sup:\"0.42em\"},m=\"\",g=[\"http:\",\"https:\",\"mailto:\",\"\",void 0,\":\"],y=e.NEWLINES=/(\\r\\n?|\\n)/g,v=/(<[^<>]*>)/,x=/<(\\/?)([^ >]*)(\\s+(.*))?>/i,_=/ /i;e.BR_TAG_ALL=/ /gi;var b=/(^|[\\s\"'])style\\s*=\\s*(\"([^\"]*);?\"|'([^']*);?')/i,w=/(^|[\\s\"'])href\\s*=\\s*(\"([^\"]*)\"|'([^']*)')/i,T=/(^|[\\s\"'])target\\s*=\\s*(\"([^\"\\s]*)\"|'([^'\\s]*)')/i,k=/(^|[\\s\"'])popup\\s*=\\s*(\"([\\w=,]*)\"|'([\\w=,]*)')/i;function A(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&C(n)}var M=/(^|;)\\s*color:/;e.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:[\"br\"],i=t.split(v),a=[],o=\"\",s=0,l=0;l3?a.push(c.substr(0,p-3)+\"...\"):a.push(c.substr(0,p));break}o=\"\"}}return a.join(\"\")};var S={mu:\"μ\",amp:\"&\",lt:\"<\",gt:\">\",nbsp:\" \",times:\"×\",plusmn:\"±\",deg:\"°\"},E=/&(#\\d+|#x[\\da-fA-F]+|[a-z]+);/g;function C(t){return t.replace(E,(function(t,e){return(\"#\"===e.charAt(0)?function(t){if(!(t>1114111)){var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}}(\"x\"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):S[e])||t}))}function L(t){var e=encodeURI(decodeURI(t)),r=document.createElement(\"a\"),n=document.createElement(\"a\");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==g.indexOf(i)&&-1!==g.indexOf(a)?e:\"\"}function I(t,e,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||\"top\",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a=\"bottom\"===l?function(){return c.bottom-n.height}:\"middle\"===l?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o=\"right\"===s?function(){return c.right-n.width}:\"center\"===s?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+\"px\",left:t+\"px\",\"z-index\":1e3}),this}}e.convertEntities=C,e.sanitizeHTML=function(t){t=t.replace(y,\" \");for(var e=document.createElement(\"p\"),r=e,i=[],a=t.split(v),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.timer=null}),e)},e.done=function(t){var e=r[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},e.clear=function(t){if(t)n(r[t]),delete r[t];else for(var i in r)e.clear(i)}},8083:function(t,e,r){\"use strict\";var n=r(10721);t.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},11577:function(t,e,r){\"use strict\";var n=t.exports={},i=r(74285).locationmodeToLayer,a=r(48640).N4;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,\"-\"),\"_\",t.resolution.toString(),\"m\"].join(\"\")},n.getTopojsonPath=function(t,e){return t+e+\".json\"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},44611:function(t){\"use strict\";t.exports={moduleType:\"locale\",name:\"en-US\",dictionary:{\"Click to enter Colorscale title\":\"Click to enter Colorscale title\"},format:{date:\"%m/%d/%Y\"}}},30227:function(t){\"use strict\";t.exports={moduleType:\"locale\",name:\"en\",dictionary:{\"Click to enter Colorscale title\":\"Click to enter Colourscale title\"},format:{days:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],shortDays:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],months:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],shortMonths:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],periods:[\"AM\",\"PM\"],dateTime:\"%a %b %e %X %Y\",date:\"%d/%m/%Y\",time:\"%H:%M:%S\",decimal:\".\",thousands:\",\",grouping:[3],currency:[\"$\",\"\"],year:\"%Y\",month:\"%b %Y\",dayMonth:\"%b %-d\",dayMonthYear:\"%b %-d, %Y\"}}},56037:function(t,e,r){\"use strict\";var n=r(33626);t.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split(\"[\")[0],s=0;s0&&o.log(\"Clearing previous rejected promises from queue.\"),t._promises=[]},e.cleanLayout=function(t){var r,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,h=(s.subplotsRegistry.ternary||{}).attrRegex,f=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(r=0;r3?(z.x=1.02,z.xanchor=\"left\"):z.x<-2&&(z.x=-.02,z.xanchor=\"right\"),z.y>3?(z.y=1.02,z.yanchor=\"bottom\"):z.y<-2&&(z.y=-.02,z.yanchor=\"top\")),d(t),\"rotate\"===t.dragmode&&(t.dragmode=\"orbit\"),c.clean(t),t.template&&t.template.layout&&e.cleanLayout(t.template.layout),t},e.cleanData=function(t){for(var r=0;r0)return t.substr(0,e)}e.hasParent=function(t,e){for(var r=_(e);r;){if(r in t)return!0;r=_(r)}return!1};var b=[\"x\",\"y\",\"z\"];e.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.warn(\"Full array edits are incompatible with other edits\",h);var v=r[\"\"][\"\"];if(c(v))e.set(null);else{if(!Array.isArray(v))return a.warn(\"Unrecognized full array edit value\",h,v),!0;e.set(v)}return!m&&(f(g,y),p(t),!0)}var x,_,b,w,T,k,A,M,S=Object.keys(r).map(Number).sort(o),E=e.get(),C=E||[],L=u(y,h).get(),I=[],P=-1,z=C.length;for(x=0;xC.length-(A?0:1))a.warn(\"index out of range\",h,b);else if(void 0!==k)T.length>1&&a.warn(\"Insertion & removal are incompatible with edits to the same index.\",h,b),c(k)?I.push(b):A?(\"add\"===k&&(k={}),C.splice(b,0,k),L&&L.splice(b,0,{})):a.warn(\"Unrecognized full object edit value\",h,b,k),-1===P&&(P=b);else for(_=0;_=0;x--)C.splice(I[x],1),L&&L.splice(I[x],1);if(C.length?E||e.set(C):e.set(null),m)return!1;if(f(g,y),d!==i){var O;if(-1===P)O=S;else{for(z=Math.max(C.length,z),O=[],x=0;x=P);x++)O.push(b);for(x=P;x=t.data.length||i<-t.data.length)throw new Error(r+\" must be valid indices for gd.data.\");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error(\"each index in \"+r+\" must be unique.\")}}function O(t,e,r){if(!Array.isArray(t.data))throw new Error(\"gd.data must be an array.\");if(void 0===e)throw new Error(\"currentIndices is a required argument.\");if(Array.isArray(e)||(e=[e]),z(t,e,\"currentIndices\"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&z(t,r,\"newIndices\"),void 0!==r&&e.length!==r.length)throw new Error(\"current and new indices must be of equal length.\")}function D(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error(\"gd.data must be an array\");if(!o.isPlainObject(e))throw new Error(\"update must be a key:value object\");if(void 0===r)throw new Error(\"indices must be an integer or array of integers\");for(var a in z(t,r,\"indices\"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error(\"attribute \"+a+\" must be an array of length equal to indices array length\");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error(\"when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object\")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,c,u,h,f=o.isPlainObject(n),p=[];for(var d in Array.isArray(r)||(r=[r]),r=P(r,t.data.length-1),e)for(var m=0;m-1&&-1===r.indexOf(\"grouptitlefont\")?l(r,r.replace(\"titlefont\",\"title.font\")):r.indexOf(\"titleposition\")>-1?l(r,r.replace(\"titleposition\",\"title.position\")):r.indexOf(\"titleside\")>-1?l(r,r.replace(\"titleside\",\"title.side\")):r.indexOf(\"titleoffset\")>-1&&l(r,r.replace(\"titleoffset\",\"title.offset\")):l(r,r.replace(\"title\",\"title.text\"));function l(e,r){t[r]=t[e],delete t[e]}}function q(t,e,r){t=o.getGraphDiv(t),T.clearPromiseQueue(t);var n={};if(\"string\"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn(\"Relayout fail.\",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var i=X(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[f.previousPromises];a.layoutReplot?s.push(k.layoutReplot):Object.keys(n).length&&(H(t,a,i)||f.supplyDefaults(t),a.legend&&s.push(k.doLegend),a.layoutstyle&&s.push(k.layoutStyles),a.axrange&&G(s,i.rangesAltered),a.ticks&&s.push(k.doTicksRelayout),a.modebar&&s.push(k.doModeBar),a.camera&&s.push(k.doCamera),a.colorbars&&s.push(k.doColorBars),s.push(E)),s.push(f.rehover,f.redrag,f.reselect),c.add(t,q,[t,i.undoit],q,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit(\"plotly_relayout\",i.eventData),t}))}function H(t,e,r){var n,i,a=t._fullLayout;if(!e.axrange)return!1;for(var s in e)if(\"axrange\"!==s&&e[s])return!1;var l=function(t,e){return o.coerce(n,i,m,t,e)},c={};for(var u in r.rangesAltered){var h=p.id2name(u);if(n=t.layout[h],i=a[h],d(n,i,l,c),i._matchGroup)for(var f in i._matchGroup)if(f!==u){var g=a[p.id2name(f)];g.autorange=i.autorange,g.range=i.range.slice(),g._input.range=i.range.slice()}}return!0}function G(t,e){var r=e?function(t){var r=[];for(var n in e){var i=p.getFromId(t,n);if(r.push(n),-1!==(i.ticklabelposition||\"\").indexOf(\"inside\")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)e[a]||r.push(a)}return p.draw(t,r,{skipTitle:!0})}:function(t){return p.draw(t,\"redraw\")};t.push(_,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var Z=/^[xyz]axis[0-9]*\\.range(\\[[0|1]\\])?$/,W=/^[xyz]axis[0-9]*\\.autorange$/,Y=/^[xyz]axis[0-9]*\\.domain(\\[[0|1]\\])?$/;function X(t,e){var r,n,i,a=t.layout,l=t._fullLayout,c=l._guiEditing,f=N(l._preGUI,c),d=Object.keys(e),m=p.list(t),g=o.extendDeepAll({},e),y={};for(V(e),d=Object.keys(e),n=0;n0&&\"string\"!=typeof z.parts[D];)D--;var R=z.parts[D],F=z.parts[D-1]+\".\"+R,j=z.parts.slice(0,D).join(\".\"),U=s(t.layout,j).get(),q=s(l,j).get(),H=z.get();if(void 0!==O){k[P]=O,S[P]=\"reverse\"===R?O:B(H);var G=h.getLayoutValObject(l,z.parts);if(G&&G.impliedEdits&&null!==O)for(var X in G.impliedEdits)E(o.relativeAttr(P,X),G.impliedEdits[X]);if(-1!==[\"width\",\"height\"].indexOf(P))if(O){E(\"autosize\",null);var J=\"height\"===P?\"width\":\"height\";E(J,l[J])}else l[P]=t._initialAutoSize[P];else if(\"autosize\"===P)E(\"width\",O?null:l.width),E(\"height\",O?null:l.height);else if(F.match(Z))I(F),s(l,j+\"._inputRange\").set(null);else if(F.match(W)){I(F),s(l,j+\"._inputRange\").set(null);var K=s(l,j).get();K._inputDomain&&(K._input.domain=K._inputDomain.slice())}else F.match(Y)&&s(l,j+\"._inputDomain\").set(null);if(\"type\"===R){C=U;var Q=\"linear\"===q.type&&\"log\"===O,tt=\"log\"===q.type&&\"linear\"===O;if(Q||tt){if(C&&C.range)if(q.autorange)Q&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var et=C.range[0],rt=C.range[1];Q?(et<=0&&rt<=0&&E(j+\".autorange\",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),E(j+\".range[0]\",Math.log(et)/Math.LN10),E(j+\".range[1]\",Math.log(rt)/Math.LN10)):(E(j+\".range[0]\",Math.pow(10,et)),E(j+\".range[1]\",Math.pow(10,rt)))}else E(j+\".autorange\",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[z.parts[0]]&&\"radialaxis\"===z.parts[1]&&delete l[z.parts[0]]._subplot.viewInitial[\"radialaxis.range\"],u.getComponentMethod(\"annotations\",\"convertCoords\")(t,q,O,E),u.getComponentMethod(\"images\",\"convertCoords\")(t,q,O,E)}else E(j+\".autorange\",!0),E(j+\".range\",null);s(l,j+\"._inputRange\").set(null)}else if(R.match(M)){var nt=s(l,P).get(),it=(O||{}).type;it&&\"-\"!==it||(it=\"linear\"),u.getComponentMethod(\"annotations\",\"convertCoords\")(t,nt,it,E),u.getComponentMethod(\"images\",\"convertCoords\")(t,nt,it,E)}var at=w.containerArrayMatch(P);if(at){r=at.array,n=at.index;var ot=at.property,st=G||{editType:\"calc\"};\"\"!==n&&\"\"===ot&&(w.isAddVal(O)?S[P]=null:w.isRemoveVal(O)?S[P]=(s(a,r).get()||[])[n]:o.warn(\"unrecognized full object value\",e)),A.update(b,st),y[r]||(y[r]={});var lt=y[r][n];lt||(lt=y[r][n]={}),lt[ot]=O,delete e[P]}else\"reverse\"===R?(U.range?U.range.reverse():(E(j+\".autorange\",!0),U.range=[1,0]),q.autorange?b.calc=!0:b.plot=!0):(\"dragmode\"===P&&(!1===O&&!1!==H||!1!==O&&!1===H)||l._has(\"scatter-like\")&&l._has(\"regl\")&&\"dragmode\"===P&&(\"lasso\"===O||\"select\"===O)&&\"lasso\"!==H&&\"select\"!==H||l._has(\"gl2d\")?b.plot=!0:G?A.update(b,G):b.calc=!0,z.set(O))}}for(r in y)w.applyContainerArrayChanges(t,f(a,r),y[r],b,f)||(b.plot=!0);for(var ct in L){var ut=(C=p.getFromId(t,ct))&&C._constraintGroup;if(ut)for(var ht in b.calc=!0,ut)L[ht]||(p.getFromId(t,ht)._constraintShrinkable=!0)}($(t)||e.height||e.width)&&(b.plot=!0);var ft=l.shapes;for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(\".\")+\".uirevision\").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(a,u){function h(){t.emit(\"plotly_animating\"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,f.transition(t,e.frame.data,e.frame.layout,T.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit(\"plotly_animatingframe\",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit(\"plotly_animated\"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()};e()}var p,d,m=0;function g(t){return Array.isArray(i)?m>=i.length?t.transitionOpts=i[m]:t.transitionOpts=i[0]:t.transitionOpts=i,m++,t}var y=[],v=null==e,x=Array.isArray(e);if(v||x||!o.isPlainObject(e)){if(v||-1!==[\"string\",\"number\"].indexOf(typeof e))for(p=0;p0&&ww)&&k.push(d);y=k}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,g=(u[m]||d[m]||{}).name,y=e[n].name,v=u[g]||d[g];g&&y&&\"number\"==typeof y&&v&&S<5&&(S++,o.warn('addFrames: overwriting frame \"'+(u[g]||d[g]).name+'\" with a frame whose name of type \"number\" also equates to \"'+g+'\". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===S&&o.warn(\"addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.\")),d[m]={name:m},p.push({frame:f.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:h+n})}p.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if(\"number\"==typeof(i=p[n].frame).name&&o.warn(\"Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings\"),!i.name)for(;u[i.name=\"frame \"+t._transitionData._counter++];);if(u[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:\"delete\",index:n}),s.unshift({type:\"insert\",index:n,value:i[n]});var l=f.modifyFrames,u=f.modifyFrames,h=[t,s],p=[t,a];return c&&c.add(t,l,h,u,p),f.modifyFrames(t,a)},e.addTraces=function t(r,n,i){r=o.getGraphDiv(r);var a,s,l=[],u=e.deleteTraces,h=t,f=[r,l],p=[r,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error(\"gd.data must be an array.\");if(void 0===e)throw new Error(\"traces must be defined.\");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!b(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function b(t){return t===Math.round(t)&&t>=0}function w(){var t,e,r={};for(t in h(r,o),n.subplotsRegistry)if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else{var u=t._module;if(u||(u=(n.modules[t.type||a.type.dflt]||{})._module),!u)return!1;if(!(i=(r=u.attributes)&&r[o])){var h=u.basePlotModule;h&&h.attributes&&(i=h.attributes[o])}i||(i=a[o])}return _(i,e,s)},e.getLayoutValObject=function(t,e){var r=function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var c;for(r=0;r=i&&(r._input||{})._templateitemname;s&&(o=i);var l,c=e+\"[\"+o+\"]\";function u(){l={},s&&(l[c]={},l[c][a]=s)}function h(t,e){s?n.nestedProperty(l[c],t).set(e):l[c+\".\"+t]=e}function f(){var t=l;return u(),t}return u(),{modifyBase:function(t,e){l[t]=e},modifyItem:h,getUpdateObj:f,applyUpdate:function(e,r){e&&h(e,r);var i=f();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},71817:function(t,e,r){\"use strict\";var n=r(45568),i=r(33626),a=r(44122),o=r(34809),s=r(30635),l=r(34823),c=r(78766),u=r(62203),h=r(17240),f=r(95433),p=r(29714),d=r(4530),m=r(84391),g=m.enforce,y=m.clean,v=r(32919).doAutoRange,x=\"start\",_=r(54826).zindexSeparator;function b(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}function w(t){var r,i,s,l,h,m,g=t._fullLayout,y=g._size,v=y.p,x=p.list(t,\"\",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?\"100%\":g.width+\"px\",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?\"100%\":g.height+\"px\"}).selectAll(\".main-svg\").call(u.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),e.drawMainTitle(t),f.manage(t),!g._has(\"cartesian\"))return a.previousPromises(t);function w(t,e,r){var n=t._lw/2;return\"x\"===t._id.charAt(0)?e?\"top\"===r?e._offset-v-n:e._offset+e._length+v+n:y.t+y.h*(1-(t.position||0))+n%1:e?\"right\"===r?e._offset+e._length+v+n:e._offset-v-n:y.l+y.w*(t.position||0)+n%1}for(r=0;r.5?\"t\":\"b\",o=t._fullLayout.margin[a],s=0;return\"paper\"===e.yref?s=r+e.pad.t+e.pad.b:\"container\"===e.yref&&(s=function(t,e,r,n,i){var a=0;return\"middle\"===r&&(a+=i/2),\"t\"===t?(\"top\"===r&&(a+=i),a+=n-e*n):(\"bottom\"===r&&(a+=i),a+=e*n),a}(a,n,i,t._fullLayout.height,r)+e.pad.t+e.pad.b),s>o?s:0}(t,e,m);if(g>0){!function(t,e,r,n){var i=\"title.automargin\",s=t._fullLayout.title,l=s.y>.5?\"t\":\"b\",c={x:s.x,y:s.y,t:0,b:0},u={};\"paper\"===s.yref&&function(t,e,r,n,i){var a=\"paper\"===e.yref?t._fullLayout._size.h:t._fullLayout.height,s=o.isTopAnchor(e)?n:n-i,l=\"b\"===r?a-s:s;return!(o.isTopAnchor(e)&&\"t\"===r||o.isBottomAnchor(e)&&\"b\"===r)&&lT?u.push({code:\"unused\",traceType:v,templateCount:w,dataCount:T}):T>w&&u.push({code:\"reused\",traceType:v,templateCount:w,dataCount:T})}}else u.push({code:\"data\"});if(function t(e,r){for(var n in e)if(\"_\"!==n.charAt(0)){var a=e[n],o=m(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&u.push({code:\"missing\",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&g(a)&&t(a,o)}}({data:p,layout:f},\"\"),u.length)return u.map(y)}},80491:function(t,e,r){\"use strict\";var n=r(10721),i=r(31420),a=r(44122),o=r(34809),s=r(84619),l=r(6243),c=r(72914),u=r(29697).version,h={format:{valType:\"enumerated\",values:[\"png\",\"jpeg\",\"webp\",\"svg\",\"full-json\"],dflt:\"png\"},width:{valType:\"number\",min:1},height:{valType:\"number\",min:1},scale:{valType:\"number\",min:0,dflt:1},setBackground:{valType:\"any\",dflt:!1},imageDataOnly:{valType:\"boolean\",dflt:!1}};t.exports=function(t,e){var r,f,p,d;function m(t){return!(t in e)||o.validate(e[t],h[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],f=t.layout||{},p=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),f=o.extendDeep({},t.layout),p=t._context,d=t._fullLayout||{}),!m(\"width\")&&null!==e.width||!m(\"height\")&&null!==e.height)throw new Error(\"Height and width should be pixel values.\");if(!m(\"format\"))throw new Error(\"Export format is not \"+o.join2(h.format.values,\", \",\" or \")+\".\");var g={};function y(t,r){return o.coerce(e,g,h,t,r)}var v=y(\"format\"),x=y(\"width\"),_=y(\"height\"),b=y(\"scale\"),w=y(\"setBackground\"),T=y(\"imageDataOnly\"),k=document.createElement(\"div\");k.style.position=\"absolute\",k.style.left=\"-5000px\",document.body.appendChild(k);var A=o.extendFlat({},f);x?A.width=x:null===e.width&&n(d.width)&&(A.width=d.width),_?A.height=_:null===e.height&&n(d.height)&&(A.height=d.height);var M=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function E(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function C(){return new Promise((function(t,e){var r=l(k,v,b),n=k._fullLayout.width,h=k._fullLayout.height;function f(){i.purge(k),document.body.removeChild(k)}if(\"full-json\"===v){var p=a.graphJson(k,!1,\"keepdata\",\"object\",!0,!0);return p.version=u,p=JSON.stringify(p),f(),t(T?p:s.encodeJSON(p))}if(f(),\"svg\"===v)return t(T?r:s.encodeSVG(r));var d=document.createElement(\"canvas\");d.id=o.randstr(),c({format:v,width:n,height:h,scale:b,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.newPlot(k,r,A,M).then(S).then(E).then(C).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,\"\"):t}(e))})).catch((function(t){e(t)}))}))}},2466:function(t,e,r){\"use strict\";var n=r(34809),i=r(44122),a=r(57297),o=r(24452).dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,i,a,o){o=o||[];for(var h=Object.keys(t),f=0;fx.length&&i.push(p(\"unused\",a,y.concat(x.length)));var A,M,S,E,C,L=x.length,I=Array.isArray(k);if(I&&(L=Math.min(L,k.length)),2===_.dimensions)for(M=0;Mx[M].length&&i.push(p(\"unused\",a,y.concat(M,x[M].length)));var P=x[M].length;for(A=0;A<(I?Math.min(P,k[M].length):P);A++)S=I?k[M][A]:k,E=v[M][A],C=x[M][A],n.validate(E,S)?C!==E&&C!==+E&&i.push(p(\"dynamic\",a,y.concat(M,A),E,C)):i.push(p(\"value\",a,y.concat(M,A),E))}else i.push(p(\"array\",a,y.concat(M),v[M]));else for(M=0;M1&&f.push(p(\"object\",\"layout\"))),i.supplyDefaults(d);for(var m=d._fullData,g=r.length,y=0;y0&&Math.round(h)===h))return{vals:i};c=h}for(var f=e.calendar,p=\"start\"===l,d=\"end\"===l,m=t[r+\"period0\"],g=a(m,f)||0,y=[],v=[],x=[],_=i.length,b=0;b<_;b++){var w,T,k,A=i[b];if(c){for(w=Math.round((A-g)/(c*s)),k=o(g,c*w,f);k>A;)k=o(k,-c,f);for(;k<=A;)k=o(k,c,f);T=o(k,-c,f)}else{for(k=g+(w=Math.round((A-g)/u))*u;k>A;)k-=u;for(;k<=A;)k+=u;T=k-u}y[b]=p?T:d?k:(T+k)/2,v[b]=T,x[b]=k}return{vals:y,starts:v,ends:x}}},55126:function(t){\"use strict\";t.exports={xaxis:{valType:\"subplotid\",dflt:\"x\",editType:\"calc+clearAxisTypes\"},yaxis:{valType:\"subplotid\",dflt:\"y\",editType:\"calc+clearAxisTypes\"}}},32919:function(t,e,r){\"use strict\";var n=r(45568),i=r(10721),a=r(34809),o=r(63821).FP_SAFE,s=r(33626),l=r(62203),c=r(5975),u=c.getFromId,h=c.isLinked;function f(t,e){var r,n,i=[],o=t._fullLayout,s=d(o,e,0),l=d(o,e,1),c=g(t,e),u=c.min,h=c.max;if(0===u.length||0===h.length)return a.simpleMap(e.range,e.r2l);var f=u[0].val,m=h[0].val;for(r=1;r0&&((A=L-s(_)-l(b))>I?M/A>P&&(w=_,T=b,P=M/A):M/L>P&&(w={val:_.val,nopad:1},T={val:b.val,nopad:1},P=M/L));if(f===m){var z=f-1,O=f+1;if(E)if(0===f)i=[0,1];else{var D=(f>0?h:u).reduce((function(t,e){return Math.max(t,l(e))}),0),R=f/(1-Math.min(.5,D/L));i=f>0?[0,R]:[R,0]}else i=C?[Math.max(0,z),Math.max(1,O)]:[z,O]}else E?(w.val>=0&&(w={val:0,nopad:1}),T.val<=0&&(T={val:0,nopad:1})):C&&(w.val-P*s(w)<0&&(w={val:0,nopad:1}),T.val<=0&&(T={val:1,nopad:1})),P=(T.val-w.val-p(e,_.val,b.val))/(L-s(w)-l(T)),i=[w.val-P*s(w),T.val+P*l(T)];return i=k(i,e),e.limitRange&&e.limitRange(),v&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function p(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),S=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=A(r.vpadplus||r.vpad),C=A(r.vpadminus||r.vpad);if(!T){if(f=1/0,p=-1/0,w)for(n=0;n0&&(f=a),a>p&&a-o&&(f=a),a>p&&a=P;n--)I(n);return{min:d,max:m,opts:r}},concatExtremes:g};var m=3;function g(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,c=[],h=[];function f(t,e){for(n=0;n=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function _(t){return i(t)&&Math.abs(t)=e}function T(t,e,r){return void 0===e||void 0===r||(e=t.d2l(e))=c&&(o=c,r=c),s<=c&&(s=c,n=c)}}return r=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.minallowed&&T(e,r.minallowed,r.maxallowed)?r.minallowed:r&&void 0!==r.clipmin&&T(e,r.clipmin,r.clipmax)?Math.max(t,e.d2l(r.clipmin)):t}(r,e),n=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.maxallowed&&T(e,r.minallowed,r.maxallowed)?r.maxallowed:r&&void 0!==r.clipmax&&T(e,r.clipmin,r.clipmax)?Math.min(t,e.d2l(r.clipmax)):t}(n,e),[r,n]}},75511:function(t){\"use strict\";t.exports=function(t,e,r){var n,i;if(r){var a=\"reversed\"===e||\"min reversed\"===e||\"max reversed\"===e;n=r[a?1:0],i=r[a?0:1]}var o=t(\"autorangeoptions.minallowed\",null===i?n:void 0),s=t(\"autorangeoptions.maxallowed\",null===n?i:void 0);void 0===o&&t(\"autorangeoptions.clipmin\"),void 0===s&&t(\"autorangeoptions.clipmax\"),t(\"autorangeoptions.include\")}},29714:function(t,e,r){\"use strict\";var n=r(45568),i=r(10721),a=r(44122),o=r(33626),s=r(34809),l=s.strTranslate,c=r(30635),u=r(17240),h=r(78766),f=r(62203),p=r(25829),d=r(68599),m=r(63821),g=m.ONEMAXYEAR,y=m.ONEAVGYEAR,v=m.ONEMINYEAR,x=m.ONEMAXQUARTER,_=m.ONEAVGQUARTER,b=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,k=m.ONEMINMONTH,A=m.ONEWEEK,M=m.ONEDAY,S=M/2,E=m.ONEHOUR,C=m.ONEMIN,L=m.ONESEC,I=m.ONEMILLI,P=m.ONEMICROSEC,z=m.MINUS_SIGN,O=m.BADNUM,D={K:\"zeroline\"},R={K:\"gridline\",L:\"path\"},F={K:\"minor-gridline\",L:\"path\"},B={K:\"tick\",L:\"path\"},N={K:\"tick\",L:\"text\"},j={width:[\"x\",\"r\",\"l\",\"xl\",\"xr\"],height:[\"y\",\"t\",\"b\",\"yt\",\"yb\"],right:[\"r\",\"xr\"],left:[\"l\",\"xl\"],top:[\"t\",\"yt\"],bottom:[\"b\",\"yb\"]},U=r(4530),V=U.MID_SHIFT,q=U.CAP_SHIFT,H=U.LINE_SPACING,G=U.OPPOSITE_SIDE,Z=t.exports={};Z.setConvert=r(19091);var W=r(9666),Y=r(5975),X=Y.idSort,$=Y.isLinked;Z.id2name=Y.id2name,Z.name2id=Y.name2id,Z.cleanId=Y.cleanId,Z.list=Y.list,Z.listIds=Y.listIds,Z.getFromId=Y.getFromId,Z.getFromTrace=Y.getFromTrace;var J=r(32919);Z.getAutoRange=J.getAutoRange,Z.findExtremes=J.findExtremes;var K=1e-4;function Q(t){var e=(t[1]-t[0])*K;return[t[0]-e,t[1]+e]}Z.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+\"axis\"],c=n+\"ref\",u={};return i||(i=l[0]||(\"string\"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+\" domain\"}))),u[c]={valType:\"enumerated\",values:l.concat(a?\"string\"==typeof a?[a]:a:[]),dflt:i},s.coerce(t,e,u,c)},Z.getRefType=function(t){return void 0===t?t:\"paper\"===t?\"paper\":\"pixel\"===t?\"pixel\":/( domain)$/.test(t)?\"domain\":\"range\"},Z.coercePosition=function(t,e,r,n,i,a){var o,l;if(\"range\"!==Z.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var c=Z.getFromId(e,n);l=r(i,a=c.fraction2r(a)),o=c.cleanPos}t[i]=o(l)},Z.cleanPosition=function(t,e,r){return(\"paper\"===r||\"pixel\"===r?s.ensureNumber:Z.getFromId(e,r).cleanPos)(t)},Z.redrawComponents=function(t,e){e=e||Z.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),c={},u=0;un&&f2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},Z.saveRangeInitial=function(t,e){for(var r=Z.list(t,\"\",!0),n=!1,i=0;i.3*f||u(n)||u(a))){var p=r.dtick/2;t+=t+p.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=Z.tickIncrement(t,\"M6\",\"reverse\")+1.5*M:a.exactMonths>.8?t=Z.tickIncrement(t,\"M1\",\"reverse\")+15.5*M:t-=S;var l=Z.tickIncrement(t,r);if(l<=n)return l}return t}(v,t,y,c,a)),g=v;g<=u;)g=Z.tickIncrement(g,y,!1,a);return{start:e.c2r(v,0,a),end:e.c2r(g,0,a),size:y,_dataSpan:u-c}},Z.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var n,a=e.dtick&&i(e._tmin);if(a){var o=Z.tickIncrement(e._tmin,e.dtick,!0);n=[e._tmin,.99*o+.01*e._tmin]}else{var l=s.simpleMap(e.range,e.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(t.range=s.simpleMap(n,e.l2r),t._isMinor=!0,Z.prepTicks(t,r),a){var c=i(e.dtick),u=i(t.dtick),h=c?e.dtick:+e.dtick.substring(1),f=u?t.dtick:+t.dtick.substring(1);c&&u?nt(h,f)?h===2*A&&f===2*M&&(t.dtick=A):h===2*A&&f===3*M?t.dtick=A:h!==A||(e._input.minor||{}).nticks?it(h/f,2.5)?t.dtick=h/2:t.dtick=h:t.dtick=M:\"M\"===String(e.dtick).charAt(0)?u?t.dtick=\"M1\":nt(h,f)?h>=12&&2===f&&(t.dtick=\"M3\"):t.dtick=e.dtick:\"L\"===String(t.dtick).charAt(0)?\"L\"===String(e.dtick).charAt(0)?nt(h,f)||(t.dtick=it(h/f,2.5)?e.dtick/2:e.dtick):t.dtick=\"D1\":\"D2\"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},Z.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if(\"auto\"===t.tickmode||!t.dtick){var n,a=t.nticks;a||(\"category\"===t.type||\"multicategory\"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,a=t._length/n):(n=\"y\"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),\"radialaxis\"===t._name&&(a*=2)),t.minor&&\"array\"!==t.minor.tickmode||\"array\"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,Z.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}\"period\"===t.ticklabelmode&&function(t){var e;function r(){return!(i(t.dtick)||\"M\"!==t.dtick.charAt(0))}var n=r(),a=Z.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=E,o&&!n&&t.dtickt.range[1],p=!t.ticklabelindex||s.isArrayOrTypedArray(t.ticklabelindex)?t.ticklabelindex:[t.ticklabelindex],d=s.simpleMap(t.range,t.r2l,void 0,void 0,e),m=d[1]=(V?0:1);q--){var H=!q;q?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var G=q?t:s.extendFlat({},t,t.minor);if(H?Z.prepMinorTicks(G,t,e):Z.prepTicks(G,e),\"array\"!==G.tickmode)if(\"sync\"!==G.tickmode){var W=Q(d),Y=W[0],X=W[1],$=i(G.dtick),J=\"log\"===l&&!($||\"L\"===G.dtick.charAt(0)),K=Z.tickFirst(G,e);if(q){if(t._tmin=K,K=X:nt<=X;nt=Z.tickIncrement(nt,it,m,c)){if(q&&tt++,G.rangebreaks&&!m){if(nt=D)break}if(N.length>R||nt===rt)break;rt=nt;var at={value:nt};q?(J&&nt!==(0|nt)&&(at.simpleLabel=!0),u>1&&tt%u&&(at.skipLabel=!0),N.push(at)):(at.minor=!0,j.push(at))}}else N=[],F=st(t);else q?(N=[],F=lt(t,!H)):(j=[],B=lt(t,!H))}!j||j.length<2?p=!1:(r=(j[1].value-j[0].value)*(f?-1:1),n=t.tickformat,(/%f/.test(n)?r>=P:/%L/.test(n)?r>=I:/%[SX]/.test(n)?r>=L:/%M/.test(n)?r>=C:/%[HI]/.test(n)?r>=E:/%p/.test(n)?r>=S:/%[Aadejuwx]/.test(n)?r>=M:/%[UVW]/.test(n)?r>=A:/%[Bbm]/.test(n)?r>=k:/%[q]/.test(n)?r>=b:!/%[Yy]/.test(n)||r>=v)||(p=!1));if(p){var ot=N.concat(j);h&&N.length&&(ot=ot.slice(1)),(ot=ot.sort((function(t,e){return t.value-e.value})).filter((function(t,e,r){return 0===e||t.value!==r[e-1].value}))).map((function(t,e){return void 0!==t.minor||t.skipLabel?null:e})).filter((function(t){return null!==t})).forEach((function(t){p.map((function(e){var r=t+e;r>=0&&r0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),h=r||u,f=0;h>=v?f=u>=v&&u<=g?u:y:r===_&&h>=b?f=u>=b&&u<=x?u:_:h>=k?f=u>=k&&u<=w?u:T:r===A&&h>=A?f=A:h>=M?f=M:r===S&&h>=S?f=S:r===E&&h>=E&&(f=E),f>=u&&(f=u,s=!0);var p=i+f;if(e.rangebreaks&&f>0){for(var d=0,m=0;m<84;m++){var C=(m+.5)/84;e.maskBreaks(i*(1-C)+C*p)!==O&&d++}(f*=d/84)||(t[n].drop=!0),s&&u>A&&(f=u)}(f>0||0===n)&&(t[n].periodX=i+f/2)}}(U,t,t._definedDelta),t.rangebreaks){var gt=\"y\"===t._id.charAt(0),yt=1;\"auto\"===t.tickmode&&(yt=t.tickfont?t.tickfont.size:12);var vt=NaN;for(a=N.length-1;a>-1;a--)if(N[a].drop)N.splice(a,1);else{N[a].value=Ft(N[a].value,t);var xt=t.c2p(N[a].value);(gt?vt>xt-yt:vtD||nD&&(r.periodX=D),n10||\"01-01\"!==n.substr(5)?t._tickround=\"d\":t._tickround=+e.substr(1)%12==0?\"y\":\"m\";else if(e>=M&&a<=10||e>=15*M)t._tickround=\"d\";else if(e>=C&&a<=16||e>=E)t._tickround=\"M\";else if(e>=L&&a<=19||e>=C)t._tickround=\"S\";else{var o=t.l2r(r+e).replace(/^-/,\"\").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||\"L\"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(_t(t.exponentformat)&&!bt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function vt(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||\"\",fontSize:n.size,font:n.family,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontTextcase:n.textcase,fontLineposition:n.lineposition,fontShadow:n.shadow,fontColor:n.color}}Z.autoTicks=function(t,e,r){var n;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if(\"date\"===t.type){t.tick0=s.dateTick0(t.calendar,0);var o=2*e;if(o>y)e/=y,n=a(10),t.dtick=\"M\"+12*gt(e,n,ct);else if(o>T)e/=T,t.dtick=\"M\"+gt(e,1,ut);else if(o>M){if(t.dtick=gt(e,M,t._hasDayOfWeekBreaks?[1,2,7,14]:ft),!r){var l=Z.getTickFormat(t),c=\"period\"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),c&&(t._dowTick0=t.tick0)}}else o>E?t.dtick=gt(e,E,ut):o>C?t.dtick=gt(e,C,ht):o>L?t.dtick=gt(e,L,ht):(n=a(10),t.dtick=gt(e,n,ct))}else if(\"log\"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var h=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/h,n=a(10),t.dtick=\"L\"+gt(e,n,ct)}else t.dtick=e>.3?\"D2\":\"D1\"}else\"category\"===t.type||\"multicategory\"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):Rt(t)?(t.tick0=0,n=1,t.dtick=gt(e,n,mt)):(t.tick0=0,n=a(10),t.dtick=gt(e,n,ct));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&\"string\"!=typeof t.dtick){var f=t.dtick;throw t.dtick=1,\"ax.dtick error: \"+String(f)}},Z.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return s.increment(t,o*e);var l=e.charAt(0),c=o*Number(e.substr(1));if(\"M\"===l)return s.incrementMonth(t,c,a);if(\"L\"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if(\"D\"===l){var u=\"D2\"===e?dt:pt,h=t+.01*o,f=s.roundUp(s.mod(h,1),u,r);return Math.floor(h)+Math.log(n.round(Math.pow(10,f),1))/Math.LN10}throw\"unrecognized dtick \"+String(e)},Z.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1]=0&&r<=t._length?e:null};if(l&&s.isArrayOrTypedArray(t.ticktext)){var p=s.simpleMap(t.range,t.r2l),d=(Math.abs(p[1]-p[0])-(t._lBreaks||0))/1e4;for(a=0;a \")}else t._prevDateHead=l,c+=\" \"+l;e.text=c}(t,o,r,c):\"log\"===u?function(t,e,r,n,a){var o=t.dtick,l=e.x,c=t.tickformat,u=\"string\"==typeof o&&o.charAt(0);if(\"never\"===a&&(a=\"\"),n&&\"L\"!==u&&(o=\"L3\",u=\"L\"),c||\"L\"===u)e.text=wt(Math.pow(10,l),t,a,n);else if(i(o)||\"D\"===u&&s.mod(l+.01,1)<.1){var h=Math.round(l),f=Math.abs(h),p=t.exponentformat;\"power\"===p||_t(p)&&bt(h)?(e.text=0===h?1:1===h?\"10\":\"10\"+(h>1?\"\":z)+f+\" \",e.fontSize*=1.25):(\"e\"===p||\"E\"===p)&&f>2?e.text=\"1\"+p+(h>0?\"+\":z)+f:(e.text=wt(Math.pow(10,l),t,\"\",\"fakehover\"),\"D1\"===o&&\"y\"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if(\"D\"!==u)throw\"unrecognized dtick \"+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if(\"D1\"===t.dtick){var d=String(e.text).charAt(0);\"0\"!==d&&\"1\"!==d||(\"y\"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,c,g):\"category\"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=\"\"),e.text=String(r)}(t,o):\"multicategory\"===u?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?\"\":String(i[1]),o=void 0===i[0]?\"\":String(i[0]);r?e.text=o+\" - \"+a:(e.text=a,e.text2=o)}(t,o,r):Rt(t)?function(t,e,r,n,i){if(\"radians\"!==t.thetaunit||r)e.text=wt(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text=\"0\";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=wt(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text=\"π\":e.text=o[0]+\"π\":e.text=[\"\",o[0],\" \",\"⁄\",\"\",o[1],\" \",\"π\"].join(\"\"),l&&(e.text=z+e.text)}}}}(t,o,r,c,g):function(t,e,r,n,i){\"never\"===i?i=\"\":\"all\"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i=\"hide\"),e.text=wt(e.x,t,i,n)}(t,o,0,c,g),n||(t.tickprefix&&!m(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!m(t.showticksuffix)&&(o.text+=t.ticksuffix)),t.labelalias&&t.labelalias.hasOwnProperty(o.text)){var y=t.labelalias[o.text];\"string\"==typeof y&&(o.text=y)}return(\"boundaries\"===t.tickson||t.showdividers)&&(o.xbnd=[f(o.x-.5),f(o.x+t.dtick-.5)]),o},Z.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=s.isArrayOrTypedArray(e)?e[0]:e,i=s.isArrayOrTypedArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return Z.hoverLabelText(t,n,r)+\" - \"+Z.hoverLabelText(t,i,r);var a=\"log\"===t.type&&n<=0,o=Z.tickText(t,t.c2l(a?-n:n),\"hover\").text;return a?0===n?\"0\":z+o:o};var xt=[\"f\",\"p\",\"n\",\"μ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\"];function _t(t){return\"SI\"===t||\"B\"===t}function bt(t){return t>14||t<-15}function wt(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||\"B\",c=e._tickexponent,u=Z.getTickFormat(e),h=e.separatethousands;if(n){var f={exponentformat:l,minexponent:e.minexponent,dtick:\"none\"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:\"none\"===e.showexponent?e.range.map(e.r2d):[0,t||1]};yt(f),o=(Number(f._tickround)||0)+4,c=f._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,z);var p,d=Math.pow(10,-o)/2;if(\"none\"===l&&(c=0),(t=Math.abs(t))\"+p+\"\":\"B\"===l&&9===c?t+=\"B\":_t(l)&&(t+=xt[c/3+5])),a?z+t:t}function Tt(t,e){if(t){var r=Object.keys(j).reduce((function(t,r){return-1!==e.indexOf(r)&&j[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function kt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case\"date\":case\"linear\":for(e=0;e=o(i)))){r=n;break}break;case\"log\":for(e=0;e=0&&i.unshift(i.splice(n,1).shift())}}));var o={false:{left:0,right:0}};return s.syncOrAsync(i.map((function(e){return function(){if(e){var n=Z.getFromId(t,e);r||(r={}),r.axShifts=o,r.overlayingShiftedAx=a;var i=Z.drawOne(t,n,r);return n._shiftPusher&&jt(n,n._fullDepth||0,o,!0),n._r=n.range.slice(),n._rl=s.simpleMap(n._r,n.r2l),i}}})))},Z.drawOne=function(t,e,r){var n,i,l,p=(r=r||{}).axShifts||{},d=r.overlayingShiftedAx||[];e.setScale();var m=t._fullLayout,g=e._id,y=g.charAt(0),v=Z.counterLetter(g),x=m._plots[e._mainSubplot];if(x){if(e._shiftPusher=e.autoshift||-1!==d.indexOf(e._id)||-1!==d.indexOf(e.overlaying),e._shiftPusher&\"free\"===e.anchor){var _=e.linewidth/2||0;\"inside\"===e.ticks&&(_+=e.ticklen),jt(e,_,p,!0),jt(e,e.shift||0,p,!1)}!0===r.skipTitle&&void 0!==e._shift||(e._shift=function(t,e){return t.autoshift?e[t.overlaying][t.side]:t.shift||0}(e,p));var b=x[y+\"axislayer\"],w=e._mainLinePosition,T=w+=e._shift,k=e._mainMirrorPosition,A=e._vals=Z.calcTicks(e),M=[e.mirror,T,k].join(\"_\");for(n=0;n0?r.bottom-u:0,h))));var f=0,p=0;if(e._shiftPusher&&(f=Math.max(h,r.height>0?\"l\"===l?u-r.left:r.right-u:0),e.title.text!==m._dfltTitle[y]&&(p=(e._titleStandoff||0)+(e._titleScoot||0),\"l\"===l&&(p+=St(e))),e._fullDepth=Math.max(f,p)),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1],g=\"number\"==typeof e._shift?e._shift:0;if(\"x\"===y){if(\"b\"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?u-r.top:0,h),d.reverse()),r.width>0){var x=r.right-(e._offset+e._length);x>0&&(n.xr=1,n.r=x);var _=e._offset-r.left;_>0&&(n.xl=0,n.l=_)}}else if(\"l\"===l?(e._depth=Math.max(r.height>0?u-r.left:0,h),n[l]=e._depth-g):(e._depth=Math.max(r.height>0?r.right-u:0,h),n[l]=e._depth+g,d.reverse()),r.height>0){var b=r.bottom-(e._offset+e._length);b>0&&(n.yb=0,n.b=b);var w=e._offset-r.top;w>0&&(n.yt=1,n.t=w)}n[v]=\"free\"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==m._dfltTitle[y]&&(n[l]+=St(e)+(e.title.standoff||0)),e.mirror&&\"free\"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[c]+=h),!0===e.mirror||\"ticks\"===e.mirror?i[v]=e._anchorAxis.domain[d[1]]:\"all\"!==e.mirror&&\"allticks\"!==e.mirror||(i[v]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}ht&&(s=o.getComponentMethod(\"rangeslider\",\"autoMarginOpts\")(t,e)),\"string\"==typeof e.automargin&&(Tt(n,e.automargin),Tt(i,e.automargin)),a.autoMargin(t,Lt(e),n),a.autoMargin(t,It(e),i),a.autoMargin(t,Pt(e),s)})),s.syncOrAsync(ct)}}function ft(t){var r=g+(t||\"tick\");return S[r]||(S[r]=function(t,e,r){var n,i,a,o;if(t._selections[e].size())n=1/0,i=-1/0,a=1/0,o=-1/0,t._selections[e].each((function(){var t=Ct(this),e=f.bBox(t.node().parentNode);n=Math.min(n,e.top),i=Math.max(i,e.bottom),a=Math.min(a,e.left),o=Math.max(o,e.right)}));else{var s=Z.makeLabelFns(t,r);n=i=s.yFn({dx:0,dy:0,fontSize:0}),a=o=s.xFn({dx:0,dy:0,fontSize:0})}return{top:n,bottom:i,left:a,right:o,height:i-n,width:o-a}}(e,r,T)),S[r]}},Z.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:\"top\",y:\"right\"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return\"inside\"!==(e?(t.minor||{}).ticks:t.ticks)==(\"x\"===r)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},Z.makeTransTickFn=function(t){return\"x\"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},Z.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||\"\",r=function(t){return-1!==e.indexOf(t)},n=r(\"top\"),i=r(\"left\"),a=r(\"right\"),o=r(\"bottom\"),s=r(\"inside\"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,h=3,f=t.tickfont?t.tickfont.size:12;return(o||n)&&(u+=f*q,h+=(t.linewidth||0)/2),(i||a)&&(u+=(t.linewidth||0)/2,h+=3),s&&\"top\"===c&&(h-=f*(1-q)),(i||n)&&(u=-u),\"bottom\"!==c&&\"right\"!==c||(h=-h),[l?u:0,s?h:0]}(t),r=t.ticklabelshift||0,n=t.ticklabelstandoff||0,i=e[0],a=e[1],o=t.range[0]>t.range[1],s=t.ticklabelposition&&-1!==t.ticklabelposition.indexOf(\"inside\"),c=!s;if(r&&(r*=o?-1:1),n){var u=t.side;n*=s&&(\"top\"===u||\"left\"===u)||c&&(\"bottom\"===u||\"right\"===u)?1:-1}return\"x\"===t._id.charAt(0)?function(e){return l(i+t._offset+t.l2p(At(e))+r,a+n)}:function(e){return l(a+n,i+t._offset+t.l2p(At(e))+r)}},Z.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return\"\";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return\"x\"===o?\"M0,\"+(e+s*r)+\"v\"+a*r:\"M\"+(e+s*r)+\",0h\"+a*r},Z.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||\"\",a=function(t){return-1!==n.indexOf(t)},o=a(\"top\"),l=a(\"left\"),c=a(\"right\"),u=a(\"bottom\")||l||o||c,h=a(\"inside\"),f=\"inside\"===n&&\"inside\"===t.ticks||!h&&\"outside\"===t.ticks&&\"boundaries\"!==t.tickson,p=0,d=0,m=f?t.ticklen:0;if(h?m*=-1:u&&(m=0),f&&(p+=m,r)){var g=s.deg2rad(r);p=m*Math.cos(g)+1,d=m*Math.sin(g)}t.showticklabels&&(f||t.showline)&&(p+=.2*t.tickfont.size);var y,v,x,_,b,w={labelStandoff:p+=(t.linewidth||1)/2*(h?-1:1),labelShift:d},T=0,k=t.side,A=t._id.charAt(0),M=t.tickangle;if(\"x\"===A)_=(b=!h&&\"bottom\"===k||h&&\"top\"===k)?1:-1,h&&(_*=-1),y=d*_,v=e+p*_,x=b?1:-.2,90===Math.abs(M)&&(h?x+=V:x=-90===M&&\"bottom\"===k?q:90===M&&\"top\"===k?V:.5,T=V/2*(M/90)),w.xFn=function(t){return t.dx+y+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*x},w.anchorFn=function(t,e){if(u){if(l)return\"end\";if(c)return\"start\"}return i(e)&&0!==e&&180!==e?e*_<0!==h?\"end\":\"start\":\"middle\"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:\"top\"===t.side!==h?-n:0};else if(\"y\"===A){if(_=(b=!h&&\"left\"===k||h&&\"right\"===k)?1:-1,h&&(_*=-1),y=p,v=d*_,x=0,h||90!==Math.abs(M)||(x=-90===M&&\"left\"===k||90===M&&\"right\"===k?q:.5),h){var S=i(M)?+M:0;if(0!==S){var E=s.deg2rad(S);T=Math.abs(Math.sin(E))*q*_,x=0}}w.xFn=function(t){return t.dx+e-(y+t.fontSize*x)*_+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*V},w.anchorFn=function(t,e){return i(e)&&90===Math.abs(e)?\"middle\":b?\"end\":\"start\"},w.heightFn=function(e,r,n){return\"right\"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},Z.drawTicks=function(t,e,r){r=r||{};var i=e._id+\"tick\",a=[].concat(e.minor&&e.minor.ticks?r.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?r.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=r.layer.selectAll(\"path.\"+i).data(a,Mt);o.exit().remove(),o.enter().append(\"path\").classed(i,1).classed(\"ticks\",1).classed(\"crisp\",!1!==r.crisp).each((function(t){return h.stroke(n.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style(\"stroke-width\",(function(r){return f.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+\"px\"})).attr(\"d\",r.path).style(\"display\",null),Nt(e,[B]),o.attr(\"transform\",r.transFn)},Z.drawGrid=function(t,e,r){if(r=r||{},\"sync\"!==e.tickmode){var i=e._id+\"grid\",a=e.minor&&e.minor.showgrid,o=a?r.vals.filter((function(t){return t.minor})):[],s=e.showgrid?r.vals.filter((function(t){return!t.minor})):[],l=r.counterAxis;if(l&&Z.shouldShowZeroLine(t,e,l))for(var c=\"array\"===e.tickmode,u=0;u=0;y--){var v=y?m:g;if(v){var x=v.selectAll(\"path.\"+i).data(y?s:o,Mt);x.exit().remove(),x.enter().append(\"path\").classed(i,1).classed(\"crisp\",!1!==r.crisp),x.attr(\"transform\",r.transFn).attr(\"d\",r.path).each((function(t){return h.stroke(n.select(this),t.minor?e.minor.gridcolor:e.gridcolor||\"#ddd\")})).style(\"stroke-dasharray\",(function(t){return f.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style(\"stroke-width\",(function(t){return(t.minor?d:e._gw)+\"px\"})).style(\"display\",null),\"function\"==typeof r.path&&x.attr(\"d\",r.path)}}Nt(e,[R,F])}},Z.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+\"zl\",i=Z.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll(\"path.\"+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.enter().append(\"path\").classed(n,1).classed(\"zl\",1).classed(\"crisp\",!1!==r.crisp).each((function(){r.layer.selectAll(\"path\").sort((function(t,e){return X(t.id,e.id)}))})),a.attr(\"transform\",r.transFn).attr(\"d\",r.path).call(h.stroke,e.zerolinecolor||h.defaultLine).style(\"stroke-width\",f.crispRound(t,e.zerolinewidth,e._gw||1)+\"px\").style(\"display\",null),Nt(e,[D])},Z.drawLabels=function(t,e,r){r=r||{};var a=t._fullLayout,o=e._id,u=r.cls||o+\"tick\",h=r.vals.filter((function(t){return t.text})),p=r.labelFns,d=r.secondary?0:e.tickangle,m=(e._prevTickAngles||{})[u],g=r.layer.selectAll(\"g.\"+u).data(e.showticklabels?h:[],Mt),y=[];function v(t,a){t.each((function(t){var o=n.select(this),s=o.select(\".text-math-group\"),u=p.anchorFn(t,a),h=r.transFn.call(o.node(),t)+(i(a)&&0!=+a?\" rotate(\"+a+\",\"+p.xFn(t)+\",\"+(p.yFn(t)-t.fontSize/2)+\")\":\"\"),d=c.lineCount(o),m=H*t.fontSize,g=p.heightFn(t,i(a)?+a:0,(d-1)*m);if(g&&(h+=l(0,g)),s.empty()){var y=o.select(\"text\");y.attr({transform:h,\"text-anchor\":u}),y.style(\"opacity\",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var v=f.bBox(s.node()).width*{end:-.5,start:.5}[u];s.attr(\"transform\",h+l(v,0))}}))}g.enter().append(\"g\").classed(u,1).append(\"text\").attr(\"text-anchor\",\"middle\").each((function(e){var r=n.select(this),i=t._promises.length;r.call(c.positionText,p.xFn(e),p.yFn(e)).call(f.font,{family:e.font,size:e.fontSize,color:e.fontColor,weight:e.fontWeight,style:e.fontStyle,variant:e.fontVariant,textcase:e.fontTextcase,lineposition:e.fontLineposition,shadow:e.fontShadow}).text(e.text).call(c.convertToTspans,t),t._promises[i]?y.push(t._promises.pop().then((function(){v(r,d)}))):v(r,d)})),Nt(e,[N]),g.exit().remove(),r.repositionOnUpdate&&g.each((function(t){n.select(this).select(\"text\").call(c.positionText,p.xFn(t),p.yFn(t))})),e._adjustTickLabelsOverflow=function(){var r=e.ticklabeloverflow;if(r&&\"allow\"!==r){var i=-1!==r.indexOf(\"hide\"),o=\"x\"===e._id.charAt(0),l=0,c=o?t._fullLayout.width:t._fullLayout.height;if(-1!==r.indexOf(\"domain\")){var u=s.simpleMap(e.range,e.r2l);l=e.l2p(u[0])+e._offset,c=e.l2p(u[1])+e._offset}var h=Math.min(l,c),p=Math.max(l,c),d=e.side,m=1/0,y=-1/0;for(var v in g.each((function(t){var r=n.select(this);if(r.select(\".text-math-group\").empty()){var a=f.bBox(r.node()),s=0;o?(a.right>p||a.leftp||a.top+(e.tickangle?0:t.fontSize/4)e[\"_visibleLabelMin_\"+r._id]?l.style(\"display\",\"none\"):\"tick\"!==t.K||i||l.style(\"display\",null)}))}))}))}))},v(g,m+1?m:d);var x=null;e._selections&&(e._selections[u]=g);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&a._redrawFromAutoMarginCount&&90===m?(x=m,_.push((function(){v(g,m)}))):_.push((function(){if(v(g,d),h.length&&e.autotickangles&&(\"log\"!==e.type||\"D\"!==String(e.dtick).charAt(0))){x=e.autotickangles[0];var t,n=0,i=[],a=1;g.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),o=Ct(this),s=f.bBox(o.node());a=Math.max(a,c.lineCount(o)),i.push({top:0,bottom:10,height:10,left:r-s.width/2,right:r+s.width/2+2,width:s.width+2})}));var o=(\"boundaries\"===e.tickson||e.showdividers)&&!r.secondary,l=h.length,u=Math.abs((h[l-1].x-h[0].x)*e._m)/(l-1),p=o?u/2:u,m=o?e.ticklen:1.25*n*a,y=p/Math.sqrt(Math.pow(p,2)+Math.pow(m,2)),_=e.autotickangles.map((function(t){return t*Math.PI/180})),b=_.find((function(t){return Math.abs(Math.cos(t))<=y}));void 0===b&&(b=_.reduce((function(t,e){return Math.abs(Math.cos(t))j*O&&(I=O,E[S]=C[S]=P[S])}var U=Math.abs(I-L);U-k>0?k*=1+k/(U-=k):k=0,\"y\"!==e._id.charAt(0)&&(k=-k),E[M]=w.p2r(w.r2p(C[M])+A*k),\"min\"===w.autorange||\"max reversed\"===w.autorange?(E[0]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0):\"max\"!==w.autorange&&\"min reversed\"!==w.autorange||(E[1]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[w._name+\".range\"]=E}var V=s.syncOrAsync(_);return V&&V.then&&t._promises.push(V),V},Z.getPxPosition=function(t,e){var r,n=t._fullLayout._size,i=e._id.charAt(0),a=e.side;return\"free\"!==e.anchor?r=e._anchorAxis:\"x\"===i?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:\"y\"===i&&(r={_offset:n.l+(e.position||0)*n.w+e._shift,_length:0}),\"top\"===a||\"left\"===a?r._offset:\"bottom\"===a||\"right\"===a?r._offset+r._length:void 0},Z.shouldShowZeroLine=function(t,e,r){var n=s.simpleMap(e.range,e.r2l);return n[0]*n[1]<=0&&e.zeroline&&(\"linear\"===e.type||\"-\"===e.type)&&!(e.rangebreaks&&e.maskBreaks(0)===O)&&(Et(e,0)||!function(t,e,r,n){var i=r._mainAxis;if(i){var a=t._fullLayout,o=e._id.charAt(0),s=Z.counterLetter(e._id),l=e._offset+(Math.abs(n[0])1)for(n=1;n2*o}(i,e))return\"date\";var g=\"strict\"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=h(r),i=0,o=0,s={},u=0;u2*i}(i,g)?\"category\":function(t,e){for(var r=t.length,n=0;n=2){var s,c,u=\"\";if(2===o.length)for(s=0;s<2;s++)if(c=b(o[s])){u=y;break}var h=i(\"pattern\",u);if(h===y)for(s=0;s<2;s++)(c=b(o[s]))&&(e.bounds[s]=o[s]=c-1);if(h)for(s=0;s<2;s++)switch(c=o[s],h){case y:if(!n(c))return void(e.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(e.enabled=!1);e.bounds[s]=o[s]=c;break;case v:if(!n(c))return void(e.enabled=!1);if((c=+c)<0||c>24)return void(e.enabled=!1);e.bounds[s]=o[s]=c}if(!1===r.autorange){var f=r.range;if(f[0]f[1])return void(e.enabled=!1)}else if(o[0]>f[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},e.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(\" \")[0]},e.isLinked=function(t,e){return a(e,t._axisMatchGroups)||a(e,t._axisConstraintGroups)}},46473:function(t,e,r){\"use strict\";var n=r(87800).isTypedArraySpec;t.exports=function(t,e,r,i){if(\"category\"===e.type){var a,o=t.categoryarray,s=Array.isArray(o)&&o.length>0||n(o);s&&(a=\"array\");var l,c=r(\"categoryorder\",a);\"array\"===c&&(l=r(\"categoryarray\")),s||\"array\"!==c||(c=e.categoryorder=\"trace\"),\"trace\"===c?e._initialCategories=[]:\"array\"===c?e._initialCategories=l.slice():(l=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?i.substr(n):a.substr(r))+o:i+a+t*e:o}function g(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;oc*x)||T)for(r=0;rz&&FI&&(I=F);f/=(I-L)/(2*P),L=l.l2r(L),I=l.l2r(I),l.range=l._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,i){return t.append(\"path\").attr(\"class\",\"zoombox\").style({fill:e>.2?\"rgba(0,0,0,0)\":\"rgba(255,255,255,0)\",\"stroke-width\":0}).attr(\"transform\",c(r,n)).attr(\"d\",i+\"Z\")}function j(t,e,r){return t.append(\"path\").attr(\"class\",\"zoombox-corners\").style({fill:h.background,stroke:h.defaultLine,\"stroke-width\":1,opacity:0}).attr(\"transform\",c(e,r)).attr(\"d\",\"M0,0Z\")}function U(t,e,r,n,i,a){t.attr(\"d\",n+\"M\"+r.l+\",\"+r.t+\"v\"+r.h+\"h\"+r.w+\"v-\"+r.h+\"h-\"+r.w+\"Z\"),V(t,e,i,a)}function V(t,e,r,n){r||(t.transition().style(\"fill\",n>.2?\"rgba(0,0,0,0.4)\":\"rgba(255,255,255,0.3)\").duration(200),e.transition().style(\"opacity\",1).duration(200))}function q(t){n.select(t).selectAll(\".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners\").remove()}function H(t){P&&t.data&&t._context.showTips&&(i.notifier(i._(t,\"Double-click to zoom back out\"),\"long\"),P=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,I)/2);return\"M\"+(t.l-3.5)+\",\"+(t.t-.5+e)+\"h3v\"+-e+\"h\"+e+\"v-3h-\"+(e+3)+\"ZM\"+(t.r+3.5)+\",\"+(t.t-.5+e)+\"h-3v\"+-e+\"h\"+-e+\"v-3h\"+(e+3)+\"ZM\"+(t.r+3.5)+\",\"+(t.b+.5-e)+\"h-3v\"+e+\"h\"+-e+\"v3h\"+(e+3)+\"ZM\"+(t.l-3.5)+\",\"+(t.b+.5-e)+\"h3v\"+e+\"h\"+e+\"v3h-\"+(e+3)+\"Z\"}function Z(t,e,r,n,a){for(var o,s,l,c,u=!1,h={},f={},p=(a||{}).xaHash,d=(a||{}).yaHash,m=0;m=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(q(i),2!==t||yt||Ht(),gt)o.indexOf(\"select\")>-1&&S(r,i,$,J,e.id,It),o.indexOf(\"event\")>-1&&p.click(i,r,e.id);else if(1===t&&yt){var s=m?z:P,c=\"s\"===m||\"w\"===y?0:1,h=s._name+\".range[\"+c+\"]\",f=function(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return\"date\"===t.type?n:\"log\"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,a(\".\"+r+\"g\")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a(\".\"+String(r)+\"g\")(n))}(s,c),d=\"left\",g=\"middle\";if(s.fixedrange)return;m?(g=\"n\"===m?\"top\":\"bottom\",\"right\"===s.side&&(d=\"right\")):\"e\"===y&&(d=\"right\"),i._context.showAxisRangeEntryBoxes&&n.select(_t).call(u.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(f),fill:s.tickfont?s.tickfont.color:\"#444\",horizontalAlign:d,verticalAlign:g}).on(\"edit\",(function(t){var e=s.d2r(t);void 0!==e&&l.call(\"_guiRelayout\",i,h,e)}))}}}function Ot(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,pt*e+bt)),i=Math.max(0,Math.min(et,dt*r+wt)),a=Math.abs(n-bt),o=Math.abs(i-wt);function s(){St=\"\",Tt.r=Tt.l,Tt.t=Tt.b,Ct.attr(\"d\",\"M0,0Z\")}if(Tt.l=Math.min(bt,n),Tt.r=Math.max(bt,n),Tt.t=Math.min(wt,i),Tt.b=Math.max(wt,i),rt.isSubplotConstrained)a>I||o>I?(St=\"xy\",a/tt>o/et?(o=a*et/tt,wt>i?Tt.t=wt-o:Tt.b=wt+o):(a=o*tt/et,bt>n?Tt.l=bt-a:Tt.r=bt+a),Ct.attr(\"d\",G(Tt))):s();else if(nt.isSubplotConstrained)if(a>I||o>I){St=\"xy\";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),c=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=c*tt,Tt.b=(1-l)*et,Tt.t=(1-c)*et,Ct.attr(\"d\",G(Tt))}else s();else!at||o0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;u<$.length;u++)$[u].range=$[u]._r.slice(),E($[u],1-r/et);o=(e=r*tt/et)/2}if(nt.isSubplotConstrained||!at&&1===it.length){for(u=0;u1&&(void 0!==a.maxallowed&&st===(a.range[0]1&&(void 0!==o.maxallowed&<===(o.range[0]1)if(l)e.xlines=f(n,\"path\",\"xlines-above\"),e.ylines=f(n,\"path\",\"ylines-above\"),e.xaxislayer=f(n,\"g\",\"xaxislayer-above\"),e.yaxislayer=f(n,\"g\",\"yaxislayer-above\");else{if(!a){var h=f(n,\"g\",\"layer-subplot\");e.shapelayer=f(h,\"g\",\"shapelayer\"),e.imagelayer=f(h,\"g\",\"imagelayer\"),e.minorGridlayer=f(n,\"g\",\"minor-gridlayer\"),e.gridlayer=f(n,\"g\",\"gridlayer\"),e.zerolinelayer=f(n,\"g\",\"zerolinelayer\");var m=f(n,\"g\",\"layer-between\");e.shapelayerBetween=f(m,\"g\",\"shapelayer\"),e.imagelayerBetween=f(m,\"g\",\"imagelayer\"),f(n,\"path\",\"xlines-below\"),f(n,\"path\",\"ylines-below\"),e.overlinesBelow=f(n,\"g\",\"overlines-below\"),f(n,\"g\",\"xaxislayer-below\"),f(n,\"g\",\"yaxislayer-below\"),e.overaxesBelow=f(n,\"g\",\"overaxes-below\")}e.overplot=f(n,\"g\",\"overplot\"),e.plot=f(e.overplot,\"g\",i),a||(e.xlines=f(n,\"path\",\"xlines-above\"),e.ylines=f(n,\"path\",\"ylines-above\"),e.overlinesAbove=f(n,\"g\",\"overlines-above\"),f(n,\"g\",\"xaxislayer-above\"),f(n,\"g\",\"yaxislayer-above\"),e.overaxesAbove=f(n,\"g\",\"overaxes-above\"),e.xlines=n.select(\".xlines-\"+o),e.ylines=n.select(\".ylines-\"+s),e.xaxislayer=n.select(\".xaxislayer-\"+o),e.yaxislayer=n.select(\".yaxislayer-\"+s))}else{var g=e.mainplotinfo,y=g.plotgroup,v=i+\"-x\",x=i+\"-y\";e.minorGridlayer=g.minorGridlayer,e.gridlayer=g.gridlayer,e.zerolinelayer=g.zerolinelayer,f(g.overlinesBelow,\"path\",v),f(g.overlinesBelow,\"path\",x),f(g.overaxesBelow,\"g\",v),f(g.overaxesBelow,\"g\",x),e.plot=f(g.overplot,\"g\",i),f(g.overlinesAbove,\"path\",v),f(g.overlinesAbove,\"path\",x),f(g.overaxesAbove,\"g\",v),f(g.overaxesAbove,\"g\",x),e.xlines=y.select(\".overlines-\"+o).select(\".\"+v),e.ylines=y.select(\".overlines-\"+s).select(\".\"+x),e.xaxislayer=y.select(\".overaxes-\"+o).select(\".\"+v),e.yaxislayer=y.select(\".overaxes-\"+s).select(\".\"+x)}a||(l||(p(e.minorGridlayer,\"g\",e.xaxis._id),p(e.minorGridlayer,\"g\",e.yaxis._id),e.minorGridlayer.selectAll(\"g\").map((function(t){return t[0]})).sort(c.idSort),p(e.gridlayer,\"g\",e.xaxis._id),p(e.gridlayer,\"g\",e.yaxis._id),e.gridlayer.selectAll(\"g\").map((function(t){return t[0]})).sort(c.idSort)),e.xlines.style(\"fill\",\"none\").classed(\"crisp\",!0),e.ylines.style(\"fill\",\"none\").classed(\"crisp\",!0))}function y(t,e){if(t){var r={};for(var i in t.each((function(t){var i=t[0];n.select(this).remove(),v(i,e),r[i]=!0})),e._plots)for(var a=e._plots[i].overlays||[],o=0;o0){var g=p.id;if(-1!==g.indexOf(d))continue;g+=d+(u+1),p=a.extendFlat({},p,{id:g,plot:o._cartesianlayer.selectAll(\".subplot\").select(\".\"+g)})}for(var y,v=[],x=0;x1&&(w+=d+b),_.push(n+w),r=0;r_[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s),\"sync\"===e.tickmode&&(e.tickmode=\"auto\")}return r(\"layer\"),e}},54616:function(t,e,r){\"use strict\";var n=r(87703);t.exports=function(t,e,r,i,a){a||(a={});var o=a.tickSuffixDflt,s=n(t);r(\"tickprefix\")&&r(\"showtickprefix\",s),r(\"ticksuffix\",o)&&r(\"showticksuffix\",s)}},90259:function(t,e,r){\"use strict\";var n=r(75511);t.exports=function(t,e,r,i){var a=e._template||{},o=e.type||a.type||\"-\";r(\"minallowed\"),r(\"maxallowed\");var s,l=r(\"range\");l||i.noInsiderange||\"log\"===o||(!(s=r(\"insiderange\"))||null!==s[0]&&null!==s[1]||(e.insiderange=!1,s=void 0),s&&(l=r(\"range\",s)));var c,u=e.getAutorangeDflt(l,i),h=r(\"autorange\",u);!l||(null!==l[0]||null!==l[1])&&(null!==l[0]&&null!==l[1]||\"reversed\"!==h&&!0!==h)&&(null===l[0]||\"min\"!==h&&\"max reversed\"!==h)&&(null===l[1]||\"max\"!==h&&\"min reversed\"!==h)||(l=void 0,delete e.range,e.autorange=!0,c=!0),c||(h=r(\"autorange\",u=e.getAutorangeDflt(l,i))),h&&(n(r,h,l),\"linear\"!==o&&\"-\"!==o||r(\"rangemode\")),e.cleanRange()}},67611:function(t,e,r){\"use strict\";var n=r(4530).FROM_BL;t.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||\"center\"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}},19091:function(t,e,r){\"use strict\";var n=r(45568),i=r(42696).aL,a=r(34809),o=a.numberFormat,s=r(10721),l=a.cleanNumber,c=a.ms2DateTime,u=a.dateTime2ms,h=a.ensureNumber,f=a.isArrayOrTypedArray,p=r(63821),d=p.FP_SAFE,m=p.BADNUM,g=p.LOG_CLIP,y=p.ONEWEEK,v=p.ONEDAY,x=p.ONEHOUR,_=p.ONEMIN,b=p.ONESEC,w=r(5975),T=r(54826),k=T.HOUR_PATTERN,A=T.WEEKDAY_PATTERN;function M(t){return Math.pow(10,t)}function S(t){return null!=t}t.exports=function(t,e){e=e||{};var r=t._id||\"x\",p=r.charAt(0);function E(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*g*Math.abs(n-i))}return m}function C(e,r,n,i){if((i||{}).msUTC&&s(e))return+e;var o=u(e,n||t.calendar);if(o===m){if(!s(e))return m;e=+e;var l=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-l/10);o=u(new Date(c))+l/10}return o}function L(e,r,n){return c(e,r,n||t.calendar)}function I(e){return t._categories[Math.round(e)]}function P(e){if(S(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(\"number\"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return m}function z(e){if(t._categoriesMap)return t._categoriesMap[e]}function O(t){var e=z(t);return void 0!==e?e:s(t)?+t:void 0}function D(t){return s(t)?+t:z(t)}function R(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var B=function(e){return s(e)?R(e,t._m,t._b):m},N=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j=\"y\"===p;B=function(e){if(!s(e))return m;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,o=0,l=0;lu)){o=a<(c+u)/2?l:l+1;break}o=l+1}var h=t._B[o]||0;return isFinite(h)?R(e,t._m2,h):0},N=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return F(e,t._m2,t._B[n])}}t.c2l=\"log\"===t.type?E:h,t.l2c=\"log\"===t.type?M:h,t.l2p=B,t.p2l=N,t.c2p=\"log\"===t.type?function(t,e){return B(E(t,e))}:B,t.p2c=\"log\"===t.type?function(t){return M(N(t))}:N,-1!==[\"linear\",\"-\"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=h,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=N,t.cleanPos=h):\"log\"===t.type?(t.d2r=t.d2l=function(t,e){return E(l(t),e)},t.r2d=t.r2c=function(t){return M(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=h,t.c2r=E,t.l2d=M,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return M(N(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=N,t.cleanPos=h):\"date\"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=C,t.c2d=t.c2r=t.l2d=t.l2r=L,t.d2p=t.r2p=function(e,r,n){return t.l2p(C(e,0,n))},t.p2d=t.p2r=function(t,e,r){return L(N(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,m,t.calendar)}):\"category\"===t.type?(t.d2c=t.d2l=P,t.r2d=t.c2d=t.l2d=I,t.d2r=t.d2l_noadd=O,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=h,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return I(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return\"string\"==typeof t&&\"\"!==t?t:h(t)}):\"multicategory\"===t.type&&(t.r2d=t.c2d=t.l2d=I,t.d2r=t.d2l_noadd=O,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=z,t.l2r=t.c2r=h,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return I(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||\"string\"==typeof t&&\"\"!==t?t:h(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var c in l)if(c!==r){var u=e[w.id2name(c)];s=s.concat(u._traceIndices)}var h=[[0,{}],[0,{}]],d=[];for(i=0;il[1]&&(i[s?0:1]=n),i[0]===i[1]){var c=t.l2r(r),u=t.l2r(n);if(void 0!==r){var h=c+1;void 0!==n&&(h=Math.min(h,u)),i[s?1:0]=h}if(void 0!==n){var f=u+1;void 0!==r&&(f=Math.max(f,c)),i[s?0:1]=f}}}},t.cleanRange=function(e,r){t._cleanRange(e,r),t.limitRange(e)},t._cleanRange=function(e,r){r||(r={}),e||(e=\"range\");var n,i,o=a.nestedProperty(t,e).get();if(i=(i=\"date\"===t.type?a.dfltRange(t.calendar):\"y\"===p?T.DFLTRANGEY:\"realaxis\"===t._name?[0,1]:r.dfltRange||T.DFLTRANGEX).slice(),\"tozero\"!==t.rangemode&&\"nonnegative\"!==t.rangemode||(i[0]=0),o&&2===o.length){var l=null===o[0],c=null===o[1];for(\"date\"!==t.type||t.autorange||(o[0]=a.cleanDate(o[0],m,t.calendar),o[1]=a.cleanDate(o[1],m,t.calendar)),n=0;n<2;n++)if(\"date\"===t.type){if(!a.isDateTime(o[n],t.calendar)){t[e]=i;break}if(t.r2l(o[0])===t.r2l(o[1])){var u=a.constrain(t.r2l(o[0]),a.MIN_MS+1e3,a.MAX_MS-1e3);o[0]=t.l2r(u-1e3),o[1]=t.l2r(u+1e3);break}}else{if(!s(o[n])){if(l||c||!s(o[1-n])){t[e]=i;break}o[n]=o[1-n]*(n?10:.1)}if(o[n]<-d?o[n]=-d:o[n]>d&&(o[n]=d),o[0]===o[1]){var h=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=h,o[1]+=h}}}else a.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=w.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?\"_r\":\"range\",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][1],o),h=\"y\"===p;if(h?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks&&(t._rangebreaks=t.locateBreaks(Math.min(c,u),Math.max(c,u)),t._rangebreaks.length)){for(s=0;su&&(f=!f),f&&t._rangebreaks.reverse();var d=f?-1:1;for(t._m2=d*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(h?u:c)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&c.push({min:t,max:n})}};for(n=0;n