@happyvertical/smrt-planner 0.62.8 → 0.62.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/404.html +18 -18
- package/app/_app/immutable/chunks/{DdOC2xE-.js → B0toeDgA.js} +1 -1
- package/app/_app/immutable/chunks/{DkQ0TpH9.js → B93MBt1I.js} +33 -33
- package/app/_app/immutable/chunks/{Cu_aga20.js → BNkDjmwM.js} +1 -1
- package/app/_app/immutable/chunks/{X79AuOjW.js → BRyq6ZTQ.js} +1 -1
- package/app/_app/immutable/chunks/{BtXyg_G0.js → BS5gZFjG.js} +1 -1
- package/app/_app/immutable/chunks/{CHfb9fLV.js → Bdd7ctp5.js} +1 -1
- package/app/_app/immutable/chunks/BgcpWyp8.js +1 -0
- package/app/_app/immutable/chunks/{C6XFc5Ho.js → Bm8SIw_P.js} +1 -1
- package/app/_app/immutable/chunks/{DJaypyFQ.js → BsgnMLLR.js} +1 -1
- package/app/_app/immutable/chunks/{FBKuVRtI.js → CA1LxN05.js} +1 -1
- package/app/_app/immutable/chunks/{C837193f.js → CAaWbMB6.js} +1 -1
- package/app/_app/immutable/chunks/{49ozPZ-o.js → CHgM8nqC.js} +2 -2
- package/app/_app/immutable/chunks/CJ54AUpu.js +1 -0
- package/app/_app/immutable/chunks/CO1WqIr8.js +1 -0
- package/app/_app/immutable/chunks/{wKop_saD.js → CTBNIJHT.js} +1 -1
- package/app/_app/immutable/chunks/{BcUiNTI5.js → Ceva9sPs.js} +1 -1
- package/app/_app/immutable/chunks/{QjJZJFMR.js → ChDz08Aw.js} +1 -1
- package/app/_app/immutable/chunks/{1WLXuR-X.js → CuWu--gG.js} +1 -1
- package/app/_app/immutable/chunks/{JltwYdao.js → D4AycwWR.js} +1 -1
- package/app/_app/immutable/chunks/{avCAZc0V.js → DJ2Vogdb.js} +1 -1
- package/app/_app/immutable/chunks/{CrFT46OU.js → DJko0Z-V.js} +1 -1
- package/app/_app/immutable/chunks/{CX-nrVjP.js → DZ7MmKti.js} +1 -1
- package/app/_app/immutable/chunks/{CVHqha_e.js → DhbM87-k.js} +3 -3
- package/app/_app/immutable/chunks/{DlLrrcJS.js → DnFx6cgx.js} +1 -1
- package/app/_app/immutable/chunks/{NylVZ0NF.js → DoAWfU9j.js} +1 -1
- package/app/_app/immutable/chunks/{DwGJo4Pt.js → DwyRYrl1.js} +1 -1
- package/app/_app/immutable/chunks/{pPOlvCIS.js → DzV0EPR8.js} +1 -1
- package/app/_app/immutable/chunks/{DD9oMrRy.js → Ymyh-Axh.js} +1 -1
- package/app/_app/immutable/chunks/{C8CQUDLB.js → jxpGYZWs.js} +1 -1
- package/app/_app/immutable/entry/{app.Cg7MqXPk.js → app.BH5EzJOz.js} +2 -2
- package/app/_app/immutable/entry/start.CmIp0JMa.js +1 -0
- package/app/_app/immutable/nodes/{0.BmAhd00I.js → 0.jESU9TIJ.js} +1 -1
- package/app/_app/immutable/nodes/{1.6DBeR-j9.js → 1.C4XkFquF.js} +1 -1
- package/app/_app/immutable/nodes/{10.CK1u8m6w.js → 10.DR3HPfrN.js} +1 -1
- package/app/_app/immutable/nodes/{11.m93iGyDQ.js → 11.DGoR2AkY.js} +1 -1
- package/app/_app/immutable/nodes/{12.BD_ZrrDM.js → 12.Qm7yfzP1.js} +1 -1
- package/app/_app/immutable/nodes/{13.BFANMpQK.js → 13.C39OiFbM.js} +1 -1
- package/app/_app/immutable/nodes/{14.8_QD-Y8c.js → 14.Drzuj3d9.js} +1 -1
- package/app/_app/immutable/nodes/{2.D-NkNI8W.js → 2.DhNGn43A.js} +3 -3
- package/app/_app/immutable/nodes/{3.CkoVquCA.js → 3.CinVuhq5.js} +1 -1
- package/app/_app/immutable/nodes/{4.DmhkpuYq.js → 4.BB0BfJxD.js} +1 -1
- package/app/_app/immutable/nodes/{5.DjUGGAN-.js → 5.2kkKsE1N.js} +1 -1
- package/app/_app/immutable/nodes/{6.DLxYbgfN.js → 6.CqtPa07c.js} +1 -1
- package/app/_app/immutable/nodes/{7.BA7sx2bc.js → 7.CNqlX0VT.js} +1 -1
- package/app/_app/immutable/nodes/{8.DS_5XNzo.js → 8.Ck4lOGHE.js} +1 -1
- package/app/_app/immutable/nodes/{9.KYKgjqe6.js → 9.DcNgJT9H.js} +1 -1
- package/app/_app/version.json +1 -1
- package/app/advanced-styles/index.html +20 -20
- package/app/ai/index.html +24 -24
- package/app/blueprint/index.html +19 -19
- package/app/cookbook/index.html +19 -19
- package/app/index.html +27 -27
- package/app/m/ads/AdDeliveryTier/index.html +23 -23
- package/app/m/ads/AdEvent/index.html +23 -23
- package/app/m/ads/AdFormat/index.html +23 -23
- package/app/m/ads/AdGroup/index.html +23 -23
- package/app/m/ads/AdVariation/index.html +23 -23
- package/app/m/analytics/AnalyticsDataStream/index.html +23 -23
- package/app/m/analytics/AnalyticsEvent/index.html +23 -23
- package/app/m/analytics/AnalyticsProperty/index.html +23 -23
- package/app/m/analytics/AnalyticsReport/index.html +23 -23
- package/app/m/approvals/ApprovalEvent/index.html +23 -23
- package/app/m/approvals/ApprovalPolicy/index.html +23 -23
- package/app/m/approvals/ApprovalRequest/index.html +23 -23
- package/app/m/assets/Asset/attachments/index.html +24 -24
- package/app/m/assets/Asset/index.html +23 -23
- package/app/m/assets/AssetAssociation/index.html +23 -23
- package/app/m/assets/AssetMetafield/index.html +23 -23
- package/app/m/assets/AssetStatus/index.html +23 -23
- package/app/m/assets/AssetType/index.html +23 -23
- package/app/m/assets/Folder/index.html +23 -23
- package/app/m/chat/AgentSession/index.html +23 -23
- package/app/m/chat/ChatMessage/index.html +23 -23
- package/app/m/chat/ChatParticipant/index.html +23 -23
- package/app/m/chat/ChatReaction/index.html +23 -23
- package/app/m/chat/ChatRoom/index.html +23 -23
- package/app/m/chat/ChatThread/index.html +23 -23
- package/app/m/chat/VoiceGatewayTurn/index.html +23 -23
- package/app/m/chat/VoiceSession/index.html +23 -23
- package/app/m/commerce/AccountingConnection/index.html +23 -23
- package/app/m/commerce/AccountingInvoiceReadback/index.html +23 -23
- package/app/m/commerce/AccountingMapping/index.html +23 -23
- package/app/m/commerce/AccountingPaymentSync/index.html +23 -23
- package/app/m/commerce/Agreement/index.html +23 -23
- package/app/m/commerce/Cart/index.html +23 -23
- package/app/m/commerce/Contract/index.html +23 -23
- package/app/m/commerce/ContractLineItem/index.html +23 -23
- package/app/m/commerce/Customer/index.html +23 -23
- package/app/m/commerce/DocumentTax/index.html +23 -23
- package/app/m/commerce/Estimate/index.html +23 -23
- package/app/m/commerce/Fulfillment/index.html +23 -23
- package/app/m/commerce/FulfillmentLineItem/index.html +23 -23
- package/app/m/commerce/HistoricalCustomerFunds/index.html +23 -23
- package/app/m/commerce/HistoricalCustomerFundsAllocation/index.html +23 -23
- package/app/m/commerce/HistoricalSalesLine/index.html +23 -23
- package/app/m/commerce/Invoice/index.html +23 -23
- package/app/m/commerce/InvoiceLineItem/index.html +23 -23
- package/app/m/commerce/Lease/index.html +23 -23
- package/app/m/commerce/LicenseSale/index.html +23 -23
- package/app/m/commerce/Order/index.html +23 -23
- package/app/m/commerce/Payment/index.html +23 -23
- package/app/m/commerce/PaymentAllocation/index.html +23 -23
- package/app/m/commerce/PaymentInstrument/index.html +23 -23
- package/app/m/commerce/PaymentIntent/index.html +23 -23
- package/app/m/commerce/Payout/index.html +23 -23
- package/app/m/commerce/ProductionOrder/index.html +23 -23
- package/app/m/commerce/PurchaseContract/index.html +23 -23
- package/app/m/commerce/PurchaseOrder/index.html +23 -23
- package/app/m/commerce/SalesContract/index.html +23 -23
- package/app/m/commerce/SupplierQuote/index.html +23 -23
- package/app/m/commerce/TaxCode/index.html +23 -23
- package/app/m/commerce/TaxComponent/index.html +23 -23
- package/app/m/commerce/TaxSettings/index.html +23 -23
- package/app/m/commerce/TaxSummaryReport/index.html +23 -23
- package/app/m/commerce/TenantPaymentAccount/index.html +23 -23
- package/app/m/commerce/Vendor/index.html +23 -23
- package/app/m/commerce/WholesaleOrder/index.html +23 -23
- package/app/m/content/Content/articles/index.html +24 -24
- package/app/m/content/Content/index.html +23 -23
- package/app/m/content/ContentContribution/index.html +23 -23
- package/app/m/content/ContentContributionAttachment/index.html +23 -23
- package/app/m/content/ContentContributionRevision/index.html +23 -23
- package/app/m/content/ContentContributionType/index.html +23 -23
- package/app/m/content/ContentContributor/index.html +23 -23
- package/app/m/content/ContentCorrection/index.html +23 -23
- package/app/m/content/ContentFeedSource/index.html +23 -23
- package/app/m/content/ContentGovernanceAssignment/index.html +23 -23
- package/app/m/content/ContentGovernancePolicy/index.html +23 -23
- package/app/m/content/ContentGovernanceProfile/index.html +23 -23
- package/app/m/content/ContentReference/index.html +23 -23
- package/app/m/content/ContentReview/index.html +23 -23
- package/app/m/content/ContentVersion/index.html +23 -23
- package/app/m/events/Event/index.html +23 -23
- package/app/m/events/EventParticipant/index.html +23 -23
- package/app/m/events/EventSeries/index.html +23 -23
- package/app/m/events/EventType/index.html +23 -23
- package/app/m/expenses/Expense/index.html +23 -23
- package/app/m/facts/Fact/index.html +23 -23
- package/app/m/facts/FactContent/index.html +23 -23
- package/app/m/facts/FactEvidence/index.html +23 -23
- package/app/m/facts/FactSource/index.html +23 -23
- package/app/m/facts/FactSubject/index.html +23 -23
- package/app/m/facts/FactTag/index.html +23 -23
- package/app/m/fields/FieldPolicy/index.html +23 -23
- package/app/m/fields/FieldPolicySuggestion/index.html +23 -23
- package/app/m/fields/FieldUsageCounter/index.html +23 -23
- package/app/m/human-resources/Employment/index.html +23 -23
- package/app/m/human-resources/EmploymentTerm/index.html +23 -23
- package/app/m/human-resources/HeldQualification/index.html +23 -23
- package/app/m/human-resources/Qualification/index.html +23 -23
- package/app/m/images/Image/index.html +23 -23
- package/app/m/inventory/InventoryLocation/index.html +23 -23
- package/app/m/inventory/Lot/index.html +23 -23
- package/app/m/inventory/LotCorrection/index.html +23 -23
- package/app/m/inventory/LotDocument/index.html +23 -23
- package/app/m/inventory/LotStockLevel/index.html +23 -23
- package/app/m/inventory/LotUsage/index.html +23 -23
- package/app/m/inventory/StockLevel/index.html +23 -23
- package/app/m/inventory/StockMovement/index.html +23 -23
- package/app/m/ledgers/Account/index.html +23 -23
- package/app/m/ledgers/Journal/index.html +23 -23
- package/app/m/ledgers/JournalEntry/index.html +23 -23
- package/app/m/ledgers/Ledger/index.html +23 -23
- package/app/m/manufacturing/Assembly/index.html +23 -23
- package/app/m/manufacturing/BillOfMaterials/index.html +23 -23
- package/app/m/manufacturing/BomLine/index.html +23 -23
- package/app/m/manufacturing/Operation/index.html +23 -23
- package/app/m/manufacturing/ProductionRun/index.html +23 -23
- package/app/m/manufacturing/ProductionRunCompletion/index.html +23 -23
- package/app/m/manufacturing/RoutingStep/index.html +23 -23
- package/app/m/marketing/Campaign/index.html +23 -23
- package/app/m/marketing/CampaignChannel/index.html +23 -23
- package/app/m/marketing/CampaignMetricSnapshot/index.html +23 -23
- package/app/m/messages/Account/index.html +23 -23
- package/app/m/messages/Attachment/index.html +23 -23
- package/app/m/messages/Blacklist/index.html +23 -23
- package/app/m/messages/Email/failed-sends/index.html +24 -24
- package/app/m/messages/Email/index.html +23 -23
- package/app/m/messages/Email/mailbox/index.html +24 -24
- package/app/m/messages/EmailAccount/index.html +23 -23
- package/app/m/messages/EmailAttachment/index.html +23 -23
- package/app/m/messages/EmailFolder/index.html +23 -23
- package/app/m/messages/Message/index.html +23 -23
- package/app/m/messages/MessagingEndpoint/index.html +23 -23
- package/app/m/messages/PersonaMessageRoute/index.html +23 -23
- package/app/m/messages/SlackAccount/index.html +23 -23
- package/app/m/messages/SlackMessage/index.html +23 -23
- package/app/m/messages/SlackMessage/slack-messages/index.html +24 -24
- package/app/m/messages/TelegramAccount/index.html +23 -23
- package/app/m/messages/Tweet/index.html +23 -23
- package/app/m/messages/TwitterAccount/index.html +23 -23
- package/app/m/messages/Whitelist/index.html +23 -23
- package/app/m/messages/ZulipAccount/index.html +23 -23
- package/app/m/places/Place/index.html +23 -23
- package/app/m/places/PlaceType/index.html +23 -23
- package/app/m/products/Category/index.html +23 -23
- package/app/m/products/Material/index.html +23 -23
- package/app/m/products/Product/index.html +23 -23
- package/app/m/products/Product/ingredients/index.html +24 -24
- package/app/m/products/ProductVariant/index.html +23 -23
- package/app/m/products/Sku/index.html +23 -23
- package/app/m/profiles/ApiKey/index.html +23 -23
- package/app/m/profiles/Bot/index.html +23 -23
- package/app/m/profiles/MagicLinkToken/index.html +23 -23
- package/app/m/profiles/NostrIdentity/index.html +23 -23
- package/app/m/profiles/OidcIdentity/index.html +23 -23
- package/app/m/profiles/Organization/index.html +23 -23
- package/app/m/profiles/Person/index.html +23 -23
- package/app/m/profiles/Profile/index.html +23 -23
- package/app/m/profiles/ProfileMetadata/index.html +23 -23
- package/app/m/profiles/ProfileMetafield/index.html +23 -23
- package/app/m/profiles/ProfileRelationship/index.html +23 -23
- package/app/m/profiles/ProfileRelationshipTerm/index.html +23 -23
- package/app/m/profiles/ProfileRelationshipType/index.html +23 -23
- package/app/m/profiles/ProfileType/index.html +23 -23
- package/app/m/projects/Comment/index.html +23 -23
- package/app/m/projects/Issue/index.html +23 -23
- package/app/m/projects/Label/index.html +23 -23
- package/app/m/projects/Project/index.html +23 -23
- package/app/m/projects/ProjectIntegration/index.html +23 -23
- package/app/m/projects/PullRequest/index.html +23 -23
- package/app/m/projects/Repository/index.html +23 -23
- package/app/m/properties/Property/index.html +23 -23
- package/app/m/properties/Zone/index.html +23 -23
- package/app/m/reports/RuntimeReport/index.html +23 -23
- package/app/m/reports/SmrtPrincipalReportRefreshTask/index.html +23 -23
- package/app/m/reports/SmrtReportLock/index.html +23 -23
- package/app/m/reports/SmrtReportRefreshTask/index.html +23 -23
- package/app/m/reports/SmrtReportRun/index.html +23 -23
- package/app/m/reports/SmrtReportSchedule/index.html +23 -23
- package/app/m/reports/SmrtReportWatermark/index.html +23 -23
- package/app/m/sales/Agreement/index.html +23 -23
- package/app/m/sales/AttributionException/index.html +23 -23
- package/app/m/sales/AttributionPolicy/index.html +23 -23
- package/app/m/sales/Commission/index.html +23 -23
- package/app/m/sales/CommissionAdjustment/index.html +23 -23
- package/app/m/sales/CommissionPayout/index.html +23 -23
- package/app/m/sales/CommissionPlan/index.html +23 -23
- package/app/m/sales/Earner/index.html +23 -23
- package/app/m/sales/EarnerSourceAttribution/index.html +23 -23
- package/app/m/sales/EarningEvent/index.html +23 -23
- package/app/m/sales/ExecutedAgreement/index.html +23 -23
- package/app/m/sales/Lead/index.html +23 -23
- package/app/m/sales/Opportunity/index.html +23 -23
- package/app/m/sales/OpportunityConversion/index.html +23 -23
- package/app/m/sales/PipelineDefinition/index.html +23 -23
- package/app/m/sales/PipelineStage/index.html +23 -23
- package/app/m/sales/Referral/index.html +23 -23
- package/app/m/sales/ReferralAgreement/index.html +23 -23
- package/app/m/sales/ReferralLink/index.html +23 -23
- package/app/m/sales/ReferralProgram/index.html +23 -23
- package/app/m/sales/ReferralTermSnapshot/index.html +23 -23
- package/app/m/sales/ReferralTouch/index.html +23 -23
- package/app/m/sales/Referrer/index.html +23 -23
- package/app/m/sales/ReferrerIdentifier/index.html +23 -23
- package/app/m/sales/SalesActivity/index.html +23 -23
- package/app/m/sales/SalesRepresentative/index.html +23 -23
- package/app/m/sites/DnsZone/index.html +23 -23
- package/app/m/sites/Domain/index.html +23 -23
- package/app/m/sites/ProjectDomain/index.html +23 -23
- package/app/m/sites/Site/index.html +23 -23
- package/app/m/sites/SiteAgentBinding/index.html +23 -23
- package/app/m/social/OAuthState/index.html +23 -23
- package/app/m/social/SocialAccount/index.html +23 -23
- package/app/m/social/SocialPost/index.html +23 -23
- package/app/m/social/SocialPostAnalyticsSnapshot/index.html +23 -23
- package/app/m/subscriptions/BillingAdjustment/index.html +23 -23
- package/app/m/subscriptions/ClientCharge/index.html +23 -23
- package/app/m/subscriptions/CreditGrant/index.html +23 -23
- package/app/m/subscriptions/PricingRule/index.html +23 -23
- package/app/m/subscriptions/RetailCharge/index.html +23 -23
- package/app/m/subscriptions/SpendingPolicy/index.html +23 -23
- package/app/m/subscriptions/SubscriptionPlan/index.html +23 -23
- package/app/m/subscriptions/SubscriptionPlanVersion/index.html +23 -23
- package/app/m/subscriptions/TenantSubscription/index.html +23 -23
- package/app/m/subscriptions/TenantUsageMetric/index.html +23 -23
- package/app/m/support/ServiceTimeEntry/index.html +23 -23
- package/app/m/support/SupportAiRun/index.html +23 -23
- package/app/m/support/SupportAvailability/index.html +23 -23
- package/app/m/support/SupportCase/index.html +23 -23
- package/app/m/support/SupportCaseEvent/index.html +23 -23
- package/app/m/support/SupportChannelBinding/index.html +23 -23
- package/app/m/support/SupportCharge/index.html +23 -23
- package/app/m/support/SupportCompensation/index.html +23 -23
- package/app/m/support/SupportCompensationPlan/index.html +23 -23
- package/app/m/support/SupportEscalation/index.html +23 -23
- package/app/m/support/SupportInteraction/index.html +23 -23
- package/app/m/support/SupportPlan/index.html +23 -23
- package/app/m/support/SupportPolicy/index.html +23 -23
- package/app/m/support/SupportQualification/index.html +23 -23
- package/app/m/support/SupportServiceTarget/index.html +23 -23
- package/app/m/support/SupportSpecialist/index.html +23 -23
- package/app/m/support/SupportWorkLink/index.html +23 -23
- package/app/m/tags/Tag/index.html +23 -23
- package/app/m/tags/TagAlias/index.html +23 -23
- package/app/m/timesheets/AttendanceBreak/index.html +23 -23
- package/app/m/timesheets/AttendancePunch/index.html +23 -23
- package/app/m/timesheets/AttendanceSegment/index.html +23 -23
- package/app/m/timesheets/ServiceChargeSnapshot/index.html +23 -23
- package/app/m/timesheets/ServiceCompensationSnapshot/index.html +23 -23
- package/app/m/timesheets/ServiceTimeEntry/index.html +23 -23
- package/app/m/users/Group/index.html +23 -23
- package/app/m/users/GroupMember/index.html +23 -23
- package/app/m/users/GroupRole/index.html +23 -23
- package/app/m/users/Membership/index.html +23 -23
- package/app/m/users/MembershipOverride/index.html +23 -23
- package/app/m/users/Permission/index.html +23 -23
- package/app/m/users/Role/index.html +23 -23
- package/app/m/users/RolePermission/index.html +23 -23
- package/app/m/users/Session/index.html +23 -23
- package/app/m/users/Tenant/index.html +23 -23
- package/app/m/users/TenantIntegration/index.html +23 -23
- package/app/m/users/TenantPermissionOverride/index.html +23 -23
- package/app/m/users/User/index.html +23 -23
- package/app/m/video/Character/index.html +23 -23
- package/app/m/video/CharacterAsset/index.html +23 -23
- package/app/m/video/CompositeJob/index.html +23 -23
- package/app/m/video/Performer/index.html +23 -23
- package/app/m/video/PerformerAsset/index.html +23 -23
- package/app/m/video/Scene/index.html +23 -23
- package/app/m/video/SceneAsset/index.html +23 -23
- package/app/m/video/VideoComposition/index.html +23 -23
- package/app/m/video/VideoCompositionAsset/index.html +23 -23
- package/app/m/video/VideoSequence/index.html +23 -23
- package/app/m/video/VideoSequenceAsset/index.html +23 -23
- package/app/m/video/VideoShot/index.html +23 -23
- package/app/m/video/VideoShotAsset/index.html +23 -23
- package/app/m/video/VideoShotCharacter/index.html +23 -23
- package/app/m/video/VideoWorkflow/index.html +23 -23
- package/app/m/voice/VoiceOutput/index.html +23 -23
- package/app/m/voice/VoiceProfile/index.html +23 -23
- package/app/m/voice/VoiceSample/index.html +23 -23
- package/app/mcp.html +1 -1
- package/app/packages/ads/index.html +21 -21
- package/app/packages/analytics/index.html +21 -21
- package/app/packages/app-mcp/index.html +21 -21
- package/app/packages/approvals/index.html +21 -21
- package/app/packages/assets/index.html +21 -21
- package/app/packages/chat/index.html +21 -21
- package/app/packages/comments/index.html +21 -21
- package/app/packages/commerce/index.html +21 -21
- package/app/packages/content/index.html +21 -21
- package/app/packages/events/index.html +21 -21
- package/app/packages/expenses/index.html +21 -21
- package/app/packages/facts/index.html +21 -21
- package/app/packages/fields/index.html +21 -21
- package/app/packages/human-resources/index.html +21 -21
- package/app/packages/images/index.html +21 -21
- package/app/packages/index.html +20 -20
- package/app/packages/inference/index.html +21 -21
- package/app/packages/ingestion/index.html +21 -21
- package/app/packages/inventory/index.html +21 -21
- package/app/packages/ledgers/index.html +21 -21
- package/app/packages/manufacturing/index.html +21 -21
- package/app/packages/marketing/index.html +21 -21
- package/app/packages/messages/index.html +21 -21
- package/app/packages/places/index.html +21 -21
- package/app/packages/preferences/index.html +21 -21
- package/app/packages/products/index.html +21 -21
- package/app/packages/profiles/index.html +21 -21
- package/app/packages/projects/index.html +21 -21
- package/app/packages/properties/index.html +21 -21
- package/app/packages/reactions/index.html +21 -21
- package/app/packages/reports/index.html +21 -21
- package/app/packages/sales/index.html +21 -21
- package/app/packages/sites/index.html +21 -21
- package/app/packages/social/index.html +21 -21
- package/app/packages/subscriptions/index.html +21 -21
- package/app/packages/support/index.html +21 -21
- package/app/packages/tags/index.html +21 -21
- package/app/packages/timesheets/index.html +21 -21
- package/app/packages/users/index.html +21 -21
- package/app/packages/video/index.html +21 -21
- package/app/packages/voice/index.html +21 -21
- package/app/packages/webhooks/index.html +21 -21
- package/app/recipes/account-access/help/index.html +21 -21
- package/app/recipes/account-access/index.html +23 -23
- package/app/recipes/activity/help/index.html +21 -21
- package/app/recipes/activity/index.html +23 -23
- package/app/recipes/ads.campaigns/help/index.html +21 -21
- package/app/recipes/ads.campaigns/index.html +23 -23
- package/app/recipes/affiliates.referrals/help/index.html +21 -21
- package/app/recipes/affiliates.referrals/index.html +23 -23
- package/app/recipes/agreements/help/index.html +21 -21
- package/app/recipes/agreements/index.html +23 -23
- package/app/recipes/analytics.reports/help/index.html +21 -21
- package/app/recipes/analytics.reports/index.html +23 -23
- package/app/recipes/approvals.requests/help/index.html +21 -21
- package/app/recipes/approvals.requests/index.html +23 -23
- package/app/recipes/assets/help/index.html +21 -21
- package/app/recipes/assets/index.html +23 -23
- package/app/recipes/billing/help/index.html +21 -21
- package/app/recipes/billing/index.html +23 -23
- package/app/recipes/chat.assistant/help/index.html +21 -21
- package/app/recipes/chat.assistant/index.html +23 -23
- package/app/recipes/comments/help/index.html +21 -21
- package/app/recipes/comments/index.html +23 -23
- package/app/recipes/commerce.customers/help/index.html +21 -21
- package/app/recipes/commerce.customers/index.html +23 -23
- package/app/recipes/commerce.estimates/help/index.html +21 -21
- package/app/recipes/commerce.estimates/index.html +23 -23
- package/app/recipes/commerce.purchases/help/index.html +21 -21
- package/app/recipes/commerce.purchases/index.html +23 -23
- package/app/recipes/commerce.sales/help/index.html +21 -21
- package/app/recipes/commerce.sales/index.html +23 -23
- package/app/recipes/commerce.vendors/help/index.html +21 -21
- package/app/recipes/commerce.vendors/index.html +23 -23
- package/app/recipes/commerce.wholesale/help/index.html +21 -21
- package/app/recipes/commerce.wholesale/index.html +23 -23
- package/app/recipes/content.articles/help/index.html +21 -21
- package/app/recipes/content.articles/index.html +23 -23
- package/app/recipes/events.calendar/help/index.html +21 -21
- package/app/recipes/events.calendar/index.html +23 -23
- package/app/recipes/expenses.tracking/help/index.html +21 -21
- package/app/recipes/expenses.tracking/index.html +23 -23
- package/app/recipes/fields.form-customization/help/index.html +21 -21
- package/app/recipes/fields.form-customization/index.html +23 -23
- package/app/recipes/human-resources.people/help/index.html +21 -21
- package/app/recipes/human-resources.people/index.html +23 -23
- package/app/recipes/human-resources.qualifications/help/index.html +21 -21
- package/app/recipes/human-resources.qualifications/index.html +23 -23
- package/app/recipes/ingestion/help/index.html +21 -21
- package/app/recipes/ingestion/index.html +23 -23
- package/app/recipes/integrations/help/index.html +21 -21
- package/app/recipes/integrations/index.html +23 -23
- package/app/recipes/inventory.stock/help/index.html +21 -21
- package/app/recipes/inventory.stock/index.html +23 -23
- package/app/recipes/ledgers.bookkeeping/help/index.html +21 -21
- package/app/recipes/ledgers.bookkeeping/index.html +23 -23
- package/app/recipes/manufacturing.assemblies/help/index.html +21 -21
- package/app/recipes/manufacturing.assemblies/index.html +23 -23
- package/app/recipes/manufacturing.production/help/index.html +21 -21
- package/app/recipes/manufacturing.production/index.html +23 -23
- package/app/recipes/marketing.campaigns/help/index.html +21 -21
- package/app/recipes/marketing.campaigns/index.html +23 -23
- package/app/recipes/messages/help/index.html +21 -21
- package/app/recipes/messages/index.html +23 -23
- package/app/recipes/places.locations/help/index.html +21 -21
- package/app/recipes/places.locations/index.html +23 -23
- package/app/recipes/products/help/index.html +21 -21
- package/app/recipes/products/index.html +23 -23
- package/app/recipes/profiles.identity/help/index.html +21 -21
- package/app/recipes/profiles.identity/index.html +23 -23
- package/app/recipes/projects.tracker/help/index.html +21 -21
- package/app/recipes/projects.tracker/index.html +23 -23
- package/app/recipes/reports.materialized/help/index.html +21 -21
- package/app/recipes/reports.materialized/index.html +23 -23
- package/app/recipes/reports.runtime/help/index.html +21 -21
- package/app/recipes/reports.runtime/index.html +23 -23
- package/app/recipes/sales.pipeline/help/index.html +21 -21
- package/app/recipes/sales.pipeline/index.html +23 -23
- package/app/recipes/social.posts/help/index.html +21 -21
- package/app/recipes/social.posts/index.html +23 -23
- package/app/recipes/subscriptions.plans/help/index.html +21 -21
- package/app/recipes/subscriptions.plans/index.html +23 -23
- package/app/recipes/support.tickets/help/index.html +21 -21
- package/app/recipes/support.tickets/index.html +23 -23
- package/app/recipes/tags.taxonomy/help/index.html +21 -21
- package/app/recipes/tags.taxonomy/index.html +23 -23
- package/app/recipes/team-collaboration/help/index.html +21 -21
- package/app/recipes/team-collaboration/index.html +23 -23
- package/app/recipes/timesheets.time-entries/help/index.html +21 -21
- package/app/recipes/timesheets.time-entries/index.html +23 -23
- package/app/recipes/video.library/help/index.html +21 -21
- package/app/recipes/video.library/index.html +23 -23
- package/app/recipes/voice.profiles/help/index.html +21 -21
- package/app/recipes/voice.profiles/index.html +23 -23
- package/app/s/custom-accounts/index.html +19 -19
- package/app/s/custom-appointments/index.html +19 -19
- package/app/s/custom-billing/index.html +19 -19
- package/app/s/custom-bookings/index.html +19 -19
- package/app/s/custom-buying/index.html +19 -19
- package/app/s/custom-checkout/index.html +19 -19
- package/app/s/custom-classes/index.html +19 -19
- package/app/s/custom-clients/index.html +19 -19
- package/app/s/custom-events/index.html +19 -19
- package/app/s/custom-fleet/index.html +19 -19
- package/app/s/custom-gigs/index.html +19 -19
- package/app/s/custom-giving/index.html +19 -19
- package/app/s/custom-instruments/index.html +19 -19
- package/app/s/custom-jobs/index.html +19 -19
- package/app/s/custom-kitchen/index.html +19 -19
- package/app/s/custom-lessons/index.html +19 -19
- package/app/s/custom-material/index.html +19 -19
- package/app/s/custom-meetings/index.html +19 -19
- package/app/s/custom-members/index.html +19 -19
- package/app/s/custom-merch/index.html +19 -19
- package/app/s/custom-money/index.html +19 -19
- package/app/s/custom-paint/index.html +19 -19
- package/app/s/custom-parts/index.html +19 -19
- package/app/s/custom-rentals/index.html +19 -19
- package/app/s/custom-roastery/index.html +19 -19
- package/app/s/custom-schedule/index.html +19 -19
- package/app/s/custom-shelf/index.html +19 -19
- package/app/s/custom-shop/index.html +19 -19
- package/app/s/custom-students/index.html +19 -19
- package/app/s/custom-wholesale/index.html +19 -19
- package/app/s/custom-work/index.html +19 -19
- package/app/s/custom-yard/index.html +19 -19
- package/app/s/section-access-control/index.html +19 -19
- package/app/s/section-account-security/index.html +19 -19
- package/app/s/section-accounting/index.html +19 -19
- package/app/s/section-agreements/index.html +19 -19
- package/app/s/section-analytics/index.html +19 -19
- package/app/s/section-approvals/index.html +19 -19
- package/app/s/section-assets/index.html +19 -19
- package/app/s/section-billing/index.html +19 -19
- package/app/s/section-calendar/index.html +19 -19
- package/app/s/section-catalog/index.html +19 -19
- package/app/s/section-grow/index.html +19 -19
- package/app/s/section-make/index.html +19 -19
- package/app/s/section-messages/index.html +19 -19
- package/app/s/section-more/index.html +19 -19
- package/app/s/section-operations/index.html +19 -19
- package/app/s/section-places/index.html +19 -19
- package/app/s/section-projects/index.html +19 -19
- package/app/s/section-publish/index.html +19 -19
- package/app/s/section-purchasing/index.html +19 -19
- package/app/s/section-reports.runtime/index.html +19 -19
- package/app/s/section-sales/index.html +19 -19
- package/app/s/section-staff/index.html +19 -19
- package/app/s/section-support/index.html +19 -19
- package/app/s/section-taxonomy/index.html +19 -19
- package/app/s/section-team/index.html +19 -19
- package/app/s/section-work/index.html +19 -19
- package/dist/catalog/catalog.json +41 -41
- package/dist/core/index.js +43 -43
- package/dist/smrt-version.d.ts +1 -1
- package/dist/smrt-version.js +1 -1
- package/package.json +57 -57
- package/app/_app/immutable/chunks/1Wv0ngpy.js +0 -1
- package/app/_app/immutable/chunks/Bp-cYZic.js +0 -1
- package/app/_app/immutable/chunks/DOmhB14-.js +0 -1
- package/app/_app/immutable/entry/start.BM_rdcUv.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./
|
|
2
|
-
import{$ as e,Mt as t,bt as n,vt as r}from"./DG3qFFTE.js";import{t as i}from"./BaNbYf_w.js";import"./xihTtKlq.js";import{I as a,L as o,O as s,Q as c,St as l,W as u,Z as d,_ as f,_t as p,bt as m,et as h,h as g,ht as _,p as v,x as y,yt as b}from"./DkQ0TpH9.js";import{v as x}from"./CVHqha_e.js";import"./D3syEjNq.js";import"./DmfvgI_r.js";import{u as S}from"./X79AuOjW.js";import{$ as C,A as w,C as ee,D as te,E as ne,F as re,I as ie,L as T,M as ae,N as oe,P as se,R as ce,T as le,X as E,Y as ue,Z as de,b as fe,h as pe,j as me,k as he,n as ge,q as _e,r as ve,z as ye}from"./FBKuVRtI.js";import{B as be,D as xe,G as Se,H as Ce,J as we,K as Te,M as Ee,V as De,X as Oe,Y as ke,Z as Ae,a as je,b as D,c as Me,d as Ne,l as Pe,n as Fe,r as Ie,s as Le,t as O,v as Re,x as k,z as ze}from"./CrFT46OU.js";var Be=[`identifier`,`status`,`date`,`party`,`total`,`money`];function Ve(e){for(let t of[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`])if(e.includes(t))return t}function He(e,t,n={}){let r=new Set(n.exclude??[]),i=n.max??4,a=Object.keys(t).filter(t=>!r.has(t)&&t in e.fields),o=e=>a.find(n=>t[n]?.includes(e)),s=[],c=e=>{e&&!s.includes(e)&&s.push(e)};c(o(`identifier`)??o(`title`));for(let e of Be)e!==`identifier`&&(e===`money`&&s.some(e=>t[e]?.includes(`money`))||c(e===`date`?a.find(e=>t[e]?.includes(`date`)&&e!==`createdAt`&&e!==`updatedAt`)??o(`date`):o(e)));return s.slice(0,i).map(n=>({key:n,label:A(n,e),...Ve(t[n]??[])?{role:Ve(t[n]??[])}:{}}))}function Ue(e,t,n={}){let r=new Set(n.exclude??[]),i=Object.keys(t).filter(t=>!r.has(t)&&t in e.fields),a=i.filter(t=>e.fields[t]?.type===`text`),o=a.find(e=>/^(?:description|title|name|label)$/.test(e))??a.find(e=>t[e]?.includes(`title`))??a.find(e=>!t[e]?.includes(`identifier`)),s=i.find(e=>t[e]?.includes(`quantity`)),c=i.filter(e=>t[e]?.includes(`money`)),l=c.find(e=>/unit|price|rate/i.test(e)),u=c.find(e=>/^(?:amount|lineTotal|total|lineAmount)$/.test(e))??[...c].reverse().find(e=>e!==l),d=[];return o&&d.push({key:o,label:A(o,e)}),s&&d.push({key:s,label:A(s,e),role:`quantity`}),l&&d.push({key:l,label:A(l,e),role:`money`,summarize:!1}),u&&u!==l&&d.push({key:u,label:A(u,e),role:`money`}),d}function A(e,t){let n=t.fields[e];return n&&(n.type===`foreignKey`||n.type===`crossPackageRef`)&&/.[a-z]Id$/.test(e)?re(e.slice(0,-2)):re(e)}function We(e){if(e.dataWidgets&&e.page)return[e.page];let t=[{id:`shortcuts`,type:`shortcuts`,span:4,options:{}}];if(e.dataWidgets&&e.lead){let n=e.lead,r=e.override,i=r&&typeof r==`object`&&!Array.isArray(r)?r:void 0,a=i?.changed;a&&typeof a==`object`&&!Array.isArray(a)&&Object.hasOwn(a,`count`)&&!(Array.isArray(i?.removed)&&i.removed.includes(`count`))&&t.push({id:`count`,type:`metric`,span:1,options:{title:n.plural,model:n.id,measure:`count`}}),t.push({id:`latest`,type:`records`,span:4,options:{title:`${n.name} records`,model:n.id,limit:5,summaries:!1}})}return t}var Ge=[`text`,`integer`,`decimal`,`boolean`,`datetime`,`json`,`foreignKey`,`crossPackageRef`];function Ke(e){return Ge.includes(e)?e:`text`}var qe=/(Date|^date|period(Start|End))$/;function Je(e,t){return t.type===`datetime`&&!t.system&&qe.test(t.name)&&!e.fields.some(e=>e.name===`allDay`)?`date`:void 0}function Ye(e){return fe(e)[0]}function Xe(e,t){let n=t.ui?{...t.ui}:void 0,r=s(t)?`money`:Je(e,t);return{type:Ke(t.type),required:t.required,nullable:!t.required,...t.default===void 0?{}:{default:t.default},...t.description?{description:t.description}:{},...n?{ui:n}:{},...t.enum?.length?{enum:[...t.enum]}:{},...r?{format:r}:{},...Ye(e)===t.name?{display:!0}:{}}}function Ze(e,t){return e.includes(`:`)?e:`${t.slice(0,t.lastIndexOf(`:`))}:${e}`}function Qe(e,t){if(!t.related)return!1;let n=Ze(t.related,e.id);return ke(p,n,h).some(t=>t.id===e.id)}function $e(e){return e.fields.flatMap(t=>{if(t.type!==`foreignKey`&&t.type!==`crossPackageRef`||!t.related)return[];let n=m(Ze(t.related,e.id));return n?[{field:t.name,kind:t.type===`crossPackageRef`?`crossPackageRef`:`foreignKey`,relatedCollection:n.model.collection,...Qe(e,t)?{role:`items`}:{}}]:[]})}function j(e){let t=$e(e);return{name:e.collection,objectRef:e.id,className:e.name,idField:`id`,fields:Object.fromEntries(e.fields.map(t=>[t.name,Xe(e,t)])),...t.length?{relationships:t}:{}}}function et(e,t){return{objectRef:e.id,fields:Object.fromEntries(t.map((e,t)=>[e.name,{visibility:`basic`,label:e.label,help:e.help??null,order:t,required:e.required}]))}}function tt(e,t){let n=new Set(t);for(let t of e)for(let e of t.models)n.add(e);return n}function nt(e){return v(e.replace(/_?id$/i,``)||e)}function M(e,t,n){let r=Oe(e,t),i=new Set(e.packages.flatMap(e=>(e.recipes??[]).filter(e=>e.exposure===`ui-only`).flatMap(e=>e.models))),a=Ae(e,t).filter(e=>(e.model.exposed||i.has(e.model.id))&&n.has(e.model.id)),o=new Set(ke(e,t,h).map(e=>e.id)),s=new Map;for(let e of a)s.set(e.model.id,(s.get(e.model.id)??0)+1);let c=a.map(e=>{let t=o.has(e.model.id)?`items`:`children`,n=j(e.model),i=T(n),a=[e.fk];return{model:e.model.id,field:e.fk,label:(s.get(e.model.id)??0)>1?`${Se(e.model.name,r)} (${nt(e.fk).toLowerCase()})`:Se(e.model.name,r),kind:t,columns:t===`items`?Ue(n,i,{exclude:a}):He(n,i,{exclude:a,max:5}),...t===`items`&&`sortOrder`in n.fields?{sort:`sortOrder`}:{}}});for(let n of Te(e,t))c.push({model:n.model.id,field:n.fk,label:nt(n.fk),kind:`reference`});return c}function rt(e,t){let{sections:n}=t;if(!n)throw Error(`the cookbook widget context is missing`);let r=typeof e.section==`string`?e.section:``,i=r?n.find(e=>e.id===`section:${r}`||e.id===`custom:${r}`)?.id:t.overviewId;if(!i)throw Error(`unknown section ${r}`);return se(n,i)}function it(e){return e?async(t,n)=>{let r=rt(t,n);try{let t=await e(n,r.items.map(e=>({...e})));if(!Array.isArray(t))return r;let i=new Set,a=[];for(let e of t){if(!e||typeof e.href!=`string`)continue;let t=typeof e.id==`string`&&e.id?e.id:e.href;i.has(t)&&(t=`${t}#${a.length}`),i.add(t),a.push({...e,id:t})}return{items:a}}catch(e){if(n.signal?.aborted)throw e;return r}}:rt}var at=new Set([`foreignKey`,`crossPackageRef`]);function N(e,t){return`/m/${e}/${t}/`}function ot(e,t,n,r=`view`){let i=`${N(e,t)}${encodeURIComponent(n)}/`;return r===`edit`?`${i}edit/`:i}function st(e,t,n,r){return`${N(e,t)}?${encodeURIComponent(n)}=${encodeURIComponent(r)}`}function ct(e,t){let n=new URLSearchParams(e);for(let e of t.fields){if(!at.has(e.type))continue;let t=n.get(e.name);if(t)return{field:e.name,equals:t}}}function lt(e){return e?.equals===void 0?``:`${encodeURIComponent(e.field)}=${encodeURIComponent(e.equals)}`}var P=e=>typeof e==`number`&&Number.isSafeInteger(e)?e:null,ut=(e,t)=>e.fields.some(e=>e.name===t);function dt(e,t){let n=T(j(e)),r=ee(t,n);return Object.values(r).some(e=>P(e)!==null)?r:void 0}function ft(e,t){return!!e.fields.find(e=>e.name===`status`)?.enum?.includes(`draft`)&&typeof t.status==`string`&&t.status!==``&&t.status!==`draft`}function pt(e,t,n){if(!ft(e,t)||![`subtotal`,`taxAmount`,`totalAmount`,`discountTotal`].every(t=>ut(e,t)))return;let r=P(t.subtotal),i=P(t.taxAmount),a=P(t.totalAmount),o=P(t.discountTotal)??0;if(r===null||i===null||a===null)return;let s=d(t,`exclusive`);return{subtotal:r,discount:o,tax:i,total:a,lineAmountType:s,roundingScope:c(t,`line`),showNetSubtotal:s===`inclusive`,taxes:_(n,s).flatMap(e=>e.taxComponentId?[{taxComponentId:e.taxComponentId,name:e.name,percent:e.percent,taxable:e.taxable,tax:e.tax}]:[])}}var F=_e();function I(e){let{source:t,href:n}=e;if(!t||!n)throw Error(`the planner widget context is missing`);return{source:t,href:n}}function L(e){let t=typeof e==`string`?m(e):void 0;if(!t)throw Error(`unknown model ${String(e)}`);return{model:t.model,packageId:t.pkg.id,path:N(t.pkg.id,t.model.name)}}var R=new Set([`foreignKey`,`crossPackageRef`]);function z(e,t,n){let r=e.filter;if(typeof r!=`string`||r===``)return;if(r!==`parent`)throw Error(`unknown filter ${r}`);let{record:i}=t;if(!i?.id)throw Error(`the parent filter needs a record`);let a=typeof e.parentField==`string`&&e.parentField?e.parentField:e.field,o=typeof a==`string`?a:``,s=n.fields.find(e=>e.name===o);if(!s||!R.has(s.type))throw Error(`${n.name} has no reference field ${o}`);return{field:o,id:i.id}}async function B(e,t,n){return n?e.listWhere(t,n.field,n.id):e.list(t)}function V(e,t,n){return e(n?st(t.packageId,t.model.name,n.field,n.id):t.path)}var H=e=>typeof e==`number`&&Number.isFinite(e);async function mt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),c=await B(n,a,o),l=V(r,i,o),u=typeof e.measure==`string`?e.measure:``;if(u===`count`||u===``)return{value:c.length,format:`integer`,href:l};let d=a.fields.find(t=>t.name===e.field);if(!d||d.type!==`integer`&&d.type!==`decimal`)throw Error(`${u} needs a numeric field of ${a.name}`);let f=c.map(e=>e[d.name]).filter(H),p=0;if(f.length){if(u===`sum`||u===`avg`)p=f.reduce((e,t)=>e+t,0),u===`avg`&&(p/=f.length);else if(u===`min`)p=Math.min(...f);else if(u===`max`)p=Math.max(...f);else throw Error(`unknown measure ${u}`)}let m=s(d);return{value:m?Math.round(p):p,format:m?`money`:d.type===`integer`?`integer`:`decimal`,...m?{currency:`USD`}:{},href:l}}function ht(e,t){return H(e)&&H(t)?e-t:String(e??``).localeCompare(String(t??``))}var gt=new Set([`createdAt`,`updatedAt`]),_t=[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`];function vt(e=[]){return _t.find(t=>e.includes(t))}function yt(e,t,n,r){let i=j(e),a=r?[r]:[],o=oe(n),s=o.length?[]:pe(O.apply(e).fields.filter(t=>!a.includes(t.name)&&!xe(e,t))).filter(e=>!e.derive),c=o.length?o:s.map(e=>e.name),l=[...Ue(i,t,{exclude:a}),...He(i,t,{exclude:a,max:c.length+8})];return c.map(n=>{let r=e.fields.find(e=>e.name===n);if(!r)throw Error(`${e.name} has no field ${n}`);let i=l.find(e=>e.key===n),a=s.find(e=>e.name===n)?.label;if(i)return a?{...i,label:a}:i;let o=vt(t[n]);return{key:n,label:a??(R.has(r.type)?v(n.replace(/Id$/,``)):v(n)),...o?{role:o}:{}}})}var bt=new Set([`money`,`quantity`]);function xt(e,t){let n={};for(let r of e)(r.summarize??bt.has(r.role))&&(n[r.key]=t.reduce((e,t)=>{let n=t[r.key];return H(n)?e+n:e},0));return n}function St(e,t){let n=ie(j(e)),r=new Set(t.map(e=>n?e[n]:void 0).filter(e=>typeof e==`string`&&e!==``));return r.size===1?[...r][0]??`USD`:`USD`}async function Ct(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),s=await B(n,a,o);if(typeof e.sort==`string`&&e.sort){if(!a.fields.find(t=>t.name===e.sort)&&!gt.has(e.sort))throw Error(`${a.name} has no field ${e.sort}`);let t=s.some(t=>t[e.sort]!==void 0)?e.sort:W(a)?.name;if(t){let n=e.direction===`asc`?1:-1;s=[...s].sort((e,r)=>n*ht(e[t],r[t]))}}let c=yt(a,T(j(a)),e.columns,o?.field),l=H(e.limit)?e.limit:5,u=s.slice(0,l),d=a.fields.filter(e=>R.has(e.type)&&c.some(t=>t.key===e.name)),f=await ve(n,d,u),p=e=>Object.fromEntries(c.map(t=>{let n=e[t.key],r=d.find(e=>e.name===t.key);return r?.related&&typeof n==`string`&&n?[t.key,f.get(g(r.related,n))??``]:[t.key,n??null]})),m=xt(c,s),h=!we(a);return{rows:await Promise.all(u.map(async e=>({id:String(e.id),title:await ge(n,a,e,0,o?.field),...h?{href:r(ot(i.packageId,a.name,String(e.id)))}:{},cells:p(e)}))),...e.summaries===!1?{}:{total:s.length},...h?{href:V(r,i,o)}:{},columns:c,currency:St(a,s),...Object.keys(m).length?{summaries:m}:{}}}var wt={"7d":7,"30d":30,"90d":90,"12m":365,all:null},U=864e5;function Tt(e){return e===`7d`||e===`30d`?`day`:e===`90d`?`week`:`month`}function Et(e,t){let n=new Date(e);if(t===`month`)return Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1);let r=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate());return t===`week`?r-(n.getUTCDay()+6)%7*U:r}function Dt(e,t){if(t===`month`){let t=new Date(e);return Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,1)}return e+(t===`week`?7:1)*U}function Ot(e,t){let n=new Date(e).toISOString();return t===`month`?n.slice(0,7):n.slice(0,10)}var kt=e=>e.type===`datetime`&&!e.system;function W(e){let t=e.fields.filter(kt);return t.find(e=>/^(issue|order|start|created)/i.test(e.name))??t[0]}function At(e){if(typeof e!=`string`&&typeof e!=`number`)return;let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}async function jt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),c=typeof e.groupBy==`string`?e.groupBy:``,l=c?a.fields.find(e=>e.name===c):W(a);if(!l)throw Error(c?`${a.name} has no field ${c}`:`${a.name} has no date field to chart; choose a group-by field`);let u=typeof e.measure==`string`?e.measure:``,d;if(u&&u!==`count`){if(u!==`sum`&&u!==`avg`)throw Error(`unknown measure ${u}`);if(d=a.fields.find(t=>t.name===e.field),!d||d.type!==`integer`&&d.type!==`decimal`)throw Error(`${u} needs a numeric field of ${a.name}`)}let f=typeof e.period==`string`?e.period:`30d`;if(!Object.hasOwn(wt,f))throw Error(`unknown period ${f}`);let p=wt[f],m=kt(l),h=m?l:W(a),g=p!==null&&h?y-p*U:-1/0,_=await B(n,a,o);h&&g!==-1/0&&(_=_.filter(e=>{let t=At(e[h.name]);return t!==void 0&&t>=g&&t<=y}));let v=new Map,b=(e,t,n)=>{let r=v.get(e)??{key:t,sum:0,n:0};if(d){let e=n[d.name];if(!H(e))return;r.sum+=e}r.n+=1,v.set(e,r)},x=Tt(f);if(m){let e=g===-1/0?Math.min(..._.map(e=>At(e[l.name])??y),y):g;for(let t=Et(e,x);t<=y;t=Dt(t,x))v.set(Ot(t,x),{key:t,sum:0,n:0});for(let e of _){let t=At(e[l.name]);if(t===void 0)continue;let n=Et(t,x);b(Ot(n,x),n,e)}}else for(let e of _){let t=e[l.name],n=t==null||t===``?`(none)`:String(t);b(n,n,e)}let S=d?s(d):!1,C=e=>{if(!d)return e.n;let t=u===`avg`&&e.n?e.sum/e.n:e.sum;return S?Math.round(t):t},w=[...v.entries()].map(([e,t])=>({label:e,value:C(t),key:t.key}));return w=m?w.sort((e,t)=>Number(e.key)-Number(t.key)):w.sort((e,t)=>t.value-e.value||e.label.localeCompare(t.label)),{points:w.map(({label:e,value:t})=>({label:e,value:t})),format:d?S?`money`:d.type===`integer`?`integer`:`decimal`:`integer`,...S?{currency:`USD`}:{},href:V(r,i,o)}}te(F,{metric:mt,records:Ct,chart:jt,shortcuts:async(e,t)=>t,shortcuts:it()});function Mt(e){let{relations:t,viewAllHref:n}=e;if(!t)throw Error(`the record page context is missing`);return{relations:t,records:Ct,viewAllHref:n}}async function Nt(e,t){let{source:n}=I(e),r=e.record;if(!r?.id)throw Error(`line items need a record`);let{model:i}=L(r.model),a=await n.get(i,r.id);if(!a)return{};let o=t.find(e=>e.kind===`items`),s=o?m(o.model)?.model:void 0,c=pt(i,a,o&&s?await n.listWhere(s,o.field,r.id):[]),l=c?void 0:dt(i,a),u=ie(j(i)),d=u?a[u]:void 0;return{...c?{storedTotals:c}:{},...l?{totals:l}:{},...typeof d==`string`&&d?{currency:d}:{}}}F.register(ne((e,t)=>w(Mt(t))(e,t))),F.register(le(async(e,t)=>{let n=Mt(t),{totals:r,storedTotals:i,currency:a}=await Nt(t,n.relations);return he({...n,totals:()=>r,storedTotals:()=>i,currency:()=>a})(e,t)}));var Pt=[`shortcuts`,`metric`,`records`,`chart`,`note`],Ft={"@happyvertical/smrt-reports/svelte":async()=>({SavedReportsWidget:(await i(async()=>{let{default:e}=await import(`./1WLXuR-X.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]),import.meta.url)).default})},It=async(e,t)=>{let n=Ft[e];if(n)return(await n())[t]},Lt=D.filter(e=>e.surfaces?.some(e=>e.kind===`widget`)),Rt=Lt.flatMap(e=>(e.surfaces??[]).flatMap(e=>e.kind===`widget`?[e.type]:[]));ce(F,Lt,It);var zt=new Map(ze(D).map(e=>[`section:${e.id}`,e])),Bt=p.packages.flatMap(e=>e.models.map(e=>e.id)),Vt=[...Pt,...Rt];function Ht(e){let t=zt.get(e);for(let e of t?.recipes??[]){let t=Re(e)[0];if(t)return{id:t.model.id,name:v(t.model.name)}}}function Ut(e,t){let n=ye(zt.get(e)?.recipes[0]),r=Ht(e);return We({lead:r?{...r,plural:f(r.name)}:void 0,dataWidgets:!0,page:n&&Rt.includes(n.type)?n:void 0,override:t})}var Wt=new Map;function Gt(e,t){if(!C.test(e))return;let n=Wt.get(e);return n||(n=E({id:e,allowed:Vt,models:Bt,defaults:Ut(e)}),Wt.set(e,n)),t===void 0?n:E({...n,defaults:Ut(e,t)})}function Kt(e,t){return`detail:${e}.${t}`}var qt=new Map(p.packages.flatMap(e=>e.models.filter(l).map(t=>[ae(t.id),{packageId:e.id,model:t}])));function Jt(e){let[,t,n]=/^detail:([A-Za-z0-9_-]+)\.([A-Za-z0-9_]+)$/.exec(e)??[],r=t&&n?b(t,n):void 0;return t&&r&&l(r)?{packageId:t,model:r}:qt.get(e)}var Yt=new Set(p.packages.flatMap(e=>e.models.filter(l).map(e=>e.id))),Xt=new Map;function Zt(e){let t=Xt.get(e);if(t)return t;let n=Jt(e);if(!n)return;let r=M(p,n.model.id,Yt),i=me(j(n.model),r,{id:e,maxMetrics:2*r.length});return t=E({...i,maxWidgets:Math.max(i.maxWidgets??24,i.defaults.length+24)}),Xt.set(e,t),t}function Qt(e,t){let n=Zt(e),r=Jt(e);if(!n||!r)return;let i=M(p,r.model.id,t),a=0,o=n.defaults.filter(e=>e.type===`line-items`?i.some(e=>e.kind===`items`):e.type===`related`?i.some(e=>e.kind===`children`):t.has(String(e.options.model))?e.type!==`metric`||(a+=1,a<=4):!1);return E({...n,defaults:o})}function $t(e,t){return e.startsWith(`detail:`)?Zt(e):Gt(e,t)}function en(e,t){return zt.has(e)||e===`section:${Ee.id}`?!0:e.startsWith(`detail:`)?Jt(e)!==void 0:e.startsWith(`custom:`)&&C.test(e)&&(t?.customSections??[]).some(t=>t.id===e)}var tn=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function nn(e,t){let n=t.widgetId?`widget ${t.widgetId}${t.type?` (${t.type})`:``}`:`an entry`,r=t.options?.length?`: ${t.options.map(e=>`${e.key} ${e.code}`).join(`, `)}`:``;return`Overview ${e}: ${n} was dropped (${t.code}${r}).`}function rn(e,t){let n={...e};return e.added&&(n.added=e.added.filter(e=>!t.has(e.id))),e.changed&&(n.changed=Object.fromEntries(Object.entries(e.changed).filter(([e])=>!t.has(e)))),n}function an(e,t){let n=$t(e,t);if(!n)return{override:null,issues:[{widgetId:null,type:null,code:`malformed`,message:`not an overview id`}]};let r=ue(n,t,F);if(r.ok){let e=de(t).override?.changed?.count;return e&&n.defaults.some(e=>e.id===`count`)?{override:{...r.override??{version:1},changed:{...r.override?.changed,count:e}},issues:[]}:{override:r.override,issues:[]}}let i=de(t),a=new Set(r.issues.flatMap(e=>e.widgetId?[e.widgetId]:[]));if(!i.override)return{override:null,issues:r.issues};let o=ue(n,rn(i.override,a),F);return o.ok?{override:o.override,issues:r.issues}:{override:null,issues:[...r.issues,...o.issues]}}function on(e,t){if(!tn(e))return null;let n=[],r=[];for(let i of Object.keys(e).sort()){if(!en(i,t)){r.push(`Overview ${i} is not a page in this app and was dropped.`);continue}let{override:a,issues:o}=an(i,e[i]);for(let e of o)r.push(nn(i,e));a&&n.push([i,a])}return{overviews:Object.fromEntries(n),dropped:r}}var sn=S,cn=`glass`,ln=`system`,un=[`light`,`dark`,`system`],dn=[`none`,`sm`,`md`,`lg`,`xl`,`full`],fn=[`comfortable`,`touch`],pn=[`auto`,`standard`,`more`],G={"system-ui":`system-ui, -apple-system, "Segoe UI", sans-serif`,Inter:`Inter, system-ui, sans-serif`,Georgia:`Georgia, "Times New Roman", serif`,"ui-rounded":`ui-rounded, "SF Pro Rounded", system-ui, sans-serif`,"ui-monospace":`ui-monospace, "SF Mono", Menlo, monospace`},mn=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;function hn(e){if(typeof e!=`string`)return null;let t=mn.exec(e.trim());if(!t)return null;let n=t[1].toLowerCase();return n.length===3&&(n=[...n].map(e=>e+e).join(``)),`#${n}`}var gn=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function _n(e){if(e===void 0)return{ok:!0,theme:void 0};if(!gn(e))return{ok:!1,error:`The cookbook "theme" must be an object.`};let t={};if(e.preset!==void 0){if(typeof e.preset!=`string`||!sn.includes(e.preset))return{ok:!1,error:`The theme preset must be one of ${sn.join(`, `)}.`};t.preset=e.preset}if(e.colorScheme!==void 0){if(!un.includes(e.colorScheme))return{ok:!1,error:`The theme colorScheme must be light, dark or system.`};t.colorScheme=e.colorScheme}for(let[n,r]of[[`borderRadius`,dn],[`density`,fn],[`contrast`,pn]]){let i=e[n];if(i!==void 0){if(!r.includes(i))return{ok:!1,error:`The theme ${n} must be one of ${r.join(`, `)}.`};t[n]=i}}if(e.fontFamily!==void 0){if(typeof e.fontFamily!=`string`||!Object.hasOwn(G,e.fontFamily))return{ok:!1,error:`The theme font must be one of ${Object.keys(G).join(`, `)}.`};t.fontFamily=e.fontFamily}if(e.custom!==void 0){if(!gn(e.custom))return{ok:!1,error:`The theme "custom" must be an object.`};let n=hn(e.custom.primary);if(!n)return{ok:!1,error:`The theme custom primary must be a hex colour like #c2410c.`};let r={primary:n};if(e.custom.fontFamily!==void 0){let t=e.custom.fontFamily;if(typeof t!=`string`||!Object.hasOwn(G,t))return{ok:!1,error:`The theme font must be one of ${Object.keys(G).join(`, `)}.`};r.fontFamily=t}t.custom=r}if(e.customCss!==void 0){if(typeof e.customCss!=`string`)return{ok:!1,error:`The theme customCss must be a string.`};if(Array.from(e.customCss).length>65536)return{ok:!1,error:`The theme customCss is too long (65,536 characters maximum).`};e.customCss&&(t.customCss=e.customCss)}return{ok:!0,theme:Object.keys(t).length?t:void 0}}function vn(e){if(!e)return;let t={};return e.preset&&(t.preset=e.preset),e.colorScheme&&(t.colorScheme=e.colorScheme),e.borderRadius&&(t.borderRadius=e.borderRadius),e.density&&(t.density=e.density),e.contrast&&(t.contrast=e.contrast),e.fontFamily&&(t.fontFamily=e.fontFamily),e.custom&&(t.custom={...e.custom}),e.customCss&&(t.customCss=e.customCss),Object.keys(t).length?t:void 0}function yn(e){let t=e?.colorScheme??`system`,n=e?.custom?`brand colour ${e.custom.primary}`:e?.preset??`glass`;return t===`system`?n:`${n}, ${t}`}var K=`section:`;function bn(e,t=be(D)){let n=Object.keys(t).sort((e,t)=>t.length-e.length);if(!n.length)return e;let r=e=>{if(!e.startsWith(K))return e;let r=e.slice(8);for(let e of n){if(r===e)return`${K}${t[e]}`;if(r.startsWith(`${e}:`))return`${K}${t[e]}${r.slice(e.length)}`}return e},i=e=>e.startsWith(K)&&n.includes(e.slice(8)),a=e=>[...new Set(e)],o={...e};if(e.sectionOrder&&(o.sectionOrder=a(e.sectionOrder.map(r))),e.hidden&&(o.hidden=a(e.hidden.filter(e=>!i(e)).map(r))),e.itemOrder){let t={};for(let[n,i]of Object.entries(e.itemOrder)){let e=r(n);t[e]=a([...t[e]??[],...i.map(r)])}o.itemOrder=t}return e.moved&&(o.moved=Object.fromEntries(Object.entries(e.moved).map(([e,t])=>[r(e),r(t)]))),o}function xn(e,t=D){let n=new Map;for(let e of t){let t=Ce(e).id;for(let r of Re(e))r.key&&n.set(`${K}${t}:${r.packageId}:${r.model.name}:${r.label}`,De(r.packageId,r.model.name,r.key))}let r=e=>{let t=n.get(e);if(t)return t;if(!e.startsWith(K))return e;let r=e.slice(8).split(`:`);return r.length<3||!r[1]||!r[2]?e:De(r[1],r[2])},i=e=>[...new Set(e)],a=(e,t)=>{let n={};for(let[i,a]of Object.entries(e)){let e=r(i);e in n||(n[e]=t(a))}return n},o={...e};return e.hidden&&(o.hidden=i(e.hidden.map(r))),e.itemOrder&&(o.itemOrder=a(e.itemOrder,e=>i(e.map(r)))),e.moved&&(o.moved=a(e.moved,r)),e.items&&(o.items=a(e.items,e=>e)),o}var q=`https://s-m-r-t.dev/schemas/cookbook/v1.json`,Sn=new Set([`basic`,`advanced`,`hidden`]),Cn=new Set([`api`,`mcp`,`cli`]),J=e=>({ok:!1,error:e}),Y=e=>typeof e==`object`&&!!e&&!Array.isArray(e),X=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`);function wn(e,t){if(!Y(e))return`${t} is not an object`;let{objectRef:n,fieldName:r}=e;if(typeof n!=`string`||!n)return`${t} has no objectRef`;if(typeof r!=`string`||!r)return`${t} has no fieldName`;if(e.scopeType!==`app`)return`${t} must have scopeType "app"`;let i={objectRef:n,fieldName:r,scopeType:`app`};for(let n of[`defaultValue`,`help`,`label`]){let r=e[n];if(r!==void 0){if(typeof r!=`string`&&r!==null)return`${t}.${n} is invalid`;i[n]=r}}if(e.visibility!==void 0){let n=e.visibility;if(n!==null&&!(typeof n==`string`&&Sn.has(n)))return`${t}.visibility is invalid`;i.visibility=n}if(e.displayOrder!==void 0){let n=e.displayOrder;if(n!==null&&!(typeof n==`number`&&Number.isFinite(n)))return`${t}.displayOrder is invalid`;i.displayOrder=n}if(e.locked!==void 0){if(e.locked!==null&&typeof e.locked!=`boolean`)return`${t}.locked is invalid`;i.locked=e.locked}return i}function Tn(e){if(!Y(e)||e.version!==1)return`layout must be an object with version 1`;for(let t of[`sectionOrder`,`hidden`])if(e[t]!==void 0&&!X(e[t]))return`layout.${t} must be a list of strings`;for(let t of[`itemOrder`,`moved`,`panels`])if(e[t]!==void 0&&!Y(e[t]))return`layout.${t} must be an object`;let t=e.itemOrder;if(Y(t)){for(let[e,n]of Object.entries(t))if(e===`__proto__`||!X(n))return`layout.itemOrder.${e} must be a list of strings`}let n=e.moved;if(Y(n)){for(let[e,t]of Object.entries(n))if(e===`__proto__`||typeof t!=`string`)return`layout.moved.${e} must be a string`}return e}function En(e,t={}){if(!Y(e))return J(`This is not a cookbook: expected a JSON object.`);if(e.$schema!==void 0&&e.$schema!==`https://s-m-r-t.dev/schemas/cookbook/v1.json`&&e.$schema!==`https://s-m-r-t.dev/schemas/blueprint/v1.json`)return J(`This is not a cookbook: its "$schema" is not a cookbook schema this planner knows.`);let{version:n}=e;if(n===void 0)return J(`This is not a cookbook: it has no "version".`);if(typeof n!=`number`||!Number.isInteger(n))return J(`The cookbook "version" must be a whole number.`);if(n>1)return J(`This cookbook is version ${n}, newer than this planner understands (1). Update the planner or re-export it.`);if(n!==1)return J(`Cookbook version ${n} is not supported (this planner reads version 1).`);if(!X(e.recipes))return J(`The cookbook "recipes" must be a list of recipe ids.`);let r=e.recipes.filter(e=>!k.has(e)),i=[...new Set([...je(e.recipes.filter(e=>k.has(e)),k),...r])].sort(),a=[];if(e.features!==void 0){if(!X(e.features))return J(`The cookbook "features" must be a list of model names.`);let t=new Set;for(let n of e.features){if(t.has(n))return J(`The cookbook lists the feature ${n} more than once.`);t.add(n)}a=[...e.features].sort()}let o=new Set([...i.flatMap(e=>k.get(e)?.models??[]),...a]);if(!Array.isArray(e.policies))return J(`The cookbook "policies" must be a list.`);let s=[];for(let[t,n]of e.policies.entries()){let e=wn(n,`policies[${t}]`);if(typeof e==`string`)return J(`Invalid cookbook: ${e}.`);(o.has(e.objectRef)||Me(e))&&s.push(e)}let c;if(e.exposure!==void 0){if(!Y(e.exposure))return J(`The cookbook "exposure" must be an object.`);let t=[];for(let[n,r]of Object.entries(e.exposure)){if(!X(r)||!r.every(e=>Cn.has(e)))return J(`Invalid cookbook: exposure for ${n} must list api, mcp or cli.`);r.length&&o.has(n)&&t.push([n,[...r]])}c=Object.fromEntries(t)}let l;if(e.layout!==void 0){let t=Tn(e.layout);if(typeof t==`string`)return J(`Invalid cookbook: ${t}.`);l=xn(bn(t))}let u;if(e.theme!==void 0){let n=_n(e.theme);if(n.ok)u=n.theme;else if(!t.dropUnknownRecipes)return J(n.error)}let d,f=[];if(e.overviews!==void 0){if(t.overviews){let n=t.overviews(e.overviews,l);if(!n)return J(`The cookbook "overviews" must be an object.`);d=n.overviews,f=n.dropped}else{if(!Y(e.overviews))return J(`The cookbook "overviews" must be an object.`);Object.keys(e.overviews).length&&(f=[`Page customisations (overviews) are not kept by this host and were dropped.`])}}let p={$schema:q,version:1,recipes:i,features:a,policies:s};for(let t of[`name`,`description`]){let n=e[t];if(n!==void 0){if(typeof n!=`string`)return J(`The cookbook "${t}" must be a string.`);n.trim()&&(p[t]=n.trim())}}if(e.specs!==void 0){if(typeof e.specs!=`string`)return J(`The cookbook "specs" must be a string.`);e.specs.trim()&&(p.specs=e.specs.trim())}return c&&Object.keys(c).length&&(p.exposure=c),l&&(p.layout=l),u&&(p.theme=u),d&&Object.keys(d).length&&(p.overviews=d),f.length?{ok:!0,cookbook:p,dropped:f}:{ok:!0,cookbook:p}}var Dn=e=>({ok:!1,error:e});function On(e,t={}){return En(e,{...t,overviews:on})}function kn(e,t={}){let n;try{n=JSON.parse(e)}catch{return Dn(`This file is not valid JSON.`)}try{return On(n,t)}catch{return Dn(`This file is not a valid cookbook.`)}}var Z=`smrt-planner:cookbook-doc:v1`,An=`smrt-planner:blueprint:v1`,jn=`smrt-planner:cookbook-doc:unreadable`;function Mn(){try{return globalThis.localStorage??null}catch{return null}}function Nn(e){if(!e)return{status:`unavailable`};let t;try{t=e.getItem(Z)}catch{return{status:`unavailable`}}let n=null;try{n=e.getItem(An)}catch{}let r=t===null&&n!==null,i=r?n:t;if(i===null)return{status:`empty`};let a=kn(i,{dropUnknownRecipes:!0});if(a.ok)return r&&Q(e,Z,JSON.stringify(a.cookbook)),{status:`loaded`,cookbook:a.cookbook,previousKept:n!==null,...a.dropped?{dropped:a.dropped}:{}};t=i;let o=Q(e,jn,t);return{status:`unreadable`,reason:a.error,keptAside:o}}function Q(e,t,n){if(!e)return!1;try{return e.setItem(t,n),!0}catch{return!1}}function Pn(e,t){if(!e)return!1;try{return e.removeItem(t),!0}catch{return!1}}function Fn(e,t){return Q(e,Z,JSON.stringify(t))}function In(e,t={}){let n={$schema:q,version:1,...Fe(e)};t.name&&(n.name=t.name),t.description&&(n.description=t.description),t.specs&&(n.specs=t.specs),t.layout&&(n.layout=t.layout);let r=vn(t.theme);r&&(n.theme=r);let i=t.overviews??{},a=Object.keys(i).sort();return a.length&&(n.overviews=Object.fromEntries(a.map(e=>[e,i[e]]))),n}var Ln=new Set([`basic`,`advanced`,`hidden`]),Rn=new Set([`api`,`mcp`,`cli`]);function zn(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t+`=`.repeat((4-t.length%4)%4));return new TextDecoder().decode(Uint8Array.from(n,e=>e.charCodeAt(0)))}function Bn(e){let t=new URLSearchParams(e);return t.has(`r`)||t.has(`o`)}function Vn(e){let t={rows:[],narrowed:{}};if(!e)return t;let n;try{n=JSON.parse(zn(e))}catch{return t}if(!n||typeof n!=`object`)return t;let r=[];for(let[e,t]of Object.entries(n.r??{}))if(t&&typeof t==`object`)for(let[n,i]of Object.entries(t)){if(!i||typeof i!=`object`)continue;let t={objectRef:e,fieldName:n,scopeType:`app`};typeof i.v==`string`&&Ln.has(i.v)&&(t.visibility=i.v),typeof i.l==`string`&&(t.label=i.l),(typeof i.h==`string`||i.h===null)&&(t.help=i.h),(typeof i.d==`string`||i.d===null)&&(t.defaultValue=i.d),typeof i.o==`number`&&Number.isFinite(i.o)&&(t.displayOrder=i.o),typeof i.k==`boolean`&&(t.locked=i.k),r.push(t)}let i={};for(let[e,t]of Object.entries(n.x??{})){if(!Array.isArray(t))continue;let n=t.filter(e=>Rn.has(e));n.length&&(i[e]=n)}return{rows:r,narrowed:i}}function Hn(e){let t=new URLSearchParams(e),n=(t.get(`r`)??``).split(`,`).filter(Boolean),r=je(Ie(n,k),k),i=new Set(r.flatMap(e=>k.get(e)?.models??[])),{rows:a,narrowed:o}=Vn(t.get(`o`)??``),s={$schema:q,version:1,recipes:r,features:[],policies:a.filter(e=>i.has(e.objectRef))},c=Object.fromEntries(Object.entries(o).filter(([e])=>i.has(e)));return Object.keys(c).length&&(s.exposure=c),s}var Un=`smrt-planner:shell`;function $(e){let t=Pe(e),n=e.policies.some(e=>e.defaultValue!==void 0&&Me(e));o(Le(e)||n?t.taxRate:void 0),a({pricesIncludeTax:t.pricesIncludeTax,taxRounding:t.taxRounding,currency:t.currency})}var Wn=new class{#e=n(0);get replacementGeneration(){return e(this.#e)}set replacementGeneration(e){r(this.#e,e,!0)}#t=n();get layout(){return e(this.#t)}set layout(e){r(this.#t,e,!0)}#n=n();get name(){return e(this.#n)}set name(e){r(this.#n,e,!0)}#r=n();get description(){return e(this.#r)}set description(e){r(this.#r,e,!0)}#i=n();get specs(){return e(this.#i)}set specs(e){r(this.#i,e,!0)}#a=n();get theme(){return e(this.#a)}set theme(e){r(this.#a,e,!0)}#o=n({});get overviews(){return e(this.#o)}set overviews(e){r(this.#o,e)}#s=n(`unknown`);get persist(){return e(this.#s)}set persist(e){r(this.#s,e,!0)}#c=n(!1);get loaded(){return e(this.#c)}set loaded(e){r(this.#c,e,!0)}hostManaged=!1;#l=n(``);get loadNotice(){return e(this.#l)}set loadNotice(e){r(this.#l,e,!0)}saveBlocked=!1;#u=n(!1);get keepLegacyUrl(){return e(this.#u)}set keepLegacyUrl(e){r(this.#u,e,!0)}replacedBeforeLoad=!1;previousKept=!1;storage=null;timer;snapshot(){return In(t(O.data),{layout:t(this.layout),theme:t(this.theme),overviews:t(this.overviews),name:this.name,description:this.description,specs:this.specs})}overview(e){return Object.hasOwn(this.overviews,e)?this.overviews[e]:null}setOverview(e,t){let n=Object.fromEntries(Object.entries(this.overviews).filter(([t])=>t!==e));t&&(n[e]=t),this.overviews=n}setLayout(e){this.layout=x(e)?void 0:e}setSpecs(e){let t=e.trimEnd();this.specs=t.trim()?t:void 0}apply(e){O.load(e),this.layout=e.layout,this.theme=e.theme,this.name=e.name,this.description=e.description,this.specs=e.specs,this.overviews={...e.overviews??{}},$(e)}get unavailableNotice(){let e=[...O.unavailableRecipes,...O.unavailableFeatures];if(!e.length)return``;let t=e.length;return`${t} ${t===1?`recipe`:`recipes`} in this cookbook ${t===1?`isn't`:`aren't`} available in this version: ${e.join(`, `)}. They are kept when you save or export.`}removeUnavailable(){O.removeUnavailable(),this.scheduleSave()}setTheme(e){this.theme=vn(e)}settings(){return Pe(this.snapshot())}setSettings(e){let t=Ne(this.snapshot(),e);O.rows=t.policies.map(e=>({...e})),$(t)}replace(e){this.replacementGeneration++,this.apply(e),this.loaded||(this.replacedBeforeLoad=!0),this.saveBlocked=!1,this.keepLegacyUrl=!1}reset(e={}){this.replacementGeneration++,O.clear(),$({policies:[]}),this.layout=void 0,e.preserveTheme||(this.theme=void 0),this.name=void 0,this.description=void 0,this.specs=void 0,this.overviews={},this.saveBlocked=!1,this.keepLegacyUrl=!1}importText(e){let t=kn(e);return t.ok&&this.replace(t.cookbook),t}hydrate(e,t=u()){this.storage=t;let n=Nn(t);n.status===`loaded`&&(this.previousKept=n.previousKept),n.status===`loaded`&&!this.replacedBeforeLoad?(this.apply(n.cookbook),n.dropped?.length&&(this.loadNotice=`Some saved page customisations could not be used and were removed: ${n.dropped.join(` `)}`)):n.status===`unreadable`&&(this.saveBlocked=!n.keptAside,this.loadNotice=n.keptAside?`The saved cookbook could not be read (${n.reason}) and was kept aside; starting empty.`:`The saved cookbook could not be read (${n.reason}). Starting empty without overwriting it; import or reset to save again.`);let r=!1;if(Bn(e)&&(n.status===`loaded`&&!Q(t,`smrt-planner:cookbook-doc:backup`,JSON.stringify(n.cookbook))&&(this.saveBlocked=!0),this.apply(Hn(e)),r=!0),this.persist=n.status===`unavailable`?`memory`:`unknown`,this.loaded=!0,r){let e=this.save();this.keepLegacyUrl=!e}return r}save(){if(clearTimeout(this.timer),this.timer=void 0,!this.loaded)return!1;if(this.hostManaged)return!0;if(this.saveBlocked)return this.persist=`memory`,!1;let e=Fn(this.storage,this.snapshot());return this.persist=e?`ok`:`memory`,e&&this.previousKept&&(this.previousKept=!Pn(this.storage,An)),e&&(this.keepLegacyUrl=!1),e}scheduleSave(){this.loaded&&!this.hostManaged&&(clearTimeout(this.timer),this.timer=setTimeout(()=>this.save(),300))}flush(){this.timer!==void 0&&this.save()}};export{et as A,N as C,tt as D,ot as E,M as O,st as S,lt as T,hn as _,Mn as a,Gt as b,q as c,ln as d,cn as f,yn as g,sn as h,Z as i,j as k,dn as l,G as m,Wn as n,On as o,fn as p,$ as r,kn as s,Un as t,pn as u,Qt as v,ct as w,F as x,Kt as y};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CuWu--gG.js","./DG3qFFTE.js","./COiEfhsA.js","./xihTtKlq.js","./B93MBt1I.js","./Bq8E3AWP.js","./denq4QT7.js","../assets/currency-metadata.ksbBA8-C.css","../assets/app.V-5Q6-pe.css","./Bdd7ctp5.js","./Cekjnrta.js","../assets/feedback.DzqKT7fW.css","./DhbM87-k.js","./BaNbYf_w.js","./D3syEjNq.js","../assets/SegmentedControl.2V179a-S.css","./DmfvgI_r.js","../assets/webmcp-ui-context.D9U5lh8x.css","./BRyq6ZTQ.js","../assets/data.C5MjAC5_.css","./CUyVrfsu.js","./B18A9OMt.js","../assets/forms.CaLOi679.css","./BYcBM-fh.js","../assets/AppShell.thGpRNkw.css","./BS5gZFjG.js","../assets/workspace.DZTCJDO9.css","./CA1LxN05.js","./DJko0Z-V.js","../assets/state.DYNXOUVq.css","./DOL_dsIt.js","../assets/labels.DPtEGJlJ.css","./ChDz08Aw.js","./CTBNIJHT.js","./DwyRYrl1.js","../assets/planner.XUJWm45F.css","./D_U_DYjx.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as e,Mt as t,bt as n,vt as r}from"./DG3qFFTE.js";import{t as i}from"./BaNbYf_w.js";import"./xihTtKlq.js";import{I as a,L as o,O as s,Q as c,St as l,W as u,Z as d,_ as f,_t as p,bt as m,et as h,h as g,ht as _,p as v,x as y,yt as b}from"./B93MBt1I.js";import{v as x}from"./DhbM87-k.js";import"./D3syEjNq.js";import"./DmfvgI_r.js";import{u as S}from"./BRyq6ZTQ.js";import{$ as C,A as w,C as ee,D as te,E as ne,F as re,I as ie,L as T,M as ae,N as oe,P as se,R as ce,T as le,X as E,Y as ue,Z as de,b as fe,h as pe,j as me,k as he,n as ge,q as _e,r as ve,z as ye}from"./CA1LxN05.js";import{B as be,D as xe,G as Se,H as Ce,J as we,K as Te,M as Ee,V as De,X as Oe,Y as ke,Z as Ae,a as je,b as D,c as Me,d as Ne,l as Pe,n as Fe,r as Ie,s as Le,t as O,v as Re,x as k,z as ze}from"./DJko0Z-V.js";var Be=[`identifier`,`status`,`date`,`party`,`total`,`money`];function Ve(e){for(let t of[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`])if(e.includes(t))return t}function He(e,t,n={}){let r=new Set(n.exclude??[]),i=n.max??4,a=Object.keys(t).filter(t=>!r.has(t)&&t in e.fields),o=e=>a.find(n=>t[n]?.includes(e)),s=[],c=e=>{e&&!s.includes(e)&&s.push(e)};c(o(`identifier`)??o(`title`));for(let e of Be)e!==`identifier`&&(e===`money`&&s.some(e=>t[e]?.includes(`money`))||c(e===`date`?a.find(e=>t[e]?.includes(`date`)&&e!==`createdAt`&&e!==`updatedAt`)??o(`date`):o(e)));return s.slice(0,i).map(n=>({key:n,label:A(n,e),...Ve(t[n]??[])?{role:Ve(t[n]??[])}:{}}))}function Ue(e,t,n={}){let r=new Set(n.exclude??[]),i=Object.keys(t).filter(t=>!r.has(t)&&t in e.fields),a=i.filter(t=>e.fields[t]?.type===`text`),o=a.find(e=>/^(?:description|title|name|label)$/.test(e))??a.find(e=>t[e]?.includes(`title`))??a.find(e=>!t[e]?.includes(`identifier`)),s=i.find(e=>t[e]?.includes(`quantity`)),c=i.filter(e=>t[e]?.includes(`money`)),l=c.find(e=>/unit|price|rate/i.test(e)),u=c.find(e=>/^(?:amount|lineTotal|total|lineAmount)$/.test(e))??[...c].reverse().find(e=>e!==l),d=[];return o&&d.push({key:o,label:A(o,e)}),s&&d.push({key:s,label:A(s,e),role:`quantity`}),l&&d.push({key:l,label:A(l,e),role:`money`,summarize:!1}),u&&u!==l&&d.push({key:u,label:A(u,e),role:`money`}),d}function A(e,t){let n=t.fields[e];return n&&(n.type===`foreignKey`||n.type===`crossPackageRef`)&&/.[a-z]Id$/.test(e)?re(e.slice(0,-2)):re(e)}function We(e){if(e.dataWidgets&&e.page)return[e.page];let t=[{id:`shortcuts`,type:`shortcuts`,span:4,options:{}}];if(e.dataWidgets&&e.lead){let n=e.lead,r=e.override,i=r&&typeof r==`object`&&!Array.isArray(r)?r:void 0,a=i?.changed;a&&typeof a==`object`&&!Array.isArray(a)&&Object.hasOwn(a,`count`)&&!(Array.isArray(i?.removed)&&i.removed.includes(`count`))&&t.push({id:`count`,type:`metric`,span:1,options:{title:n.plural,model:n.id,measure:`count`}}),t.push({id:`latest`,type:`records`,span:4,options:{title:`${n.name} records`,model:n.id,limit:5,summaries:!1}})}return t}var Ge=[`text`,`integer`,`decimal`,`boolean`,`datetime`,`json`,`foreignKey`,`crossPackageRef`];function Ke(e){return Ge.includes(e)?e:`text`}var qe=/(Date|^date|period(Start|End))$/;function Je(e,t){return t.type===`datetime`&&!t.system&&qe.test(t.name)&&!e.fields.some(e=>e.name===`allDay`)?`date`:void 0}function Ye(e){return fe(e)[0]}function Xe(e,t){let n=t.ui?{...t.ui}:void 0,r=s(t)?`money`:Je(e,t);return{type:Ke(t.type),required:t.required,nullable:!t.required,...t.default===void 0?{}:{default:t.default},...t.description?{description:t.description}:{},...n?{ui:n}:{},...t.enum?.length?{enum:[...t.enum]}:{},...r?{format:r}:{},...Ye(e)===t.name?{display:!0}:{}}}function Ze(e,t){return e.includes(`:`)?e:`${t.slice(0,t.lastIndexOf(`:`))}:${e}`}function Qe(e,t){if(!t.related)return!1;let n=Ze(t.related,e.id);return ke(p,n,h).some(t=>t.id===e.id)}function $e(e){return e.fields.flatMap(t=>{if(t.type!==`foreignKey`&&t.type!==`crossPackageRef`||!t.related)return[];let n=m(Ze(t.related,e.id));return n?[{field:t.name,kind:t.type===`crossPackageRef`?`crossPackageRef`:`foreignKey`,relatedCollection:n.model.collection,...Qe(e,t)?{role:`items`}:{}}]:[]})}function j(e){let t=$e(e);return{name:e.collection,objectRef:e.id,className:e.name,idField:`id`,fields:Object.fromEntries(e.fields.map(t=>[t.name,Xe(e,t)])),...t.length?{relationships:t}:{}}}function et(e,t){return{objectRef:e.id,fields:Object.fromEntries(t.map((e,t)=>[e.name,{visibility:`basic`,label:e.label,help:e.help??null,order:t,required:e.required}]))}}function tt(e,t){let n=new Set(t);for(let t of e)for(let e of t.models)n.add(e);return n}function nt(e){return v(e.replace(/_?id$/i,``)||e)}function M(e,t,n){let r=Oe(e,t),i=new Set(e.packages.flatMap(e=>(e.recipes??[]).filter(e=>e.exposure===`ui-only`).flatMap(e=>e.models))),a=Ae(e,t).filter(e=>(e.model.exposed||i.has(e.model.id))&&n.has(e.model.id)),o=new Set(ke(e,t,h).map(e=>e.id)),s=new Map;for(let e of a)s.set(e.model.id,(s.get(e.model.id)??0)+1);let c=a.map(e=>{let t=o.has(e.model.id)?`items`:`children`,n=j(e.model),i=T(n),a=[e.fk];return{model:e.model.id,field:e.fk,label:(s.get(e.model.id)??0)>1?`${Se(e.model.name,r)} (${nt(e.fk).toLowerCase()})`:Se(e.model.name,r),kind:t,columns:t===`items`?Ue(n,i,{exclude:a}):He(n,i,{exclude:a,max:5}),...t===`items`&&`sortOrder`in n.fields?{sort:`sortOrder`}:{}}});for(let n of Te(e,t))c.push({model:n.model.id,field:n.fk,label:nt(n.fk),kind:`reference`});return c}function rt(e,t){let{sections:n}=t;if(!n)throw Error(`the cookbook widget context is missing`);let r=typeof e.section==`string`?e.section:``,i=r?n.find(e=>e.id===`section:${r}`||e.id===`custom:${r}`)?.id:t.overviewId;if(!i)throw Error(`unknown section ${r}`);return se(n,i)}function it(e){return e?async(t,n)=>{let r=rt(t,n);try{let t=await e(n,r.items.map(e=>({...e})));if(!Array.isArray(t))return r;let i=new Set,a=[];for(let e of t){if(!e||typeof e.href!=`string`)continue;let t=typeof e.id==`string`&&e.id?e.id:e.href;i.has(t)&&(t=`${t}#${a.length}`),i.add(t),a.push({...e,id:t})}return{items:a}}catch(e){if(n.signal?.aborted)throw e;return r}}:rt}var at=new Set([`foreignKey`,`crossPackageRef`]);function N(e,t){return`/m/${e}/${t}/`}function ot(e,t,n,r=`view`){let i=`${N(e,t)}${encodeURIComponent(n)}/`;return r===`edit`?`${i}edit/`:i}function st(e,t,n,r){return`${N(e,t)}?${encodeURIComponent(n)}=${encodeURIComponent(r)}`}function ct(e,t){let n=new URLSearchParams(e);for(let e of t.fields){if(!at.has(e.type))continue;let t=n.get(e.name);if(t)return{field:e.name,equals:t}}}function lt(e){return e?.equals===void 0?``:`${encodeURIComponent(e.field)}=${encodeURIComponent(e.equals)}`}var P=e=>typeof e==`number`&&Number.isSafeInteger(e)?e:null,ut=(e,t)=>e.fields.some(e=>e.name===t);function dt(e,t){let n=T(j(e)),r=ee(t,n);return Object.values(r).some(e=>P(e)!==null)?r:void 0}function ft(e,t){return!!e.fields.find(e=>e.name===`status`)?.enum?.includes(`draft`)&&typeof t.status==`string`&&t.status!==``&&t.status!==`draft`}function pt(e,t,n){if(!ft(e,t)||![`subtotal`,`taxAmount`,`totalAmount`,`discountTotal`].every(t=>ut(e,t)))return;let r=P(t.subtotal),i=P(t.taxAmount),a=P(t.totalAmount),o=P(t.discountTotal)??0;if(r===null||i===null||a===null)return;let s=d(t,`exclusive`);return{subtotal:r,discount:o,tax:i,total:a,lineAmountType:s,roundingScope:c(t,`line`),showNetSubtotal:s===`inclusive`,taxes:_(n,s).flatMap(e=>e.taxComponentId?[{taxComponentId:e.taxComponentId,name:e.name,percent:e.percent,taxable:e.taxable,tax:e.tax}]:[])}}var F=_e();function I(e){let{source:t,href:n}=e;if(!t||!n)throw Error(`the planner widget context is missing`);return{source:t,href:n}}function L(e){let t=typeof e==`string`?m(e):void 0;if(!t)throw Error(`unknown model ${String(e)}`);return{model:t.model,packageId:t.pkg.id,path:N(t.pkg.id,t.model.name)}}var R=new Set([`foreignKey`,`crossPackageRef`]);function z(e,t,n){let r=e.filter;if(typeof r!=`string`||r===``)return;if(r!==`parent`)throw Error(`unknown filter ${r}`);let{record:i}=t;if(!i?.id)throw Error(`the parent filter needs a record`);let a=typeof e.parentField==`string`&&e.parentField?e.parentField:e.field,o=typeof a==`string`?a:``,s=n.fields.find(e=>e.name===o);if(!s||!R.has(s.type))throw Error(`${n.name} has no reference field ${o}`);return{field:o,id:i.id}}async function B(e,t,n){return n?e.listWhere(t,n.field,n.id):e.list(t)}function V(e,t,n){return e(n?st(t.packageId,t.model.name,n.field,n.id):t.path)}var H=e=>typeof e==`number`&&Number.isFinite(e);async function mt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),c=await B(n,a,o),l=V(r,i,o),u=typeof e.measure==`string`?e.measure:``;if(u===`count`||u===``)return{value:c.length,format:`integer`,href:l};let d=a.fields.find(t=>t.name===e.field);if(!d||d.type!==`integer`&&d.type!==`decimal`)throw Error(`${u} needs a numeric field of ${a.name}`);let f=c.map(e=>e[d.name]).filter(H),p=0;if(f.length){if(u===`sum`||u===`avg`)p=f.reduce((e,t)=>e+t,0),u===`avg`&&(p/=f.length);else if(u===`min`)p=Math.min(...f);else if(u===`max`)p=Math.max(...f);else throw Error(`unknown measure ${u}`)}let m=s(d);return{value:m?Math.round(p):p,format:m?`money`:d.type===`integer`?`integer`:`decimal`,...m?{currency:`USD`}:{},href:l}}function ht(e,t){return H(e)&&H(t)?e-t:String(e??``).localeCompare(String(t??``))}var gt=new Set([`createdAt`,`updatedAt`]),_t=[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`];function vt(e=[]){return _t.find(t=>e.includes(t))}function yt(e,t,n,r){let i=j(e),a=r?[r]:[],o=oe(n),s=o.length?[]:pe(O.apply(e).fields.filter(t=>!a.includes(t.name)&&!xe(e,t))).filter(e=>!e.derive),c=o.length?o:s.map(e=>e.name),l=[...Ue(i,t,{exclude:a}),...He(i,t,{exclude:a,max:c.length+8})];return c.map(n=>{let r=e.fields.find(e=>e.name===n);if(!r)throw Error(`${e.name} has no field ${n}`);let i=l.find(e=>e.key===n),a=s.find(e=>e.name===n)?.label;if(i)return a?{...i,label:a}:i;let o=vt(t[n]);return{key:n,label:a??(R.has(r.type)?v(n.replace(/Id$/,``)):v(n)),...o?{role:o}:{}}})}var bt=new Set([`money`,`quantity`]);function xt(e,t){let n={};for(let r of e)(r.summarize??bt.has(r.role))&&(n[r.key]=t.reduce((e,t)=>{let n=t[r.key];return H(n)?e+n:e},0));return n}function St(e,t){let n=ie(j(e)),r=new Set(t.map(e=>n?e[n]:void 0).filter(e=>typeof e==`string`&&e!==``));return r.size===1?[...r][0]??`USD`:`USD`}async function Ct(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),s=await B(n,a,o);if(typeof e.sort==`string`&&e.sort){if(!a.fields.find(t=>t.name===e.sort)&&!gt.has(e.sort))throw Error(`${a.name} has no field ${e.sort}`);let t=s.some(t=>t[e.sort]!==void 0)?e.sort:W(a)?.name;if(t){let n=e.direction===`asc`?1:-1;s=[...s].sort((e,r)=>n*ht(e[t],r[t]))}}let c=yt(a,T(j(a)),e.columns,o?.field),l=H(e.limit)?e.limit:5,u=s.slice(0,l),d=a.fields.filter(e=>R.has(e.type)&&c.some(t=>t.key===e.name)),f=await ve(n,d,u),p=e=>Object.fromEntries(c.map(t=>{let n=e[t.key],r=d.find(e=>e.name===t.key);return r?.related&&typeof n==`string`&&n?[t.key,f.get(g(r.related,n))??``]:[t.key,n??null]})),m=xt(c,s),h=!we(a);return{rows:await Promise.all(u.map(async e=>({id:String(e.id),title:await ge(n,a,e,0,o?.field),...h?{href:r(ot(i.packageId,a.name,String(e.id)))}:{},cells:p(e)}))),...e.summaries===!1?{}:{total:s.length},...h?{href:V(r,i,o)}:{},columns:c,currency:St(a,s),...Object.keys(m).length?{summaries:m}:{}}}var wt={"7d":7,"30d":30,"90d":90,"12m":365,all:null},U=864e5;function Tt(e){return e===`7d`||e===`30d`?`day`:e===`90d`?`week`:`month`}function Et(e,t){let n=new Date(e);if(t===`month`)return Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1);let r=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate());return t===`week`?r-(n.getUTCDay()+6)%7*U:r}function Dt(e,t){if(t===`month`){let t=new Date(e);return Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,1)}return e+(t===`week`?7:1)*U}function Ot(e,t){let n=new Date(e).toISOString();return t===`month`?n.slice(0,7):n.slice(0,10)}var kt=e=>e.type===`datetime`&&!e.system;function W(e){let t=e.fields.filter(kt);return t.find(e=>/^(issue|order|start|created)/i.test(e.name))??t[0]}function At(e){if(typeof e!=`string`&&typeof e!=`number`)return;let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}async function jt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),c=typeof e.groupBy==`string`?e.groupBy:``,l=c?a.fields.find(e=>e.name===c):W(a);if(!l)throw Error(c?`${a.name} has no field ${c}`:`${a.name} has no date field to chart; choose a group-by field`);let u=typeof e.measure==`string`?e.measure:``,d;if(u&&u!==`count`){if(u!==`sum`&&u!==`avg`)throw Error(`unknown measure ${u}`);if(d=a.fields.find(t=>t.name===e.field),!d||d.type!==`integer`&&d.type!==`decimal`)throw Error(`${u} needs a numeric field of ${a.name}`)}let f=typeof e.period==`string`?e.period:`30d`;if(!Object.hasOwn(wt,f))throw Error(`unknown period ${f}`);let p=wt[f],m=kt(l),h=m?l:W(a),g=p!==null&&h?y-p*U:-1/0,_=await B(n,a,o);h&&g!==-1/0&&(_=_.filter(e=>{let t=At(e[h.name]);return t!==void 0&&t>=g&&t<=y}));let v=new Map,b=(e,t,n)=>{let r=v.get(e)??{key:t,sum:0,n:0};if(d){let e=n[d.name];if(!H(e))return;r.sum+=e}r.n+=1,v.set(e,r)},x=Tt(f);if(m){let e=g===-1/0?Math.min(..._.map(e=>At(e[l.name])??y),y):g;for(let t=Et(e,x);t<=y;t=Dt(t,x))v.set(Ot(t,x),{key:t,sum:0,n:0});for(let e of _){let t=At(e[l.name]);if(t===void 0)continue;let n=Et(t,x);b(Ot(n,x),n,e)}}else for(let e of _){let t=e[l.name],n=t==null||t===``?`(none)`:String(t);b(n,n,e)}let S=d?s(d):!1,C=e=>{if(!d)return e.n;let t=u===`avg`&&e.n?e.sum/e.n:e.sum;return S?Math.round(t):t},w=[...v.entries()].map(([e,t])=>({label:e,value:C(t),key:t.key}));return w=m?w.sort((e,t)=>Number(e.key)-Number(t.key)):w.sort((e,t)=>t.value-e.value||e.label.localeCompare(t.label)),{points:w.map(({label:e,value:t})=>({label:e,value:t})),format:d?S?`money`:d.type===`integer`?`integer`:`decimal`:`integer`,...S?{currency:`USD`}:{},href:V(r,i,o)}}te(F,{metric:mt,records:Ct,chart:jt,shortcuts:async(e,t)=>t,shortcuts:it()});function Mt(e){let{relations:t,viewAllHref:n}=e;if(!t)throw Error(`the record page context is missing`);return{relations:t,records:Ct,viewAllHref:n}}async function Nt(e,t){let{source:n}=I(e),r=e.record;if(!r?.id)throw Error(`line items need a record`);let{model:i}=L(r.model),a=await n.get(i,r.id);if(!a)return{};let o=t.find(e=>e.kind===`items`),s=o?m(o.model)?.model:void 0,c=pt(i,a,o&&s?await n.listWhere(s,o.field,r.id):[]),l=c?void 0:dt(i,a),u=ie(j(i)),d=u?a[u]:void 0;return{...c?{storedTotals:c}:{},...l?{totals:l}:{},...typeof d==`string`&&d?{currency:d}:{}}}F.register(ne((e,t)=>w(Mt(t))(e,t))),F.register(le(async(e,t)=>{let n=Mt(t),{totals:r,storedTotals:i,currency:a}=await Nt(t,n.relations);return he({...n,totals:()=>r,storedTotals:()=>i,currency:()=>a})(e,t)}));var Pt=[`shortcuts`,`metric`,`records`,`chart`,`note`],Ft={"@happyvertical/smrt-reports/svelte":async()=>({SavedReportsWidget:(await i(async()=>{let{default:e}=await import(`./CuWu--gG.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]),import.meta.url)).default})},It=async(e,t)=>{let n=Ft[e];if(n)return(await n())[t]},Lt=D.filter(e=>e.surfaces?.some(e=>e.kind===`widget`)),Rt=Lt.flatMap(e=>(e.surfaces??[]).flatMap(e=>e.kind===`widget`?[e.type]:[]));ce(F,Lt,It);var zt=new Map(ze(D).map(e=>[`section:${e.id}`,e])),Bt=p.packages.flatMap(e=>e.models.map(e=>e.id)),Vt=[...Pt,...Rt];function Ht(e){let t=zt.get(e);for(let e of t?.recipes??[]){let t=Re(e)[0];if(t)return{id:t.model.id,name:v(t.model.name)}}}function Ut(e,t){let n=ye(zt.get(e)?.recipes[0]),r=Ht(e);return We({lead:r?{...r,plural:f(r.name)}:void 0,dataWidgets:!0,page:n&&Rt.includes(n.type)?n:void 0,override:t})}var Wt=new Map;function Gt(e,t){if(!C.test(e))return;let n=Wt.get(e);return n||(n=E({id:e,allowed:Vt,models:Bt,defaults:Ut(e)}),Wt.set(e,n)),t===void 0?n:E({...n,defaults:Ut(e,t)})}function Kt(e,t){return`detail:${e}.${t}`}var qt=new Map(p.packages.flatMap(e=>e.models.filter(l).map(t=>[ae(t.id),{packageId:e.id,model:t}])));function Jt(e){let[,t,n]=/^detail:([A-Za-z0-9_-]+)\.([A-Za-z0-9_]+)$/.exec(e)??[],r=t&&n?b(t,n):void 0;return t&&r&&l(r)?{packageId:t,model:r}:qt.get(e)}var Yt=new Set(p.packages.flatMap(e=>e.models.filter(l).map(e=>e.id))),Xt=new Map;function Zt(e){let t=Xt.get(e);if(t)return t;let n=Jt(e);if(!n)return;let r=M(p,n.model.id,Yt),i=me(j(n.model),r,{id:e,maxMetrics:2*r.length});return t=E({...i,maxWidgets:Math.max(i.maxWidgets??24,i.defaults.length+24)}),Xt.set(e,t),t}function Qt(e,t){let n=Zt(e),r=Jt(e);if(!n||!r)return;let i=M(p,r.model.id,t),a=0,o=n.defaults.filter(e=>e.type===`line-items`?i.some(e=>e.kind===`items`):e.type===`related`?i.some(e=>e.kind===`children`):t.has(String(e.options.model))?e.type!==`metric`||(a+=1,a<=4):!1);return E({...n,defaults:o})}function $t(e,t){return e.startsWith(`detail:`)?Zt(e):Gt(e,t)}function en(e,t){return zt.has(e)||e===`section:${Ee.id}`?!0:e.startsWith(`detail:`)?Jt(e)!==void 0:e.startsWith(`custom:`)&&C.test(e)&&(t?.customSections??[]).some(t=>t.id===e)}var tn=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function nn(e,t){let n=t.widgetId?`widget ${t.widgetId}${t.type?` (${t.type})`:``}`:`an entry`,r=t.options?.length?`: ${t.options.map(e=>`${e.key} ${e.code}`).join(`, `)}`:``;return`Overview ${e}: ${n} was dropped (${t.code}${r}).`}function rn(e,t){let n={...e};return e.added&&(n.added=e.added.filter(e=>!t.has(e.id))),e.changed&&(n.changed=Object.fromEntries(Object.entries(e.changed).filter(([e])=>!t.has(e)))),n}function an(e,t){let n=$t(e,t);if(!n)return{override:null,issues:[{widgetId:null,type:null,code:`malformed`,message:`not an overview id`}]};let r=ue(n,t,F);if(r.ok){let e=de(t).override?.changed?.count;return e&&n.defaults.some(e=>e.id===`count`)?{override:{...r.override??{version:1},changed:{...r.override?.changed,count:e}},issues:[]}:{override:r.override,issues:[]}}let i=de(t),a=new Set(r.issues.flatMap(e=>e.widgetId?[e.widgetId]:[]));if(!i.override)return{override:null,issues:r.issues};let o=ue(n,rn(i.override,a),F);return o.ok?{override:o.override,issues:r.issues}:{override:null,issues:[...r.issues,...o.issues]}}function on(e,t){if(!tn(e))return null;let n=[],r=[];for(let i of Object.keys(e).sort()){if(!en(i,t)){r.push(`Overview ${i} is not a page in this app and was dropped.`);continue}let{override:a,issues:o}=an(i,e[i]);for(let e of o)r.push(nn(i,e));a&&n.push([i,a])}return{overviews:Object.fromEntries(n),dropped:r}}var sn=S,cn=`glass`,ln=`system`,un=[`light`,`dark`,`system`],dn=[`none`,`sm`,`md`,`lg`,`xl`,`full`],fn=[`comfortable`,`touch`],pn=[`auto`,`standard`,`more`],G={"system-ui":`system-ui, -apple-system, "Segoe UI", sans-serif`,Inter:`Inter, system-ui, sans-serif`,Georgia:`Georgia, "Times New Roman", serif`,"ui-rounded":`ui-rounded, "SF Pro Rounded", system-ui, sans-serif`,"ui-monospace":`ui-monospace, "SF Mono", Menlo, monospace`},mn=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;function hn(e){if(typeof e!=`string`)return null;let t=mn.exec(e.trim());if(!t)return null;let n=t[1].toLowerCase();return n.length===3&&(n=[...n].map(e=>e+e).join(``)),`#${n}`}var gn=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function _n(e){if(e===void 0)return{ok:!0,theme:void 0};if(!gn(e))return{ok:!1,error:`The cookbook "theme" must be an object.`};let t={};if(e.preset!==void 0){if(typeof e.preset!=`string`||!sn.includes(e.preset))return{ok:!1,error:`The theme preset must be one of ${sn.join(`, `)}.`};t.preset=e.preset}if(e.colorScheme!==void 0){if(!un.includes(e.colorScheme))return{ok:!1,error:`The theme colorScheme must be light, dark or system.`};t.colorScheme=e.colorScheme}for(let[n,r]of[[`borderRadius`,dn],[`density`,fn],[`contrast`,pn]]){let i=e[n];if(i!==void 0){if(!r.includes(i))return{ok:!1,error:`The theme ${n} must be one of ${r.join(`, `)}.`};t[n]=i}}if(e.fontFamily!==void 0){if(typeof e.fontFamily!=`string`||!Object.hasOwn(G,e.fontFamily))return{ok:!1,error:`The theme font must be one of ${Object.keys(G).join(`, `)}.`};t.fontFamily=e.fontFamily}if(e.custom!==void 0){if(!gn(e.custom))return{ok:!1,error:`The theme "custom" must be an object.`};let n=hn(e.custom.primary);if(!n)return{ok:!1,error:`The theme custom primary must be a hex colour like #c2410c.`};let r={primary:n};if(e.custom.fontFamily!==void 0){let t=e.custom.fontFamily;if(typeof t!=`string`||!Object.hasOwn(G,t))return{ok:!1,error:`The theme font must be one of ${Object.keys(G).join(`, `)}.`};r.fontFamily=t}t.custom=r}if(e.customCss!==void 0){if(typeof e.customCss!=`string`)return{ok:!1,error:`The theme customCss must be a string.`};if(Array.from(e.customCss).length>65536)return{ok:!1,error:`The theme customCss is too long (65,536 characters maximum).`};e.customCss&&(t.customCss=e.customCss)}return{ok:!0,theme:Object.keys(t).length?t:void 0}}function vn(e){if(!e)return;let t={};return e.preset&&(t.preset=e.preset),e.colorScheme&&(t.colorScheme=e.colorScheme),e.borderRadius&&(t.borderRadius=e.borderRadius),e.density&&(t.density=e.density),e.contrast&&(t.contrast=e.contrast),e.fontFamily&&(t.fontFamily=e.fontFamily),e.custom&&(t.custom={...e.custom}),e.customCss&&(t.customCss=e.customCss),Object.keys(t).length?t:void 0}function yn(e){let t=e?.colorScheme??`system`,n=e?.custom?`brand colour ${e.custom.primary}`:e?.preset??`glass`;return t===`system`?n:`${n}, ${t}`}var K=`section:`;function bn(e,t=be(D)){let n=Object.keys(t).sort((e,t)=>t.length-e.length);if(!n.length)return e;let r=e=>{if(!e.startsWith(K))return e;let r=e.slice(8);for(let e of n){if(r===e)return`${K}${t[e]}`;if(r.startsWith(`${e}:`))return`${K}${t[e]}${r.slice(e.length)}`}return e},i=e=>e.startsWith(K)&&n.includes(e.slice(8)),a=e=>[...new Set(e)],o={...e};if(e.sectionOrder&&(o.sectionOrder=a(e.sectionOrder.map(r))),e.hidden&&(o.hidden=a(e.hidden.filter(e=>!i(e)).map(r))),e.itemOrder){let t={};for(let[n,i]of Object.entries(e.itemOrder)){let e=r(n);t[e]=a([...t[e]??[],...i.map(r)])}o.itemOrder=t}return e.moved&&(o.moved=Object.fromEntries(Object.entries(e.moved).map(([e,t])=>[r(e),r(t)]))),o}function xn(e,t=D){let n=new Map;for(let e of t){let t=Ce(e).id;for(let r of Re(e))r.key&&n.set(`${K}${t}:${r.packageId}:${r.model.name}:${r.label}`,De(r.packageId,r.model.name,r.key))}let r=e=>{let t=n.get(e);if(t)return t;if(!e.startsWith(K))return e;let r=e.slice(8).split(`:`);return r.length<3||!r[1]||!r[2]?e:De(r[1],r[2])},i=e=>[...new Set(e)],a=(e,t)=>{let n={};for(let[i,a]of Object.entries(e)){let e=r(i);e in n||(n[e]=t(a))}return n},o={...e};return e.hidden&&(o.hidden=i(e.hidden.map(r))),e.itemOrder&&(o.itemOrder=a(e.itemOrder,e=>i(e.map(r)))),e.moved&&(o.moved=a(e.moved,r)),e.items&&(o.items=a(e.items,e=>e)),o}var q=`https://s-m-r-t.dev/schemas/cookbook/v1.json`,Sn=new Set([`basic`,`advanced`,`hidden`]),Cn=new Set([`api`,`mcp`,`cli`]),J=e=>({ok:!1,error:e}),Y=e=>typeof e==`object`&&!!e&&!Array.isArray(e),X=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`);function wn(e,t){if(!Y(e))return`${t} is not an object`;let{objectRef:n,fieldName:r}=e;if(typeof n!=`string`||!n)return`${t} has no objectRef`;if(typeof r!=`string`||!r)return`${t} has no fieldName`;if(e.scopeType!==`app`)return`${t} must have scopeType "app"`;let i={objectRef:n,fieldName:r,scopeType:`app`};for(let n of[`defaultValue`,`help`,`label`]){let r=e[n];if(r!==void 0){if(typeof r!=`string`&&r!==null)return`${t}.${n} is invalid`;i[n]=r}}if(e.visibility!==void 0){let n=e.visibility;if(n!==null&&!(typeof n==`string`&&Sn.has(n)))return`${t}.visibility is invalid`;i.visibility=n}if(e.displayOrder!==void 0){let n=e.displayOrder;if(n!==null&&!(typeof n==`number`&&Number.isFinite(n)))return`${t}.displayOrder is invalid`;i.displayOrder=n}if(e.locked!==void 0){if(e.locked!==null&&typeof e.locked!=`boolean`)return`${t}.locked is invalid`;i.locked=e.locked}return i}function Tn(e){if(!Y(e)||e.version!==1)return`layout must be an object with version 1`;for(let t of[`sectionOrder`,`hidden`])if(e[t]!==void 0&&!X(e[t]))return`layout.${t} must be a list of strings`;for(let t of[`itemOrder`,`moved`,`panels`])if(e[t]!==void 0&&!Y(e[t]))return`layout.${t} must be an object`;let t=e.itemOrder;if(Y(t)){for(let[e,n]of Object.entries(t))if(e===`__proto__`||!X(n))return`layout.itemOrder.${e} must be a list of strings`}let n=e.moved;if(Y(n)){for(let[e,t]of Object.entries(n))if(e===`__proto__`||typeof t!=`string`)return`layout.moved.${e} must be a string`}return e}function En(e,t={}){if(!Y(e))return J(`This is not a cookbook: expected a JSON object.`);if(e.$schema!==void 0&&e.$schema!==`https://s-m-r-t.dev/schemas/cookbook/v1.json`&&e.$schema!==`https://s-m-r-t.dev/schemas/blueprint/v1.json`)return J(`This is not a cookbook: its "$schema" is not a cookbook schema this planner knows.`);let{version:n}=e;if(n===void 0)return J(`This is not a cookbook: it has no "version".`);if(typeof n!=`number`||!Number.isInteger(n))return J(`The cookbook "version" must be a whole number.`);if(n>1)return J(`This cookbook is version ${n}, newer than this planner understands (1). Update the planner or re-export it.`);if(n!==1)return J(`Cookbook version ${n} is not supported (this planner reads version 1).`);if(!X(e.recipes))return J(`The cookbook "recipes" must be a list of recipe ids.`);let r=e.recipes.filter(e=>!k.has(e)),i=[...new Set([...je(e.recipes.filter(e=>k.has(e)),k),...r])].sort(),a=[];if(e.features!==void 0){if(!X(e.features))return J(`The cookbook "features" must be a list of model names.`);let t=new Set;for(let n of e.features){if(t.has(n))return J(`The cookbook lists the feature ${n} more than once.`);t.add(n)}a=[...e.features].sort()}let o=new Set([...i.flatMap(e=>k.get(e)?.models??[]),...a]);if(!Array.isArray(e.policies))return J(`The cookbook "policies" must be a list.`);let s=[];for(let[t,n]of e.policies.entries()){let e=wn(n,`policies[${t}]`);if(typeof e==`string`)return J(`Invalid cookbook: ${e}.`);(o.has(e.objectRef)||Me(e))&&s.push(e)}let c;if(e.exposure!==void 0){if(!Y(e.exposure))return J(`The cookbook "exposure" must be an object.`);let t=[];for(let[n,r]of Object.entries(e.exposure)){if(!X(r)||!r.every(e=>Cn.has(e)))return J(`Invalid cookbook: exposure for ${n} must list api, mcp or cli.`);r.length&&o.has(n)&&t.push([n,[...r]])}c=Object.fromEntries(t)}let l;if(e.layout!==void 0){let t=Tn(e.layout);if(typeof t==`string`)return J(`Invalid cookbook: ${t}.`);l=xn(bn(t))}let u;if(e.theme!==void 0){let n=_n(e.theme);if(n.ok)u=n.theme;else if(!t.dropUnknownRecipes)return J(n.error)}let d,f=[];if(e.overviews!==void 0){if(t.overviews){let n=t.overviews(e.overviews,l);if(!n)return J(`The cookbook "overviews" must be an object.`);d=n.overviews,f=n.dropped}else{if(!Y(e.overviews))return J(`The cookbook "overviews" must be an object.`);Object.keys(e.overviews).length&&(f=[`Page customisations (overviews) are not kept by this host and were dropped.`])}}let p={$schema:q,version:1,recipes:i,features:a,policies:s};for(let t of[`name`,`description`]){let n=e[t];if(n!==void 0){if(typeof n!=`string`)return J(`The cookbook "${t}" must be a string.`);n.trim()&&(p[t]=n.trim())}}if(e.specs!==void 0){if(typeof e.specs!=`string`)return J(`The cookbook "specs" must be a string.`);e.specs.trim()&&(p.specs=e.specs.trim())}return c&&Object.keys(c).length&&(p.exposure=c),l&&(p.layout=l),u&&(p.theme=u),d&&Object.keys(d).length&&(p.overviews=d),f.length?{ok:!0,cookbook:p,dropped:f}:{ok:!0,cookbook:p}}var Dn=e=>({ok:!1,error:e});function On(e,t={}){return En(e,{...t,overviews:on})}function kn(e,t={}){let n;try{n=JSON.parse(e)}catch{return Dn(`This file is not valid JSON.`)}try{return On(n,t)}catch{return Dn(`This file is not a valid cookbook.`)}}var Z=`smrt-planner:cookbook-doc:v1`,An=`smrt-planner:blueprint:v1`,jn=`smrt-planner:cookbook-doc:unreadable`;function Mn(){try{return globalThis.localStorage??null}catch{return null}}function Nn(e){if(!e)return{status:`unavailable`};let t;try{t=e.getItem(Z)}catch{return{status:`unavailable`}}let n=null;try{n=e.getItem(An)}catch{}let r=t===null&&n!==null,i=r?n:t;if(i===null)return{status:`empty`};let a=kn(i,{dropUnknownRecipes:!0});if(a.ok)return r&&Q(e,Z,JSON.stringify(a.cookbook)),{status:`loaded`,cookbook:a.cookbook,previousKept:n!==null,...a.dropped?{dropped:a.dropped}:{}};t=i;let o=Q(e,jn,t);return{status:`unreadable`,reason:a.error,keptAside:o}}function Q(e,t,n){if(!e)return!1;try{return e.setItem(t,n),!0}catch{return!1}}function Pn(e,t){if(!e)return!1;try{return e.removeItem(t),!0}catch{return!1}}function Fn(e,t){return Q(e,Z,JSON.stringify(t))}function In(e,t={}){let n={$schema:q,version:1,...Fe(e)};t.name&&(n.name=t.name),t.description&&(n.description=t.description),t.specs&&(n.specs=t.specs),t.layout&&(n.layout=t.layout);let r=vn(t.theme);r&&(n.theme=r);let i=t.overviews??{},a=Object.keys(i).sort();return a.length&&(n.overviews=Object.fromEntries(a.map(e=>[e,i[e]]))),n}var Ln=new Set([`basic`,`advanced`,`hidden`]),Rn=new Set([`api`,`mcp`,`cli`]);function zn(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t+`=`.repeat((4-t.length%4)%4));return new TextDecoder().decode(Uint8Array.from(n,e=>e.charCodeAt(0)))}function Bn(e){let t=new URLSearchParams(e);return t.has(`r`)||t.has(`o`)}function Vn(e){let t={rows:[],narrowed:{}};if(!e)return t;let n;try{n=JSON.parse(zn(e))}catch{return t}if(!n||typeof n!=`object`)return t;let r=[];for(let[e,t]of Object.entries(n.r??{}))if(t&&typeof t==`object`)for(let[n,i]of Object.entries(t)){if(!i||typeof i!=`object`)continue;let t={objectRef:e,fieldName:n,scopeType:`app`};typeof i.v==`string`&&Ln.has(i.v)&&(t.visibility=i.v),typeof i.l==`string`&&(t.label=i.l),(typeof i.h==`string`||i.h===null)&&(t.help=i.h),(typeof i.d==`string`||i.d===null)&&(t.defaultValue=i.d),typeof i.o==`number`&&Number.isFinite(i.o)&&(t.displayOrder=i.o),typeof i.k==`boolean`&&(t.locked=i.k),r.push(t)}let i={};for(let[e,t]of Object.entries(n.x??{})){if(!Array.isArray(t))continue;let n=t.filter(e=>Rn.has(e));n.length&&(i[e]=n)}return{rows:r,narrowed:i}}function Hn(e){let t=new URLSearchParams(e),n=(t.get(`r`)??``).split(`,`).filter(Boolean),r=je(Ie(n,k),k),i=new Set(r.flatMap(e=>k.get(e)?.models??[])),{rows:a,narrowed:o}=Vn(t.get(`o`)??``),s={$schema:q,version:1,recipes:r,features:[],policies:a.filter(e=>i.has(e.objectRef))},c=Object.fromEntries(Object.entries(o).filter(([e])=>i.has(e)));return Object.keys(c).length&&(s.exposure=c),s}var Un=`smrt-planner:shell`;function $(e){let t=Pe(e),n=e.policies.some(e=>e.defaultValue!==void 0&&Me(e));o(Le(e)||n?t.taxRate:void 0),a({pricesIncludeTax:t.pricesIncludeTax,taxRounding:t.taxRounding,currency:t.currency})}var Wn=new class{#e=n(0);get replacementGeneration(){return e(this.#e)}set replacementGeneration(e){r(this.#e,e,!0)}#t=n();get layout(){return e(this.#t)}set layout(e){r(this.#t,e,!0)}#n=n();get name(){return e(this.#n)}set name(e){r(this.#n,e,!0)}#r=n();get description(){return e(this.#r)}set description(e){r(this.#r,e,!0)}#i=n();get specs(){return e(this.#i)}set specs(e){r(this.#i,e,!0)}#a=n();get theme(){return e(this.#a)}set theme(e){r(this.#a,e,!0)}#o=n({});get overviews(){return e(this.#o)}set overviews(e){r(this.#o,e)}#s=n(`unknown`);get persist(){return e(this.#s)}set persist(e){r(this.#s,e,!0)}#c=n(!1);get loaded(){return e(this.#c)}set loaded(e){r(this.#c,e,!0)}hostManaged=!1;#l=n(``);get loadNotice(){return e(this.#l)}set loadNotice(e){r(this.#l,e,!0)}saveBlocked=!1;#u=n(!1);get keepLegacyUrl(){return e(this.#u)}set keepLegacyUrl(e){r(this.#u,e,!0)}replacedBeforeLoad=!1;previousKept=!1;storage=null;timer;snapshot(){return In(t(O.data),{layout:t(this.layout),theme:t(this.theme),overviews:t(this.overviews),name:this.name,description:this.description,specs:this.specs})}overview(e){return Object.hasOwn(this.overviews,e)?this.overviews[e]:null}setOverview(e,t){let n=Object.fromEntries(Object.entries(this.overviews).filter(([t])=>t!==e));t&&(n[e]=t),this.overviews=n}setLayout(e){this.layout=x(e)?void 0:e}setSpecs(e){let t=e.trimEnd();this.specs=t.trim()?t:void 0}apply(e){O.load(e),this.layout=e.layout,this.theme=e.theme,this.name=e.name,this.description=e.description,this.specs=e.specs,this.overviews={...e.overviews??{}},$(e)}get unavailableNotice(){let e=[...O.unavailableRecipes,...O.unavailableFeatures];if(!e.length)return``;let t=e.length;return`${t} ${t===1?`recipe`:`recipes`} in this cookbook ${t===1?`isn't`:`aren't`} available in this version: ${e.join(`, `)}. They are kept when you save or export.`}removeUnavailable(){O.removeUnavailable(),this.scheduleSave()}setTheme(e){this.theme=vn(e)}settings(){return Pe(this.snapshot())}setSettings(e){let t=Ne(this.snapshot(),e);O.rows=t.policies.map(e=>({...e})),$(t)}replace(e){this.replacementGeneration++,this.apply(e),this.loaded||(this.replacedBeforeLoad=!0),this.saveBlocked=!1,this.keepLegacyUrl=!1}reset(e={}){this.replacementGeneration++,O.clear(),$({policies:[]}),this.layout=void 0,e.preserveTheme||(this.theme=void 0),this.name=void 0,this.description=void 0,this.specs=void 0,this.overviews={},this.saveBlocked=!1,this.keepLegacyUrl=!1}importText(e){let t=kn(e);return t.ok&&this.replace(t.cookbook),t}hydrate(e,t=u()){this.storage=t;let n=Nn(t);n.status===`loaded`&&(this.previousKept=n.previousKept),n.status===`loaded`&&!this.replacedBeforeLoad?(this.apply(n.cookbook),n.dropped?.length&&(this.loadNotice=`Some saved page customisations could not be used and were removed: ${n.dropped.join(` `)}`)):n.status===`unreadable`&&(this.saveBlocked=!n.keptAside,this.loadNotice=n.keptAside?`The saved cookbook could not be read (${n.reason}) and was kept aside; starting empty.`:`The saved cookbook could not be read (${n.reason}). Starting empty without overwriting it; import or reset to save again.`);let r=!1;if(Bn(e)&&(n.status===`loaded`&&!Q(t,`smrt-planner:cookbook-doc:backup`,JSON.stringify(n.cookbook))&&(this.saveBlocked=!0),this.apply(Hn(e)),r=!0),this.persist=n.status===`unavailable`?`memory`:`unknown`,this.loaded=!0,r){let e=this.save();this.keepLegacyUrl=!e}return r}save(){if(clearTimeout(this.timer),this.timer=void 0,!this.loaded)return!1;if(this.hostManaged)return!0;if(this.saveBlocked)return this.persist=`memory`,!1;let e=Fn(this.storage,this.snapshot());return this.persist=e?`ok`:`memory`,e&&this.previousKept&&(this.previousKept=!Pn(this.storage,An)),e&&(this.keepLegacyUrl=!1),e}scheduleSave(){this.loaded&&!this.hostManaged&&(clearTimeout(this.timer),this.timer=setTimeout(()=>this.save(),300))}flush(){this.timer!==void 0&&this.save()}};export{et as A,N as C,tt as D,ot as E,M as O,st as S,lt as T,hn as _,Mn as a,Gt as b,q as c,ln as d,cn as f,yn as g,sn as h,Z as i,j as k,dn as l,G as m,Wn as n,On as o,fn as p,$ as r,kn as s,Un as t,pn as u,Qt as v,ct as w,F as x,Kt as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./DG3qFFTE.js";import"./xihTtKlq.js";import"./B93MBt1I.js";import"./DhbM87-k.js";import"./D3syEjNq.js";import"./BS5gZFjG.js";import"./B18A9OMt.js";function e(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}export{e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,bt as t,c as n,et as r,nt as i,r as a,t as o,tt as s,vt as c}from"./DG3qFFTE.js";import{i as l,n as u,r as d,t as f}from"./Dt-HX3Vu.js";new URL(`sveltekit-internal://`);function p(e,t){return e===`/`||t===`ignore`?e:t===`never`?e.endsWith(`/`)?e.slice(0,-1):e:t===`always`&&!e.endsWith(`/`)?e+`/`:e}function ee(e){return e.split(`%25`).map(decodeURI).join(`%25`)}function te(e){for(let t in e)e[t]=decodeURIComponent(e[t]);return e}function m({href:e}){return e.split(`#`)[0]}function h(e,t,n,r=!1){let i=new URL(e);Object.defineProperty(i,"searchParams",{value:new Proxy(i.searchParams,{get(e,r){if(r===`get`||r===`getAll`||r===`has`)return(t,...i)=>(n(t),e[r](t,...i));t();let i=Reflect.get(e,r);return typeof i==`function`?i.bind(e):i}}),enumerable:!0,configurable:!0});let a=[`href`,`pathname`,`search`,`toString`,`toJSON`];r&&a.push(`hash`);for(let n of a)Object.defineProperty(i,n,{get(){return t(),e[n]},enumerable:!0,configurable:!0});return i}function g(){}function ne(...e){let t=5381;for(let n of e)if(typeof n==`string`){let e=n.length;for(;e;)t=t*33^n.charCodeAt(--e)}else if(ArrayBuffer.isView(n)){let e=new Uint8Array(n.buffer,n.byteOffset,n.byteLength),r=e.length;for(;r;)t=t*33^e[--r]}else throw TypeError(`value must be a string or TypedArray`);return(t>>>0).toString(36)}var re=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||`GET`)!==`GET`&&_.delete(ie(e)),re(e,t));var _=new Map;function v(e,t){let n=ie(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:e,...t}=JSON.parse(r.textContent);r.getAttribute(`data-b64`)!==null&&(e=f(e));let i=r.getAttribute(`data-ttl`);return i&&_.set(n,{body:e,init:t,ttl:1e3*Number(i)}),Promise.resolve(new Response(e,t))}return window.fetch(e,t)}function y(e,t,n){if(_.size>0){let t=ie(e,n),r=_.get(t);if(r){if(performance.now()<r.ttl&&[`default`,`force-cache`,`only-if-cached`,void 0].includes(n?.cache))return new Response(r.body,r.init);_.delete(t)}}return window.fetch(t,n)}function ie(e,t){let n=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){let e=[];t.headers&&e.push([...new Headers(t.headers)].join(`,`)),t.body&&(typeof t.body==`string`||ArrayBuffer.isView(t.body))&&e.push(t.body),n+=`[data-hash="${ne(...e)}"]`}return n}var b=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/,ae=/^\/\((?:[^)]+)\)$/;function oe(e){let t=[];return{pattern:e===`/`||ae.test(e)?/^\/$/:RegExp(`^${ce(e).map(e=>{let n=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(e);if(n)return t.push({name:n[1],matcher:n[2],optional:!1,rest:!0,chained:!0}),`(?:/([^]*))?`;let r=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(e);if(r)return t.push({name:r[1],matcher:r[2],optional:!0,rest:!1,chained:!0}),`(?:/([^/]+))?`;if(!e)return;let i=e.split(/\[(.+?)\](?!\])/);return`/`+i.map((e,n)=>{if(n%2){if(e.startsWith(`x+`))return ue(String.fromCharCode(parseInt(e.slice(2),16)));if(e.startsWith(`u+`))return ue(String.fromCharCode(...e.slice(2).split(`-`).map(e=>parseInt(e,16))));let[,r,a,o,s]=b.exec(e);return t.push({name:o,matcher:s,optional:!!r,rest:!!a,chained:a?n===1&&i[0]===``:!1}),a?`([^]*?)`:r?`([^/]*)?`:`([^/]+?)`}return ue(e)}).join(``)}).join(``)}/?$`),params:t}}function se(e){return e!==``&&!/^\([^)]+\)$/.test(e)}function ce(e){return e.slice(1).split(`/`).filter(se)}function le(e,t,n){let r={},i=e.slice(1),a=i.filter(e=>e!==void 0),o=0;for(let e=0;e<t.length;e+=1){let s=t[e],c=i[e-o];if(s.chained&&s.rest&&o&&(c=i.slice(e-o,e+1).filter(e=>e).join(`/`),o=0),c===void 0){if(s.rest)c=``;else continue}if(!s.matcher||n[s.matcher](c)){r[s.name]=c;let n=t[e+1],l=i[e+1];n&&!n.rest&&n.optional&&l&&s.chained&&(o=0),!n&&!l&&Object.keys(r).length===a.length&&(o=0)}else if(s.optional&&s.chained)o++;else return}if(!o)return r}function ue(e){return e.normalize().replace(/[[\]]/g,`\\$&`).replace(/%/g,`%25`).replace(/\//g,`%2[Ff]`).replace(/\?/g,`%3[Ff]`).replace(/#/g,`%23`).replace(/[.*+?^${}()|\\]/g,`\\$&`)}function de({nodes:e,server_loads:t,dictionary:n,matchers:r}){let i=new Set(t);return Object.entries(n).map(([t,[n,i,s]])=>{let{pattern:c,params:l}=oe(t),u={id:t,exec:e=>{let t=c.exec(e);if(t)return le(t,l,r)},errors:[1,...s||[]].map(t=>e[t]),layouts:[0,...i||[]].map(o),leaf:a(n)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function a(t){let n=t<0;return n&&(t=~t),[n,e[t]]}function o(t){return t===void 0?t:[i.has(t),e[t]]}}function fe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function pe(e,t,n=JSON.stringify){let r=n(t);try{sessionStorage[e]=r}catch{}}var x=globalThis.__sveltekit_z88j6g?.base??``,me=globalThis.__sveltekit_z88j6g?.assets??x??``,he=`1795040983427`,ge=`sveltekit:snapshot`,_e=`sveltekit:scroll`,ve=`sveltekit:states`,ye=`sveltekit:pageurl`,S=`sveltekit:history`,C=`sveltekit:navigation`,w={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},be=location.origin;function T(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){let e=document.getElementsByTagName(`base`);t=e.length?e[0].href:document.URL}return new URL(e,t)}function E(){return{x:pageXOffset,y:pageYOffset}}function D(e,t){return e.getAttribute(`data-sveltekit-${t}`)}var xe={...w,"":w.hover};function Se(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Ce(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()===`A`&&e.hasAttribute(`href`))return e;e=Se(e)}}function we(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){let e=location.hash.split(`#`)[1]||`/`;r.hash=`#${e}${r.hash}`}}catch{}let i=e instanceof SVGAElement?e.target.baseVal:e.target,a=!r||!!i||k(r,t,n)||(e.getAttribute(`rel`)||``).split(/\s+/).includes(`external`),o=r?.origin===be&&e.hasAttribute(`download`);return{url:r,external:a,target:i,download:o}}function O(e){let t=null,n=null,r=null,i=null,a=null,o=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=D(s,`preload-code`)),i===null&&(i=D(s,`preload-data`)),t===null&&(t=D(s,`keepfocus`)),n===null&&(n=D(s,`noscroll`)),a===null&&(a=D(s,`reload`)),o===null&&(o=D(s,`replacestate`)),s=Se(s);function c(e){switch(e){case``:case`true`:return!0;case`off`:case`false`:return!1;default:return}}return{preload_code:xe[r??`off`],preload_data:xe[i??`off`],keepfocus:c(t),noscroll:c(n),reload:c(a),replace_state:c(o)}}function Te(e){let t=n(e),r=!0;function i(){r=!0,t.update(e=>e)}function a(e){r=!1,t.set(e)}function o(e){let n;return t.subscribe(t=>{(n===void 0||r&&t!==n)&&e(n=t)})}return{notify:i,set:a,subscribe:o}}var Ee={v:g};function De(){let{set:e,subscribe:t}=n(!1),r;async function i(){clearTimeout(r);try{let t=await fetch(`${me}/_app/version.json`,{headers:{pragma:`no-cache`,"cache-control":`no-cache`}});if(!t.ok)return!1;let n=(await t.json()).version!==he;return n&&(e(!0),Ee.v(),clearTimeout(r)),n}catch{return!1}}return{subscribe:t,check:i}}function k(e,t,n){return e.origin!==be||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function Oe(e){}Uint8Array.fromBase64,typeof process==`object`&&process.versions?.node,Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,`byteLength`).get,typeof SharedArrayBuffer>`u`||Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,`byteLength`).get;var ke=new Set([`load`,`prerender`,`csr`,`ssr`,`trailingSlash`,`config`]);[...ke],[...new Set([...ke])];function Ae(e){return e.filter(e=>e!=null)}function A(e,t){return e+`/`+t}function je(e){return e instanceof u||e instanceof l?e.status:500}function Me(e){return e instanceof l?e.text:`Internal Error`}var j,M,Ne,Pe=a.toString().includes(`$$`)||/function \w+\(\) \{\}/.test(a.toString()),Fe=`a:`;Pe?(j={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Fe)},M={current:null},Ne={current:!1}):(j=new class{#e=t({});get data(){return e(this.#e)}set data(e){c(this.#e,e)}#t=t(null);get form(){return e(this.#t)}set form(e){c(this.#t,e)}#n=t(null);get error(){return e(this.#n)}set error(e){c(this.#n,e)}#r=t({});get params(){return e(this.#r)}set params(e){c(this.#r,e)}#i=t({id:null});get route(){return e(this.#i)}set route(e){c(this.#i,e)}#a=t({});get state(){return e(this.#a)}set state(e){c(this.#a,e)}#o=t(-1);get status(){return e(this.#o)}set status(e){c(this.#o,e)}#s=t(new URL(Fe));get url(){return e(this.#s)}set url(e){c(this.#s,e)}},M=new class{#e=t(null);get current(){return e(this.#e)}set current(e){c(this.#e,e)}},Ne=new class{#e=t(!1);get current(){return e(this.#e)}set current(e){c(this.#e,e)}},Ee.v=()=>Ne.current=!0);function Ie(e){Object.assign(j,e)}var Le={spanContext(){return Re},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},Re={traceId:``,spanId:``,traceFlags:0},{onMount:ze,tick:Be}=o,Ve=i??(e=>e()),He=new Set([`icon`,`shortcut icon`,`apple-touch-icon`]),N=null,P=fe(`sveltekit:scroll`)??{},F=fe(`sveltekit:snapshot`)??{},I={url:Te({}),page:Te({}),navigating:n(null),updated:De()};function L(e){P[e]=E()}function Ue(e,t){let n=e+1;for(;P[n];)delete P[n],n+=1;for(n=t+1;F[n];)delete F[n],n+=1}function R(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(g)}async function We(){if(`serviceWorker`in navigator){let e=await navigator.serviceWorker.getRegistration(x||`/`);e&&await e.update()}}var Ge,Ke,z,B,qe,V,Je={},Ye={},Xe=[],Ze=[],H=null;function Qe(){H?.fork?.then(e=>e?.discard()),H=null,Z={element:void 0,href:void 0}}var $e=new Map,et=new Set,tt=new Set,U=new Set,W={branch:[],error:null,url:null,nav:null},nt=!1,rt=!1,it=!0,G=!1,K=!1,at=!1,ot=!1,st,q,J,Y,ct=new Set,lt=new Map,ut=new Map;async function dt(e,t,n){if(globalThis.__sveltekit_z88j6g.data){let{q:e={},p:t={},l:n={},f:r={}}=globalThis.__sveltekit_z88j6g.data;for(let t in e)Je[t]=e[t];for(let e in n)Je[e]=n[e];for(let e in r)Je[e]=r[e];for(let e in t)Ye[e]=t[e]}document.URL!==location.href&&(location.href=location.href),V=e,await e.hooks.init?.(),Ge=de(e),B=document.documentElement,qe=t,Ke=e.nodes[0],z=e.nodes[1],Ke(),z(),q=history.state?.[S],J=history.state?.[C],q||(q=J=Date.now(),history.replaceState({...history.state,[S]:q,[C]:J},``));let r=P[q];function i(){r&&(history.scrollRestoration=`manual`,scrollTo(r.x,r.y))}n?(i(),await Gt(qe,n)):(await X({type:`enter`,url:T(V.hash?Xt(new URL(location.href)):location.href),replace_state:!0}),i()),Wt()}function ft(){Xe.length=0,ot=!1}function pt(e){Ze.some(e=>e?.snapshot)&&(F[e]=Ze.map(e=>e?.snapshot?.capture()))}function mt(e){F[e]?.forEach((e,t)=>{Ze[t]?.snapshot?.restore(e)})}function ht(){L(q),pe(_e,P),pt(J),pe(ge,F)}async function gt(e,t,n,r){let i,a;t.invalidateAll&&Qe(),await X({type:`goto`,url:T(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{if(t.invalidateAll){ot=!0,i=new Set;for(let[e,t]of lt)for(let[n,r]of t)r.resource?.reset(),i.add(A(e,n));a=new Set;for(let[e,t]of ut)for(let n of t.keys())a.add(A(e,n))}t.invalidate&&t.invalidate.forEach(Vt)}}),t.invalidateAll&&s().then(s).then(()=>{for(let[e,t]of lt)for(let[n,{resource:r}]of t)i?.has(A(e,n))&&r.start();for(let[e,t]of ut)for(let[n,{resource:r}]of t)a?.has(A(e,n))&&r.reconnect()})}async function _t(e){if(e.id!==H?.id){Qe();let t={};ct.add(t),H={id:e.id,token:t,promise:Dt({...e,preload:t}).then(e=>(ct.delete(t),e.type===`loaded`&&e.state.error&&Qe(),e)),fork:null}}return H.promise}async function vt(e){let t=(await jt(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(e=>e[1]()))}async function yt(e,t,n){let r={params:W.params,route:{id:W.route?.id??null},url:new URL(location.href)};if(W={...e.state,nav:r},Ie(e.props.page),st=new V.root({target:t,props:{...e.props,stores:I,components:Ze},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),n){let e={from:null,to:{...r,scroll:P[q]??E()},willUnload:!1,type:`enter`,complete:Promise.resolve()};U.forEach(t=>t(e))}mt(J),rt=!0}async function bt({url:e,params:t,branch:n,errors:r,status:i,error:a,route:o,form:s}){let c=`never`;if(x&&(e.pathname===x||e.pathname===x+`/`))c=`always`;else for(let e of n)e?.slash!==void 0&&(c=e.slash);e.pathname=p(e.pathname,c),e.search=e.search;let l={type:`loaded`,state:{url:e,params:t,branch:n,error:a,route:o},props:{constructors:Ae(n).map(e=>e.node.component),page:$(j)}};s!==void 0&&(l.props.form=s);let u={},d=!j,f=0;for(let e=0;e<Math.max(n.length,W.branch.length);e+=1){let t=n[e],r=W.branch[e];t?.data!==r?.data&&(d=!0),t&&(u={...u,...t.data},d&&(l.props[`data_${f}`]=u),f+=1)}return(!W.url||e.href!==W.url.href||W.error!==a||s!==void 0&&s!==j.form||d)&&(l.props.page={error:a,params:t,route:{id:o?.id??null},state:{},status:i,url:new URL(e),form:s??null,data:d?u:j.data}),l}async function xt({loader:e,parent:t,url:n,params:r,route:i,server_data_node:a}){let o=null,s=!0,c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();if(l.universal?.load){function e(...e){for(let t of e){let{href:e}=new URL(t,n);c.dependencies.add(e)}}let u={tracing:{enabled:!1,root:Le,current:Le},route:new Proxy(i,{get:(e,t)=>(s&&(c.route=!0),e[t])}),params:new Proxy(r,{get:(e,t)=>(s&&c.params.add(t),e[t])}),data:a?.data??null,url:h(n,()=>{s&&(c.url=!0)},e=>{s&&c.search_params.add(e)},V.hash),async fetch(t,r){t instanceof Request&&(r={body:t.method===`GET`||t.method===`HEAD`?void 0:await t.blob(),cache:t.cache,credentials:t.credentials,headers:[...t.headers].length>0?t?.headers:void 0,integrity:t.integrity,keepalive:t.keepalive,method:t.method,mode:t.mode,redirect:t.redirect,referrer:t.referrer,referrerPolicy:t.referrerPolicy,signal:t.signal,...r});let{resolved:i,promise:a}=St(t,r,n);return s&&e(i.href),a},setHeaders:g,depends:e,parent(){return s&&(c.parent=!0),t()},untrack(e){s=!1;try{return e()}finally{s=!0}}};o=await l.universal.load.call(null,u)??null}return{node:l,loader:e,server:a,universal:l.universal?.load?{type:`data`,data:o,uses:c}:null,data:o??a?.data??null,slash:l.universal?.trailingSlash??a?.slash}}function St(e,t,n){let r=e instanceof Request?e.url:e,i=new URL(r,n);return i.origin===n.origin&&(r=i.href.slice(n.origin.length)),{resolved:i,promise:rt?y(r,i.href,t):v(r,t)}}function Ct(e,t,n,r,i,a){if(ot)return!0;if(!i)return!1;if(i.parent&&e||i.route&&t||i.url&&n)return!0;for(let e of i.search_params)if(r.has(e))return!0;for(let e of i.params)if(a[e]!==W.params[e])return!0;for(let e of i.dependencies)if(Xe.some(t=>t(new URL(e))))return!0;return!1}function wt(e,t){return e?.type===`data`?e:e?.type===`skip`?t??null:null}function Tt(e,t){if(!e)return new Set(t.searchParams.keys());let n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(let r of n){let i=e.searchParams.getAll(r),a=t.searchParams.getAll(r);i.every(e=>a.includes(e))&&a.every(e=>i.includes(e))&&n.delete(r)}return n}function Et({error:e,url:t,route:n,params:r}){return{type:`loaded`,state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:$(j),constructors:[]}}}async function Dt({id:e,invalidating:t,url:n,params:r,route:i,preload:a}){if(H?.id===e)return ct.delete(H.token),H.promise;let{errors:o,layouts:s,leaf:c}=i,l=[...s,c];o.forEach(e=>e?.().catch(g)),l.forEach(e=>e?.[1]().catch(g));let f=W.url?e!==Nt(W.url):!1,p=W.route?i.id!==W.route.id:!1,ee=Tt(W.url,n),te=!1,m=l.map(async(e,t)=>{if(!e)return;let a=W.branch[t];return e[1]===a?.loader&&!Ct(te,p,f,ee,a.universal?.uses,r)?a:(te=!0,xt({loader:e[1],url:n,params:r,route:i,parent:async()=>{let e={};for(let n=0;n<t;n+=1)Object.assign(e,(await m[n])?.data);return e},server_data_node:wt(e[0]?{type:`skip`}:null,e[0]?a?.server:void 0)}))});for(let e of m)e.catch(g);let h=[];for(let e=0;e<l.length;e+=1)if(l[e])try{h.push(await m[e])}catch(t){if(t instanceof d)return{type:`redirect`,location:t.location};if(a&&ct.has(a))return Et({error:await Q(t,{params:r,url:n,route:{id:i.id}}),url:n,params:r,route:i});let s=je(t),c;if(t instanceof u)c=t.body;else{if(await I.updated.check())return await We(),await R(n);c=await Q(t,{params:r,url:n,route:{id:i.id}})}let l=await Ot(e,h,o);return l?bt({url:n,params:r,branch:h.slice(0,l.idx).concat(l.node),errors:o,status:s,error:c,route:i}):await Ft(n,{id:i.id},c,s)}else h.push(void 0);return bt({url:n,params:r,branch:h,errors:o,status:200,error:null,route:i,form:t?void 0:null})}async function Ot(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)--r;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function kt({status:e,error:t,url:n,route:r}){let i={};try{return bt({url:n,params:i,branch:[await xt({loader:Ke,url:n,params:i,route:r,parent:()=>Promise.resolve({}),server_data_node:wt(null)}),{node:await z(),loader:z,universal:null,server:null,data:null}],status:e,error:t,errors:[],route:null})}catch(t){if(t instanceof d){await gt(new URL(t.location,location.href),{},0);return}let a=await V.get_error_template(),o=await Q(t,{url:n,params:i,route:r}),s=a({status:e,message:String(o?.message??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}),c=new DOMParser().parseFromString(s,`text/html`);throw document.documentElement.replaceChild(document.adoptNode(c.head),document.head),document.documentElement.replaceChild(document.adoptNode(c.body),document.body),t}}async function At(e){let t=e.href;if($e.has(t))return $e.get(t);let n;try{let r=(async()=>{let t=await V.hooks.reroute({url:new URL(e),fetch:async(t,n)=>St(t,n,e).promise})??e;if(typeof t==`string`){let n=new URL(e);V.hash?n.hash=t:n.pathname=t,t=n}return t})();$e.set(t,r),n=await r}catch{$e.delete(t);return}return n}async function jt(e,t){if(e&&!k(e,x,V.hash)){let n=await At(e);if(!n)return;let r=Mt(n);for(let n of Ge){let i=n.exec(r);if(i)return{id:Nt(e),invalidating:t,route:n,params:te(i),url:e}}}}function Mt(e){return ee(V.hash?e.hash.replace(/^#/,``).replace(/[?#].+/,``):e.pathname.slice(x.length))||`/`}function Nt(e){return(V.hash?e.hash.replace(/^#/,``):e.pathname)+e.search}function Pt({url:e,type:t,intent:n,delta:r,event:i,scroll:a}){let o=!1,s=Yt(W,n,e,t,a??null);r!==void 0&&(s.navigation.delta=r),i!==void 0&&(s.navigation.event=i);let c={...s.navigation,cancel:()=>{o=!0,s.reject(Error(`navigation cancelled`))}};return G||et.forEach(e=>e(c)),o?null:s}async function X({type:e,url:t,popped:n,keepfocus:i,noscroll:a,replace_state:o,state:c={},redirect_count:u=0,nav_token:d={},accept:f=g,block:p=g,event:ee}){let te=Y;Y=d;let m=await jt(t,!1),h=e===`enter`?Yt(W,m,t,e):Pt({url:t,type:e,delta:n?.delta,intent:m,scroll:n?.scroll,event:ee});if(!h){p(),Y===d&&(Y=te);return}let ne=q,re=J;f(),G=!0,rt&&h.navigation.type!==`enter`&&I.navigating.set(M.current=h.navigation);let _=m&&await Dt(m);if(!_){if(k(t,x,V.hash))return await R(t,o);_=await Ft(t,{id:null},await Q(new l(404,`Not Found`,`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,o)}if(t=m?.url||t,Y!==d){h.reject(Error(`navigation aborted`));return}if(!_)return;if(_.type===`redirect`){if(u<20){await X({type:e,url:new URL(_.location,t),popped:n,keepfocus:i,noscroll:a,replace_state:o,state:c,redirect_count:u+1,nav_token:d}),h.fulfil(void 0);return}if(_=await kt({status:500,error:await Q(Error(`Redirect loop`),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}}),!_)return}else if(_.props.page.status>=400&&await I.updated.check())return await We(),await R(t,o);if(ft(),L(ne),pt(re),_.props.page.url.pathname!==t.pathname&&(t.pathname=_.props.page.url.pathname),c=n?n.state:c,!n){let e=+!o,n={[S]:q+=e,[C]:J+=e,[ve]:c};(o?history.replaceState:history.pushState).call(history,n,``,t),o||Ue(q,J)}let v=m&&H?.id===m.id?H.fork:null;H?.fork&&!v?Qe():(H=null,Z={element:void 0,href:void 0}),_.props.page.state=c;let y;if(rt){let e=(await Promise.all(Array.from(tt,e=>e(h.navigation)))).filter(e=>typeof e==`function`);if(e.length>0){function t(){e.forEach(e=>{U.delete(e)})}e.push(t),e.forEach(e=>{U.add(e)})}let n=h.navigation.to;W={..._.state,nav:{params:n.params,route:n.route,url:n.url}},_.props.page&&(_.props.page.url=t),!i&&document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur();let a=v&&await v;a?y=a.commit():(N=null,st.$set(_.props),N&&Object.assign(_.props.page,N),Ie(_.props.page),y=r?.()),at=!0}else await yt(_,qe,!1);let{activeElement:ie}=document;if(await y,await s(),await s(),Y!==d){h.reject(Error(`navigation aborted`));return}_.props.page&&N&&Object.assign(_.props.page,N);let b=null;if(it){let e=n?n.scroll:a?E():null;e?scrollTo(e.x,e.y):(b=t.hash&&document.getElementById(Zt(t)))?b.scrollIntoView():scrollTo(0,0)}let ae=document.activeElement!==ie&&document.activeElement!==document.body;!i&&!ae&&Jt(t,!b),it=!0,G=!1,h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=E()),U.forEach(e=>e(h.navigation)),e===`popstate`&&mt(J),I.navigating.set(M.current=null)}async function Ft(e,t,n,r,i){return e.origin===be&&e.pathname===location.pathname&&!nt?await kt({status:r,error:n,url:e,route:t}):await R(e,i)}var Z={element:void 0,href:void 0};function It(){let e,t;B.addEventListener(`mousemove`,t=>{let n=t.target;clearTimeout(e),e=setTimeout(()=>{i(n,w.hover)},20)});function n(e){e.defaultPrevented||i(e.composedPath()[0],w.tap)}B.addEventListener(`mousedown`,n),B.addEventListener(`touchstart`,n,{passive:!0});let r=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&(vt(new URL(t.target.href)),r.unobserve(t.target))},{threshold:0});async function i(e,n){let r=Ce(e,B),i=r===Z.element&&r?.href===Z.href&&n>=t;if(!r||i)return;let{url:a,external:o,download:s}=we(r,x,V.hash);if(o||s)return;let c=O(r),l=a&&Nt(W.url)===Nt(a);if(!(c.reload||l)){if(n<=c.preload_data){Z={element:r,href:r.href},t=w.tap;let e=await jt(a,!1);if(!e)return;_t(e)}else n<=c.preload_code&&(Z={element:r,href:r.href},t=n,vt(a))}}function a(){r.disconnect();for(let e of B.querySelectorAll(`a`)){let{url:t,external:n,download:i}=we(e,x,V.hash);if(n||i)continue;let a=O(e);a.reload||(a.preload_code===w.viewport&&r.observe(e),a.preload_code===w.eager&&vt(t))}}U.add(a),a()}function Q(e,t){if(e instanceof u)return e.body;let n=je(e),r=Me(e);return V.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Lt(e,t){ze(()=>(e.add(t),()=>{e.delete(t)}))}function Rt(e){Lt(U,e)}function zt(e){Lt(tt,e)}function Bt(e,t={}){return e=new URL(T(e)),e.origin===be?gt(e,t,0):Promise.reject(Error(`goto: invalid URL`))}function Vt(e){if(typeof e==`function`)Xe.push(e);else{let{href:t}=new URL(e,location.href);Xe.push(e=>e.href===t)}}function Ht(e,t){L(q);let n={[S]:q+=1,[C]:J,[ye]:j.url.href,[ve]:t};history.pushState(n,``,T(e)),at=!0,j.state=t,st.$set({page:Ve(()=>$(j))}),Ue(q,J)}function Ut(e,t){let n={[S]:q,[C]:J,[ye]:j.url.href,[ve]:t};history.replaceState(n,``,T(e)),j.state=t,st.$set({page:Ve(()=>$(j))})}function Wt(){history.scrollRestoration=`manual`,addEventListener(`beforeunload`,e=>{let t=!1;if(ht(),!G){let e=Yt(W,void 0,null,`leave`),n={...e.navigation,cancel:()=>{t=!0,e.reject(Error(`navigation cancelled`))}};et.forEach(e=>e(n))}t?(e.preventDefault(),e.returnValue=``):history.scrollRestoration=`auto`}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&ht()}),navigator.connection?.saveData||It(),B.addEventListener(`click`,async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;let n=Ce(t.composedPath()[0],B);if(!n)return;let{url:r,external:i,target:a,download:o}=we(n,x,V.hash);if(!r)return;if(a===`_parent`||a===`_top`){if(window.parent!==window)return}else if(a&&a!==`_self`)return;let s=O(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&r.protocol!==`https:`&&r.protocol!==`http:`||o)return;let[c,l]=(V.hash?r.hash.replace(/^#/,``):r.href).split(`#`),u=c===m(location);if(i||s.reload&&(!u||!l))Pt({url:r,type:`link`,event:t})?G=!0:t.preventDefault();else{if(l!==void 0&&u){let[,i]=W.url.href.split(`#`);if(i===l){if(t.preventDefault(),l===``||l===`top`&&n.ownerDocument.getElementById(`top`)===null)scrollTo({top:0});else{let e=n.ownerDocument.getElementById(decodeURIComponent(l));e&&(e.scrollIntoView(),e.focus())}return}if(K=!0,L(q),e(r),!s.replace_state)return;K=!1}t.preventDefault(),await new Promise(e=>{requestAnimationFrame(()=>{setTimeout(e,0)}),setTimeout(e,100)}),await X({type:`link`,url:r,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??r.href===location.href,event:t})}}),B.addEventListener(`submit`,e=>{if(e.defaultPrevented)return;let t=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if((n?.formTarget||t.target)===`_blank`||(n?.formMethod||t.method)!==`get`)return;let r=new URL(n?.hasAttribute(`formaction`)&&n?.formAction||t.action);if(k(r,x,!1))return;let i=e.target,a=O(i);if(a.reload)return;e.preventDefault(),e.stopPropagation();let o=new FormData(i,n);r.search=new URLSearchParams(o).toString(),X({type:`form`,url:r,keepfocus:a.keepfocus,noscroll:a.noscroll,replace_state:a.replace_state??r.href===location.href,event:e})}),addEventListener(`popstate`,async t=>{if(!qt){if(t.state?.[`sveltekit:history`]){let n=t.state[S];if(Y={},n===q)return;let r=P[n],i=t.state[`sveltekit:states`]??{},a=new URL(t.state[`sveltekit:pageurl`]??location.href),o=t.state[C],s=W.url?m(location)===m(W.url):!1;if(o===J&&(at||s)){i!==j.state&&(j.state=i),e(a),P[q]=E(),r&&scrollTo(r.x,r.y),q=n;return}let c=n-q;await X({type:`popstate`,url:a,popped:{state:i,scroll:r,delta:c},accept:()=>{q=n,J=o},block:()=>{history.go(-c)},nav_token:Y,event:t})}else K||(e(new URL(location.href)),V.hash&&location.reload())}}),addEventListener(`hashchange`,()=>{K&&(K=!1,history.replaceState({...history.state,[S]:++q,[C]:J},``,location.href))});for(let e of document.querySelectorAll(`link`))He.has(e.rel)&&(e.href=e.href);addEventListener(`pageshow`,e=>{e.persisted&&I.navigating.set(M.current=null)});function e(e){W.url=j.url=e,I.page.set($(j)),I.page.notify()}}async function Gt(e,{status:t=200,error:n,node_ids:r,params:i,route:a,server_route:o,data:s,form:c}){nt=!0;let l=new URL(location.href),u;({params:i={},route:a={id:null}}=await jt(l,!1)||{}),u=Ge.find(({id:e})=>e===a.id);let f,p=!0;try{let e=r.map(async(t,n)=>{let r=s[n];return r?.uses&&(r.uses=Kt(r.uses)),xt({loader:V.nodes[t],url:l,params:i,route:a,parent:async()=>{let t={};for(let r=0;r<n;r+=1)Object.assign(t,(await e[r]).data);return t},server_data_node:wt(r)})}),o=await Promise.all(e);if(u){let e=u.layouts;for(let t=0;t<e.length;t++)e[t]||o.splice(t,0,void 0)}f=await bt({url:l,params:i,branch:o,status:t,error:n,errors:u?.errors,form:c,route:u??null})}catch(t){if(t instanceof d)return await R(new URL(t.location,location.href));f=await kt({status:je(t),error:await Q(t,{url:l,params:i,route:a}),url:l,route:a}),e.textContent=``,p=!1}f&&(f.props.page&&(f.props.page.state={}),await yt(f,e,p))}function Kt(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}var qt=!1;function Jt(e,t=!0){let n=document.querySelector(`[autofocus]`);if(n)n.focus();else{let n=Zt(e);if(n&&document.getElementById(n)){let{x:r,y:i}=E();setTimeout(()=>{let a=history.state;qt=!0,location.replace(new URL(`#${n}`,location.href)),history.replaceState(a,``,e),t&&scrollTo(r,i),qt=!1})}else{let e=document.body,t=e.getAttribute(`tabindex`);e.tabIndex=-1,e.focus({preventScroll:!0,focusVisible:!1}),t===null?e.removeAttribute(`tabindex`):e.setAttribute(`tabindex`,t)}let r=getSelection();if(r&&r.type!==`None`){let e=[];for(let t=0;t<r.rangeCount;t+=1)e.push(r.getRangeAt(t));setTimeout(()=>{if(r.rangeCount===e.length){for(let t=0;t<r.rangeCount;t+=1){let n=e[t],i=r.getRangeAt(t);if(n.commonAncestorContainer!==i.commonAncestorContainer||n.startContainer!==i.startContainer||n.endContainer!==i.endContainer||n.startOffset!==i.startOffset||n.endOffset!==i.endOffset)return}r.removeAllRanges()}})}}}function Yt(e,t,n,r,i=null){let a,o,s=new Promise((e,t)=>{a=e,o=t});return s.catch(g),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:E()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:i},willUnload:!t,type:r,complete:s},fulfil:a,reject:o}}function $(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function Xt(e){let t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function Zt(e){let t;if(V.hash){let[,,n]=e.hash.split(`#`,3);t=n??``}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Ut as a,j as c,Ht as i,Oe as l,Bt as n,dt as o,zt as r,M as s,Rt as t,x as u};
|