@powerhousedao/service-offering 1.0.0-dev.24 → 1.0.0-dev.28
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/README.md +58 -164
- package/package.json +39 -57
- package/dist/document-models/document-models.d.ts +0 -3
- package/dist/document-models/document-models.d.ts.map +0 -1
- package/dist/document-models/document-models.js +0 -12
- package/dist/document-models/facet/gen/schema/types.d.ts +0 -195
- package/dist/document-models/facet/gen/schema/types.d.ts.map +0 -1
- package/dist/document-models/facet/gen/schema/types.js +0 -1
- package/dist/document-models/facet/gen/schema/zod.d.ts +0 -18
- package/dist/document-models/facet/gen/schema/zod.d.ts.map +0 -1
- package/dist/document-models/facet/gen/schema/zod.js +0 -69
- package/dist/document-models/facet/index.d.ts +0 -3
- package/dist/document-models/facet/index.d.ts.map +0 -1
- package/dist/document-models/facet/index.js +0 -2
- package/dist/document-models/facet/upgrades/index.d.ts +0 -3
- package/dist/document-models/facet/upgrades/index.d.ts.map +0 -1
- package/dist/document-models/facet/upgrades/index.js +0 -2
- package/dist/document-models/facet/upgrades/upgrade-manifest.d.ts +0 -4
- package/dist/document-models/facet/upgrades/upgrade-manifest.d.ts.map +0 -1
- package/dist/document-models/facet/upgrades/upgrade-manifest.js +0 -7
- package/dist/document-models/facet/upgrades/versions.d.ts +0 -3
- package/dist/document-models/facet/upgrades/versions.d.ts.map +0 -1
- package/dist/document-models/facet/upgrades/versions.js +0 -2
- package/dist/document-models/facet/v1/actions.d.ts +0 -20
- package/dist/document-models/facet/v1/actions.d.ts.map +0 -1
- package/dist/document-models/facet/v1/actions.js +0 -8
- package/dist/document-models/facet/v1/gen/actions.d.ts +0 -6
- package/dist/document-models/facet/v1/gen/actions.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/actions.js +0 -2
- package/dist/document-models/facet/v1/gen/controller.d.ts +0 -4
- package/dist/document-models/facet/v1/gen/controller.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/controller.js +0 -3
- package/dist/document-models/facet/v1/gen/creators.d.ts +0 -5
- package/dist/document-models/facet/v1/gen/creators.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/creators.js +0 -4
- package/dist/document-models/facet/v1/gen/document-model.d.ts +0 -3
- package/dist/document-models/facet/v1/gen/document-model.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/document-model.js +0 -134
- package/dist/document-models/facet/v1/gen/document-schema.d.ts +0 -56
- package/dist/document-models/facet/v1/gen/document-schema.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/document-schema.js +0 -33
- package/dist/document-models/facet/v1/gen/document-type.d.ts +0 -2
- package/dist/document-models/facet/v1/gen/document-type.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/document-type.js +0 -1
- package/dist/document-models/facet/v1/gen/facet-management/actions.d.ts +0 -12
- package/dist/document-models/facet/v1/gen/facet-management/actions.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/facet-management/actions.js +0 -1
- package/dist/document-models/facet/v1/gen/facet-management/creators.d.ts +0 -5
- package/dist/document-models/facet/v1/gen/facet-management/creators.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/facet-management/creators.js +0 -4
- package/dist/document-models/facet/v1/gen/facet-management/error.d.ts +0 -2
- package/dist/document-models/facet/v1/gen/facet-management/error.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/facet-management/error.js +0 -1
- package/dist/document-models/facet/v1/gen/facet-management/operations.d.ts +0 -8
- package/dist/document-models/facet/v1/gen/facet-management/operations.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/facet-management/operations.js +0 -1
- package/dist/document-models/facet/v1/gen/index.d.ts +0 -14
- package/dist/document-models/facet/v1/gen/index.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/index.js +0 -13
- package/dist/document-models/facet/v1/gen/option-management/actions.d.ts +0 -20
- package/dist/document-models/facet/v1/gen/option-management/actions.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/option-management/actions.js +0 -1
- package/dist/document-models/facet/v1/gen/option-management/creators.d.ts +0 -7
- package/dist/document-models/facet/v1/gen/option-management/creators.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/option-management/creators.js +0 -6
- package/dist/document-models/facet/v1/gen/option-management/error.d.ts +0 -28
- package/dist/document-models/facet/v1/gen/option-management/error.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/option-management/error.js +0 -23
- package/dist/document-models/facet/v1/gen/option-management/operations.d.ts +0 -10
- package/dist/document-models/facet/v1/gen/option-management/operations.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/option-management/operations.js +0 -1
- package/dist/document-models/facet/v1/gen/ph-factories.d.ts +0 -23
- package/dist/document-models/facet/v1/gen/ph-factories.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/ph-factories.js +0 -51
- package/dist/document-models/facet/v1/gen/reducer.d.ts +0 -3
- package/dist/document-models/facet/v1/gen/reducer.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/reducer.js +0 -44
- package/dist/document-models/facet/v1/gen/schema/index.d.ts +0 -3
- package/dist/document-models/facet/v1/gen/schema/index.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/schema/index.js +0 -2
- package/dist/document-models/facet/v1/gen/schema/types.d.ts +0 -195
- package/dist/document-models/facet/v1/gen/schema/types.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/schema/types.js +0 -1
- package/dist/document-models/facet/v1/gen/schema/zod.d.ts +0 -18
- package/dist/document-models/facet/v1/gen/schema/zod.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/schema/zod.js +0 -69
- package/dist/document-models/facet/v1/gen/types.d.ts +0 -12
- package/dist/document-models/facet/v1/gen/types.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/types.js +0 -1
- package/dist/document-models/facet/v1/gen/utils.d.ts +0 -15
- package/dist/document-models/facet/v1/gen/utils.d.ts.map +0 -1
- package/dist/document-models/facet/v1/gen/utils.js +0 -55
- package/dist/document-models/facet/v1/hooks.d.ts +0 -14
- package/dist/document-models/facet/v1/hooks.d.ts.map +0 -1
- package/dist/document-models/facet/v1/hooks.js +0 -25
- package/dist/document-models/facet/v1/index.d.ts +0 -6
- package/dist/document-models/facet/v1/index.d.ts.map +0 -1
- package/dist/document-models/facet/v1/index.js +0 -5
- package/dist/document-models/facet/v1/module.d.ts +0 -5
- package/dist/document-models/facet/v1/module.d.ts.map +0 -1
- package/dist/document-models/facet/v1/module.js +0 -14
- package/dist/document-models/facet/v1/src/index.d.ts +0 -2
- package/dist/document-models/facet/v1/src/index.d.ts.map +0 -1
- package/dist/document-models/facet/v1/src/index.js +0 -1
- package/dist/document-models/facet/v1/src/reducers/facet-management.d.ts +0 -3
- package/dist/document-models/facet/v1/src/reducers/facet-management.d.ts.map +0 -1
- package/dist/document-models/facet/v1/src/reducers/facet-management.js +0 -10
- package/dist/document-models/facet/v1/src/reducers/option-management.d.ts +0 -3
- package/dist/document-models/facet/v1/src/reducers/option-management.d.ts.map +0 -1
- package/dist/document-models/facet/v1/src/reducers/option-management.js +0 -56
- package/dist/document-models/facet/v1/src/utils.d.ts +0 -2
- package/dist/document-models/facet/v1/src/utils.d.ts.map +0 -1
- package/dist/document-models/facet/v1/src/utils.js +0 -1
- package/dist/document-models/facet/v1/tests/document-model.test.d.ts +0 -10
- package/dist/document-models/facet/v1/tests/document-model.test.d.ts.map +0 -1
- package/dist/document-models/facet/v1/tests/document-model.test.js +0 -104
- package/dist/document-models/facet/v1/tests/facet-management.test.d.ts +0 -2
- package/dist/document-models/facet/v1/tests/facet-management.test.d.ts.map +0 -1
- package/dist/document-models/facet/v1/tests/facet-management.test.js +0 -25
- package/dist/document-models/facet/v1/tests/option-management.test.d.ts +0 -2
- package/dist/document-models/facet/v1/tests/option-management.test.d.ts.map +0 -1
- package/dist/document-models/facet/v1/tests/option-management.test.js +0 -45
- package/dist/document-models/facet/v1/utils.d.ts +0 -14
- package/dist/document-models/facet/v1/utils.d.ts.map +0 -1
- package/dist/document-models/facet/v1/utils.js +0 -7
- package/dist/document-models/index.d.ts +0 -6
- package/dist/document-models/index.d.ts.map +0 -1
- package/dist/document-models/index.js +0 -5
- package/dist/document-models/resource-instance/gen/schema/types.d.ts +0 -272
- package/dist/document-models/resource-instance/gen/schema/types.d.ts.map +0 -1
- package/dist/document-models/resource-instance/gen/schema/types.js +0 -1
- package/dist/document-models/resource-instance/gen/schema/zod.d.ts +0 -44
- package/dist/document-models/resource-instance/gen/schema/zod.d.ts.map +0 -1
- package/dist/document-models/resource-instance/gen/schema/zod.js +0 -187
- package/dist/document-models/resource-instance/index.d.ts +0 -3
- package/dist/document-models/resource-instance/index.d.ts.map +0 -1
- package/dist/document-models/resource-instance/index.js +0 -2
- package/dist/document-models/resource-instance/upgrades/index.d.ts +0 -3
- package/dist/document-models/resource-instance/upgrades/index.d.ts.map +0 -1
- package/dist/document-models/resource-instance/upgrades/index.js +0 -2
- package/dist/document-models/resource-instance/upgrades/upgrade-manifest.d.ts +0 -4
- package/dist/document-models/resource-instance/upgrades/upgrade-manifest.d.ts.map +0 -1
- package/dist/document-models/resource-instance/upgrades/upgrade-manifest.js +0 -7
- package/dist/document-models/resource-instance/upgrades/versions.d.ts +0 -3
- package/dist/document-models/resource-instance/upgrades/versions.d.ts.map +0 -1
- package/dist/document-models/resource-instance/upgrades/versions.js +0 -2
- package/dist/document-models/resource-instance/v1/actions.d.ts +0 -33
- package/dist/document-models/resource-instance/v1/actions.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/actions.js +0 -8
- package/dist/document-models/resource-instance/v1/gen/actions.d.ts +0 -6
- package/dist/document-models/resource-instance/v1/gen/actions.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/actions.js +0 -2
- package/dist/document-models/resource-instance/v1/gen/configuration-management/actions.d.ts +0 -20
- package/dist/document-models/resource-instance/v1/gen/configuration-management/actions.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/configuration-management/actions.js +0 -1
- package/dist/document-models/resource-instance/v1/gen/configuration-management/creators.d.ts +0 -7
- package/dist/document-models/resource-instance/v1/gen/configuration-management/creators.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/configuration-management/creators.js +0 -6
- package/dist/document-models/resource-instance/v1/gen/configuration-management/error.d.ts +0 -35
- package/dist/document-models/resource-instance/v1/gen/configuration-management/error.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/configuration-management/error.js +0 -32
- package/dist/document-models/resource-instance/v1/gen/configuration-management/operations.d.ts +0 -10
- package/dist/document-models/resource-instance/v1/gen/configuration-management/operations.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/configuration-management/operations.js +0 -1
- package/dist/document-models/resource-instance/v1/gen/controller.d.ts +0 -4
- package/dist/document-models/resource-instance/v1/gen/controller.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/controller.js +0 -3
- package/dist/document-models/resource-instance/v1/gen/creators.d.ts +0 -5
- package/dist/document-models/resource-instance/v1/gen/creators.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/creators.js +0 -4
- package/dist/document-models/resource-instance/v1/gen/document-model.d.ts +0 -3
- package/dist/document-models/resource-instance/v1/gen/document-model.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/document-model.js +0 -394
- package/dist/document-models/resource-instance/v1/gen/document-schema.d.ts +0 -107
- package/dist/document-models/resource-instance/v1/gen/document-schema.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/document-schema.js +0 -33
- package/dist/document-models/resource-instance/v1/gen/document-type.d.ts +0 -2
- package/dist/document-models/resource-instance/v1/gen/document-type.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/document-type.js +0 -1
- package/dist/document-models/resource-instance/v1/gen/index.d.ts +0 -14
- package/dist/document-models/resource-instance/v1/gen/index.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/index.js +0 -13
- package/dist/document-models/resource-instance/v1/gen/instance-management/actions.d.ts +0 -64
- package/dist/document-models/resource-instance/v1/gen/instance-management/actions.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/instance-management/actions.js +0 -1
- package/dist/document-models/resource-instance/v1/gen/instance-management/creators.d.ts +0 -18
- package/dist/document-models/resource-instance/v1/gen/instance-management/creators.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/instance-management/creators.js +0 -17
- package/dist/document-models/resource-instance/v1/gen/instance-management/error.d.ts +0 -99
- package/dist/document-models/resource-instance/v1/gen/instance-management/error.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/instance-management/error.js +0 -112
- package/dist/document-models/resource-instance/v1/gen/instance-management/operations.d.ts +0 -21
- package/dist/document-models/resource-instance/v1/gen/instance-management/operations.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/instance-management/operations.js +0 -1
- package/dist/document-models/resource-instance/v1/gen/ph-factories.d.ts +0 -23
- package/dist/document-models/resource-instance/v1/gen/ph-factories.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/ph-factories.js +0 -68
- package/dist/document-models/resource-instance/v1/gen/reducer.d.ts +0 -3
- package/dist/document-models/resource-instance/v1/gen/reducer.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/reducer.js +0 -109
- package/dist/document-models/resource-instance/v1/gen/schema/index.d.ts +0 -3
- package/dist/document-models/resource-instance/v1/gen/schema/index.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/schema/index.js +0 -2
- package/dist/document-models/resource-instance/v1/gen/schema/types.d.ts +0 -272
- package/dist/document-models/resource-instance/v1/gen/schema/types.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/schema/types.js +0 -1
- package/dist/document-models/resource-instance/v1/gen/schema/zod.d.ts +0 -44
- package/dist/document-models/resource-instance/v1/gen/schema/zod.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/schema/zod.js +0 -187
- package/dist/document-models/resource-instance/v1/gen/types.d.ts +0 -12
- package/dist/document-models/resource-instance/v1/gen/types.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/types.js +0 -1
- package/dist/document-models/resource-instance/v1/gen/utils.d.ts +0 -15
- package/dist/document-models/resource-instance/v1/gen/utils.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/gen/utils.js +0 -72
- package/dist/document-models/resource-instance/v1/hooks.d.ts +0 -14
- package/dist/document-models/resource-instance/v1/hooks.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/hooks.js +0 -25
- package/dist/document-models/resource-instance/v1/index.d.ts +0 -6
- package/dist/document-models/resource-instance/v1/index.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/index.js +0 -5
- package/dist/document-models/resource-instance/v1/module.d.ts +0 -5
- package/dist/document-models/resource-instance/v1/module.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/module.js +0 -14
- package/dist/document-models/resource-instance/v1/src/index.d.ts +0 -2
- package/dist/document-models/resource-instance/v1/src/index.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/src/index.js +0 -1
- package/dist/document-models/resource-instance/v1/src/reducers/configuration-management.d.ts +0 -3
- package/dist/document-models/resource-instance/v1/src/reducers/configuration-management.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/src/reducers/configuration-management.js +0 -77
- package/dist/document-models/resource-instance/v1/src/reducers/instance-management.d.ts +0 -3
- package/dist/document-models/resource-instance/v1/src/reducers/instance-management.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/src/reducers/instance-management.js +0 -141
- package/dist/document-models/resource-instance/v1/src/utils.d.ts +0 -2
- package/dist/document-models/resource-instance/v1/src/utils.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/src/utils.js +0 -1
- package/dist/document-models/resource-instance/v1/tests/configuration-management.test.d.ts +0 -2
- package/dist/document-models/resource-instance/v1/tests/configuration-management.test.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/tests/configuration-management.test.js +0 -45
- package/dist/document-models/resource-instance/v1/tests/document-model.test.d.ts +0 -10
- package/dist/document-models/resource-instance/v1/tests/document-model.test.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/tests/document-model.test.js +0 -104
- package/dist/document-models/resource-instance/v1/tests/instance-management.test.d.ts +0 -2
- package/dist/document-models/resource-instance/v1/tests/instance-management.test.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/tests/instance-management.test.js +0 -155
- package/dist/document-models/resource-instance/v1/utils.d.ts +0 -14
- package/dist/document-models/resource-instance/v1/utils.d.ts.map +0 -1
- package/dist/document-models/resource-instance/v1/utils.js +0 -7
- package/dist/document-models/resource-template/gen/schema/types.d.ts +0 -371
- package/dist/document-models/resource-template/gen/schema/types.d.ts.map +0 -1
- package/dist/document-models/resource-template/gen/schema/types.js +0 -1
- package/dist/document-models/resource-template/gen/schema/zod.d.ts +0 -52
- package/dist/document-models/resource-template/gen/schema/zod.d.ts.map +0 -1
- package/dist/document-models/resource-template/gen/schema/zod.js +0 -312
- package/dist/document-models/resource-template/index.d.ts +0 -3
- package/dist/document-models/resource-template/index.d.ts.map +0 -1
- package/dist/document-models/resource-template/index.js +0 -2
- package/dist/document-models/resource-template/upgrades/index.d.ts +0 -3
- package/dist/document-models/resource-template/upgrades/index.d.ts.map +0 -1
- package/dist/document-models/resource-template/upgrades/index.js +0 -2
- package/dist/document-models/resource-template/upgrades/upgrade-manifest.d.ts +0 -4
- package/dist/document-models/resource-template/upgrades/upgrade-manifest.d.ts.map +0 -1
- package/dist/document-models/resource-template/upgrades/upgrade-manifest.js +0 -7
- package/dist/document-models/resource-template/upgrades/versions.d.ts +0 -3
- package/dist/document-models/resource-template/upgrades/versions.d.ts.map +0 -1
- package/dist/document-models/resource-template/upgrades/versions.js +0 -2
- package/dist/document-models/resource-template/v1/actions.d.ts +0 -43
- package/dist/document-models/resource-template/v1/actions.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/actions.js +0 -13
- package/dist/document-models/resource-template/v1/gen/actions.d.ts +0 -16
- package/dist/document-models/resource-template/v1/gen/actions.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/actions.js +0 -7
- package/dist/document-models/resource-template/v1/gen/audience-management/actions.d.ts +0 -12
- package/dist/document-models/resource-template/v1/gen/audience-management/actions.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/audience-management/actions.js +0 -1
- package/dist/document-models/resource-template/v1/gen/audience-management/creators.d.ts +0 -5
- package/dist/document-models/resource-template/v1/gen/audience-management/creators.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/audience-management/creators.js +0 -4
- package/dist/document-models/resource-template/v1/gen/audience-management/error.d.ts +0 -21
- package/dist/document-models/resource-template/v1/gen/audience-management/error.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/audience-management/error.js +0 -16
- package/dist/document-models/resource-template/v1/gen/audience-management/operations.d.ts +0 -8
- package/dist/document-models/resource-template/v1/gen/audience-management/operations.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/audience-management/operations.js +0 -1
- package/dist/document-models/resource-template/v1/gen/content-section-management/actions.d.ts +0 -20
- package/dist/document-models/resource-template/v1/gen/content-section-management/actions.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/content-section-management/actions.js +0 -1
- package/dist/document-models/resource-template/v1/gen/content-section-management/creators.d.ts +0 -7
- package/dist/document-models/resource-template/v1/gen/content-section-management/creators.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/content-section-management/creators.js +0 -6
- package/dist/document-models/resource-template/v1/gen/content-section-management/error.d.ts +0 -2
- package/dist/document-models/resource-template/v1/gen/content-section-management/error.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/content-section-management/error.js +0 -1
- package/dist/document-models/resource-template/v1/gen/content-section-management/operations.d.ts +0 -10
- package/dist/document-models/resource-template/v1/gen/content-section-management/operations.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/content-section-management/operations.js +0 -1
- package/dist/document-models/resource-template/v1/gen/controller.d.ts +0 -4
- package/dist/document-models/resource-template/v1/gen/controller.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/controller.js +0 -3
- package/dist/document-models/resource-template/v1/gen/creators.d.ts +0 -15
- package/dist/document-models/resource-template/v1/gen/creators.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/creators.js +0 -14
- package/dist/document-models/resource-template/v1/gen/document-model.d.ts +0 -3
- package/dist/document-models/resource-template/v1/gen/document-model.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/document-model.js +0 -516
- package/dist/document-models/resource-template/v1/gen/document-schema.d.ts +0 -98
- package/dist/document-models/resource-template/v1/gen/document-schema.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/document-schema.js +0 -33
- package/dist/document-models/resource-template/v1/gen/document-type.d.ts +0 -2
- package/dist/document-models/resource-template/v1/gen/document-type.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/document-type.js +0 -1
- package/dist/document-models/resource-template/v1/gen/facet-targeting/actions.d.ts +0 -20
- package/dist/document-models/resource-template/v1/gen/facet-targeting/actions.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/facet-targeting/actions.js +0 -1
- package/dist/document-models/resource-template/v1/gen/facet-targeting/creators.d.ts +0 -7
- package/dist/document-models/resource-template/v1/gen/facet-targeting/creators.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/facet-targeting/creators.js +0 -6
- package/dist/document-models/resource-template/v1/gen/facet-targeting/error.d.ts +0 -28
- package/dist/document-models/resource-template/v1/gen/facet-targeting/error.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/facet-targeting/error.js +0 -23
- package/dist/document-models/resource-template/v1/gen/facet-targeting/operations.d.ts +0 -10
- package/dist/document-models/resource-template/v1/gen/facet-targeting/operations.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/facet-targeting/operations.js +0 -1
- package/dist/document-models/resource-template/v1/gen/index.d.ts +0 -19
- package/dist/document-models/resource-template/v1/gen/index.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/index.js +0 -18
- package/dist/document-models/resource-template/v1/gen/option-group-management/actions.d.ts +0 -32
- package/dist/document-models/resource-template/v1/gen/option-group-management/actions.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/option-group-management/actions.js +0 -1
- package/dist/document-models/resource-template/v1/gen/option-group-management/creators.d.ts +0 -10
- package/dist/document-models/resource-template/v1/gen/option-group-management/creators.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/option-group-management/creators.js +0 -9
- package/dist/document-models/resource-template/v1/gen/option-group-management/error.d.ts +0 -28
- package/dist/document-models/resource-template/v1/gen/option-group-management/error.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/option-group-management/error.js +0 -23
- package/dist/document-models/resource-template/v1/gen/option-group-management/operations.d.ts +0 -13
- package/dist/document-models/resource-template/v1/gen/option-group-management/operations.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/option-group-management/operations.js +0 -1
- package/dist/document-models/resource-template/v1/gen/ph-factories.d.ts +0 -23
- package/dist/document-models/resource-template/v1/gen/ph-factories.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/ph-factories.js +0 -65
- package/dist/document-models/resource-template/v1/gen/reducer.d.ts +0 -3
- package/dist/document-models/resource-template/v1/gen/reducer.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/reducer.js +0 -164
- package/dist/document-models/resource-template/v1/gen/schema/index.d.ts +0 -3
- package/dist/document-models/resource-template/v1/gen/schema/index.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/schema/index.js +0 -2
- package/dist/document-models/resource-template/v1/gen/schema/types.d.ts +0 -378
- package/dist/document-models/resource-template/v1/gen/schema/types.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/schema/types.js +0 -1
- package/dist/document-models/resource-template/v1/gen/schema/zod.d.ts +0 -53
- package/dist/document-models/resource-template/v1/gen/schema/zod.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/schema/zod.js +0 -321
- package/dist/document-models/resource-template/v1/gen/service-category-management/actions.d.ts +0 -12
- package/dist/document-models/resource-template/v1/gen/service-category-management/actions.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/service-category-management/actions.js +0 -1
- package/dist/document-models/resource-template/v1/gen/service-category-management/creators.d.ts +0 -5
- package/dist/document-models/resource-template/v1/gen/service-category-management/creators.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/service-category-management/creators.js +0 -4
- package/dist/document-models/resource-template/v1/gen/service-category-management/error.d.ts +0 -2
- package/dist/document-models/resource-template/v1/gen/service-category-management/error.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/service-category-management/error.js +0 -1
- package/dist/document-models/resource-template/v1/gen/service-category-management/operations.d.ts +0 -8
- package/dist/document-models/resource-template/v1/gen/service-category-management/operations.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/service-category-management/operations.js +0 -1
- package/dist/document-models/resource-template/v1/gen/service-management/actions.d.ts +0 -24
- package/dist/document-models/resource-template/v1/gen/service-management/actions.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/service-management/actions.js +0 -1
- package/dist/document-models/resource-template/v1/gen/service-management/creators.d.ts +0 -8
- package/dist/document-models/resource-template/v1/gen/service-management/creators.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/service-management/creators.js +0 -7
- package/dist/document-models/resource-template/v1/gen/service-management/error.d.ts +0 -52
- package/dist/document-models/resource-template/v1/gen/service-management/error.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/service-management/error.js +0 -49
- package/dist/document-models/resource-template/v1/gen/service-management/operations.d.ts +0 -11
- package/dist/document-models/resource-template/v1/gen/service-management/operations.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/service-management/operations.js +0 -1
- package/dist/document-models/resource-template/v1/gen/template-management/actions.d.ts +0 -24
- package/dist/document-models/resource-template/v1/gen/template-management/actions.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/template-management/actions.js +0 -1
- package/dist/document-models/resource-template/v1/gen/template-management/creators.d.ts +0 -8
- package/dist/document-models/resource-template/v1/gen/template-management/creators.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/template-management/creators.js +0 -7
- package/dist/document-models/resource-template/v1/gen/template-management/error.d.ts +0 -2
- package/dist/document-models/resource-template/v1/gen/template-management/error.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/template-management/error.js +0 -1
- package/dist/document-models/resource-template/v1/gen/template-management/operations.d.ts +0 -11
- package/dist/document-models/resource-template/v1/gen/template-management/operations.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/template-management/operations.js +0 -1
- package/dist/document-models/resource-template/v1/gen/types.d.ts +0 -12
- package/dist/document-models/resource-template/v1/gen/types.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/types.js +0 -1
- package/dist/document-models/resource-template/v1/gen/utils.d.ts +0 -15
- package/dist/document-models/resource-template/v1/gen/utils.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/gen/utils.js +0 -69
- package/dist/document-models/resource-template/v1/hooks.d.ts +0 -14
- package/dist/document-models/resource-template/v1/hooks.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/hooks.js +0 -25
- package/dist/document-models/resource-template/v1/index.d.ts +0 -6
- package/dist/document-models/resource-template/v1/index.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/index.js +0 -5
- package/dist/document-models/resource-template/v1/module.d.ts +0 -5
- package/dist/document-models/resource-template/v1/module.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/module.js +0 -14
- package/dist/document-models/resource-template/v1/src/index.d.ts +0 -2
- package/dist/document-models/resource-template/v1/src/index.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/src/index.js +0 -1
- package/dist/document-models/resource-template/v1/src/reducers/audience-management.d.ts +0 -3
- package/dist/document-models/resource-template/v1/src/reducers/audience-management.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/src/reducers/audience-management.js +0 -17
- package/dist/document-models/resource-template/v1/src/reducers/content-section-management.d.ts +0 -3
- package/dist/document-models/resource-template/v1/src/reducers/content-section-management.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/src/reducers/content-section-management.js +0 -44
- package/dist/document-models/resource-template/v1/src/reducers/facet-targeting.d.ts +0 -3
- package/dist/document-models/resource-template/v1/src/reducers/facet-targeting.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/src/reducers/facet-targeting.js +0 -47
- package/dist/document-models/resource-template/v1/src/reducers/option-group-management.d.ts +0 -3
- package/dist/document-models/resource-template/v1/src/reducers/option-group-management.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/src/reducers/option-group-management.js +0 -66
- package/dist/document-models/resource-template/v1/src/reducers/service-category-management.d.ts +0 -3
- package/dist/document-models/resource-template/v1/src/reducers/service-category-management.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/src/reducers/service-category-management.js +0 -10
- package/dist/document-models/resource-template/v1/src/reducers/service-management.d.ts +0 -3
- package/dist/document-models/resource-template/v1/src/reducers/service-management.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/src/reducers/service-management.js +0 -71
- package/dist/document-models/resource-template/v1/src/reducers/template-management.d.ts +0 -3
- package/dist/document-models/resource-template/v1/src/reducers/template-management.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/src/reducers/template-management.js +0 -39
- package/dist/document-models/resource-template/v1/src/utils.d.ts +0 -2
- package/dist/document-models/resource-template/v1/src/utils.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/src/utils.js +0 -1
- package/dist/document-models/resource-template/v1/tests/audience-management.test.d.ts +0 -2
- package/dist/document-models/resource-template/v1/tests/audience-management.test.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/tests/audience-management.test.js +0 -25
- package/dist/document-models/resource-template/v1/tests/content-section-management.test.d.ts +0 -2
- package/dist/document-models/resource-template/v1/tests/content-section-management.test.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/tests/content-section-management.test.js +0 -45
- package/dist/document-models/resource-template/v1/tests/document-model.test.d.ts +0 -10
- package/dist/document-models/resource-template/v1/tests/document-model.test.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/tests/document-model.test.js +0 -104
- package/dist/document-models/resource-template/v1/tests/facet-targeting.test.d.ts +0 -2
- package/dist/document-models/resource-template/v1/tests/facet-targeting.test.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/tests/facet-targeting.test.js +0 -45
- package/dist/document-models/resource-template/v1/tests/option-group-management.test.d.ts +0 -2
- package/dist/document-models/resource-template/v1/tests/option-group-management.test.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/tests/option-group-management.test.js +0 -75
- package/dist/document-models/resource-template/v1/tests/service-category-management.test.d.ts +0 -2
- package/dist/document-models/resource-template/v1/tests/service-category-management.test.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/tests/service-category-management.test.js +0 -25
- package/dist/document-models/resource-template/v1/tests/service-management.test.d.ts +0 -2
- package/dist/document-models/resource-template/v1/tests/service-management.test.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/tests/service-management.test.js +0 -55
- package/dist/document-models/resource-template/v1/tests/template-management.test.d.ts +0 -2
- package/dist/document-models/resource-template/v1/tests/template-management.test.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/tests/template-management.test.js +0 -55
- package/dist/document-models/resource-template/v1/utils.d.ts +0 -14
- package/dist/document-models/resource-template/v1/utils.d.ts.map +0 -1
- package/dist/document-models/resource-template/v1/utils.js +0 -7
- package/dist/document-models/service-offering/gen/schema/types.d.ts +0 -526
- package/dist/document-models/service-offering/gen/schema/types.d.ts.map +0 -1
- package/dist/document-models/service-offering/gen/schema/types.js +0 -1
- package/dist/document-models/service-offering/gen/schema/zod.d.ts +0 -114
- package/dist/document-models/service-offering/gen/schema/zod.d.ts.map +0 -1
- package/dist/document-models/service-offering/gen/schema/zod.js +0 -539
- package/dist/document-models/service-offering/index.d.ts +0 -3
- package/dist/document-models/service-offering/index.d.ts.map +0 -1
- package/dist/document-models/service-offering/index.js +0 -2
- package/dist/document-models/service-offering/upgrades/index.d.ts +0 -3
- package/dist/document-models/service-offering/upgrades/index.d.ts.map +0 -1
- package/dist/document-models/service-offering/upgrades/index.js +0 -2
- package/dist/document-models/service-offering/upgrades/upgrade-manifest.d.ts +0 -4
- package/dist/document-models/service-offering/upgrades/upgrade-manifest.d.ts.map +0 -1
- package/dist/document-models/service-offering/upgrades/upgrade-manifest.js +0 -7
- package/dist/document-models/service-offering/upgrades/versions.d.ts +0 -3
- package/dist/document-models/service-offering/upgrades/versions.d.ts.map +0 -1
- package/dist/document-models/service-offering/upgrades/versions.js +0 -2
- package/dist/document-models/service-offering/v1/actions.d.ts +0 -50
- package/dist/document-models/service-offering/v1/actions.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/actions.js +0 -10
- package/dist/document-models/service-offering/v1/gen/actions.d.ts +0 -10
- package/dist/document-models/service-offering/v1/gen/actions.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/actions.js +0 -4
- package/dist/document-models/service-offering/v1/gen/controller.d.ts +0 -4
- package/dist/document-models/service-offering/v1/gen/controller.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/controller.js +0 -3
- package/dist/document-models/service-offering/v1/gen/creators.d.ts +0 -9
- package/dist/document-models/service-offering/v1/gen/creators.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/creators.js +0 -8
- package/dist/document-models/service-offering/v1/gen/document-model.d.ts +0 -3
- package/dist/document-models/service-offering/v1/gen/document-model.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/document-model.js +0 -691
- package/dist/document-models/service-offering/v1/gen/document-schema.d.ts +0 -86
- package/dist/document-models/service-offering/v1/gen/document-schema.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/document-schema.js +0 -33
- package/dist/document-models/service-offering/v1/gen/document-type.d.ts +0 -2
- package/dist/document-models/service-offering/v1/gen/document-type.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/document-type.js +0 -1
- package/dist/document-models/service-offering/v1/gen/index.d.ts +0 -16
- package/dist/document-models/service-offering/v1/gen/index.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/index.js +0 -15
- package/dist/document-models/service-offering/v1/gen/offering/actions.d.ts +0 -48
- package/dist/document-models/service-offering/v1/gen/offering/actions.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/offering/actions.js +0 -1
- package/dist/document-models/service-offering/v1/gen/offering/creators.d.ts +0 -14
- package/dist/document-models/service-offering/v1/gen/offering/creators.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/offering/creators.js +0 -13
- package/dist/document-models/service-offering/v1/gen/offering/error.d.ts +0 -42
- package/dist/document-models/service-offering/v1/gen/offering/error.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/offering/error.js +0 -37
- package/dist/document-models/service-offering/v1/gen/offering/operations.d.ts +0 -17
- package/dist/document-models/service-offering/v1/gen/offering/operations.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/offering/operations.js +0 -1
- package/dist/document-models/service-offering/v1/gen/option-groups/actions.d.ts +0 -36
- package/dist/document-models/service-offering/v1/gen/option-groups/actions.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/option-groups/actions.js +0 -1
- package/dist/document-models/service-offering/v1/gen/option-groups/creators.d.ts +0 -11
- package/dist/document-models/service-offering/v1/gen/option-groups/creators.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/option-groups/creators.js +0 -10
- package/dist/document-models/service-offering/v1/gen/option-groups/error.d.ts +0 -56
- package/dist/document-models/service-offering/v1/gen/option-groups/error.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/option-groups/error.js +0 -53
- package/dist/document-models/service-offering/v1/gen/option-groups/operations.d.ts +0 -14
- package/dist/document-models/service-offering/v1/gen/option-groups/operations.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/option-groups/operations.js +0 -1
- package/dist/document-models/service-offering/v1/gen/ph-factories.d.ts +0 -23
- package/dist/document-models/service-offering/v1/gen/ph-factories.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/ph-factories.js +0 -61
- package/dist/document-models/service-offering/v1/gen/reducer.d.ts +0 -3
- package/dist/document-models/service-offering/v1/gen/reducer.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/reducer.js +0 -196
- package/dist/document-models/service-offering/v1/gen/schema/index.d.ts +0 -3
- package/dist/document-models/service-offering/v1/gen/schema/index.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/schema/index.js +0 -2
- package/dist/document-models/service-offering/v1/gen/schema/types.d.ts +0 -533
- package/dist/document-models/service-offering/v1/gen/schema/types.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/schema/types.js +0 -1
- package/dist/document-models/service-offering/v1/gen/schema/zod.d.ts +0 -115
- package/dist/document-models/service-offering/v1/gen/schema/zod.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/schema/zod.js +0 -548
- package/dist/document-models/service-offering/v1/gen/services/actions.d.ts +0 -16
- package/dist/document-models/service-offering/v1/gen/services/actions.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/services/actions.js +0 -1
- package/dist/document-models/service-offering/v1/gen/services/creators.d.ts +0 -6
- package/dist/document-models/service-offering/v1/gen/services/creators.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/services/creators.js +0 -5
- package/dist/document-models/service-offering/v1/gen/services/error.d.ts +0 -21
- package/dist/document-models/service-offering/v1/gen/services/error.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/services/error.js +0 -16
- package/dist/document-models/service-offering/v1/gen/services/operations.d.ts +0 -9
- package/dist/document-models/service-offering/v1/gen/services/operations.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/services/operations.js +0 -1
- package/dist/document-models/service-offering/v1/gen/tiers/actions.d.ts +0 -60
- package/dist/document-models/service-offering/v1/gen/tiers/actions.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/tiers/actions.js +0 -1
- package/dist/document-models/service-offering/v1/gen/tiers/creators.d.ts +0 -17
- package/dist/document-models/service-offering/v1/gen/tiers/creators.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/tiers/creators.js +0 -16
- package/dist/document-models/service-offering/v1/gen/tiers/error.d.ts +0 -113
- package/dist/document-models/service-offering/v1/gen/tiers/error.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/tiers/error.js +0 -119
- package/dist/document-models/service-offering/v1/gen/tiers/operations.d.ts +0 -20
- package/dist/document-models/service-offering/v1/gen/tiers/operations.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/tiers/operations.js +0 -1
- package/dist/document-models/service-offering/v1/gen/types.d.ts +0 -12
- package/dist/document-models/service-offering/v1/gen/types.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/types.js +0 -1
- package/dist/document-models/service-offering/v1/gen/utils.d.ts +0 -15
- package/dist/document-models/service-offering/v1/gen/utils.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/gen/utils.js +0 -65
- package/dist/document-models/service-offering/v1/hooks.d.ts +0 -14
- package/dist/document-models/service-offering/v1/hooks.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/hooks.js +0 -25
- package/dist/document-models/service-offering/v1/index.d.ts +0 -6
- package/dist/document-models/service-offering/v1/index.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/index.js +0 -5
- package/dist/document-models/service-offering/v1/module.d.ts +0 -5
- package/dist/document-models/service-offering/v1/module.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/module.js +0 -14
- package/dist/document-models/service-offering/v1/src/index.d.ts +0 -2
- package/dist/document-models/service-offering/v1/src/index.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/src/index.js +0 -1
- package/dist/document-models/service-offering/v1/src/reducers/offering.d.ts +0 -3
- package/dist/document-models/service-offering/v1/src/reducers/offering.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/src/reducers/offering.js +0 -89
- package/dist/document-models/service-offering/v1/src/reducers/option-groups.d.ts +0 -3
- package/dist/document-models/service-offering/v1/src/reducers/option-groups.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/src/reducers/option-groups.js +0 -212
- package/dist/document-models/service-offering/v1/src/reducers/services.d.ts +0 -3
- package/dist/document-models/service-offering/v1/src/reducers/services.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/src/reducers/services.js +0 -40
- package/dist/document-models/service-offering/v1/src/reducers/tiers.d.ts +0 -3
- package/dist/document-models/service-offering/v1/src/reducers/tiers.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/src/reducers/tiers.js +0 -216
- package/dist/document-models/service-offering/v1/src/utils.d.ts +0 -61
- package/dist/document-models/service-offering/v1/src/utils.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/src/utils.js +0 -176
- package/dist/document-models/service-offering/v1/tests/document-model.test.d.ts +0 -10
- package/dist/document-models/service-offering/v1/tests/document-model.test.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/tests/document-model.test.js +0 -104
- package/dist/document-models/service-offering/v1/tests/offering.test.d.ts +0 -2
- package/dist/document-models/service-offering/v1/tests/offering.test.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/tests/offering.test.js +0 -115
- package/dist/document-models/service-offering/v1/tests/option-groups.test.d.ts +0 -2
- package/dist/document-models/service-offering/v1/tests/option-groups.test.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/tests/option-groups.test.js +0 -85
- package/dist/document-models/service-offering/v1/tests/services.test.d.ts +0 -2
- package/dist/document-models/service-offering/v1/tests/services.test.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/tests/services.test.js +0 -35
- package/dist/document-models/service-offering/v1/tests/tiers.test.d.ts +0 -2
- package/dist/document-models/service-offering/v1/tests/tiers.test.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/tests/tiers.test.js +0 -145
- package/dist/document-models/service-offering/v1/utils.d.ts +0 -17
- package/dist/document-models/service-offering/v1/utils.d.ts.map +0 -1
- package/dist/document-models/service-offering/v1/utils.js +0 -7
- package/dist/document-models/subscription-instance/gen/schema/types.d.ts +0 -552
- package/dist/document-models/subscription-instance/gen/schema/types.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/gen/schema/types.js +0 -1
- package/dist/document-models/subscription-instance/gen/schema/zod.d.ts +0 -109
- package/dist/document-models/subscription-instance/gen/schema/zod.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/gen/schema/zod.js +0 -556
- package/dist/document-models/subscription-instance/index.d.ts +0 -3
- package/dist/document-models/subscription-instance/index.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/index.js +0 -2
- package/dist/document-models/subscription-instance/upgrades/index.d.ts +0 -3
- package/dist/document-models/subscription-instance/upgrades/index.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/upgrades/index.js +0 -2
- package/dist/document-models/subscription-instance/upgrades/upgrade-manifest.d.ts +0 -4
- package/dist/document-models/subscription-instance/upgrades/upgrade-manifest.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/upgrades/upgrade-manifest.js +0 -7
- package/dist/document-models/subscription-instance/upgrades/versions.d.ts +0 -3
- package/dist/document-models/subscription-instance/upgrades/versions.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/upgrades/versions.js +0 -2
- package/dist/document-models/subscription-instance/v1/actions.d.ts +0 -53
- package/dist/document-models/subscription-instance/v1/actions.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/actions.js +0 -11
- package/dist/document-models/subscription-instance/v1/gen/actions.d.ts +0 -12
- package/dist/document-models/subscription-instance/v1/gen/actions.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/actions.js +0 -5
- package/dist/document-models/subscription-instance/v1/gen/controller.d.ts +0 -4
- package/dist/document-models/subscription-instance/v1/gen/controller.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/controller.js +0 -3
- package/dist/document-models/subscription-instance/v1/gen/creators.d.ts +0 -11
- package/dist/document-models/subscription-instance/v1/gen/creators.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/creators.js +0 -10
- package/dist/document-models/subscription-instance/v1/gen/customer/actions.d.ts +0 -12
- package/dist/document-models/subscription-instance/v1/gen/customer/actions.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/customer/actions.js +0 -1
- package/dist/document-models/subscription-instance/v1/gen/customer/creators.d.ts +0 -5
- package/dist/document-models/subscription-instance/v1/gen/customer/creators.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/customer/creators.js +0 -4
- package/dist/document-models/subscription-instance/v1/gen/customer/error.d.ts +0 -2
- package/dist/document-models/subscription-instance/v1/gen/customer/error.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/customer/error.js +0 -1
- package/dist/document-models/subscription-instance/v1/gen/customer/operations.d.ts +0 -8
- package/dist/document-models/subscription-instance/v1/gen/customer/operations.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/customer/operations.js +0 -1
- package/dist/document-models/subscription-instance/v1/gen/document-model.d.ts +0 -3
- package/dist/document-models/subscription-instance/v1/gen/document-model.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/document-model.js +0 -736
- package/dist/document-models/subscription-instance/v1/gen/document-schema.d.ts +0 -134
- package/dist/document-models/subscription-instance/v1/gen/document-schema.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/document-schema.js +0 -33
- package/dist/document-models/subscription-instance/v1/gen/document-type.d.ts +0 -2
- package/dist/document-models/subscription-instance/v1/gen/document-type.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/document-type.js +0 -1
- package/dist/document-models/subscription-instance/v1/gen/index.d.ts +0 -17
- package/dist/document-models/subscription-instance/v1/gen/index.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/index.js +0 -16
- package/dist/document-models/subscription-instance/v1/gen/metrics/actions.d.ts +0 -28
- package/dist/document-models/subscription-instance/v1/gen/metrics/actions.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/metrics/actions.js +0 -1
- package/dist/document-models/subscription-instance/v1/gen/metrics/creators.d.ts +0 -9
- package/dist/document-models/subscription-instance/v1/gen/metrics/creators.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/metrics/creators.js +0 -8
- package/dist/document-models/subscription-instance/v1/gen/metrics/error.d.ts +0 -74
- package/dist/document-models/subscription-instance/v1/gen/metrics/error.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/metrics/error.js +0 -86
- package/dist/document-models/subscription-instance/v1/gen/metrics/operations.d.ts +0 -12
- package/dist/document-models/subscription-instance/v1/gen/metrics/operations.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/metrics/operations.js +0 -1
- package/dist/document-models/subscription-instance/v1/gen/ph-factories.d.ts +0 -23
- package/dist/document-models/subscription-instance/v1/gen/ph-factories.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/ph-factories.js +0 -77
- package/dist/document-models/subscription-instance/v1/gen/reducer.d.ts +0 -3
- package/dist/document-models/subscription-instance/v1/gen/reducer.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/reducer.js +0 -212
- package/dist/document-models/subscription-instance/v1/gen/schema/index.d.ts +0 -3
- package/dist/document-models/subscription-instance/v1/gen/schema/index.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/schema/index.js +0 -2
- package/dist/document-models/subscription-instance/v1/gen/schema/types.d.ts +0 -552
- package/dist/document-models/subscription-instance/v1/gen/schema/types.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/schema/types.js +0 -1
- package/dist/document-models/subscription-instance/v1/gen/schema/zod.d.ts +0 -109
- package/dist/document-models/subscription-instance/v1/gen/schema/zod.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/schema/zod.js +0 -556
- package/dist/document-models/subscription-instance/v1/gen/service/actions.d.ts +0 -40
- package/dist/document-models/subscription-instance/v1/gen/service/actions.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/service/actions.js +0 -1
- package/dist/document-models/subscription-instance/v1/gen/service/creators.d.ts +0 -12
- package/dist/document-models/subscription-instance/v1/gen/service/creators.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/service/creators.js +0 -11
- package/dist/document-models/subscription-instance/v1/gen/service/error.d.ts +0 -63
- package/dist/document-models/subscription-instance/v1/gen/service/error.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/service/error.js +0 -60
- package/dist/document-models/subscription-instance/v1/gen/service/operations.d.ts +0 -15
- package/dist/document-models/subscription-instance/v1/gen/service/operations.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/service/operations.js +0 -1
- package/dist/document-models/subscription-instance/v1/gen/service-group/actions.d.ts +0 -24
- package/dist/document-models/subscription-instance/v1/gen/service-group/actions.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/service-group/actions.js +0 -1
- package/dist/document-models/subscription-instance/v1/gen/service-group/creators.d.ts +0 -8
- package/dist/document-models/subscription-instance/v1/gen/service-group/creators.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/service-group/creators.js +0 -7
- package/dist/document-models/subscription-instance/v1/gen/service-group/error.d.ts +0 -40
- package/dist/document-models/subscription-instance/v1/gen/service-group/error.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/service-group/error.js +0 -39
- package/dist/document-models/subscription-instance/v1/gen/service-group/operations.d.ts +0 -11
- package/dist/document-models/subscription-instance/v1/gen/service-group/operations.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/service-group/operations.js +0 -1
- package/dist/document-models/subscription-instance/v1/gen/subscription/actions.d.ts +0 -72
- package/dist/document-models/subscription-instance/v1/gen/subscription/actions.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/subscription/actions.js +0 -1
- package/dist/document-models/subscription-instance/v1/gen/subscription/creators.d.ts +0 -20
- package/dist/document-models/subscription-instance/v1/gen/subscription/creators.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/subscription/creators.js +0 -19
- package/dist/document-models/subscription-instance/v1/gen/subscription/error.d.ts +0 -56
- package/dist/document-models/subscription-instance/v1/gen/subscription/error.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/subscription/error.js +0 -51
- package/dist/document-models/subscription-instance/v1/gen/subscription/operations.d.ts +0 -23
- package/dist/document-models/subscription-instance/v1/gen/subscription/operations.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/subscription/operations.js +0 -1
- package/dist/document-models/subscription-instance/v1/gen/types.d.ts +0 -12
- package/dist/document-models/subscription-instance/v1/gen/types.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/types.js +0 -1
- package/dist/document-models/subscription-instance/v1/gen/utils.d.ts +0 -15
- package/dist/document-models/subscription-instance/v1/gen/utils.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/gen/utils.js +0 -81
- package/dist/document-models/subscription-instance/v1/hooks.d.ts +0 -14
- package/dist/document-models/subscription-instance/v1/hooks.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/hooks.js +0 -25
- package/dist/document-models/subscription-instance/v1/index.d.ts +0 -6
- package/dist/document-models/subscription-instance/v1/index.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/index.js +0 -5
- package/dist/document-models/subscription-instance/v1/module.d.ts +0 -5
- package/dist/document-models/subscription-instance/v1/module.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/module.js +0 -14
- package/dist/document-models/subscription-instance/v1/src/index.d.ts +0 -2
- package/dist/document-models/subscription-instance/v1/src/index.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/src/index.js +0 -1
- package/dist/document-models/subscription-instance/v1/src/reducers/customer.d.ts +0 -3
- package/dist/document-models/subscription-instance/v1/src/reducers/customer.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/src/reducers/customer.js +0 -9
- package/dist/document-models/subscription-instance/v1/src/reducers/metrics.d.ts +0 -3
- package/dist/document-models/subscription-instance/v1/src/reducers/metrics.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/src/reducers/metrics.js +0 -97
- package/dist/document-models/subscription-instance/v1/src/reducers/service-group.d.ts +0 -3
- package/dist/document-models/subscription-instance/v1/src/reducers/service-group.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/src/reducers/service-group.js +0 -133
- package/dist/document-models/subscription-instance/v1/src/reducers/service.d.ts +0 -3
- package/dist/document-models/subscription-instance/v1/src/reducers/service.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/src/reducers/service.js +0 -155
- package/dist/document-models/subscription-instance/v1/src/reducers/subscription.d.ts +0 -3
- package/dist/document-models/subscription-instance/v1/src/reducers/subscription.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/src/reducers/subscription.js +0 -275
- package/dist/document-models/subscription-instance/v1/src/reducers/utils.d.ts +0 -7
- package/dist/document-models/subscription-instance/v1/src/reducers/utils.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/src/reducers/utils.js +0 -15
- package/dist/document-models/subscription-instance/v1/src/utils.d.ts +0 -2
- package/dist/document-models/subscription-instance/v1/src/utils.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/src/utils.js +0 -1
- package/dist/document-models/subscription-instance/v1/tests/customer.test.d.ts +0 -2
- package/dist/document-models/subscription-instance/v1/tests/customer.test.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/tests/customer.test.js +0 -25
- package/dist/document-models/subscription-instance/v1/tests/document-model.test.d.ts +0 -10
- package/dist/document-models/subscription-instance/v1/tests/document-model.test.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/tests/document-model.test.js +0 -104
- package/dist/document-models/subscription-instance/v1/tests/metrics.test.d.ts +0 -2
- package/dist/document-models/subscription-instance/v1/tests/metrics.test.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/tests/metrics.test.js +0 -152
- package/dist/document-models/subscription-instance/v1/tests/service-group.test.d.ts +0 -2
- package/dist/document-models/subscription-instance/v1/tests/service-group.test.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/tests/service-group.test.js +0 -55
- package/dist/document-models/subscription-instance/v1/tests/service.test.d.ts +0 -2
- package/dist/document-models/subscription-instance/v1/tests/service.test.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/tests/service.test.js +0 -95
- package/dist/document-models/subscription-instance/v1/tests/subscription.test.d.ts +0 -2
- package/dist/document-models/subscription-instance/v1/tests/subscription.test.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/tests/subscription.test.js +0 -175
- package/dist/document-models/subscription-instance/v1/utils.d.ts +0 -14
- package/dist/document-models/subscription-instance/v1/utils.d.ts.map +0 -1
- package/dist/document-models/subscription-instance/v1/utils.js +0 -7
- package/dist/document-models/upgrade-manifests.d.ts +0 -3
- package/dist/document-models/upgrade-manifests.d.ts.map +0 -1
- package/dist/document-models/upgrade-manifests.js +0 -12
- package/dist/editors/editors.d.ts +0 -3
- package/dist/editors/editors.d.ts.map +0 -1
- package/dist/editors/editors.js +0 -10
- package/dist/editors/index.d.ts +0 -5
- package/dist/editors/index.d.ts.map +0 -1
- package/dist/editors/index.js +0 -4
- package/dist/editors/resource-instance-editor/components/OperatorProfilePanel.d.ts +0 -11
- package/dist/editors/resource-instance-editor/components/OperatorProfilePanel.d.ts.map +0 -1
- package/dist/editors/resource-instance-editor/components/OperatorProfilePanel.js +0 -28
- package/dist/editors/resource-instance-editor/editor.d.ts +0 -2
- package/dist/editors/resource-instance-editor/editor.d.ts.map +0 -1
- package/dist/editors/resource-instance-editor/editor.js +0 -1301
- package/dist/editors/resource-instance-editor/hooks/useBuilderProfiles.d.ts +0 -15
- package/dist/editors/resource-instance-editor/hooks/useBuilderProfiles.d.ts.map +0 -1
- package/dist/editors/resource-instance-editor/hooks/useBuilderProfiles.js +0 -85
- package/dist/editors/resource-instance-editor/module.d.ts +0 -4
- package/dist/editors/resource-instance-editor/module.d.ts.map +0 -1
- package/dist/editors/resource-instance-editor/module.js +0 -10
- package/dist/editors/resource-instance-editor/types.d.ts +0 -2
- package/dist/editors/resource-instance-editor/types.d.ts.map +0 -1
- package/dist/editors/resource-instance-editor/types.js +0 -1
- package/dist/editors/resource-instance-editor/utils/graphql-client.d.ts +0 -6
- package/dist/editors/resource-instance-editor/utils/graphql-client.d.ts.map +0 -1
- package/dist/editors/resource-instance-editor/utils/graphql-client.js +0 -5
- package/dist/editors/resource-template-editor/components/FacetTargeting.d.ts +0 -9
- package/dist/editors/resource-template-editor/components/FacetTargeting.d.ts.map +0 -1
- package/dist/editors/resource-template-editor/components/FacetTargeting.js +0 -958
- package/dist/editors/resource-template-editor/components/TemplateInfo.d.ts +0 -9
- package/dist/editors/resource-template-editor/components/TemplateInfo.d.ts.map +0 -1
- package/dist/editors/resource-template-editor/components/TemplateInfo.js +0 -2217
- package/dist/editors/resource-template-editor/components/markdown-editor.d.ts +0 -12
- package/dist/editors/resource-template-editor/components/markdown-editor.d.ts.map +0 -1
- package/dist/editors/resource-template-editor/components/markdown-editor.js +0 -130
- package/dist/editors/resource-template-editor/editor.d.ts +0 -2
- package/dist/editors/resource-template-editor/editor.d.ts.map +0 -1
- package/dist/editors/resource-template-editor/editor.js +0 -146
- package/dist/editors/resource-template-editor/module.d.ts +0 -4
- package/dist/editors/resource-template-editor/module.d.ts.map +0 -1
- package/dist/editors/resource-template-editor/module.js +0 -10
- package/dist/editors/service-offering-editor/components/ConfirmDialog.d.ts +0 -12
- package/dist/editors/service-offering-editor/components/ConfirmDialog.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/components/ConfirmDialog.js +0 -20
- package/dist/editors/service-offering-editor/components/EditName.d.ts +0 -3
- package/dist/editors/service-offering-editor/components/EditName.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/components/EditName.js +0 -31
- package/dist/editors/service-offering-editor/components/InfoIcon.d.ts +0 -8
- package/dist/editors/service-offering-editor/components/InfoIcon.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/components/InfoIcon.js +0 -5
- package/dist/editors/service-offering-editor/components/MarkdownPreview.d.ts +0 -8
- package/dist/editors/service-offering-editor/components/MarkdownPreview.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/components/MarkdownPreview.js +0 -47
- package/dist/editors/service-offering-editor/components/OfferingProgress.d.ts +0 -13
- package/dist/editors/service-offering-editor/components/OfferingProgress.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/components/OfferingProgress.js +0 -228
- package/dist/editors/service-offering-editor/components/ResourceTemplateSelector.d.ts +0 -9
- package/dist/editors/service-offering-editor/components/ResourceTemplateSelector.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/components/ResourceTemplateSelector.js +0 -485
- package/dist/editors/service-offering-editor/components/ServiceCatalog.d.ts +0 -9
- package/dist/editors/service-offering-editor/components/ServiceCatalog.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/components/ServiceCatalog.js +0 -928
- package/dist/editors/service-offering-editor/components/TheMatrix.d.ts +0 -9
- package/dist/editors/service-offering-editor/components/TheMatrix.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/components/TheMatrix.js +0 -1392
- package/dist/editors/service-offering-editor/components/TierDefinition.d.ts +0 -9
- package/dist/editors/service-offering-editor/components/TierDefinition.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/components/TierDefinition.js +0 -230
- package/dist/editors/service-offering-editor/components/TierPricingOptionsPanel.d.ts +0 -11
- package/dist/editors/service-offering-editor/components/TierPricingOptionsPanel.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/components/TierPricingOptionsPanel.js +0 -58
- package/dist/editors/service-offering-editor/components/pricing-utils.d.ts +0 -38
- package/dist/editors/service-offering-editor/components/pricing-utils.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/components/pricing-utils.js +0 -140
- package/dist/editors/service-offering-editor/editor.css +0 -119
- package/dist/editors/service-offering-editor/editor.d.ts +0 -4
- package/dist/editors/service-offering-editor/editor.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/editor.js +0 -79
- package/dist/editors/service-offering-editor/hooks/useRemoteResourceTemplates.d.ts +0 -17
- package/dist/editors/service-offering-editor/hooks/useRemoteResourceTemplates.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/hooks/useRemoteResourceTemplates.js +0 -49
- package/dist/editors/service-offering-editor/hooks/useServiceOfferingDocument.d.ts +0 -13
- package/dist/editors/service-offering-editor/hooks/useServiceOfferingDocument.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/hooks/useServiceOfferingDocument.js +0 -36
- package/dist/editors/service-offering-editor/module.d.ts +0 -4
- package/dist/editors/service-offering-editor/module.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/module.js +0 -10
- package/dist/editors/service-offering-editor/utils/graphql-client.d.ts +0 -6
- package/dist/editors/service-offering-editor/utils/graphql-client.d.ts.map +0 -1
- package/dist/editors/service-offering-editor/utils/graphql-client.js +0 -5
- package/dist/editors/subscription-instance-editor/components/BillingPanel.d.ts +0 -11
- package/dist/editors/subscription-instance-editor/components/BillingPanel.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/components/BillingPanel.js +0 -50
- package/dist/editors/subscription-instance-editor/components/CustomerInfo.d.ts +0 -11
- package/dist/editors/subscription-instance-editor/components/CustomerInfo.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/components/CustomerInfo.js +0 -56
- package/dist/editors/subscription-instance-editor/components/ImportServiceConfigButton.d.ts +0 -17
- package/dist/editors/subscription-instance-editor/components/ImportServiceConfigButton.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/components/ImportServiceConfigButton.js +0 -37
- package/dist/editors/subscription-instance-editor/components/MetricActions.d.ts +0 -21
- package/dist/editors/subscription-instance-editor/components/MetricActions.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/components/MetricActions.js +0 -71
- package/dist/editors/subscription-instance-editor/components/MockDataButton.d.ts +0 -9
- package/dist/editors/subscription-instance-editor/components/MockDataButton.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/components/MockDataButton.js +0 -254
- package/dist/editors/subscription-instance-editor/components/ModeToggle.d.ts +0 -8
- package/dist/editors/subscription-instance-editor/components/ModeToggle.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/components/ModeToggle.js +0 -4
- package/dist/editors/subscription-instance-editor/components/OperatorNotes.d.ts +0 -9
- package/dist/editors/subscription-instance-editor/components/OperatorNotes.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/components/OperatorNotes.js +0 -17
- package/dist/editors/subscription-instance-editor/components/ServicesPanel.d.ts +0 -11
- package/dist/editors/subscription-instance-editor/components/ServicesPanel.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/components/ServicesPanel.js +0 -40
- package/dist/editors/subscription-instance-editor/components/StatusBadge.d.ts +0 -7
- package/dist/editors/subscription-instance-editor/components/StatusBadge.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/components/StatusBadge.js +0 -26
- package/dist/editors/subscription-instance-editor/components/SubscriptionActions.d.ts +0 -11
- package/dist/editors/subscription-instance-editor/components/SubscriptionActions.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/components/SubscriptionActions.js +0 -87
- package/dist/editors/subscription-instance-editor/components/SubscriptionHeader.d.ts +0 -11
- package/dist/editors/subscription-instance-editor/components/SubscriptionHeader.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/components/SubscriptionHeader.js +0 -51
- package/dist/editors/subscription-instance-editor/components/billing-utils.d.ts +0 -61
- package/dist/editors/subscription-instance-editor/components/billing-utils.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/components/billing-utils.js +0 -169
- package/dist/editors/subscription-instance-editor/components/mapOfferingToSubscription.d.ts +0 -32
- package/dist/editors/subscription-instance-editor/components/mapOfferingToSubscription.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/components/mapOfferingToSubscription.js +0 -202
- package/dist/editors/subscription-instance-editor/editor.d.ts +0 -2
- package/dist/editors/subscription-instance-editor/editor.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/editor.js +0 -2589
- package/dist/editors/subscription-instance-editor/module.d.ts +0 -4
- package/dist/editors/subscription-instance-editor/module.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/module.js +0 -10
- package/dist/editors/subscription-instance-editor/types.d.ts +0 -3
- package/dist/editors/subscription-instance-editor/types.d.ts.map +0 -1
- package/dist/editors/subscription-instance-editor/types.js +0 -1
- package/dist/editors/utils/graphql-client.d.ts +0 -83
- package/dist/editors/utils/graphql-client.d.ts.map +0 -1
- package/dist/editors/utils/graphql-client.js +0 -197
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -6
- package/dist/powerhouse.manifest.json +0 -69
- package/dist/processors/factory.d.ts +0 -8
- package/dist/processors/factory.d.ts.map +0 -1
- package/dist/processors/factory.js +0 -39
- package/dist/processors/index.d.ts +0 -6
- package/dist/processors/index.d.ts.map +0 -1
- package/dist/processors/index.js +0 -5
- package/dist/style.css +0 -3562
- package/dist/subgraphs/index.d.ts +0 -2
- package/dist/subgraphs/index.d.ts.map +0 -1
- package/dist/subgraphs/index.js +0 -1
- package/dist/subgraphs/resources-services/index.d.ts +0 -11
- package/dist/subgraphs/resources-services/index.d.ts.map +0 -1
- package/dist/subgraphs/resources-services/index.js +0 -11
- package/dist/subgraphs/resources-services/resolvers.d.ts +0 -3
- package/dist/subgraphs/resources-services/resolvers.d.ts.map +0 -1
- package/dist/subgraphs/resources-services/resolvers.js +0 -732
- package/dist/subgraphs/resources-services/schema.d.ts +0 -3
- package/dist/subgraphs/resources-services/schema.d.ts.map +0 -1
- package/dist/subgraphs/resources-services/schema.js +0 -348
- package/dist/vite.config.d.ts +0 -3
- package/dist/vite.config.d.ts.map +0 -1
- package/dist/vite.config.js +0 -13
|
@@ -1,1392 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useMemo, useEffect, useRef, useCallback } from "react";
|
|
3
|
-
import { generateId } from "document-model/core";
|
|
4
|
-
import { usePHToast, } from "@powerhousedao/reactor-browser";
|
|
5
|
-
import {} from "@powerhousedao/service-offering/document-models/service-offering";
|
|
6
|
-
import { BILLING_CYCLE_SHORT_LABELS, BILLING_CYCLE_LABELS, BILLING_CYCLE_MONTHS, RECURRING_BILLING_CYCLES, formatPrice, detectMajorityCycle, } from "./pricing-utils.js";
|
|
7
|
-
import { addServiceLevel, updateServiceLevel, addUsageLimit, updateUsageLimit, removeUsageLimit, addService, updateService, } from "../../../document-models/service-offering/v1/gen/creators.js";
|
|
8
|
-
import { getUserSelectionPriceBreakdown, } from "../../../document-models/service-offering/v1/index.js";
|
|
9
|
-
import { InfoIcon } from "./InfoIcon.js";
|
|
10
|
-
import { ConfirmDialog } from "./ConfirmDialog.js";
|
|
11
|
-
const SERVICE_LEVELS = [
|
|
12
|
-
{
|
|
13
|
-
value: "INCLUDED",
|
|
14
|
-
label: "Included",
|
|
15
|
-
shortLabel: "✓",
|
|
16
|
-
color: "#059669",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
value: "OPTIONAL",
|
|
20
|
-
label: "Optional",
|
|
21
|
-
shortLabel: "Optional",
|
|
22
|
-
color: "#0284c7",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
value: "NOT_INCLUDED",
|
|
26
|
-
label: "Not Included",
|
|
27
|
-
shortLabel: "—",
|
|
28
|
-
color: "#94a3b8",
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
value: "NOT_APPLICABLE",
|
|
32
|
-
label: "Not Applicable",
|
|
33
|
-
shortLabel: "/",
|
|
34
|
-
color: "#cbd5e1",
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
value: "CUSTOM",
|
|
38
|
-
label: "Custom",
|
|
39
|
-
shortLabel: "Custom",
|
|
40
|
-
color: "#d97706",
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
value: "VARIABLE",
|
|
44
|
-
label: "Variable",
|
|
45
|
-
shortLabel: "#",
|
|
46
|
-
color: "#7c3aed",
|
|
47
|
-
},
|
|
48
|
-
];
|
|
49
|
-
const UNGROUPED_ID = "__ungrouped__";
|
|
50
|
-
export function TheMatrix({ document, dispatch }) {
|
|
51
|
-
const { state } = document;
|
|
52
|
-
const services = state.global.services ?? [];
|
|
53
|
-
const tiers = state.global.tiers ?? [];
|
|
54
|
-
const optionGroups = state.global.optionGroups ?? [];
|
|
55
|
-
const toast = usePHToast();
|
|
56
|
-
// Get selected facets from the offering document's facetTargets
|
|
57
|
-
const offeringFacetTargets = state.global.facetTargets ?? [];
|
|
58
|
-
// Build facet categories from the SERVICE OFFERING's selected facet targets
|
|
59
|
-
// This ensures only the options selected in the offering's facet targeting appear in the Matrix
|
|
60
|
-
const facetCategories = useMemo(() => {
|
|
61
|
-
const categories = {};
|
|
62
|
-
offeringFacetTargets.forEach((facet) => {
|
|
63
|
-
categories[facet.categoryKey] = {
|
|
64
|
-
label: facet.categoryLabel,
|
|
65
|
-
options: facet.selectedOptions.map((option) => ({
|
|
66
|
-
id: option.toLowerCase().replace(/\s+/g, "-"),
|
|
67
|
-
label: option,
|
|
68
|
-
})),
|
|
69
|
-
};
|
|
70
|
-
});
|
|
71
|
-
return categories;
|
|
72
|
-
}, [offeringFacetTargets]);
|
|
73
|
-
const [enabledOptionalGroups, setEnabledOptionalGroups] = useState(() => {
|
|
74
|
-
return new Set(optionGroups.filter((g) => g.defaultSelected).map((g) => g.id));
|
|
75
|
-
});
|
|
76
|
-
const [selectedCell, setSelectedCell] = useState(null);
|
|
77
|
-
const [addServiceModal, setAddServiceModal] = useState(null);
|
|
78
|
-
const [newServiceName, setNewServiceName] = useState("");
|
|
79
|
-
const [newServiceDescription, setNewServiceDescription] = useState("");
|
|
80
|
-
const [newServiceSelectedTiers, setNewServiceSelectedTiers] = useState(new Set());
|
|
81
|
-
// Edit service modal state
|
|
82
|
-
const [editServiceModal, setEditServiceModal] = useState(null);
|
|
83
|
-
const [editServiceName, setEditServiceName] = useState("");
|
|
84
|
-
const [editServiceDescription, setEditServiceDescription] = useState("");
|
|
85
|
-
const [editServiceSelectedTiers, setEditServiceSelectedTiers] = useState(new Set());
|
|
86
|
-
const [selectedTierIdx, setSelectedTierIdx] = useState(0);
|
|
87
|
-
// Global billing cycle view - lets users see prices/discounts for different cycles
|
|
88
|
-
const [activeBillingCycle, setActiveBillingCycle] = useState("MONTHLY");
|
|
89
|
-
// Per-addon billing cycle state (add-ons have independent cycle selection)
|
|
90
|
-
const [addonBillingCycles, setAddonBillingCycles] = useState({});
|
|
91
|
-
// Per-group billing cycle state (non-addon service groups can select their own cycle)
|
|
92
|
-
const [groupBillingCycles, setGroupBillingCycles] = useState({});
|
|
93
|
-
// Detect CUSTOM billing mode: any non-addon group has a cycle different from global
|
|
94
|
-
const isCustomBillingMode = useMemo(() => {
|
|
95
|
-
const overrides = Object.values(groupBillingCycles);
|
|
96
|
-
if (overrides.length === 0)
|
|
97
|
-
return false;
|
|
98
|
-
return overrides.some((cycle) => cycle !== activeBillingCycle);
|
|
99
|
-
}, [groupBillingCycles, activeBillingCycle]);
|
|
100
|
-
// Billing cycle majority detection (state only — memo goes after regularGroups is defined)
|
|
101
|
-
const [majorityDismissed, setMajorityDismissed] = useState(false);
|
|
102
|
-
// Handle group cycle override with majority-based auto-remerge
|
|
103
|
-
const handleGroupCycleChange = useCallback((groupId, newCycle) => {
|
|
104
|
-
setGroupBillingCycles((prev) => {
|
|
105
|
-
const updated = { ...prev, [groupId]: newCycle };
|
|
106
|
-
// Count total regular (non-setup, non-addon) groups
|
|
107
|
-
const totalRegular = optionGroups.filter((g) => g.costType !== "SETUP" && !g.isAddOn).length;
|
|
108
|
-
if (totalRegular === 0) {
|
|
109
|
-
return updated;
|
|
110
|
-
}
|
|
111
|
-
// Compute effective cycle for each regular group
|
|
112
|
-
const cycleCounts = new Map();
|
|
113
|
-
for (const g of optionGroups) {
|
|
114
|
-
if (g.costType === "SETUP" || g.isAddOn)
|
|
115
|
-
continue;
|
|
116
|
-
const effective = updated[g.id] || activeBillingCycle;
|
|
117
|
-
cycleCounts.set(effective, (cycleCounts.get(effective) || 0) + 1);
|
|
118
|
-
}
|
|
119
|
-
// Check for majority (>50%) on a NEW cycle different from the global
|
|
120
|
-
for (const [cycle, count] of cycleCounts) {
|
|
121
|
-
if (count > totalRegular / 2 && cycle !== activeBillingCycle) {
|
|
122
|
-
// New majority found — adopt as global and clear overrides
|
|
123
|
-
setTimeout(() => {
|
|
124
|
-
setActiveBillingCycle(cycle);
|
|
125
|
-
setGroupBillingCycles({});
|
|
126
|
-
}, 0);
|
|
127
|
-
return prev;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return updated;
|
|
131
|
-
});
|
|
132
|
-
}, [activeBillingCycle, optionGroups]);
|
|
133
|
-
// When switching to a global cycle, reset all group overrides (exit Custom mode)
|
|
134
|
-
const handleGlobalCycleChange = useCallback((cycle) => {
|
|
135
|
-
setActiveBillingCycle(cycle);
|
|
136
|
-
setGroupBillingCycles({});
|
|
137
|
-
}, []);
|
|
138
|
-
// All non-addon group IDs (always included) + user-toggled addon IDs
|
|
139
|
-
const allSelectedGroupIds = useMemo(() => {
|
|
140
|
-
const nonAddonIds = optionGroups.filter((g) => !g.isAddOn).map((g) => g.id);
|
|
141
|
-
const addonIds = [...enabledOptionalGroups].filter((id) => optionGroups.some((g) => g.id === id && g.isAddOn));
|
|
142
|
-
return [...nonAddonIds, ...addonIds];
|
|
143
|
-
}, [optionGroups, enabledOptionalGroups]);
|
|
144
|
-
// Copy current UserSelectionInput to clipboard for mutation testing
|
|
145
|
-
const handleCopyUserSelection = useCallback(() => {
|
|
146
|
-
const selectedTier = tiers[selectedTierIdx];
|
|
147
|
-
if (!selectedTier)
|
|
148
|
-
return;
|
|
149
|
-
const groupOverrides = Object.entries(groupBillingCycles)
|
|
150
|
-
.filter(([, cycle]) => cycle !== activeBillingCycle)
|
|
151
|
-
.map(([groupId, billingCycle]) => ({ groupId, billingCycle }));
|
|
152
|
-
const addonOverrides = Object.entries(addonBillingCycles)
|
|
153
|
-
.filter(([groupId]) => enabledOptionalGroups.has(groupId))
|
|
154
|
-
.filter(([, cycle]) => cycle !== activeBillingCycle)
|
|
155
|
-
.map(([groupId, billingCycle]) => ({ groupId, billingCycle }));
|
|
156
|
-
const userSelection = {
|
|
157
|
-
tierId: selectedTier.id,
|
|
158
|
-
billingCycle: activeBillingCycle,
|
|
159
|
-
optionGroupIds: allSelectedGroupIds,
|
|
160
|
-
...(groupOverrides.length > 0 && {
|
|
161
|
-
groupBillingCycleOverrides: groupOverrides,
|
|
162
|
-
}),
|
|
163
|
-
...(addonOverrides.length > 0 && {
|
|
164
|
-
addonBillingCycleOverrides: addonOverrides,
|
|
165
|
-
}),
|
|
166
|
-
};
|
|
167
|
-
const mutationPayload = JSON.stringify(userSelection, null, 2);
|
|
168
|
-
navigator.clipboard.writeText(mutationPayload).then(() => toast?.("UserSelectionInput copied to clipboard!", { type: "success" }), () => toast?.("Failed to copy to clipboard", { type: "error" }));
|
|
169
|
-
}, [
|
|
170
|
-
tiers,
|
|
171
|
-
selectedTierIdx,
|
|
172
|
-
activeBillingCycle,
|
|
173
|
-
allSelectedGroupIds,
|
|
174
|
-
groupBillingCycles,
|
|
175
|
-
addonBillingCycles,
|
|
176
|
-
toast,
|
|
177
|
-
]);
|
|
178
|
-
// Initialize selected facets from offering's facet targets
|
|
179
|
-
const [selectedFacets, setSelectedFacets] = useState(() => {
|
|
180
|
-
const initial = {};
|
|
181
|
-
offeringFacetTargets.forEach((facet) => {
|
|
182
|
-
if (facet.selectedOptions.length > 0) {
|
|
183
|
-
initial[facet.categoryKey] = facet.selectedOptions[0]
|
|
184
|
-
.toLowerCase()
|
|
185
|
-
.replace(/\s+/g, "-");
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
return initial;
|
|
189
|
-
});
|
|
190
|
-
// Metric editing modal state
|
|
191
|
-
const [metricModal, setMetricModal] = useState(null);
|
|
192
|
-
const [metricName, setMetricName] = useState("");
|
|
193
|
-
const [metricLimits, setMetricLimits] = useState({});
|
|
194
|
-
const [metricEnabledTiers, setMetricEnabledTiers] = useState(new Set());
|
|
195
|
-
// Per-tier overage pricing for metric modal
|
|
196
|
-
const [metricOveragePrices, setMetricOveragePrices] = useState({});
|
|
197
|
-
// Unit name for the metric (e.g., "entity", "user", "API call")
|
|
198
|
-
const [metricUnitName, setMetricUnitName] = useState("");
|
|
199
|
-
// Per-tier paid limits for the metric modal (dual limits: freeLimit + paidLimit)
|
|
200
|
-
const [metricPaidLimits, setMetricPaidLimits] = useState({});
|
|
201
|
-
// Reset cycle for the metric (shared across tiers)
|
|
202
|
-
const [metricResetCycle, setMetricResetCycle] = useState("MONTHLY");
|
|
203
|
-
// Destructive action confirmation state
|
|
204
|
-
const [pendingRemoveMetric, setPendingRemoveMetric] = useState(null);
|
|
205
|
-
const getServiceGroup = (service) => {
|
|
206
|
-
// Services now have optionGroupId directly on them
|
|
207
|
-
return service.optionGroupId || null;
|
|
208
|
-
};
|
|
209
|
-
const groupedServices = useMemo(() => {
|
|
210
|
-
const groups = new Map();
|
|
211
|
-
optionGroups.forEach((g) => groups.set(g.id, []));
|
|
212
|
-
groups.set(UNGROUPED_ID, []);
|
|
213
|
-
services.forEach((service) => {
|
|
214
|
-
const groupId = getServiceGroup(service) || UNGROUPED_ID;
|
|
215
|
-
const groupServices = groups.get(groupId) || [];
|
|
216
|
-
groupServices.push(service);
|
|
217
|
-
groups.set(groupId, groupServices);
|
|
218
|
-
});
|
|
219
|
-
// Sort services within each group by displayOrder
|
|
220
|
-
groups.forEach((groupServices, _groupId) => {
|
|
221
|
-
groupServices.sort((a, b) => {
|
|
222
|
-
const orderA = a.displayOrder ?? 999;
|
|
223
|
-
const orderB = b.displayOrder ?? 999;
|
|
224
|
-
return orderA - orderB;
|
|
225
|
-
});
|
|
226
|
-
});
|
|
227
|
-
return groups;
|
|
228
|
-
}, [services, tiers, optionGroups]);
|
|
229
|
-
const setupGroups = useMemo(() => {
|
|
230
|
-
return optionGroups.filter((g) => g.costType === "SETUP");
|
|
231
|
-
}, [optionGroups]);
|
|
232
|
-
const regularGroups = useMemo(() => {
|
|
233
|
-
return optionGroups.filter((g) => g.costType !== "SETUP" && !g.isAddOn);
|
|
234
|
-
}, [optionGroups]);
|
|
235
|
-
// Billing cycle majority suggestion: suggest switching when >50% of groups share a different cycle
|
|
236
|
-
const majorityResult = useMemo(() => detectMajorityCycle(regularGroups, activeBillingCycle, groupBillingCycles), [regularGroups, activeBillingCycle, groupBillingCycles]);
|
|
237
|
-
// Global billing cycle bar: driven by the offering's availableBillingCycles
|
|
238
|
-
const availableCyclesForSelectedTier = useMemo(() => {
|
|
239
|
-
const globalCycles = state.global.availableBillingCycles ?? [];
|
|
240
|
-
if (globalCycles.length === 0) {
|
|
241
|
-
return RECURRING_BILLING_CYCLES;
|
|
242
|
-
}
|
|
243
|
-
return RECURRING_BILLING_CYCLES.filter((c) => globalCycles.includes(c));
|
|
244
|
-
}, [state.global.availableBillingCycles]);
|
|
245
|
-
const addonGroups = useMemo(() => {
|
|
246
|
-
return optionGroups.filter((g) => g.isAddOn);
|
|
247
|
-
}, [optionGroups]);
|
|
248
|
-
// Precompute price breakdowns for all tiers using the centralized utility
|
|
249
|
-
const tierBreakdowns = useMemo(() => {
|
|
250
|
-
return tiers.map((tier) => getUserSelectionPriceBreakdown(state, {
|
|
251
|
-
tierId: tier.id,
|
|
252
|
-
billingCycle: activeBillingCycle,
|
|
253
|
-
optionGroupIds: allSelectedGroupIds,
|
|
254
|
-
groupBillingCycleOverrides: groupBillingCycles,
|
|
255
|
-
addonBillingCycleOverrides: addonBillingCycles,
|
|
256
|
-
}));
|
|
257
|
-
}, [
|
|
258
|
-
tiers,
|
|
259
|
-
optionGroups,
|
|
260
|
-
activeBillingCycle,
|
|
261
|
-
allSelectedGroupIds,
|
|
262
|
-
groupBillingCycles,
|
|
263
|
-
addonBillingCycles,
|
|
264
|
-
]);
|
|
265
|
-
const ungroupedSetupServices = useMemo(() => {
|
|
266
|
-
return (groupedServices.get(UNGROUPED_ID) || []).filter((s) => s.isSetupFormation);
|
|
267
|
-
}, [groupedServices]);
|
|
268
|
-
const ungroupedRegularServices = useMemo(() => {
|
|
269
|
-
return (groupedServices.get(UNGROUPED_ID) || []).filter((s) => !s.isSetupFormation);
|
|
270
|
-
}, [groupedServices]);
|
|
271
|
-
const getServiceLevelForTier = (serviceId, tier) => {
|
|
272
|
-
return tier.serviceLevels.find((sl) => sl.serviceId === serviceId);
|
|
273
|
-
};
|
|
274
|
-
const getUniqueMetricsForService = (serviceId) => {
|
|
275
|
-
const metricsSet = new Set();
|
|
276
|
-
tiers.forEach((tier) => {
|
|
277
|
-
tier.usageLimits
|
|
278
|
-
.filter((ul) => ul.serviceId === serviceId)
|
|
279
|
-
.forEach((ul) => metricsSet.add(ul.metric));
|
|
280
|
-
});
|
|
281
|
-
return Array.from(metricsSet);
|
|
282
|
-
};
|
|
283
|
-
// Incomplete services detection - services not assigned to any tier
|
|
284
|
-
const incompleteServices = useMemo(() => {
|
|
285
|
-
if (tiers.length === 0)
|
|
286
|
-
return [];
|
|
287
|
-
return services.filter((service) => {
|
|
288
|
-
// Check if service is included in at least one tier
|
|
289
|
-
const isIncludedAnywhere = tiers.some((tier) => tier.serviceLevels.some((sl) => sl.serviceId === service.id && sl.level === "INCLUDED"));
|
|
290
|
-
return !isIncludedAnywhere;
|
|
291
|
-
});
|
|
292
|
-
}, [services, tiers]);
|
|
293
|
-
const getUsageLimitForMetric = (serviceId, metric, tier) => {
|
|
294
|
-
return tier.usageLimits.find((ul) => ul.serviceId === serviceId && ul.metric === metric);
|
|
295
|
-
};
|
|
296
|
-
// Derive tier display pricing from precomputed breakdown
|
|
297
|
-
const getTierDisplayPrice = (tierIdx) => {
|
|
298
|
-
const breakdown = tierBreakdowns[tierIdx];
|
|
299
|
-
const months = BILLING_CYCLE_MONTHS[activeBillingCycle];
|
|
300
|
-
const undiscountedTotal = breakdown.tierCycleTotal +
|
|
301
|
-
breakdown.addOnBreakdowns.reduce((s, a) => s + a.cycleAmount, 0);
|
|
302
|
-
const discountedTotal = breakdown.totals.grandRecurringTotal;
|
|
303
|
-
const monthlyEq = months > 0
|
|
304
|
-
? Math.round((discountedTotal / months) * 100) / 100
|
|
305
|
-
: discountedTotal;
|
|
306
|
-
const savingsPercent = undiscountedTotal > 0
|
|
307
|
-
? Math.round(((undiscountedTotal - discountedTotal) / undiscountedTotal) * 100)
|
|
308
|
-
: 0;
|
|
309
|
-
return {
|
|
310
|
-
amount: discountedTotal,
|
|
311
|
-
monthlyEquivalent: monthlyEq,
|
|
312
|
-
billedTotal: discountedTotal,
|
|
313
|
-
hasDiscount: savingsPercent > 0,
|
|
314
|
-
savingsPercent,
|
|
315
|
-
discountLabel: savingsPercent > 0 ? `SAVE ${savingsPercent}%` : "",
|
|
316
|
-
};
|
|
317
|
-
};
|
|
318
|
-
const handleSetServiceLevel = (serviceId, tierId, level, existingLevelId, optionGroupId) => {
|
|
319
|
-
if (existingLevelId) {
|
|
320
|
-
dispatch(updateServiceLevel({
|
|
321
|
-
tierId,
|
|
322
|
-
serviceLevelId: existingLevelId,
|
|
323
|
-
level,
|
|
324
|
-
lastModified: new Date().toISOString(),
|
|
325
|
-
}));
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
dispatch(addServiceLevel({
|
|
329
|
-
tierId,
|
|
330
|
-
serviceLevelId: generateId(),
|
|
331
|
-
serviceId,
|
|
332
|
-
level,
|
|
333
|
-
optionGroupId,
|
|
334
|
-
lastModified: new Date().toISOString(),
|
|
335
|
-
}));
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
const toggleOptionalGroup = (groupId) => {
|
|
339
|
-
setEnabledOptionalGroups((prev) => {
|
|
340
|
-
const next = new Set(prev);
|
|
341
|
-
if (next.has(groupId)) {
|
|
342
|
-
next.delete(groupId);
|
|
343
|
-
}
|
|
344
|
-
else {
|
|
345
|
-
next.add(groupId);
|
|
346
|
-
}
|
|
347
|
-
return next;
|
|
348
|
-
});
|
|
349
|
-
};
|
|
350
|
-
const handleAddService = () => {
|
|
351
|
-
if (!addServiceModal || !newServiceName.trim())
|
|
352
|
-
return;
|
|
353
|
-
const newServiceId = generateId();
|
|
354
|
-
const now = new Date().toISOString();
|
|
355
|
-
// Add the service with optionGroupId directly on the service
|
|
356
|
-
dispatch(addService({
|
|
357
|
-
id: newServiceId,
|
|
358
|
-
title: newServiceName.trim(),
|
|
359
|
-
description: newServiceDescription.trim() || null,
|
|
360
|
-
isSetupFormation: addServiceModal.isSetupFormation,
|
|
361
|
-
optionGroupId: addServiceModal.groupId !== UNGROUPED_ID
|
|
362
|
-
? addServiceModal.groupId
|
|
363
|
-
: undefined,
|
|
364
|
-
lastModified: now,
|
|
365
|
-
}));
|
|
366
|
-
// Create ServiceLevelBindings for each selected tier
|
|
367
|
-
newServiceSelectedTiers.forEach((tierId) => {
|
|
368
|
-
dispatch(addServiceLevel({
|
|
369
|
-
tierId,
|
|
370
|
-
serviceLevelId: generateId(),
|
|
371
|
-
serviceId: newServiceId,
|
|
372
|
-
level: "INCLUDED",
|
|
373
|
-
optionGroupId: addServiceModal.groupId !== UNGROUPED_ID
|
|
374
|
-
? addServiceModal.groupId
|
|
375
|
-
: undefined,
|
|
376
|
-
lastModified: now,
|
|
377
|
-
}));
|
|
378
|
-
});
|
|
379
|
-
setNewServiceName("");
|
|
380
|
-
setNewServiceDescription("");
|
|
381
|
-
setNewServiceSelectedTiers(new Set());
|
|
382
|
-
setAddServiceModal(null);
|
|
383
|
-
};
|
|
384
|
-
const openAddServiceModal = (groupId, isSetupFormation) => {
|
|
385
|
-
setAddServiceModal({ groupId, isSetupFormation });
|
|
386
|
-
setNewServiceName("");
|
|
387
|
-
setNewServiceDescription("");
|
|
388
|
-
setNewServiceSelectedTiers(new Set());
|
|
389
|
-
};
|
|
390
|
-
const openEditServiceModal = (service) => {
|
|
391
|
-
setEditServiceModal(service);
|
|
392
|
-
setEditServiceName(service.title);
|
|
393
|
-
setEditServiceDescription(service.description || "");
|
|
394
|
-
// Initialize selected tiers based on current service levels
|
|
395
|
-
const includedTiers = new Set();
|
|
396
|
-
tiers.forEach((tier) => {
|
|
397
|
-
const serviceLevel = tier.serviceLevels.find((sl) => sl.serviceId === service.id);
|
|
398
|
-
if (serviceLevel && serviceLevel.level === "INCLUDED") {
|
|
399
|
-
includedTiers.add(tier.id);
|
|
400
|
-
}
|
|
401
|
-
});
|
|
402
|
-
setEditServiceSelectedTiers(includedTiers);
|
|
403
|
-
};
|
|
404
|
-
const handleSaveEditService = () => {
|
|
405
|
-
if (!editServiceModal || !editServiceName.trim())
|
|
406
|
-
return;
|
|
407
|
-
const now = new Date().toISOString();
|
|
408
|
-
// Update service name/description
|
|
409
|
-
dispatch(updateService({
|
|
410
|
-
id: editServiceModal.id,
|
|
411
|
-
title: editServiceName.trim(),
|
|
412
|
-
description: editServiceDescription.trim() || null,
|
|
413
|
-
lastModified: now,
|
|
414
|
-
}));
|
|
415
|
-
// Update tier assignments
|
|
416
|
-
tiers.forEach((tier) => {
|
|
417
|
-
const existingLevel = tier.serviceLevels.find((sl) => sl.serviceId === editServiceModal.id);
|
|
418
|
-
const shouldBeIncluded = editServiceSelectedTiers.has(tier.id);
|
|
419
|
-
if (shouldBeIncluded && !existingLevel) {
|
|
420
|
-
// Add to tier
|
|
421
|
-
dispatch(addServiceLevel({
|
|
422
|
-
tierId: tier.id,
|
|
423
|
-
serviceLevelId: generateId(),
|
|
424
|
-
serviceId: editServiceModal.id,
|
|
425
|
-
level: "INCLUDED",
|
|
426
|
-
optionGroupId: editServiceModal.optionGroupId || undefined,
|
|
427
|
-
lastModified: now,
|
|
428
|
-
}));
|
|
429
|
-
}
|
|
430
|
-
else if (shouldBeIncluded &&
|
|
431
|
-
existingLevel &&
|
|
432
|
-
existingLevel.level !== "INCLUDED") {
|
|
433
|
-
// Update to included
|
|
434
|
-
dispatch(updateServiceLevel({
|
|
435
|
-
tierId: tier.id,
|
|
436
|
-
serviceLevelId: existingLevel.id,
|
|
437
|
-
level: "INCLUDED",
|
|
438
|
-
lastModified: now,
|
|
439
|
-
}));
|
|
440
|
-
}
|
|
441
|
-
else if (!shouldBeIncluded &&
|
|
442
|
-
existingLevel &&
|
|
443
|
-
existingLevel.level === "INCLUDED") {
|
|
444
|
-
// Remove from tier (set to NOT_INCLUDED)
|
|
445
|
-
dispatch(updateServiceLevel({
|
|
446
|
-
tierId: tier.id,
|
|
447
|
-
serviceLevelId: existingLevel.id,
|
|
448
|
-
level: "NOT_INCLUDED",
|
|
449
|
-
lastModified: now,
|
|
450
|
-
}));
|
|
451
|
-
}
|
|
452
|
-
});
|
|
453
|
-
setEditServiceModal(null);
|
|
454
|
-
setEditServiceName("");
|
|
455
|
-
setEditServiceDescription("");
|
|
456
|
-
setEditServiceSelectedTiers(new Set());
|
|
457
|
-
};
|
|
458
|
-
// Metric modal handlers
|
|
459
|
-
const handleAddMetric = (serviceId) => {
|
|
460
|
-
setMetricModal({ serviceId, metric: null });
|
|
461
|
-
setMetricName("");
|
|
462
|
-
// Initialize limits for all tiers to empty string
|
|
463
|
-
const initialLimits = {};
|
|
464
|
-
const initialPaidLimits = {};
|
|
465
|
-
const initialOveragePrices = {};
|
|
466
|
-
// Only enable tiers where the service is INCLUDED
|
|
467
|
-
const includedTierIds = new Set();
|
|
468
|
-
tiers.forEach((tier) => {
|
|
469
|
-
initialLimits[tier.id] = "";
|
|
470
|
-
initialPaidLimits[tier.id] = "";
|
|
471
|
-
initialOveragePrices[tier.id] = "";
|
|
472
|
-
const binding = tier.serviceLevels.find((sl) => sl.serviceId === serviceId);
|
|
473
|
-
if (binding && binding.level === "INCLUDED") {
|
|
474
|
-
includedTierIds.add(tier.id);
|
|
475
|
-
}
|
|
476
|
-
});
|
|
477
|
-
setMetricLimits(initialLimits);
|
|
478
|
-
setMetricPaidLimits(initialPaidLimits);
|
|
479
|
-
setMetricEnabledTiers(includedTierIds);
|
|
480
|
-
// Reset per-tier overage pricing and unit name
|
|
481
|
-
setMetricOveragePrices(initialOveragePrices);
|
|
482
|
-
setMetricUnitName("");
|
|
483
|
-
// Default to NONE for setup/formation services, MONTHLY otherwise
|
|
484
|
-
const service = services.find((s) => s.id === serviceId);
|
|
485
|
-
setMetricResetCycle(service?.isSetupFormation ? "NONE" : "MONTHLY");
|
|
486
|
-
};
|
|
487
|
-
const handleEditMetric = (serviceId, metric) => {
|
|
488
|
-
setMetricModal({ serviceId, metric });
|
|
489
|
-
setMetricName(metric);
|
|
490
|
-
// Initialize limits with existing values and track which tiers have this metric
|
|
491
|
-
const existingLimits = {};
|
|
492
|
-
const existingPaidLimits = {};
|
|
493
|
-
const existingOveragePrices = {};
|
|
494
|
-
const enabledTiers = new Set();
|
|
495
|
-
let existingUnitName = "";
|
|
496
|
-
let existingResetCycle = "MONTHLY";
|
|
497
|
-
tiers.forEach((tier) => {
|
|
498
|
-
const usageLimit = tier.usageLimits.find((ul) => ul.serviceId === serviceId && ul.metric === metric);
|
|
499
|
-
// Load value from either limit (numeric) or notes (string)
|
|
500
|
-
existingLimits[tier.id] =
|
|
501
|
-
usageLimit?.freeLimit?.toString() || usageLimit?.notes || "";
|
|
502
|
-
existingPaidLimits[tier.id] = usageLimit?.paidLimit?.toString() || "";
|
|
503
|
-
// Load per-tier overage pricing
|
|
504
|
-
existingOveragePrices[tier.id] = usageLimit?.unitPrice?.toString() || "";
|
|
505
|
-
if (usageLimit) {
|
|
506
|
-
enabledTiers.add(tier.id);
|
|
507
|
-
// Get unit name from first tier that has it
|
|
508
|
-
if (!existingUnitName && usageLimit.unitName) {
|
|
509
|
-
existingUnitName = usageLimit.unitName;
|
|
510
|
-
}
|
|
511
|
-
// Get reset cycle from first tier that has it
|
|
512
|
-
if (usageLimit.resetCycle) {
|
|
513
|
-
existingResetCycle = usageLimit.resetCycle;
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
});
|
|
517
|
-
setMetricLimits(existingLimits);
|
|
518
|
-
setMetricPaidLimits(existingPaidLimits);
|
|
519
|
-
setMetricEnabledTiers(enabledTiers);
|
|
520
|
-
setMetricOveragePrices(existingOveragePrices);
|
|
521
|
-
setMetricUnitName(existingUnitName);
|
|
522
|
-
setMetricResetCycle(existingResetCycle);
|
|
523
|
-
};
|
|
524
|
-
const handleRemoveMetric = (serviceId, metric) => {
|
|
525
|
-
setPendingRemoveMetric({ serviceId, metric });
|
|
526
|
-
};
|
|
527
|
-
const confirmRemoveMetric = () => {
|
|
528
|
-
if (!pendingRemoveMetric)
|
|
529
|
-
return;
|
|
530
|
-
const { serviceId, metric } = pendingRemoveMetric;
|
|
531
|
-
// Remove this metric from all tiers
|
|
532
|
-
tiers.forEach((tier) => {
|
|
533
|
-
const usageLimit = tier.usageLimits.find((ul) => ul.serviceId === serviceId && ul.metric === metric);
|
|
534
|
-
if (usageLimit) {
|
|
535
|
-
dispatch(removeUsageLimit({
|
|
536
|
-
tierId: tier.id,
|
|
537
|
-
limitId: usageLimit.id,
|
|
538
|
-
lastModified: new Date().toISOString(),
|
|
539
|
-
}));
|
|
540
|
-
}
|
|
541
|
-
});
|
|
542
|
-
setPendingRemoveMetric(null);
|
|
543
|
-
};
|
|
544
|
-
// Arrow button handler for service reordering
|
|
545
|
-
const handleReorderService = (serviceId, direction, groupServices) => {
|
|
546
|
-
// Sort services by displayOrder for consistent ordering
|
|
547
|
-
const sortedServices = [...groupServices].sort((a, b) => {
|
|
548
|
-
const orderA = a.displayOrder ?? 999;
|
|
549
|
-
const orderB = b.displayOrder ?? 999;
|
|
550
|
-
return orderA - orderB;
|
|
551
|
-
});
|
|
552
|
-
const currentIndex = sortedServices.findIndex((s) => s.id === serviceId);
|
|
553
|
-
if (currentIndex === -1)
|
|
554
|
-
return;
|
|
555
|
-
const newIndex = direction === "up" ? currentIndex - 1 : currentIndex + 1;
|
|
556
|
-
// Check bounds
|
|
557
|
-
if (newIndex < 0 || newIndex >= sortedServices.length)
|
|
558
|
-
return;
|
|
559
|
-
const now = new Date().toISOString();
|
|
560
|
-
// Swap the two services
|
|
561
|
-
const currentService = sortedServices[currentIndex];
|
|
562
|
-
const swapService = sortedServices[newIndex];
|
|
563
|
-
dispatch(updateService({
|
|
564
|
-
id: currentService.id,
|
|
565
|
-
displayOrder: newIndex,
|
|
566
|
-
lastModified: now,
|
|
567
|
-
}));
|
|
568
|
-
dispatch(updateService({
|
|
569
|
-
id: swapService.id,
|
|
570
|
-
displayOrder: currentIndex,
|
|
571
|
-
lastModified: now,
|
|
572
|
-
}));
|
|
573
|
-
};
|
|
574
|
-
const handleSaveMetric = () => {
|
|
575
|
-
if (!metricModal || !metricName.trim())
|
|
576
|
-
return;
|
|
577
|
-
const { serviceId, metric: originalMetric } = metricModal;
|
|
578
|
-
const now = new Date().toISOString();
|
|
579
|
-
tiers.forEach((tier) => {
|
|
580
|
-
const isEnabled = metricEnabledTiers.has(tier.id);
|
|
581
|
-
const limitValue = metricLimits[tier.id];
|
|
582
|
-
const existingLimit = originalMetric
|
|
583
|
-
? tier.usageLimits.find((ul) => ul.serviceId === serviceId && ul.metric === originalMetric)
|
|
584
|
-
: null;
|
|
585
|
-
// Check if value is numeric or string
|
|
586
|
-
const parsedLimit = limitValue ? parseInt(limitValue, 10) : null;
|
|
587
|
-
const isNumeric = parsedLimit !== null && !isNaN(parsedLimit);
|
|
588
|
-
// Parse paid limit
|
|
589
|
-
const paidLimitValue = metricPaidLimits[tier.id];
|
|
590
|
-
const parsedPaidLimit = paidLimitValue
|
|
591
|
-
? parseInt(paidLimitValue, 10)
|
|
592
|
-
: null;
|
|
593
|
-
const isPaidNumeric = parsedPaidLimit !== null && !isNaN(parsedPaidLimit);
|
|
594
|
-
// Get per-tier overage pricing
|
|
595
|
-
const tierOveragePrice = metricOveragePrices[tier.id];
|
|
596
|
-
const parsedOveragePrice = tierOveragePrice
|
|
597
|
-
? parseFloat(tierOveragePrice)
|
|
598
|
-
: null;
|
|
599
|
-
const hasOveragePricing = parsedOveragePrice !== null && !isNaN(parsedOveragePrice);
|
|
600
|
-
if (existingLimit && !isEnabled) {
|
|
601
|
-
// Remove limit - tier was disabled
|
|
602
|
-
dispatch(removeUsageLimit({
|
|
603
|
-
tierId: tier.id,
|
|
604
|
-
limitId: existingLimit.id,
|
|
605
|
-
lastModified: now,
|
|
606
|
-
}));
|
|
607
|
-
}
|
|
608
|
-
else if (existingLimit && isEnabled) {
|
|
609
|
-
// Update existing limit - use limit for numeric values, notes for strings
|
|
610
|
-
dispatch(updateUsageLimit({
|
|
611
|
-
tierId: tier.id,
|
|
612
|
-
limitId: existingLimit.id,
|
|
613
|
-
metric: metricName.trim(),
|
|
614
|
-
unitName: metricUnitName.trim() || undefined,
|
|
615
|
-
freeLimit: isNumeric ? parsedLimit : null,
|
|
616
|
-
paidLimit: isPaidNumeric ? parsedPaidLimit : null,
|
|
617
|
-
notes: !isNumeric && limitValue ? limitValue.trim() : null,
|
|
618
|
-
resetCycle: metricResetCycle,
|
|
619
|
-
unitPrice: hasOveragePricing ? parsedOveragePrice : null,
|
|
620
|
-
unitPriceCurrency: hasOveragePricing ? "USD" : undefined,
|
|
621
|
-
lastModified: now,
|
|
622
|
-
}));
|
|
623
|
-
}
|
|
624
|
-
else if (!existingLimit && isEnabled) {
|
|
625
|
-
// Add new limit - use limit for numeric values, notes for strings
|
|
626
|
-
dispatch(addUsageLimit({
|
|
627
|
-
tierId: tier.id,
|
|
628
|
-
limitId: generateId(),
|
|
629
|
-
serviceId,
|
|
630
|
-
metric: metricName.trim(),
|
|
631
|
-
unitName: metricUnitName.trim() || undefined,
|
|
632
|
-
freeLimit: isNumeric ? parsedLimit : null,
|
|
633
|
-
paidLimit: isPaidNumeric ? parsedPaidLimit : null,
|
|
634
|
-
notes: !isNumeric && limitValue ? limitValue.trim() : null,
|
|
635
|
-
resetCycle: metricResetCycle,
|
|
636
|
-
unitPrice: hasOveragePricing ? parsedOveragePrice : undefined,
|
|
637
|
-
unitPriceCurrency: hasOveragePricing ? "USD" : undefined,
|
|
638
|
-
lastModified: now,
|
|
639
|
-
}));
|
|
640
|
-
}
|
|
641
|
-
});
|
|
642
|
-
setMetricModal(null);
|
|
643
|
-
setMetricName("");
|
|
644
|
-
setMetricLimits({});
|
|
645
|
-
setMetricPaidLimits({});
|
|
646
|
-
setMetricEnabledTiers(new Set());
|
|
647
|
-
setMetricOveragePrices({});
|
|
648
|
-
setMetricUnitName("");
|
|
649
|
-
setMetricResetCycle("MONTHLY");
|
|
650
|
-
};
|
|
651
|
-
const getLevelDisplay = (serviceLevel) => {
|
|
652
|
-
if (!serviceLevel)
|
|
653
|
-
return { label: "—", color: "#cbd5e1" };
|
|
654
|
-
const level = serviceLevel.level;
|
|
655
|
-
const config = SERVICE_LEVELS.find((l) => l.value === level);
|
|
656
|
-
if (level === "CUSTOM" && serviceLevel.customValue) {
|
|
657
|
-
return {
|
|
658
|
-
label: serviceLevel.customValue,
|
|
659
|
-
color: config?.color || "#d97706",
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
return {
|
|
663
|
-
label: config?.shortLabel || level,
|
|
664
|
-
color: config?.color || "#475569",
|
|
665
|
-
};
|
|
666
|
-
};
|
|
667
|
-
if (services.length === 0 || tiers.length === 0) {
|
|
668
|
-
return (_jsx(_Fragment, { children: _jsx("div", { className: "bg-white rounded-xl shadow-md overflow-hidden", children: _jsxs("div", { className: "py-16 px-8 text-center", children: [_jsx("svg", { className: "w-16 h-16 mx-auto mb-4 text-slate-300", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), _jsx("h3", { className: "text-lg font-semibold text-slate-900 mb-2", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Matrix Not Ready" }), _jsx("p", { className: "text-sm text-slate-500 max-w-[28rem] mx-auto", children: services.length === 0 && tiers.length === 0
|
|
669
|
-
? "Add services in the Service Catalog and tiers in Tier Definition to configure the matrix."
|
|
670
|
-
: services.length === 0
|
|
671
|
-
? "Add services in the Service Catalog to configure the matrix."
|
|
672
|
-
: "Add tiers in Tier Definition to configure the matrix." })] }) }) }));
|
|
673
|
-
}
|
|
674
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "bg-white rounded-xl shadow-md overflow-hidden", children: [Object.keys(facetCategories).length > 0 && (_jsx("div", { className: "px-6 py-5 border-b border-slate-200", style: {
|
|
675
|
-
background: "linear-gradient(to bottom, #f8fafc, #ffffff)",
|
|
676
|
-
}, children: _jsx("div", { className: "flex flex-wrap items-end gap-6", children: Object.entries(facetCategories).map(([key, category]) => (_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: "text-[0.625rem] font-medium uppercase tracking-[0.08em] text-slate-500", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" }, children: category.label }), category.options.length <= 3 ? (_jsx("div", { className: "flex bg-white border border-slate-200 rounded-[10px] overflow-hidden", children: category.options.map((option, optIdx) => (_jsx("button", { type: "button", onClick: () => setSelectedFacets((prev) => ({
|
|
677
|
-
...prev,
|
|
678
|
-
[key]: option.id,
|
|
679
|
-
})), className: `px-3.5 py-2 text-[0.8125rem] font-medium border-none cursor-pointer transition-all duration-150 ${optIdx > 0 ? "border-l border-slate-200" : ""} ${selectedFacets[key] === option.id
|
|
680
|
-
? "bg-violet-100 text-violet-700"
|
|
681
|
-
: "bg-white text-slate-600 hover:bg-slate-50"}`, style: {
|
|
682
|
-
fontFamily: "'DM Sans', system-ui, sans-serif",
|
|
683
|
-
...(optIdx > 0
|
|
684
|
-
? { borderLeft: "1px solid #e2e8f0" }
|
|
685
|
-
: {}),
|
|
686
|
-
}, children: option.label }, option.id))) })) : (_jsx("select", { value: selectedFacets[key] || category.options[0]?.id || "", onChange: (e) => setSelectedFacets((prev) => ({
|
|
687
|
-
...prev,
|
|
688
|
-
[key]: e.target.value,
|
|
689
|
-
})), className: "text-[0.8125rem] text-slate-700 bg-white border border-slate-200 rounded-[10px] py-2 pl-3 pr-8 cursor-pointer outline-none transition-all duration-150 appearance-none hover:border-slate-300 focus:border-violet-400 focus:shadow-[0_0_0_3px_#ede9fe]", style: {
|
|
690
|
-
fontFamily: "'DM Sans', system-ui, sans-serif",
|
|
691
|
-
backgroundImage: "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E\")",
|
|
692
|
-
backgroundRepeat: "no-repeat",
|
|
693
|
-
backgroundPosition: "right 0.5rem center",
|
|
694
|
-
backgroundSize: "1rem",
|
|
695
|
-
}, children: category.options.map((option) => (_jsx("option", { value: option.id, children: option.label }, option.id))) }))] }, key))) }) })), incompleteServices.length > 0 && (_jsxs("div", { className: "flex items-start gap-3.5 p-4 px-5 mb-4 bg-amber-50 border border-amber-200 rounded-[10px]", style: {
|
|
696
|
-
animation: "matrix-warning-pulse 2s ease-in-out infinite",
|
|
697
|
-
}, children: [_jsx("div", { className: "shrink-0 w-6 h-6 text-amber-600", children: _jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "w-full h-full", children: _jsx("path", { d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }) }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("span", { className: "text-sm font-semibold text-amber-800", children: [incompleteServices.length, " service", incompleteServices.length !== 1 ? "s" : "", " not configured"] }), _jsxs("span", { className: "text-[0.8125rem] text-amber-700 leading-6", children: ["The following services are not included in any tier:", " ", _jsx("strong", { className: "font-semibold text-amber-900", children: incompleteServices
|
|
698
|
-
.slice(0, 3)
|
|
699
|
-
.map((s) => s.title)
|
|
700
|
-
.join(", ") }), incompleteServices.length > 3 &&
|
|
701
|
-
` and ${incompleteServices.length - 3} more`] })] })] })), _jsxs("div", { className: "flex items-center gap-4 py-3 px-5 bg-slate-50 border border-slate-200 rounded-xl mb-4", children: [_jsx("span", { className: "text-[0.6875rem] font-medium uppercase tracking-[0.08em] text-slate-500 whitespace-nowrap", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" }, children: "Set Subscription Plan & Billing Cycle:" }), _jsxs("div", { className: "flex gap-1.5", children: [availableCyclesForSelectedTier.map((cycle) => (_jsx("button", { onClick: () => handleGlobalCycleChange(cycle), className: `py-1.5 px-3.5 text-[0.8125rem] font-medium rounded-[10px] cursor-pointer transition-all duration-150 ${!isCustomBillingMode && activeBillingCycle === cycle ? "bg-violet-600 border-violet-600 text-white hover:bg-violet-700 hover:border-violet-700" : "text-slate-600 bg-white border border-slate-200 hover:border-violet-300 hover:text-violet-700"}`, style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: BILLING_CYCLE_SHORT_LABELS[cycle] }, cycle))), isCustomBillingMode && (_jsx("span", { className: "py-1.5 px-3.5 text-[0.8125rem] font-medium rounded-[10px] bg-amber-500 border border-amber-500 text-white cursor-default italic", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Custom" }))] }), _jsxs("button", { type: "button", onClick: handleCopyUserSelection, className: "inline-flex items-center gap-1.5 ml-auto py-1.5 px-3 text-[0.6875rem] font-medium text-slate-500 bg-white border border-slate-200 rounded-[10px] cursor-pointer transition-all duration-150 whitespace-nowrap hover:text-violet-700 hover:border-violet-300 hover:bg-violet-50", title: "Copy current UserSelectionInput as JSON for mutation testing", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" }, children: [_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "w-3.5 h-3.5", children: [_jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }), _jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })] }), "Copy Selection"] })] }), majorityResult && !majorityDismissed && (_jsxs("div", { className: "flex items-center gap-2 py-2 px-3 mb-2 bg-sky-50 border border-sky-200 rounded-[10px] text-xs text-sky-800", children: [_jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "shrink-0 w-4 h-4 text-sky-500", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), _jsxs("span", { className: "flex-1", children: [majorityResult.count, " of ", majorityResult.total, " service groups use", " ", _jsx("strong", { children: BILLING_CYCLE_SHORT_LABELS[majorityResult.majorityCycle] }), " ", "billing."] }), _jsxs("button", { type: "button", className: "py-1 px-2 text-[0.6875rem] font-medium rounded-md cursor-pointer border border-transparent transition-all duration-150 bg-sky-600 text-white hover:bg-sky-700", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, onClick: () => {
|
|
702
|
-
handleGlobalCycleChange(majorityResult.majorityCycle);
|
|
703
|
-
setMajorityDismissed(true);
|
|
704
|
-
}, children: ["Switch to", " ", BILLING_CYCLE_SHORT_LABELS[majorityResult.majorityCycle]] }), _jsx("button", { type: "button", className: "py-1 px-2 text-[0.6875rem] font-medium rounded-md cursor-pointer transition-all duration-150 bg-transparent text-sky-600 border border-sky-300 hover:bg-sky-100", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, onClick: () => setMajorityDismissed(true), children: "Keep current" })] })), _jsxs("div", { className: "overflow-x-auto overflow-y-auto max-h-[calc(100vh-220px)] so-scrollbar-h so-scrollbar-v", children: [_jsxs("table", { className: "w-full border-collapse text-[0.8125rem]", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { className: "sticky left-0 z-10 bg-white p-4 text-left font-normal text-slate-500 border-b border-slate-200 min-w-[260px]", children: _jsx(InfoIcon, { content: "INCLUDED: part of the tier. OPTIONAL: available as add-on. NOT_INCLUDED: not available in this tier. CUSTOM/VARIABLE: negotiated pricing.", side: "right" }) }), tiers.map((tier, idx) => {
|
|
705
|
-
const cyclePrice = tier.isCustomPricing
|
|
706
|
-
? null
|
|
707
|
-
: getTierDisplayPrice(idx);
|
|
708
|
-
const isSelected = idx === selectedTierIdx;
|
|
709
|
-
return (_jsxs("th", { onClick: () => {
|
|
710
|
-
setSelectedTierIdx(idx);
|
|
711
|
-
}, className: `p-4 text-center border-b border-slate-200 min-w-[140px] cursor-pointer transition-all duration-150 ${isSelected ? "text-white relative" : "bg-white"}`, style: isSelected
|
|
712
|
-
? {
|
|
713
|
-
background: "linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)",
|
|
714
|
-
boxShadow: "0 4px 12px rgba(139, 92, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15)",
|
|
715
|
-
}
|
|
716
|
-
: undefined, onMouseEnter: (e) => {
|
|
717
|
-
if (!isSelected)
|
|
718
|
-
e.currentTarget.style.background =
|
|
719
|
-
"linear-gradient(180deg, #f8fafc 0%, #f5f3ff 100%)";
|
|
720
|
-
}, onMouseLeave: (e) => {
|
|
721
|
-
if (!isSelected)
|
|
722
|
-
e.currentTarget.style.background = "";
|
|
723
|
-
}, children: [isSelected && (_jsx("div", { className: "absolute inset-0 pointer-events-none", style: {
|
|
724
|
-
background: "linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 50%)",
|
|
725
|
-
} })), _jsxs("div", { className: "flex flex-col items-center gap-1.5", children: [_jsx("div", { className: "w-4 h-4 rounded-full transition-all duration-150", style: isSelected
|
|
726
|
-
? {
|
|
727
|
-
borderColor: "rgba(255, 255, 255, 0.9)",
|
|
728
|
-
background: "linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)",
|
|
729
|
-
boxShadow: "inset 0 0 0 3px #ffffff, 0 2px 4px rgba(0, 0, 0, 0.15)",
|
|
730
|
-
border: "2px solid rgba(255,255,255,0.9)",
|
|
731
|
-
}
|
|
732
|
-
: { border: "2px solid #cbd5e1" } }), _jsx("span", { className: `font-semibold ${isSelected ? "text-white" : "text-slate-900"}`, style: {
|
|
733
|
-
fontFamily: "'DM Sans', system-ui, sans-serif",
|
|
734
|
-
}, children: tier.name }), tier.isCustomPricing ? (_jsx("span", { className: `text-[0.6875rem] ${isSelected ? "text-white/85" : "text-slate-500"}`, children: "Custom" })) : cyclePrice ? (_jsxs(_Fragment, { children: [_jsxs("span", { className: `text-xl font-bold leading-tight ${isSelected ? "text-white" : "text-slate-900"}`, children: [formatPrice(cyclePrice.monthlyEquivalent, tierBreakdowns[idx].tierCurrency), _jsx("span", { className: `text-xs font-normal ${isSelected ? "text-white/70" : "text-slate-500"}`, children: "/mo" })] }), !isCustomBillingMode &&
|
|
735
|
-
activeBillingCycle !== "MONTHLY" && (_jsxs("span", { className: `text-[0.6875rem] ${isSelected ? "text-white/65" : "text-slate-400"}`, children: ["Billed", " ", formatPrice(cyclePrice.billedTotal, tierBreakdowns[idx].tierCurrency), " ", BILLING_CYCLE_LABELS[activeBillingCycle]] })), !isCustomBillingMode &&
|
|
736
|
-
cyclePrice.hasDiscount &&
|
|
737
|
-
cyclePrice.savingsPercent > 0 && (_jsxs("span", { className: "inline-block mt-1 py-0.5 px-2 text-[0.625rem] font-semibold text-emerald-700 bg-emerald-100 rounded-md", style: {
|
|
738
|
-
fontFamily: "'DM Mono', 'SF Mono', monospace",
|
|
739
|
-
}, children: ["SAVE ", cyclePrice.savingsPercent, "%"] }))] })) : (_jsx("span", { className: `text-[0.6875rem] ${isSelected ? "text-white/85" : "text-slate-500"}`, children: "\u2014" }))] })] }, tier.id));
|
|
740
|
-
})] }) }), _jsxs("tbody", { children: [_jsx("tr", { children: _jsx("td", { colSpan: tiers.length + 1, className: "bg-slate-100 py-2.5 px-4 text-[0.625rem] font-semibold uppercase tracking-[0.08em] text-slate-600 border-b border-slate-200", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" }, children: "Service Catalog" }) }), (setupGroups.length > 0 ||
|
|
741
|
-
ungroupedSetupServices.length > 0) && (_jsx("tr", { children: _jsxs("td", { colSpan: tiers.length + 1, className: "bg-slate-50 py-3 px-4 text-xs font-semibold text-slate-700 border-b border-slate-200 flex items-center gap-2", children: [_jsx("span", { className: "flex items-center justify-center w-5 h-5 text-slate-500", children: _jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", className: "w-full h-full", children: [_jsx("path", { d: "M19 21V5a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v16" }), _jsx("path", { d: "M9 21v-6h6v6" }), _jsx("path", { d: "M9 7h.01M9 11h.01M15 7h.01M15 11h.01" })] }) }), "Setup & Formation"] }) })), setupGroups.map((group) => (_jsx(ServiceGroupSection, { group: group, services: groupedServices.get(group.id) || [], tiers: tiers, isSetupFormation: true, isOptional: false, isEnabled: true, onToggle: () => { }, getServiceLevelForTier: getServiceLevelForTier, getUniqueMetricsForService: getUniqueMetricsForService, getUsageLimitForMetric: getUsageLimitForMetric, getLevelDisplay: getLevelDisplay, selectedCell: selectedCell, setSelectedCell: setSelectedCell, handleSetServiceLevel: handleSetServiceLevel, dispatch: dispatch, onAddService: openAddServiceModal, selectedTierIdx: selectedTierIdx, onAddMetric: handleAddMetric, onEditMetric: handleEditMetric, onRemoveMetric: handleRemoveMetric, onEditService: openEditServiceModal, onReorderService: handleReorderService, activeBillingCycle: activeBillingCycle }, group.id))), ungroupedSetupServices.length > 0 && (_jsx(ServiceGroupSection, { group: {
|
|
742
|
-
id: UNGROUPED_ID,
|
|
743
|
-
name: "Setup & Formation",
|
|
744
|
-
description: null,
|
|
745
|
-
isAddOn: false,
|
|
746
|
-
defaultSelected: true,
|
|
747
|
-
availableBillingCycles: [],
|
|
748
|
-
billingCycleDiscounts: [],
|
|
749
|
-
costType: null,
|
|
750
|
-
currency: null,
|
|
751
|
-
price: null,
|
|
752
|
-
pricingMode: null,
|
|
753
|
-
standalonePricing: null,
|
|
754
|
-
tierDependentPricing: null,
|
|
755
|
-
discountMode: null,
|
|
756
|
-
}, services: ungroupedSetupServices, tiers: tiers, isSetupFormation: true, isOptional: false, isEnabled: true, onToggle: () => { }, getServiceLevelForTier: getServiceLevelForTier, getUniqueMetricsForService: getUniqueMetricsForService, getUsageLimitForMetric: getUsageLimitForMetric, getLevelDisplay: getLevelDisplay, selectedCell: selectedCell, setSelectedCell: setSelectedCell, handleSetServiceLevel: handleSetServiceLevel, dispatch: dispatch, selectedTierIdx: selectedTierIdx, onAddMetric: handleAddMetric, onEditMetric: handleEditMetric, onRemoveMetric: handleRemoveMetric, onEditService: openEditServiceModal, onReorderService: handleReorderService, activeBillingCycle: activeBillingCycle }, "ungrouped-setup")), (regularGroups.length > 0 ||
|
|
757
|
-
ungroupedRegularServices.length > 0) && (_jsx("tr", { children: _jsxs("td", { colSpan: tiers.length + 1, className: "bg-slate-50 py-3 px-4 text-xs font-semibold text-slate-700 border-b border-slate-200 flex items-center gap-2", children: [_jsx("span", { className: "flex items-center justify-center w-5 h-5 text-slate-500", children: _jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", className: "w-full h-full", children: _jsx("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }) }), "Recurring Services"] }) })), regularGroups.map((group) => (_jsx(ServiceGroupSection, { group: group, services: groupedServices.get(group.id) || [], tiers: tiers, isSetupFormation: false, isOptional: false, isEnabled: true, onToggle: () => { }, getServiceLevelForTier: getServiceLevelForTier, getUniqueMetricsForService: getUniqueMetricsForService, getUsageLimitForMetric: getUsageLimitForMetric, getLevelDisplay: getLevelDisplay, selectedCell: selectedCell, setSelectedCell: setSelectedCell, handleSetServiceLevel: handleSetServiceLevel, onAddService: openAddServiceModal, selectedTierIdx: selectedTierIdx, dispatch: dispatch, onAddMetric: handleAddMetric, onEditMetric: handleEditMetric, onRemoveMetric: handleRemoveMetric, onEditService: openEditServiceModal, onReorderService: handleReorderService, activeBillingCycle: activeBillingCycle, groupActiveCycle: groupBillingCycles[group.id], onGroupCycleChange: (cycle) => handleGroupCycleChange(group.id, cycle), groupBreakdown: tierBreakdowns[selectedTierIdx]?.optionGroupBreakdowns.find((b) => b.optionGroupId === group.id) }, group.id))), ungroupedRegularServices.length > 0 && (_jsx(ServiceGroupSection, { group: {
|
|
758
|
-
id: UNGROUPED_ID,
|
|
759
|
-
name: "Recurring Services",
|
|
760
|
-
description: null,
|
|
761
|
-
isAddOn: false,
|
|
762
|
-
defaultSelected: true,
|
|
763
|
-
availableBillingCycles: [],
|
|
764
|
-
billingCycleDiscounts: [],
|
|
765
|
-
costType: null,
|
|
766
|
-
currency: null,
|
|
767
|
-
price: null,
|
|
768
|
-
pricingMode: null,
|
|
769
|
-
standalonePricing: null,
|
|
770
|
-
tierDependentPricing: null,
|
|
771
|
-
discountMode: null,
|
|
772
|
-
}, services: ungroupedRegularServices, tiers: tiers, isSetupFormation: false, isOptional: false, isEnabled: true, onToggle: () => { }, getServiceLevelForTier: getServiceLevelForTier, getUniqueMetricsForService: getUniqueMetricsForService, getUsageLimitForMetric: getUsageLimitForMetric, getLevelDisplay: getLevelDisplay, selectedCell: selectedCell, setSelectedCell: setSelectedCell, handleSetServiceLevel: handleSetServiceLevel, dispatch: dispatch, selectedTierIdx: selectedTierIdx, onAddMetric: handleAddMetric, onEditMetric: handleEditMetric, onRemoveMetric: handleRemoveMetric, onEditService: openEditServiceModal, onReorderService: handleReorderService, activeBillingCycle: activeBillingCycle }, "ungrouped-regular")), _jsxs("tr", { className: "bg-slate-100 [&>td]:py-2.5 [&>td]:px-4 [&>td]:font-semibold [&>td]:text-slate-700 [&>td]:border-b [&>td]:border-slate-300 [&>td:first-child]:sticky [&>td:first-child]:left-0 [&>td:first-child]:z-10 [&>td:first-child]:bg-slate-100", children: [_jsx("td", { children: "SUBTOTAL" }), tiers.map((tier, idx) => {
|
|
773
|
-
if (tier.isCustomPricing) {
|
|
774
|
-
return (_jsx("td", { style: { textAlign: "center" }, children: "Custom" }, tier.id));
|
|
775
|
-
}
|
|
776
|
-
const groupSum = tierBreakdowns[idx].tierMonthlyBase;
|
|
777
|
-
const tierPrice = tier.pricing.amount ?? 0;
|
|
778
|
-
const isCalculated = tier.pricingMode === "CALCULATED";
|
|
779
|
-
const currency = tier.pricing.currency || "USD";
|
|
780
|
-
const isOver = !isCalculated && tierPrice > 0 && groupSum > tierPrice;
|
|
781
|
-
return (_jsx("td", { style: { textAlign: "center" }, children: _jsxs("div", { className: "flex flex-col items-center gap-0.5", children: [_jsx("span", { className: "font-semibold", children: formatPrice(isCalculated ? groupSum : tierPrice, currency) }), isCalculated && (_jsx("span", { className: "inline-block ml-1 px-1 text-[0.5rem] font-semibold text-emerald-700 bg-emerald-100 rounded-md align-middle uppercase", title: "Calculated from service groups", style: {
|
|
782
|
-
fontFamily: "'DM Mono', 'SF Mono', monospace",
|
|
783
|
-
}, children: "calc" })), !isCalculated &&
|
|
784
|
-
groupSum > 0 &&
|
|
785
|
-
tierPrice > 0 &&
|
|
786
|
-
groupSum !== tierPrice && (_jsx("span", { className: `text-[0.5625rem] py-px px-1.5 rounded-md ${isOver ? "text-rose-700 bg-rose-100 font-semibold" : "text-slate-500 bg-slate-100"}`, style: {
|
|
787
|
-
fontFamily: "'DM Mono', 'SF Mono', monospace",
|
|
788
|
-
}, children: isOver
|
|
789
|
-
? `Groups: ${formatPrice(groupSum, currency)} (+${formatPrice(groupSum - tierPrice, currency)})`
|
|
790
|
-
: `Groups: ${formatPrice(groupSum, currency)}` }))] }) }, tier.id));
|
|
791
|
-
})] }), addonGroups.map((group) => (_jsx(ServiceGroupSection, { group: group, services: groupedServices.get(group.id) || [], tiers: tiers, isSetupFormation: false, isOptional: true, isEnabled: enabledOptionalGroups.has(group.id), onToggle: () => toggleOptionalGroup(group.id), getServiceLevelForTier: getServiceLevelForTier, getUniqueMetricsForService: getUniqueMetricsForService, getUsageLimitForMetric: getUsageLimitForMetric, getLevelDisplay: getLevelDisplay, selectedCell: selectedCell, setSelectedCell: setSelectedCell, handleSetServiceLevel: handleSetServiceLevel, dispatch: dispatch, onAddService: openAddServiceModal, selectedTierIdx: selectedTierIdx, onAddMetric: handleAddMetric, onEditMetric: handleEditMetric, onRemoveMetric: handleRemoveMetric, onEditService: openEditServiceModal, onReorderService: handleReorderService, activeBillingCycle: activeBillingCycle, addonActiveCycle: addonBillingCycles[group.id] || "MONTHLY", onAddonCycleChange: (cycle) => {
|
|
792
|
-
setAddonBillingCycles((prev) => ({
|
|
793
|
-
...prev,
|
|
794
|
-
[group.id]: cycle,
|
|
795
|
-
}));
|
|
796
|
-
}, groupBreakdown: tierBreakdowns[selectedTierIdx]?.addOnBreakdowns.find((b) => b.optionGroupId === group.id) }, group.id)))] })] }), _jsx("div", { className: "sticky bottom-0 z-[15] border-t-[3px] border-violet-400", style: { boxShadow: "0 -4px 16px rgba(0, 0, 0, 0.12)" }, children: _jsx("table", { className: "w-full border-collapse text-[0.8125rem] m-0", children: _jsxs("tbody", { children: [!isCustomBillingMode ? (_jsxs("tr", { className: "bg-violet-100 [&>td]:py-3.5 [&>td]:px-4 [&>td]:font-bold [&>td]:text-violet-900 [&>td]:border-t-2 [&>td]:border-violet-300 [&>td:first-child]:sticky [&>td:first-child]:left-0 [&>td:first-child]:z-10 [&>td:first-child]:bg-violet-100", children: [_jsxs("td", { children: ["Recurring Tier Price", _jsx(InfoIcon, { content: "Shows the calculated total for a client selecting this tier with the current billing cycle. Includes base price + included services + optional add-ons." }), _jsxs("span", { className: "font-normal text-[0.6875rem] text-slate-400 ml-1", children: ["/", BILLING_CYCLE_SHORT_LABELS[activeBillingCycle].toLowerCase()] })] }), tiers.map((tier, idx) => {
|
|
797
|
-
const breakdown = tierBreakdowns[idx];
|
|
798
|
-
const discountedTotal = breakdown.totals.grandRecurringTotal;
|
|
799
|
-
const undiscountedTotal = breakdown.tierCycleTotal +
|
|
800
|
-
breakdown.addOnBreakdowns.reduce((s, a) => s + a.cycleAmount, 0);
|
|
801
|
-
const savingsPct = undiscountedTotal > 0
|
|
802
|
-
? Math.round(((undiscountedTotal - discountedTotal) /
|
|
803
|
-
undiscountedTotal) *
|
|
804
|
-
100)
|
|
805
|
-
: 0;
|
|
806
|
-
return (_jsx("td", { className: idx === selectedTierIdx ? "text-white relative" : "", style: {
|
|
807
|
-
textAlign: "center",
|
|
808
|
-
...(idx === selectedTierIdx
|
|
809
|
-
? {
|
|
810
|
-
background: "linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)",
|
|
811
|
-
boxShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.15)",
|
|
812
|
-
}
|
|
813
|
-
: {}),
|
|
814
|
-
}, children: idx === selectedTierIdx ? (tier.isCustomPricing ? ("Custom") : (_jsxs(_Fragment, { children: [formatPrice(discountedTotal, breakdown.tierCurrency), savingsPct > 0 && (_jsxs("span", { className: "inline-block ml-1.5 py-px px-1.5 text-[0.5625rem] font-semibold text-emerald-700 bg-emerald-100 rounded-md align-middle", style: {
|
|
815
|
-
fontFamily: "'DM Mono', 'SF Mono', monospace",
|
|
816
|
-
}, children: ["SAVE ", savingsPct, "%"] }))] }))) : null }, tier.id));
|
|
817
|
-
})] })) : (
|
|
818
|
-
/* Custom billing mode: itemized per-group rows from breakdown */
|
|
819
|
-
tierBreakdowns[selectedTierIdx]?.optionGroupBreakdowns.map((ogb) => (_jsxs("tr", { className: "bg-violet-100 [&>td]:py-3.5 [&>td]:px-4 [&>td]:font-bold [&>td]:text-violet-900 [&>td]:border-t-2 [&>td]:border-violet-300 [&>td:first-child]:sticky [&>td:first-child]:left-0 [&>td:first-child]:z-10 [&>td:first-child]:bg-violet-100", children: [_jsxs("td", { children: [ogb.optionGroupName, _jsxs("span", { className: "font-normal text-[0.6875rem] text-slate-400 ml-1", children: ["/", BILLING_CYCLE_SHORT_LABELS[ogb.effectiveBillingCycle].toLowerCase()] })] }), tiers.map((tier, idx) => (_jsx("td", { className: idx === selectedTierIdx
|
|
820
|
-
? "text-white relative"
|
|
821
|
-
: "", style: {
|
|
822
|
-
textAlign: "center",
|
|
823
|
-
...(idx === selectedTierIdx
|
|
824
|
-
? {
|
|
825
|
-
background: "linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)",
|
|
826
|
-
boxShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.15)",
|
|
827
|
-
}
|
|
828
|
-
: {}),
|
|
829
|
-
}, children: idx === selectedTierIdx ? (tier.isCustomPricing ? ("Custom") : ogb.monthlyBase > 0 ? (_jsxs(_Fragment, { children: [formatPrice(ogb.recurringAmount, ogb.currency), ogb.discount &&
|
|
830
|
-
ogb.discount.discountValue > 0 && (_jsxs("span", { className: "inline-block ml-1.5 py-px px-1.5 text-[0.5625rem] font-semibold text-emerald-700 bg-emerald-100 rounded-md align-middle", style: {
|
|
831
|
-
fontFamily: "'DM Mono', 'SF Mono', monospace",
|
|
832
|
-
}, children: ["SAVE", " ", Math.round(ogb.discount.discountType ===
|
|
833
|
-
"PERCENTAGE"
|
|
834
|
-
? ogb.discount.discountValue
|
|
835
|
-
: ogb.cycleAmount > 0
|
|
836
|
-
? ((ogb.cycleAmount -
|
|
837
|
-
ogb.recurringAmount) /
|
|
838
|
-
ogb.cycleAmount) *
|
|
839
|
-
100
|
|
840
|
-
: 0), "%"] }))] })) : ("—")) : null }, tier.id)))] }, `group-${ogb.optionGroupId}`)))), tierBreakdowns[selectedTierIdx]?.addOnBreakdowns
|
|
841
|
-
.filter((ab) => ab.monthlyBase > 0)
|
|
842
|
-
.map((ab) => (_jsxs("tr", { className: "bg-violet-50 [&>td]:border-t [&>td]:border-dashed [&>td]:border-violet-200 [&>td]:font-semibold [&>td]:text-[0.8125rem] [&>td]:text-violet-700 [&>td]:py-2 [&>td]:px-4 [&>td:first-child]:bg-violet-50", children: [_jsxs("td", { children: ["+ ", ab.optionGroupName, _jsxs("span", { className: "font-normal text-[0.6875rem] text-slate-400 ml-1", children: ["/", BILLING_CYCLE_SHORT_LABELS[ab.selectedBillingCycle].toLowerCase()] })] }), tiers.map((tier, idx) => (_jsx("td", { className: idx === selectedTierIdx ? "text-white relative" : "", style: {
|
|
843
|
-
textAlign: "center",
|
|
844
|
-
...(idx === selectedTierIdx
|
|
845
|
-
? {
|
|
846
|
-
background: "linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)",
|
|
847
|
-
boxShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.15)",
|
|
848
|
-
}
|
|
849
|
-
: {}),
|
|
850
|
-
}, children: idx === selectedTierIdx ? (_jsxs(_Fragment, { children: ["+", formatPrice(ab.recurringAmount, ab.currency), ab.discount && ab.discount.discountValue > 0 && (_jsxs("span", { className: "inline-block ml-1.5 py-px px-1.5 text-[0.5625rem] font-semibold text-emerald-700 bg-emerald-100 rounded-md align-middle", style: {
|
|
851
|
-
fontFamily: "'DM Mono', 'SF Mono', monospace",
|
|
852
|
-
}, children: ["SAVE", " ", Math.round(ab.discount.discountType === "PERCENTAGE"
|
|
853
|
-
? ab.discount.discountValue
|
|
854
|
-
: ab.cycleAmount > 0
|
|
855
|
-
? ((ab.cycleAmount -
|
|
856
|
-
ab.recurringAmount) /
|
|
857
|
-
ab.cycleAmount) *
|
|
858
|
-
100
|
|
859
|
-
: 0), "%"] }))] })) : null }, tier.id)))] }, `addon-recurring-${ab.optionGroupId}`))), tierBreakdowns[selectedTierIdx]?.addOnBreakdowns
|
|
860
|
-
.filter((ab) => ab.setupCost !== null && ab.setupCost > 0)
|
|
861
|
-
.map((ab) => (_jsxs("tr", { className: "bg-violet-50 [&>td]:border-t [&>td]:border-dashed [&>td]:border-violet-200 [&>td]:font-semibold [&>td]:text-[0.8125rem] [&>td]:text-violet-700 [&>td]:py-2 [&>td]:px-4 [&>td:first-child]:bg-violet-50", children: [_jsxs("td", { children: ["+ ", ab.optionGroupName, " ", _jsx("span", { className: "font-normal text-[0.6875rem] text-slate-400 ml-1", children: "(one-time setup)" })] }), tiers.map((tier, idx) => (_jsx("td", { className: idx === selectedTierIdx ? "text-white relative" : "", style: {
|
|
862
|
-
textAlign: "center",
|
|
863
|
-
...(idx === selectedTierIdx
|
|
864
|
-
? {
|
|
865
|
-
background: "linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)",
|
|
866
|
-
boxShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.15)",
|
|
867
|
-
}
|
|
868
|
-
: {}),
|
|
869
|
-
}, children: idx === selectedTierIdx
|
|
870
|
-
? tier.excludeFromSetupFee
|
|
871
|
-
? "No setup fee"
|
|
872
|
-
: `${formatPrice(ab.setupCost, ab.setupCostCurrency || "USD")} one-time`
|
|
873
|
-
: null }, tier.id)))] }, `addon-setup-${ab.optionGroupId}`))), (() => {
|
|
874
|
-
const setupBds = tierBreakdowns[selectedTierIdx]?.setupGroupBreakdowns ?? [];
|
|
875
|
-
const totalSetupBase = setupBds.reduce((sum, s) => sum +
|
|
876
|
-
(s.setupCostDiscount?.originalAmount ?? s.setupCost ?? 0), 0);
|
|
877
|
-
const totalSetupEffective = setupBds.reduce((sum, s) => sum + (s.setupCost ?? 0), 0);
|
|
878
|
-
if (totalSetupBase === 0)
|
|
879
|
-
return null;
|
|
880
|
-
const hasDiscount = totalSetupEffective !== totalSetupBase;
|
|
881
|
-
return (_jsxs("tr", { className: "bg-violet-50 [&>td]:border-t [&>td]:border-dashed [&>td]:border-violet-200 [&>td]:font-semibold [&>td]:text-[0.8125rem] [&>td]:text-violet-700 [&>td]:py-2 [&>td]:px-4 [&>td:first-child]:bg-violet-50", children: [_jsx("td", { children: "+ Setup & Formation Fees" }), tiers.map((tier, idx) => (_jsx("td", { className: idx === selectedTierIdx ? "text-white relative" : "", style: {
|
|
882
|
-
textAlign: "center",
|
|
883
|
-
...(idx === selectedTierIdx
|
|
884
|
-
? {
|
|
885
|
-
background: "linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)",
|
|
886
|
-
boxShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.15)",
|
|
887
|
-
}
|
|
888
|
-
: {}),
|
|
889
|
-
}, children: idx === selectedTierIdx
|
|
890
|
-
? tier.excludeFromSetupFee
|
|
891
|
-
? "No setup fee"
|
|
892
|
-
: hasDiscount
|
|
893
|
-
? `${formatPrice(totalSetupEffective, "USD")} one-time`
|
|
894
|
-
: `${formatPrice(totalSetupBase, "USD")} one-time`
|
|
895
|
-
: null }, tier.id)))] }));
|
|
896
|
-
})()] }) }) })] }), selectedCell && (_jsx(ServiceLevelDetailPanel, { serviceId: selectedCell.serviceId, tierId: selectedCell.tierId, services: services, tiers: tiers, optionGroups: optionGroups, dispatch: dispatch, onClose: () => setSelectedCell(null) })), addServiceModal && (_jsx("div", { className: "fixed inset-0 bg-slate-900/75 backdrop-blur-sm flex items-center justify-center z-[100]", style: { animation: "modal-backdrop 0.2s ease-out" }, children: _jsxs("div", { className: "bg-white rounded-xl p-6 max-h-[85vh] overflow-y-auto", style: {
|
|
897
|
-
width: "min(32rem, calc(100vw - 2rem))",
|
|
898
|
-
maxWidth: "32rem",
|
|
899
|
-
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.08)",
|
|
900
|
-
animation: "modal-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
901
|
-
}, children: [_jsx("h3", { className: "text-xl font-bold text-slate-900 mb-5 tracking-tight", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Add New Service" }), _jsxs("div", { className: "mb-5", children: [_jsx("label", { className: "block text-[0.8125rem] font-semibold text-slate-700 mb-2", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Service Name" }), _jsx("input", { type: "text", value: newServiceName, onChange: (e) => setNewServiceName(e.target.value), placeholder: "Enter service name", className: "w-full text-sm text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-3 px-4 outline-none transition-all duration-150 focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)] placeholder:text-slate-400", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, autoFocus: true })] }), _jsxs("div", { className: "mb-5", children: [_jsx("label", { className: "block text-[0.8125rem] font-semibold text-slate-700 mb-2", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Description (optional)" }), _jsx("textarea", { value: newServiceDescription, onChange: (e) => setNewServiceDescription(e.target.value), placeholder: "Enter description...", rows: 2, className: "w-full text-sm text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-3 px-4 outline-none transition-all duration-150 resize-y min-h-[80px] focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)] placeholder:text-slate-400", style: { fontFamily: "'DM Sans', system-ui, sans-serif" } })] }), tiers.length > 0 && (_jsxs("div", { className: "mb-5", children: [_jsx("label", { className: "block text-[0.8125rem] font-semibold text-slate-700 mb-2", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Include in Tiers" }), _jsx("div", { className: "grid grid-cols-2 gap-2.5", children: tiers.map((tier) => {
|
|
902
|
-
const isSelected = newServiceSelectedTiers.has(tier.id);
|
|
903
|
-
return (_jsxs("label", { className: `relative flex items-center gap-2 p-3 bg-white border-2 rounded-xl cursor-pointer transition-all duration-150 min-w-0 overflow-hidden ${isSelected ? "border-violet-500 bg-violet-50 shadow-[0_0_0_3px_rgba(139,92,246,0.15)] hover:border-violet-600" : "border-slate-300 hover:border-violet-400 hover:bg-violet-50"}`, children: [_jsx("input", { type: "checkbox", checked: isSelected, onChange: (e) => {
|
|
904
|
-
const newSet = new Set(newServiceSelectedTiers);
|
|
905
|
-
if (e.target.checked) {
|
|
906
|
-
newSet.add(tier.id);
|
|
907
|
-
}
|
|
908
|
-
else {
|
|
909
|
-
newSet.delete(tier.id);
|
|
910
|
-
}
|
|
911
|
-
setNewServiceSelectedTiers(newSet);
|
|
912
|
-
}, className: "relative w-5 h-5 shrink-0 appearance-none bg-white border-2 border-slate-400 rounded-md cursor-pointer transition-all duration-150 checked:bg-violet-600 checked:border-violet-600" }), _jsx("span", { className: "flex-1 text-sm font-semibold text-slate-800 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap", children: tier.name }), tier.pricing.amount !== null && (_jsxs("span", { className: "text-xs font-semibold text-slate-500 whitespace-nowrap shrink-0", children: ["$", tier.pricing.amount, "/mo"] }))] }, tier.id));
|
|
913
|
-
}) }), newServiceSelectedTiers.size === 0 && (_jsx("p", { className: "text-[0.8125rem] text-slate-500 mt-3 italic", children: "Select at least one tier to include this service" }))] })), _jsxs("p", { className: "text-[0.8125rem] text-slate-600 mb-5 leading-6", children: ["This service will be added to", " ", _jsx("strong", { children: addServiceModal.groupId !== UNGROUPED_ID
|
|
914
|
-
? optionGroups.find((g) => g.id === addServiceModal.groupId)
|
|
915
|
-
?.name || "Unknown Group"
|
|
916
|
-
: "Ungrouped Services" }), " ", "as a", " ", addServiceModal.isSetupFormation
|
|
917
|
-
? "Setup/Formation"
|
|
918
|
-
: "Recurring", " ", "service."] }), _jsxs("div", { className: "flex gap-3 justify-end pt-2", children: [_jsx("button", { onClick: () => {
|
|
919
|
-
setAddServiceModal(null);
|
|
920
|
-
setNewServiceName("");
|
|
921
|
-
setNewServiceDescription("");
|
|
922
|
-
setNewServiceSelectedTiers(new Set());
|
|
923
|
-
}, className: "py-2.5 px-5 text-sm font-semibold rounded-[10px] cursor-pointer transition-all duration-150 bg-slate-200 text-slate-600 border-none hover:bg-slate-300 hover:text-slate-800", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Cancel" }), _jsx("button", { onClick: handleAddService, disabled: !newServiceName.trim() || newServiceSelectedTiers.size === 0, className: "py-2.5 px-5 text-sm font-semibold rounded-[10px] cursor-pointer transition-all duration-150 bg-violet-600 text-white border-none shadow-[0_2px_4px_rgba(124,58,237,0.3)] hover:enabled:bg-violet-700 hover:enabled:shadow-[0_4px_8px_rgba(124,58,237,0.4)] hover:enabled:-translate-y-px active:enabled:translate-y-0 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Add Service" })] })] }) })), editServiceModal && (_jsx("div", { className: "fixed inset-0 bg-slate-900/75 backdrop-blur-sm flex items-center justify-center z-[100]", style: { animation: "modal-backdrop 0.2s ease-out" }, children: _jsxs("div", { className: "bg-white rounded-xl p-6 max-h-[85vh] overflow-y-auto", style: {
|
|
924
|
-
width: "min(32rem, calc(100vw - 2rem))",
|
|
925
|
-
maxWidth: "32rem",
|
|
926
|
-
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.08)",
|
|
927
|
-
animation: "modal-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
928
|
-
}, children: [_jsx("h3", { className: "text-xl font-bold text-slate-900 mb-5 tracking-tight", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Edit Service" }), _jsxs("div", { className: "mb-5", children: [_jsx("label", { className: "block text-[0.8125rem] font-semibold text-slate-700 mb-2", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Service Name" }), _jsx("input", { type: "text", value: editServiceName, onChange: (e) => setEditServiceName(e.target.value), placeholder: "Enter service name", className: "w-full text-sm text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-3 px-4 outline-none transition-all duration-150 focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)] placeholder:text-slate-400", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, autoFocus: true })] }), _jsxs("div", { className: "mb-5", children: [_jsx("label", { className: "block text-[0.8125rem] font-semibold text-slate-700 mb-2", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Description (optional)" }), _jsx("textarea", { value: editServiceDescription, onChange: (e) => setEditServiceDescription(e.target.value), placeholder: "Enter description...", rows: 2, className: "w-full text-sm text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-3 px-4 outline-none transition-all duration-150 resize-y min-h-[80px] focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)] placeholder:text-slate-400", style: { fontFamily: "'DM Sans', system-ui, sans-serif" } })] }), tiers.length > 0 && (_jsxs("div", { className: "mb-5", children: [_jsx("label", { className: "block text-[0.8125rem] font-semibold text-slate-700 mb-2", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Include in Tiers" }), _jsx("div", { className: "grid grid-cols-2 gap-2.5", children: tiers.map((tier) => {
|
|
929
|
-
const isSelected = editServiceSelectedTiers.has(tier.id);
|
|
930
|
-
return (_jsxs("label", { className: `relative flex items-center gap-2 p-3 bg-white border-2 rounded-xl cursor-pointer transition-all duration-150 min-w-0 overflow-hidden ${isSelected ? "border-violet-500 bg-violet-50 shadow-[0_0_0_3px_rgba(139,92,246,0.15)] hover:border-violet-600" : "border-slate-300 hover:border-violet-400 hover:bg-violet-50"}`, children: [_jsx("input", { type: "checkbox", checked: isSelected, onChange: (e) => {
|
|
931
|
-
const newSet = new Set(editServiceSelectedTiers);
|
|
932
|
-
if (e.target.checked) {
|
|
933
|
-
newSet.add(tier.id);
|
|
934
|
-
}
|
|
935
|
-
else {
|
|
936
|
-
newSet.delete(tier.id);
|
|
937
|
-
}
|
|
938
|
-
setEditServiceSelectedTiers(newSet);
|
|
939
|
-
}, className: "relative w-5 h-5 shrink-0 appearance-none bg-white border-2 border-slate-400 rounded-md cursor-pointer transition-all duration-150 checked:bg-violet-600 checked:border-violet-600" }), _jsx("span", { className: "flex-1 text-sm font-semibold text-slate-800 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap", children: tier.name }), tier.pricing.amount !== null && (_jsxs("span", { className: "text-xs font-semibold text-slate-500 whitespace-nowrap shrink-0", children: ["$", tier.pricing.amount, "/mo"] }))] }, tier.id));
|
|
940
|
-
}) })] })), _jsxs("div", { className: "flex gap-3 justify-end pt-2", children: [_jsx("button", { onClick: () => {
|
|
941
|
-
setEditServiceModal(null);
|
|
942
|
-
setEditServiceName("");
|
|
943
|
-
setEditServiceDescription("");
|
|
944
|
-
setEditServiceSelectedTiers(new Set());
|
|
945
|
-
}, className: "py-2.5 px-5 text-sm font-semibold rounded-[10px] cursor-pointer transition-all duration-150 bg-slate-200 text-slate-600 border-none hover:bg-slate-300 hover:text-slate-800", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Cancel" }), _jsx("button", { onClick: handleSaveEditService, disabled: !editServiceName.trim(), className: "py-2.5 px-5 text-sm font-semibold rounded-[10px] cursor-pointer transition-all duration-150 bg-violet-600 text-white border-none shadow-[0_2px_4px_rgba(124,58,237,0.3)] hover:enabled:bg-violet-700 hover:enabled:shadow-[0_4px_8px_rgba(124,58,237,0.4)] hover:enabled:-translate-y-px active:enabled:translate-y-0 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Save Changes" })] })] }) })), metricModal && (_jsx("div", { className: "fixed inset-0 bg-slate-900/75 backdrop-blur-sm flex items-center justify-center z-[100]", style: { animation: "modal-backdrop 0.2s ease-out" }, children: _jsxs("div", { className: "bg-white rounded-xl p-6 max-h-[85vh] overflow-y-auto", style: {
|
|
946
|
-
width: "min(32rem, calc(100vw - 2rem))",
|
|
947
|
-
maxWidth: "32rem",
|
|
948
|
-
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.08)",
|
|
949
|
-
animation: "modal-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
950
|
-
}, children: [_jsx("h3", { className: "text-xl font-bold text-slate-900 mb-5 tracking-tight", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: metricModal.metric ? "Edit Metric" : "Add Metric" }), _jsxs("div", { className: "mb-5", children: [_jsx("label", { className: "block text-[0.8125rem] font-semibold text-slate-700 mb-2", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Metric Name" }), _jsx("input", { type: "text", value: metricName, onChange: (e) => setMetricName(e.target.value), placeholder: "e.g., Number of Entities, API Calls, Storage", className: "w-full text-sm text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-3 px-4 outline-none transition-all duration-150 focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)] placeholder:text-slate-400", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, autoFocus: true })] }), _jsxs("div", { className: "mb-5", children: [_jsx("label", { className: "block text-[0.8125rem] font-semibold text-slate-700 mb-2", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Unit Name (Optional)" }), _jsx("input", { type: "text", value: metricUnitName, onChange: (e) => setMetricUnitName(e.target.value), placeholder: "e.g., entity, user, API call, GB", className: "w-full text-sm text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-3 px-4 outline-none transition-all duration-150 focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)] placeholder:text-slate-400", style: { fontFamily: "'DM Sans', system-ui, sans-serif" } }), _jsx("p", { className: "text-[0.8125rem] text-slate-600 mb-5 leading-6", style: { marginTop: "0.375rem" }, children: "Used for overage pricing (e.g., \"$50/entity above free limit\")" })] }), _jsxs("div", { className: "mb-5", children: [_jsx("label", { className: "block text-[0.8125rem] font-semibold text-slate-700 mb-2", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Reset Cycle" }), _jsxs("select", { value: metricResetCycle, onChange: (e) => setMetricResetCycle(e.target.value), className: "w-full text-sm text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-3 px-4 outline-none transition-all duration-150 focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)] placeholder:text-slate-400 cursor-pointer", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: [_jsx("option", { value: "NONE", children: "None (One-time)" }), _jsx("option", { value: "DAILY", children: "Daily" }), _jsx("option", { value: "WEEKLY", children: "Weekly" }), _jsx("option", { value: "MONTHLY", children: "Monthly" })] }), _jsx("p", { className: "text-[0.8125rem] text-slate-600 mb-5 leading-6", style: { marginTop: "0.375rem" }, children: "How often usage limits reset. Use \"None\" for one-time setup costs." })] }), _jsxs("div", { className: "mb-5", children: [_jsx("label", { className: "block text-[0.8125rem] font-semibold text-slate-700 mb-2", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Pricing Tiers & Values" }), _jsx("p", { className: "text-[0.8125rem] text-slate-600 mb-5 leading-6", style: { marginBottom: "0.75rem" }, children: "Enable the metric for each tier and set values." }), _jsx("div", { style: {
|
|
951
|
-
display: "flex",
|
|
952
|
-
flexDirection: "column",
|
|
953
|
-
gap: "0.5rem",
|
|
954
|
-
}, children: tiers.map((tier) => {
|
|
955
|
-
const isEnabled = metricEnabledTiers.has(tier.id);
|
|
956
|
-
const tierOveragePrice = metricOveragePrices[tier.id] || "";
|
|
957
|
-
return (_jsxs("div", { style: {
|
|
958
|
-
display: "flex",
|
|
959
|
-
flexDirection: "column",
|
|
960
|
-
gap: "0.5rem",
|
|
961
|
-
padding: "0.75rem",
|
|
962
|
-
borderRadius: "6px",
|
|
963
|
-
background: isEnabled
|
|
964
|
-
? "rgba(124, 58, 237, 0.05)"
|
|
965
|
-
: "#f8fafc",
|
|
966
|
-
border: isEnabled
|
|
967
|
-
? "1px solid rgba(124, 58, 237, 0.2)"
|
|
968
|
-
: "1px solid #e2e8f0",
|
|
969
|
-
transition: "all 0.15s ease",
|
|
970
|
-
}, children: [_jsxs("div", { style: {
|
|
971
|
-
display: "flex",
|
|
972
|
-
alignItems: "center",
|
|
973
|
-
gap: "0.75rem",
|
|
974
|
-
}, children: [_jsxs("label", { style: {
|
|
975
|
-
display: "flex",
|
|
976
|
-
alignItems: "center",
|
|
977
|
-
gap: "0.5rem",
|
|
978
|
-
cursor: "pointer",
|
|
979
|
-
minWidth: "120px",
|
|
980
|
-
}, children: [_jsx("input", { type: "checkbox", checked: isEnabled, onChange: (e) => {
|
|
981
|
-
setMetricEnabledTiers((prev) => {
|
|
982
|
-
const next = new Set(prev);
|
|
983
|
-
if (e.target.checked) {
|
|
984
|
-
next.add(tier.id);
|
|
985
|
-
}
|
|
986
|
-
else {
|
|
987
|
-
next.delete(tier.id);
|
|
988
|
-
}
|
|
989
|
-
return next;
|
|
990
|
-
});
|
|
991
|
-
}, style: {
|
|
992
|
-
width: "16px",
|
|
993
|
-
height: "16px",
|
|
994
|
-
accentColor: "#7c3aed",
|
|
995
|
-
cursor: "pointer",
|
|
996
|
-
} }), _jsx("span", { style: {
|
|
997
|
-
fontWeight: 600,
|
|
998
|
-
color: isEnabled ? "#334155" : "#94a3b8",
|
|
999
|
-
fontSize: "0.875rem",
|
|
1000
|
-
}, children: tier.name })] }), _jsx("input", { type: "text", value: metricLimits[tier.id] || "", onChange: (e) => setMetricLimits((prev) => ({
|
|
1001
|
-
...prev,
|
|
1002
|
-
[tier.id]: e.target.value,
|
|
1003
|
-
})), placeholder: isEnabled ? "Free limit" : "—", className: "w-full text-sm text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-3 px-4 outline-none transition-all duration-150 focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)] placeholder:text-slate-400", disabled: !isEnabled, style: {
|
|
1004
|
-
fontFamily: "'DM Sans', system-ui, sans-serif",
|
|
1005
|
-
flex: 1,
|
|
1006
|
-
opacity: isEnabled ? 1 : 0.5,
|
|
1007
|
-
cursor: isEnabled ? "text" : "not-allowed",
|
|
1008
|
-
} }), _jsx("input", { type: "text", value: metricPaidLimits[tier.id] || "", onChange: (e) => setMetricPaidLimits((prev) => ({
|
|
1009
|
-
...prev,
|
|
1010
|
-
[tier.id]: e.target.value,
|
|
1011
|
-
})), placeholder: isEnabled ? "Paid limit" : "—", className: "w-full text-sm text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-3 px-4 outline-none transition-all duration-150 focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)] placeholder:text-slate-400", disabled: !isEnabled, style: {
|
|
1012
|
-
fontFamily: "'DM Sans', system-ui, sans-serif",
|
|
1013
|
-
flex: 1,
|
|
1014
|
-
opacity: isEnabled ? 1 : 0.5,
|
|
1015
|
-
cursor: isEnabled ? "text" : "not-allowed",
|
|
1016
|
-
} })] }), isEnabled && (_jsxs("div", { style: {
|
|
1017
|
-
display: "flex",
|
|
1018
|
-
alignItems: "center",
|
|
1019
|
-
gap: "0.5rem",
|
|
1020
|
-
marginLeft: "1.75rem",
|
|
1021
|
-
padding: "0.5rem 0.75rem",
|
|
1022
|
-
background: "rgba(255,255,255,0.6)",
|
|
1023
|
-
borderRadius: "4px",
|
|
1024
|
-
}, children: [_jsx("span", { style: {
|
|
1025
|
-
fontSize: "0.75rem",
|
|
1026
|
-
color: "#64748b",
|
|
1027
|
-
whiteSpace: "nowrap",
|
|
1028
|
-
}, children: "Overage price:" }), _jsx("span", { style: {
|
|
1029
|
-
fontFamily: "'DM Mono', 'SF Mono', monospace",
|
|
1030
|
-
fontSize: "0.8125rem",
|
|
1031
|
-
color: "#64748b",
|
|
1032
|
-
}, children: "$" }), _jsx("input", { type: "number", value: tierOveragePrice, onChange: (e) => setMetricOveragePrices((prev) => ({
|
|
1033
|
-
...prev,
|
|
1034
|
-
[tier.id]: e.target.value,
|
|
1035
|
-
})), placeholder: "0.00", step: "0.01", style: {
|
|
1036
|
-
width: "4rem",
|
|
1037
|
-
fontFamily: "'DM Mono', 'SF Mono', monospace",
|
|
1038
|
-
fontSize: "0.8125rem",
|
|
1039
|
-
fontWeight: 500,
|
|
1040
|
-
color: "#0f172a",
|
|
1041
|
-
background: "#ffffff",
|
|
1042
|
-
border: "1px solid #cbd5e1",
|
|
1043
|
-
borderRadius: "4px",
|
|
1044
|
-
padding: "0.25rem 0.375rem",
|
|
1045
|
-
outline: "none",
|
|
1046
|
-
} }), _jsxs("span", { style: {
|
|
1047
|
-
fontSize: "0.6875rem",
|
|
1048
|
-
color: "#64748b",
|
|
1049
|
-
}, children: ["per ", metricUnitName || "unit", " above free limit", metricResetCycle && metricResetCycle !== "NONE"
|
|
1050
|
-
? ` / ${metricResetCycle.toLowerCase()}`
|
|
1051
|
-
: ""] })] }))] }, tier.id));
|
|
1052
|
-
}) })] }), _jsxs("div", { className: "flex gap-3 justify-end pt-2", children: [_jsx("button", { onClick: () => {
|
|
1053
|
-
setMetricModal(null);
|
|
1054
|
-
setMetricName("");
|
|
1055
|
-
setMetricUnitName("");
|
|
1056
|
-
setMetricLimits({});
|
|
1057
|
-
setMetricPaidLimits({});
|
|
1058
|
-
setMetricEnabledTiers(new Set());
|
|
1059
|
-
setMetricOveragePrices({});
|
|
1060
|
-
setMetricResetCycle("MONTHLY");
|
|
1061
|
-
}, className: "py-2.5 px-5 text-sm font-semibold rounded-[10px] cursor-pointer transition-all duration-150 bg-slate-200 text-slate-600 border-none hover:bg-slate-300 hover:text-slate-800", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Cancel" }), _jsx("button", { onClick: handleSaveMetric, disabled: !metricName.trim() || metricEnabledTiers.size === 0, className: "py-2.5 px-5 text-sm font-semibold rounded-[10px] cursor-pointer transition-all duration-150 bg-violet-600 text-white border-none shadow-[0_2px_4px_rgba(124,58,237,0.3)] hover:enabled:bg-violet-700 hover:enabled:shadow-[0_4px_8px_rgba(124,58,237,0.4)] hover:enabled:-translate-y-px active:enabled:translate-y-0 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: metricModal.metric ? "Save Changes" : "Add Metric" })] })] }) }))] }), pendingRemoveMetric && (_jsx(ConfirmDialog, { title: "Remove this metric?", message: "This will delete the usage metric and its limits from all tiers. This action cannot be undone.", confirmLabel: "Remove Metric", variant: "danger", onConfirm: confirmRemoveMetric, onCancel: () => setPendingRemoveMetric(null) }))] }));
|
|
1062
|
-
}
|
|
1063
|
-
function ServiceGroupSection({ group, services, tiers, isSetupFormation, isOptional, isEnabled, onToggle, getServiceLevelForTier, getUniqueMetricsForService, getUsageLimitForMetric, getLevelDisplay, selectedCell, setSelectedCell, onAddService, selectedTierIdx, onAddMetric, onEditMetric, onRemoveMetric, onEditService, onReorderService, activeBillingCycle, addonActiveCycle, onAddonCycleChange: _onAddonCycleChange, groupActiveCycle, onGroupCycleChange: _onGroupCycleChange, groupBreakdown, }) {
|
|
1064
|
-
const showGroup = services.length > 0 || onAddService;
|
|
1065
|
-
if (!showGroup)
|
|
1066
|
-
return null;
|
|
1067
|
-
// Add-ons follow the global billing cycle (no independent cycle tabs);
|
|
1068
|
-
// regular groups can have a per-group override in custom billing mode.
|
|
1069
|
-
const effectiveBillingCycle = group.isAddOn
|
|
1070
|
-
? activeBillingCycle
|
|
1071
|
-
: groupActiveCycle || activeBillingCycle;
|
|
1072
|
-
const headerClass = isSetupFormation
|
|
1073
|
-
? "bg-amber-100"
|
|
1074
|
-
: isOptional
|
|
1075
|
-
? "bg-sky-100"
|
|
1076
|
-
: "bg-slate-100";
|
|
1077
|
-
const rowClass = isSetupFormation
|
|
1078
|
-
? "bg-amber-50"
|
|
1079
|
-
: isOptional
|
|
1080
|
-
? "bg-sky-50"
|
|
1081
|
-
: "bg-slate-50";
|
|
1082
|
-
return (_jsxs(_Fragment, { children: [_jsxs("tr", { className: `py-3 px-4 border-b border-slate-200 ${headerClass}`, children: [_jsx("td", { className: `sticky left-0 z-10 py-3 px-4 border-b border-slate-200 ${headerClass}`, children: _jsxs("div", { className: "flex items-center gap-3", children: [isOptional && (_jsx("button", { onClick: onToggle, className: `relative w-10 h-5 rounded-full border-none cursor-pointer transition-all duration-200 ${isEnabled ? "bg-violet-600" : "bg-slate-300"}`, children: _jsx("span", { className: `absolute top-0.5 w-4 h-4 bg-white rounded-full shadow-sm transition-all duration-150 ${isEnabled ? "left-[calc(100%-1.125rem)]" : "left-0.5"}` }) })), _jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("span", { className: "font-semibold text-slate-800", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: group.name }), group.isAddOn && (_jsx("span", { className: "text-[0.625rem] font-semibold uppercase tracking-[0.05em] text-slate-400", children: "Optional Add-on" }))] }), !isSetupFormation &&
|
|
1083
|
-
(() => {
|
|
1084
|
-
if (!groupBreakdown)
|
|
1085
|
-
return null;
|
|
1086
|
-
const { monthlyBase, recurringAmount, discount, currency } = groupBreakdown;
|
|
1087
|
-
if (monthlyBase <= 0 && !group.standalonePricing?.setupCost)
|
|
1088
|
-
return null;
|
|
1089
|
-
const setupCost = group.standalonePricing?.setupCost;
|
|
1090
|
-
const months = BILLING_CYCLE_MONTHS[effectiveBillingCycle];
|
|
1091
|
-
const monthlyEq = months > 0
|
|
1092
|
-
? Math.round((recurringAmount / months) * 100) / 100
|
|
1093
|
-
: recurringAmount;
|
|
1094
|
-
const savingsPct = discount && discount.originalAmount > 0
|
|
1095
|
-
? Math.round(((discount.originalAmount - discount.discountedAmount) /
|
|
1096
|
-
discount.originalAmount) *
|
|
1097
|
-
100)
|
|
1098
|
-
: 0;
|
|
1099
|
-
return (_jsxs("div", { className: "flex items-center gap-3 ml-auto", children: [monthlyBase > 0 && (_jsxs("span", { className: "text-sm font-bold text-slate-800 whitespace-nowrap", children: [formatPrice(effectiveBillingCycle === "MONTHLY"
|
|
1100
|
-
? monthlyBase
|
|
1101
|
-
: monthlyEq, currency), "/mo"] })), effectiveBillingCycle !== "MONTHLY" && monthlyBase > 0 && (_jsxs("span", { className: "text-[0.6875rem] font-medium text-slate-500 whitespace-nowrap", children: ["Billed ", formatPrice(recurringAmount, currency), " ", BILLING_CYCLE_LABELS[effectiveBillingCycle]] })), savingsPct > 0 && (_jsxs("span", { className: "text-[0.6875rem] font-semibold text-emerald-600 whitespace-nowrap", children: ["SAVE ", Math.round(savingsPct), "%"] })), setupCost && setupCost.amount > 0 && (_jsxs("span", { className: "text-[0.6875rem] font-medium text-slate-500 whitespace-nowrap", children: ["+", " ", formatPrice(setupCost.amount, setupCost.currency || "USD"), " ", "Setup"] }))] }));
|
|
1102
|
-
})()] }) }), _jsx("td", { colSpan: tiers.length, className: headerClass, style: { textAlign: "center" }, children: _jsx("span", { className: `inline-block py-1 px-2.5 rounded-md text-[0.625rem] font-semibold uppercase tracking-[0.04em] ${isSetupFormation || !isOptional
|
|
1103
|
-
? "bg-emerald-100 text-emerald-700"
|
|
1104
|
-
: "bg-sky-200 text-sky-700"}`, children: isSetupFormation
|
|
1105
|
-
? "INCLUDED"
|
|
1106
|
-
: isOptional
|
|
1107
|
-
? "OPTIONAL"
|
|
1108
|
-
: "INCLUDED" }) })] }), services.map((service) => {
|
|
1109
|
-
const metrics = getUniqueMetricsForService(service.id);
|
|
1110
|
-
return (_jsx(ServiceRowWithMetrics, { service: service, metrics: metrics, tiers: tiers, rowClass: rowClass, getServiceLevelForTier: getServiceLevelForTier, getUsageLimitForMetric: getUsageLimitForMetric, getLevelDisplay: getLevelDisplay, selectedCell: selectedCell, setSelectedCell: setSelectedCell, selectedTierIdx: selectedTierIdx, onAddMetric: onAddMetric, onEditMetric: onEditMetric, onRemoveMetric: onRemoveMetric, onEditService: onEditService, onReorderService: onReorderService, groupServices: services, serviceIndex: services.indexOf(service) }, service.id));
|
|
1111
|
-
}), onAddService && group.id !== "__ungrouped__" && (_jsxs("tr", { className: `[&>td]:py-2 [&>td]:px-4 [&>td]:pl-8 [&>td]:border-b [&>td]:border-slate-100 ${rowClass}`, children: [_jsx("td", { className: rowClass, children: _jsxs("button", { onClick: () => onAddService(group.id, isSetupFormation), className: "flex items-center gap-1.5 text-[0.8125rem] font-medium text-violet-600 bg-transparent border-none cursor-pointer transition-all duration-150 hover:text-violet-700", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: [_jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), "Add a Service"] }) }), _jsx("td", { colSpan: tiers.length, className: rowClass })] })), isSetupFormation &&
|
|
1112
|
-
(() => {
|
|
1113
|
-
const basePrice = group.price ?? 0;
|
|
1114
|
-
if (basePrice === 0) {
|
|
1115
|
-
return (_jsxs("tr", { className: "bg-slate-50 [&>td]:py-2.5 [&>td]:px-4 [&>td]:font-semibold [&>td]:text-slate-700 [&>td]:border-b [&>td]:border-slate-200 [&>td:first-child]:sticky [&>td:first-child]:left-0 [&>td:first-child]:z-10 [&>td:first-child]:bg-slate-50", children: [_jsx("td", { children: "TOTAL SETUP FEE" }), _jsx("td", { colSpan: tiers.length, style: { textAlign: "center" }, children: "No setup fee configured" })] }));
|
|
1116
|
-
}
|
|
1117
|
-
const selectedTier = tiers[selectedTierIdx] ?? null;
|
|
1118
|
-
const tierPricing = selectedTier
|
|
1119
|
-
? group.tierDependentPricing?.find((tp) => tp.tierId === selectedTier.id)
|
|
1120
|
-
: null;
|
|
1121
|
-
const cycleDiscount = tierPricing?.setupCostDiscounts?.find((d) => d.billingCycle === activeBillingCycle);
|
|
1122
|
-
const genericDiscount = tierPricing?.setupCost?.discount;
|
|
1123
|
-
const discount = cycleDiscount?.discountRule ?? genericDiscount;
|
|
1124
|
-
let effectivePrice = basePrice;
|
|
1125
|
-
if (discount && discount.discountValue > 0) {
|
|
1126
|
-
if (discount.discountType === "PERCENTAGE") {
|
|
1127
|
-
effectivePrice = basePrice * (1 - discount.discountValue / 100);
|
|
1128
|
-
}
|
|
1129
|
-
else {
|
|
1130
|
-
effectivePrice = Math.max(0, basePrice - discount.discountValue);
|
|
1131
|
-
}
|
|
1132
|
-
effectivePrice = Math.round(effectivePrice * 100) / 100;
|
|
1133
|
-
}
|
|
1134
|
-
const curr = group.currency || "USD";
|
|
1135
|
-
const hasDiscount = effectivePrice !== basePrice;
|
|
1136
|
-
return (_jsxs("tr", { className: "bg-slate-50 [&>td]:py-2.5 [&>td]:px-4 [&>td]:font-semibold [&>td]:text-slate-700 [&>td]:border-b [&>td]:border-slate-200 [&>td:first-child]:sticky [&>td:first-child]:left-0 [&>td:first-child]:z-10 [&>td:first-child]:bg-slate-50", children: [_jsx("td", { children: "TOTAL SETUP FEE" }), _jsx("td", { colSpan: tiers.length, style: { textAlign: "center" }, children: selectedTier?.excludeFromSetupFee ? (_jsx("span", { className: "text-slate-400 italic", children: "No setup fee for this tier" })) : hasDiscount ? (_jsxs(_Fragment, { children: [_jsx("span", { style: {
|
|
1137
|
-
textDecoration: "line-through",
|
|
1138
|
-
opacity: 0.5,
|
|
1139
|
-
marginRight: 6,
|
|
1140
|
-
}, children: formatPrice(basePrice, curr) }), formatPrice(effectivePrice, curr), " flat fee", discount?.discountType === "PERCENTAGE"
|
|
1141
|
-
? ` (${discount.discountValue}% off)`
|
|
1142
|
-
: ` (${formatPrice(discount?.discountValue ?? 0, curr)} off)`] })) : (`${formatPrice(basePrice, curr)} flat fee (applied to all ${tiers.some((t) => {
|
|
1143
|
-
const tp = group.tierDependentPricing?.find((p) => p.tierId === t.id);
|
|
1144
|
-
const monthlyAmt = tp?.recurringPricing?.find((r) => r.billingCycle === "MONTHLY")?.amount;
|
|
1145
|
-
return !monthlyAmt || monthlyAmt === 0;
|
|
1146
|
-
})
|
|
1147
|
-
? "priced "
|
|
1148
|
-
: ""}tiers)`) })] }));
|
|
1149
|
-
})(), isOptional &&
|
|
1150
|
-
(() => {
|
|
1151
|
-
const baseMonthly = isEnabled
|
|
1152
|
-
? (groupBreakdown?.monthlyBase ?? 0)
|
|
1153
|
-
: 0;
|
|
1154
|
-
const adjustedTotal = isEnabled
|
|
1155
|
-
? (groupBreakdown?.recurringAmount ?? 0)
|
|
1156
|
-
: 0;
|
|
1157
|
-
const setupCost = isEnabled
|
|
1158
|
-
? (group.standalonePricing?.setupCost?.amount ?? 0)
|
|
1159
|
-
: 0;
|
|
1160
|
-
const billingLabel = `/${BILLING_CYCLE_SHORT_LABELS[effectiveBillingCycle].toLowerCase()}`;
|
|
1161
|
-
const currency = groupBreakdown?.currency || group.currency || "USD";
|
|
1162
|
-
return (_jsxs("tr", { className: `[&>td]:py-2.5 [&>td]:px-4 [&>td]:font-semibold [&>td]:text-slate-700 [&>td]:border-b [&>td]:border-slate-300 [&>td:first-child]:sticky [&>td:first-child]:left-0 [&>td:first-child]:z-10 ${headerClass}`, children: [_jsx("td", { className: headerClass, children: "SUBTOTAL" }), _jsx("td", { colSpan: tiers.length, style: { textAlign: "center" }, children: isEnabled && (baseMonthly > 0 || setupCost > 0) ? (_jsxs(_Fragment, { children: [baseMonthly > 0 &&
|
|
1163
|
-
`+${formatPrice(adjustedTotal, currency)}${billingLabel}`, baseMonthly > 0 && setupCost > 0 && " + ", setupCost > 0 &&
|
|
1164
|
-
`${formatPrice(setupCost, currency)} setup`] })) : isEnabled ? ("Included") : ("—") })] }));
|
|
1165
|
-
})()] }));
|
|
1166
|
-
}
|
|
1167
|
-
function ServiceRowWithMetrics({ service, metrics, tiers, rowClass, getServiceLevelForTier, getUsageLimitForMetric, getLevelDisplay, selectedCell, setSelectedCell, selectedTierIdx, onAddMetric, onEditMetric, onRemoveMetric, onEditService, onReorderService, groupServices, serviceIndex, }) {
|
|
1168
|
-
const isFirst = serviceIndex === 0;
|
|
1169
|
-
const isLast = serviceIndex === groupServices.length - 1;
|
|
1170
|
-
return (_jsxs(_Fragment, { children: [_jsxs("tr", { className: `group/servicerow transition-all duration-150 hover:brightness-[0.98] ${rowClass}`, children: [_jsx("td", { className: `py-2.5 px-4 pl-8 border-b border-slate-100 sticky left-0 z-10 ${rowClass}`, children: _jsxs("div", { className: "flex items-center justify-start gap-2", children: [_jsxs("div", { className: "flex flex-col gap-px mr-2 opacity-0 group-hover/servicerow:opacity-100 transition-opacity duration-150", children: [_jsx("button", { className: "flex items-center justify-center w-[18px] h-[14px] p-0 border-none bg-transparent text-slate-400 cursor-pointer rounded-sm transition-all duration-150 hover:enabled:bg-violet-100 hover:enabled:text-violet-600 disabled:opacity-30 disabled:cursor-not-allowed [&>svg]:w-3 [&>svg]:h-3", onClick: (e) => {
|
|
1171
|
-
e.stopPropagation();
|
|
1172
|
-
onReorderService(service.id, "up", groupServices);
|
|
1173
|
-
}, disabled: isFirst, title: "Move up", children: _jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: _jsx("path", { d: "M18 15l-6-6-6 6" }) }) }), _jsx("button", { className: "flex items-center justify-center w-[18px] h-[14px] p-0 border-none bg-transparent text-slate-400 cursor-pointer rounded-sm transition-all duration-150 hover:enabled:bg-violet-100 hover:enabled:text-violet-600 disabled:opacity-30 disabled:cursor-not-allowed [&>svg]:w-3 [&>svg]:h-3", onClick: (e) => {
|
|
1174
|
-
e.stopPropagation();
|
|
1175
|
-
onReorderService(service.id, "down", groupServices);
|
|
1176
|
-
}, disabled: isLast, title: "Move down", children: _jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: _jsx("path", { d: "M6 9l6 6 6-6" }) }) })] }), _jsx("button", { className: "text-[0.8125rem] text-slate-700 bg-none border-none py-1 px-2 -m-1 rounded cursor-pointer transition-all duration-150 text-left hover:bg-slate-100 hover:text-violet-700", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, onClick: (e) => {
|
|
1177
|
-
e.stopPropagation();
|
|
1178
|
-
onEditService(service);
|
|
1179
|
-
}, title: "Click to edit service", children: service.title }), service.isSetupFormation && (_jsx("span", { className: "inline-block py-px px-1.5 ml-1.5 text-[0.5625rem] font-bold uppercase tracking-[0.04em] rounded-md bg-amber-100 text-amber-700 align-middle", children: "Setup" })), _jsx("button", { onClick: (e) => {
|
|
1180
|
-
e.stopPropagation();
|
|
1181
|
-
onAddMetric(service.id);
|
|
1182
|
-
}, className: "opacity-60 group-hover/servicerow:opacity-100 text-[0.6875rem] font-medium text-violet-600 bg-transparent border-none cursor-pointer py-0.5 px-1.5 rounded-md transition-all duration-150 whitespace-nowrap hover:bg-violet-100 hover:text-violet-700", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, title: "Add metric to this service", children: "+ Metric" })] }) }), tiers.map((tier, tierIdx) => {
|
|
1183
|
-
const serviceLevel = getServiceLevelForTier(service.id, tier);
|
|
1184
|
-
const display = getLevelDisplay(serviceLevel);
|
|
1185
|
-
const isSelected = selectedCell?.serviceId === service.id &&
|
|
1186
|
-
selectedCell?.tierId === tier.id;
|
|
1187
|
-
const isNotIncluded = !serviceLevel || serviceLevel.level === "NOT_INCLUDED";
|
|
1188
|
-
// Find next tier that has this service included (for upgrade hint)
|
|
1189
|
-
const nextTierWithService = isNotIncluded
|
|
1190
|
-
? tiers.slice(tierIdx + 1).find((t) => {
|
|
1191
|
-
const sl = getServiceLevelForTier(service.id, t);
|
|
1192
|
-
return sl && sl.level === "INCLUDED";
|
|
1193
|
-
})
|
|
1194
|
-
: null;
|
|
1195
|
-
return (_jsxs("td", { className: `py-2.5 px-4 text-center border-b border-slate-100 cursor-pointer transition-all duration-150 hover:bg-white/50 ${isSelected
|
|
1196
|
-
? "shadow-[inset_0_0_0_2px_#8b5cf6] bg-violet-500/[0.08]"
|
|
1197
|
-
: ""} ${tierIdx === selectedTierIdx ? "" : ""} ${isNotIncluded ? "relative" : ""}`, style: tierIdx === selectedTierIdx
|
|
1198
|
-
? {
|
|
1199
|
-
background: isSelected
|
|
1200
|
-
? "rgba(139, 92, 246, 0.08)"
|
|
1201
|
-
: "linear-gradient(180deg, rgba(139, 92, 246, 0.06) 0%, rgba(139, 92, 246, 0.12) 100%)",
|
|
1202
|
-
}
|
|
1203
|
-
: isNotIncluded
|
|
1204
|
-
? {
|
|
1205
|
-
background: "repeating-linear-gradient(135deg, transparent, transparent 8px, rgba(148, 163, 184, 0.08) 8px, rgba(148, 163, 184, 0.08) 16px)",
|
|
1206
|
-
}
|
|
1207
|
-
: undefined, onClick: () => setSelectedCell(isSelected
|
|
1208
|
-
? null
|
|
1209
|
-
: { serviceId: service.id, tierId: tier.id }), children: [_jsx("span", { className: `font-medium ${isNotIncluded ? "opacity-60" : ""}`, style: {
|
|
1210
|
-
color: display.color,
|
|
1211
|
-
fontFamily: "'DM Sans', system-ui, sans-serif",
|
|
1212
|
-
}, children: display.label }), isNotIncluded && nextTierWithService && (_jsxs("span", { className: "absolute bottom-0.5 left-1/2 -translate-x-1/2 translate-y-1 text-[0.5625rem] font-medium text-violet-600 whitespace-nowrap opacity-0 transition-all duration-150 pointer-events-none group-hover/servicerow:opacity-0", style: { opacity: 0 }, children: ["In ", nextTierWithService.name, " \u2192"] }))] }, tier.id));
|
|
1213
|
-
})] }), metrics.map((metric) => (_jsxs("tr", { className: `group/metricrow bg-inherit cursor-pointer transition-all duration-150 hover:bg-violet-500/[0.08] ${rowClass}`, onClick: () => onEditMetric(service.id, metric), children: [_jsx("td", { className: `py-2 px-4 pl-28 border-b border-slate-100 sticky left-0 z-10 align-middle ${rowClass}`, children: _jsxs("div", { className: "flex items-center gap-2 relative h-full", children: [_jsx("span", { className: "text-xs italic text-slate-500", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: metric }), _jsxs("div", { className: "flex gap-1 opacity-0 group-hover/metricrow:opacity-100 transition-all duration-150", children: [_jsx("button", { onClick: (e) => {
|
|
1214
|
-
e.stopPropagation();
|
|
1215
|
-
onEditMetric(service.id, metric);
|
|
1216
|
-
}, className: "p-0.5 bg-transparent border-none text-slate-400 cursor-pointer rounded-md transition-all duration-150 flex items-center justify-center hover:bg-slate-200 hover:text-violet-600", title: "Edit metric", children: _jsx("svg", { className: "w-3 h-3", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" }) }) }), _jsx("button", { onClick: (e) => {
|
|
1217
|
-
e.stopPropagation();
|
|
1218
|
-
onRemoveMetric(service.id, metric);
|
|
1219
|
-
}, className: "p-0.5 bg-transparent border-none text-slate-400 cursor-pointer rounded-md transition-all duration-150 flex items-center justify-center hover:bg-slate-200 hover:text-rose-600", title: "Remove metric", children: _jsx("svg", { className: "w-3 h-3", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }) }) })] })] }) }), tiers.map((tier, tierIdx) => {
|
|
1220
|
-
const usageLimit = getUsageLimitForMetric(service.id, metric, tier);
|
|
1221
|
-
return (_jsx("td", { className: "py-1.5 px-3 text-center border-b border-slate-100 align-middle", style: tierIdx === selectedTierIdx
|
|
1222
|
-
? {
|
|
1223
|
-
background: "linear-gradient(180deg, rgba(139, 92, 246, 0.06) 0%, rgba(139, 92, 246, 0.12) 100%)",
|
|
1224
|
-
}
|
|
1225
|
-
: undefined, children: _jsx("div", { className: "inline-flex flex-col border border-slate-200 rounded-[10px] overflow-hidden min-w-[10rem]", children: usageLimit ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex justify-between items-center py-1.5 px-3 gap-4", children: [_jsx("span", { className: "text-[0.6875rem] text-slate-500 whitespace-nowrap", children: "Included" }), _jsx("span", { className: "text-xs text-slate-700 text-right whitespace-nowrap", children: usageLimit.freeLimit != null ? (_jsxs(_Fragment, { children: [_jsxs("strong", { children: [usageLimit.freeLimit, usageLimit.unitName
|
|
1226
|
-
? ` ${usageLimit.unitName}`
|
|
1227
|
-
: ""] }), usageLimit.resetCycle &&
|
|
1228
|
-
usageLimit.resetCycle !== "NONE" && (_jsxs("span", { className: "text-[0.625rem] font-normal text-slate-400", children: [" ", "/ ", usageLimit.resetCycle.toLowerCase()] }))] })) : (_jsx("strong", { children: usageLimit.notes || "Unlimited" })) })] }), usageLimit.unitPrice != null && (_jsxs("div", { className: "flex justify-between items-center py-1.5 px-3 gap-4 border-t border-slate-100", children: [_jsx("span", { className: "text-[0.6875rem] text-slate-500 whitespace-nowrap", children: "Overage" }), _jsxs("span", { className: "text-xs text-emerald-600 font-medium text-right whitespace-nowrap", children: [formatPrice(usageLimit.unitPrice, usageLimit.unitPriceCurrency || "USD"), _jsxs("span", { className: "text-[0.625rem] font-normal text-slate-400", children: [" ", "/ extra"] })] })] }))] })) : (_jsx("span", { className: "text-xs text-slate-300", children: "\u2014" })) }) }, tier.id));
|
|
1229
|
-
})] }, `${service.id}-${metric}`)))] }));
|
|
1230
|
-
}
|
|
1231
|
-
function ServiceLevelDetailPanel({ serviceId, tierId, services, tiers, optionGroups: _optionGroups, dispatch, onClose, }) {
|
|
1232
|
-
const service = services.find((s) => s.id === serviceId);
|
|
1233
|
-
const tier = tiers.find((t) => t.id === tierId);
|
|
1234
|
-
const panelRef = useRef(null);
|
|
1235
|
-
const overlayRef = useRef(null);
|
|
1236
|
-
const onCloseRef = useRef(onClose);
|
|
1237
|
-
onCloseRef.current = onClose;
|
|
1238
|
-
// Scroll lock when modal is open
|
|
1239
|
-
useEffect(() => {
|
|
1240
|
-
const originalOverflow = document.body.style.overflow;
|
|
1241
|
-
document.body.style.overflow = "hidden";
|
|
1242
|
-
return () => {
|
|
1243
|
-
document.body.style.overflow = originalOverflow;
|
|
1244
|
-
};
|
|
1245
|
-
}, []);
|
|
1246
|
-
// Handle Escape key press
|
|
1247
|
-
useEffect(() => {
|
|
1248
|
-
const handleKeyDown = (e) => {
|
|
1249
|
-
if (e.key === "Escape") {
|
|
1250
|
-
onCloseRef.current();
|
|
1251
|
-
}
|
|
1252
|
-
};
|
|
1253
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
1254
|
-
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
1255
|
-
}, []);
|
|
1256
|
-
// Focus trap - keep focus inside the panel
|
|
1257
|
-
useEffect(() => {
|
|
1258
|
-
const panel = panelRef.current;
|
|
1259
|
-
if (!panel)
|
|
1260
|
-
return;
|
|
1261
|
-
const focusableElements = panel.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
1262
|
-
const firstElement = focusableElements[0];
|
|
1263
|
-
const lastElement = focusableElements[focusableElements.length - 1];
|
|
1264
|
-
// Focus the first element
|
|
1265
|
-
firstElement?.focus();
|
|
1266
|
-
const handleTabKey = (e) => {
|
|
1267
|
-
if (e.key !== "Tab")
|
|
1268
|
-
return;
|
|
1269
|
-
if (e.shiftKey) {
|
|
1270
|
-
if (document.activeElement === firstElement) {
|
|
1271
|
-
e.preventDefault();
|
|
1272
|
-
lastElement?.focus();
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
else {
|
|
1276
|
-
if (document.activeElement === lastElement) {
|
|
1277
|
-
e.preventDefault();
|
|
1278
|
-
firstElement?.focus();
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
};
|
|
1282
|
-
document.addEventListener("keydown", handleTabKey);
|
|
1283
|
-
return () => document.removeEventListener("keydown", handleTabKey);
|
|
1284
|
-
}, []);
|
|
1285
|
-
// Click outside to close
|
|
1286
|
-
const handleOverlayClick = useCallback((e) => {
|
|
1287
|
-
if (e.target === overlayRef.current) {
|
|
1288
|
-
onClose();
|
|
1289
|
-
}
|
|
1290
|
-
}, [onClose]);
|
|
1291
|
-
const serviceLevel = service
|
|
1292
|
-
? tier?.serviceLevels.find((sl) => sl.serviceId === serviceId)
|
|
1293
|
-
: undefined;
|
|
1294
|
-
const usageLimits = service
|
|
1295
|
-
? tier?.usageLimits.filter((ul) => ul.serviceId === serviceId) || []
|
|
1296
|
-
: [];
|
|
1297
|
-
const [isAddingMetric, setIsAddingMetric] = useState(false);
|
|
1298
|
-
const [newMetric, setNewMetric] = useState("");
|
|
1299
|
-
const [newLimit, setNewLimit] = useState("");
|
|
1300
|
-
const [customValue, setCustomValue] = useState(serviceLevel?.customValue || "");
|
|
1301
|
-
if (!service || !tier)
|
|
1302
|
-
return null;
|
|
1303
|
-
const handleAddLimit = () => {
|
|
1304
|
-
if (!newMetric.trim())
|
|
1305
|
-
return;
|
|
1306
|
-
const parsedLimit = newLimit ? parseInt(newLimit, 10) : null;
|
|
1307
|
-
const isNumeric = parsedLimit !== null && !isNaN(parsedLimit);
|
|
1308
|
-
dispatch(addUsageLimit({
|
|
1309
|
-
tierId: tier.id,
|
|
1310
|
-
limitId: generateId(),
|
|
1311
|
-
serviceId: service.id,
|
|
1312
|
-
metric: newMetric.trim(),
|
|
1313
|
-
freeLimit: isNumeric ? parsedLimit : undefined,
|
|
1314
|
-
notes: !isNumeric && newLimit ? newLimit.trim() : undefined,
|
|
1315
|
-
resetCycle: "MONTHLY",
|
|
1316
|
-
lastModified: new Date().toISOString(),
|
|
1317
|
-
}));
|
|
1318
|
-
setNewMetric("");
|
|
1319
|
-
setNewLimit("");
|
|
1320
|
-
setIsAddingMetric(false);
|
|
1321
|
-
};
|
|
1322
|
-
const handleRemoveLimit = (limitId) => {
|
|
1323
|
-
dispatch(removeUsageLimit({
|
|
1324
|
-
tierId: tier.id,
|
|
1325
|
-
limitId,
|
|
1326
|
-
lastModified: new Date().toISOString(),
|
|
1327
|
-
}));
|
|
1328
|
-
};
|
|
1329
|
-
return (_jsx("div", { ref: overlayRef, className: "fixed inset-0 bg-slate-900/75 backdrop-blur-sm flex items-center justify-end z-50", style: { animation: "panel-overlay-fade 0.2s ease-out" }, onClick: handleOverlayClick, role: "dialog", "aria-modal": "true", "aria-labelledby": "panel-title", children: _jsxs("div", { ref: panelRef, className: "w-96 h-full bg-white overflow-y-auto", style: {
|
|
1330
|
-
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
|
|
1331
|
-
animation: "panel-slide-in 0.2s ease-out",
|
|
1332
|
-
}, children: [_jsxs("div", { className: "bg-violet-600 text-white p-4", children: [_jsxs("div", { className: "flex items-center justify-between mb-1", children: [_jsxs("span", { className: "text-[0.6875rem] uppercase tracking-[0.08em] opacity-80", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" }, children: [tier.name, " Tier"] }), _jsx("button", { onClick: onClose, className: "p-1 bg-transparent border-none text-white cursor-pointer rounded-md transition-all duration-150 hover:bg-white/20", children: _jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })] }), _jsx("h3", { id: "panel-title", className: "text-lg font-semibold", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: service.title })] }), _jsx("div", { className: "p-4 flex flex-col gap-6", children: _jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between mb-3", children: [_jsx("label", { className: "block text-[0.8125rem] font-semibold text-slate-700 mb-0", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Metrics" }), _jsx("button", { onClick: () => setIsAddingMetric(true), className: "text-[0.8125rem] font-semibold text-violet-600 bg-transparent border-none cursor-pointer transition-all duration-150 hover:text-violet-700", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "+ Add Metric" })] }), usageLimits.map((limit) => (_jsx(MetricLimitItem, { limit: limit, tierId: tier.id, dispatch: dispatch, onRemove: () => handleRemoveLimit(limit.id) }, limit.id))), usageLimits.length === 0 && !isAddingMetric && (_jsx("p", { className: "text-[0.8125rem] italic text-slate-500", children: "No metrics added yet. Metrics will appear as nested rows under this service in the matrix." })), isAddingMetric && (_jsxs("div", { className: "p-3 bg-violet-50 rounded-[10px] mb-3 [&>div]:mb-2.5 [&>div:last-child]:mb-0", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-[0.625rem] font-semibold uppercase tracking-[0.08em] text-slate-500 mb-1", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" }, children: "Metric Name" }), _jsx("input", { type: "text", value: newMetric, onChange: (e) => setNewMetric(e.target.value), placeholder: "e.g., API Calls, Storage, Users", className: "w-full text-[0.8125rem] text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-2.5 px-3.5 outline-none transition-all duration-150 focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)]", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, autoFocus: true })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[0.625rem] font-semibold uppercase tracking-[0.08em] text-slate-500 mb-1", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" }, children: "Value" }), _jsx("input", { type: "text", value: newLimit, onChange: (e) => setNewLimit(e.target.value), placeholder: "e.g., 100, Unlimited, Custom", className: "w-full text-[0.8125rem] text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-2.5 px-3.5 outline-none transition-all duration-150 focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)]", style: { fontFamily: "'DM Sans', system-ui, sans-serif" } }), _jsx("p", { className: "text-[0.6875rem] text-slate-400 mt-1", children: "Enter a value or leave empty" })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx("button", { onClick: handleAddLimit, disabled: !newMetric.trim(), className: "flex-1 py-2 px-3 text-[0.8125rem] font-semibold rounded-[10px] cursor-pointer transition-all duration-150 bg-violet-600 text-white border-none hover:enabled:bg-violet-700 disabled:opacity-50 disabled:cursor-not-allowed", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Add Metric" }), _jsx("button", { onClick: () => {
|
|
1333
|
-
setNewMetric("");
|
|
1334
|
-
setNewLimit("");
|
|
1335
|
-
setIsAddingMetric(false);
|
|
1336
|
-
}, className: "flex-1 py-2 px-3 text-[0.8125rem] font-semibold rounded-[10px] cursor-pointer transition-all duration-150 bg-slate-200 text-slate-700 border-none hover:bg-slate-300", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Cancel" })] })] }))] }) }), _jsx("div", { className: "p-4 border-t border-slate-200 bg-white", children: _jsx("button", { onClick: onClose, className: "w-full py-2.5 px-4 text-sm font-semibold bg-violet-600 text-white border-none rounded-[10px] cursor-pointer transition-all duration-150 hover:bg-violet-700", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Done" }) })] }) }));
|
|
1337
|
-
}
|
|
1338
|
-
function MetricLimitItem({ limit, tierId, dispatch, onRemove, }) {
|
|
1339
|
-
const [isEditing, setIsEditing] = useState(false);
|
|
1340
|
-
const [editMetric, setEditMetric] = useState(limit.metric);
|
|
1341
|
-
const [editUnitName, setEditUnitName] = useState(limit.unitName || "");
|
|
1342
|
-
const [editLimit, setEditLimit] = useState(limit.freeLimit?.toString() || limit.notes || "");
|
|
1343
|
-
const [editPaidLimit, setEditPaidLimit] = useState(limit.paidLimit?.toString() || "");
|
|
1344
|
-
const [editResetCycle, setEditResetCycle] = useState(limit.resetCycle || "MONTHLY");
|
|
1345
|
-
// Overage pricing state
|
|
1346
|
-
const [editUnitPrice, setEditUnitPrice] = useState(limit.unitPrice?.toString() || "");
|
|
1347
|
-
const [editUnitPriceCurrency] = useState(limit.unitPriceCurrency || "USD");
|
|
1348
|
-
const handleSave = () => {
|
|
1349
|
-
const parsedLimit = editLimit ? parseInt(editLimit, 10) : null;
|
|
1350
|
-
const isNumeric = parsedLimit !== null && !isNaN(parsedLimit);
|
|
1351
|
-
const parsedPaidLimit = editPaidLimit ? parseInt(editPaidLimit, 10) : null;
|
|
1352
|
-
const isPaidNumeric = parsedPaidLimit !== null && !isNaN(parsedPaidLimit);
|
|
1353
|
-
const parsedUnitPrice = editUnitPrice ? parseFloat(editUnitPrice) : null;
|
|
1354
|
-
dispatch(updateUsageLimit({
|
|
1355
|
-
tierId,
|
|
1356
|
-
limitId: limit.id,
|
|
1357
|
-
metric: editMetric.trim() || limit.metric,
|
|
1358
|
-
unitName: editUnitName.trim() || undefined,
|
|
1359
|
-
freeLimit: isNumeric ? parsedLimit : undefined,
|
|
1360
|
-
paidLimit: isPaidNumeric ? parsedPaidLimit : undefined,
|
|
1361
|
-
notes: !isNumeric && editLimit ? editLimit.trim() : undefined,
|
|
1362
|
-
resetCycle: editResetCycle,
|
|
1363
|
-
unitPrice: parsedUnitPrice,
|
|
1364
|
-
unitPriceCurrency: parsedUnitPrice ? editUnitPriceCurrency : undefined,
|
|
1365
|
-
lastModified: new Date().toISOString(),
|
|
1366
|
-
}));
|
|
1367
|
-
setIsEditing(false);
|
|
1368
|
-
};
|
|
1369
|
-
const handleCancel = () => {
|
|
1370
|
-
setEditMetric(limit.metric);
|
|
1371
|
-
setEditUnitName(limit.unitName || "");
|
|
1372
|
-
setEditLimit(limit.freeLimit?.toString() || limit.notes || "");
|
|
1373
|
-
setEditPaidLimit(limit.paidLimit?.toString() || "");
|
|
1374
|
-
setEditResetCycle(limit.resetCycle || "MONTHLY");
|
|
1375
|
-
setEditUnitPrice(limit.unitPrice?.toString() || "");
|
|
1376
|
-
setIsEditing(false);
|
|
1377
|
-
};
|
|
1378
|
-
// Format overage display string
|
|
1379
|
-
const getOverageDisplay = () => {
|
|
1380
|
-
if (!limit.unitPrice)
|
|
1381
|
-
return null;
|
|
1382
|
-
const unitLabel = limit.unitName || "unit";
|
|
1383
|
-
return `+${formatPrice(limit.unitPrice, limit.unitPriceCurrency || "USD")} per ${unitLabel}`;
|
|
1384
|
-
};
|
|
1385
|
-
const overageDisplay = getOverageDisplay();
|
|
1386
|
-
if (isEditing) {
|
|
1387
|
-
return (_jsxs("div", { className: "p-3 bg-violet-50 rounded-[10px] mb-3 [&>div]:mb-2.5 [&>div:last-child]:mb-0", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-[0.625rem] font-semibold uppercase tracking-[0.08em] text-slate-500 mb-1", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" }, children: "Metric Name" }), _jsx("input", { type: "text", value: editMetric, onChange: (e) => setEditMetric(e.target.value), placeholder: "e.g., Number of Entities", className: "w-full text-[0.8125rem] text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-2.5 px-3.5 outline-none transition-all duration-150 focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)]", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, autoFocus: true })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[0.625rem] font-semibold uppercase tracking-[0.08em] text-slate-500 mb-1", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" }, children: "Unit Name" }), _jsx("input", { type: "text", value: editUnitName, onChange: (e) => setEditUnitName(e.target.value), placeholder: "e.g., entity, credit card, contractor", className: "w-full text-[0.8125rem] text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-2.5 px-3.5 outline-none transition-all duration-150 focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)]", style: { fontFamily: "'DM Sans', system-ui, sans-serif" } }), _jsx("p", { className: "text-[0.6875rem] text-slate-400 mt-1", children: "Used for overage pricing display (e.g., \"$50 per entity\")" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[0.625rem] font-semibold uppercase tracking-[0.08em] text-slate-500 mb-1", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" }, children: "Free Limit" }), _jsx("input", { type: "text", value: editLimit, onChange: (e) => setEditLimit(e.target.value), placeholder: "e.g., 100, Unlimited, Custom", className: "w-full text-[0.8125rem] text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-2.5 px-3.5 outline-none transition-all duration-150 focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)]", style: { fontFamily: "'DM Sans', system-ui, sans-serif" } }), _jsx("p", { className: "text-[0.6875rem] text-slate-400 mt-1", children: "Included free limit for this tier" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[0.625rem] font-semibold uppercase tracking-[0.08em] text-slate-500 mb-1", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" }, children: "Paid Limit" }), _jsx("input", { type: "text", value: editPaidLimit, onChange: (e) => setEditPaidLimit(e.target.value), placeholder: "e.g., 500, 1000", className: "w-full text-[0.8125rem] text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-2.5 px-3.5 outline-none transition-all duration-150 focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)]", style: { fontFamily: "'DM Sans', system-ui, sans-serif" } }), _jsx("p", { className: "text-[0.6875rem] text-slate-400 mt-1", children: "Maximum paid usage beyond the free limit (optional)" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[0.625rem] font-semibold uppercase tracking-[0.08em] text-slate-500 mb-1", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" }, children: "Reset Cycle" }), _jsxs("select", { value: editResetCycle, onChange: (e) => setEditResetCycle(e.target.value), className: "w-full text-[0.8125rem] text-slate-900 bg-white border-[1.5px] border-slate-300 rounded-[10px] py-2.5 px-3.5 outline-none transition-all duration-150 focus:border-violet-500 focus:shadow-[0_0_0_3px_rgba(139,92,246,0.15)] cursor-pointer", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: [_jsx("option", { value: "NONE", children: "None (One-time)" }), _jsx("option", { value: "DAILY", children: "Daily" }), _jsx("option", { value: "WEEKLY", children: "Weekly" }), _jsx("option", { value: "MONTHLY", children: "Monthly" })] })] }), _jsxs("div", { className: "mt-2 pt-3 border-t border-dashed border-slate-300", children: [_jsx("label", { className: "block text-[0.625rem] font-semibold uppercase tracking-[0.08em] text-slate-500 mb-1", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" }, children: "Overage Pricing (Optional)" }), _jsx("p", { className: "text-[0.6875rem] text-slate-400 mt-1", style: { marginBottom: "0.5rem" }, children: "Set a price for usage beyond the included limit" }), _jsxs("div", { className: "flex items-center gap-1.5 flex-wrap", children: [_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("span", { className: "text-sm text-slate-500", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" }, children: "$" }), _jsx("input", { type: "number", value: editUnitPrice, onChange: (e) => setEditUnitPrice(e.target.value), placeholder: "0.00", step: "0.01", className: "w-[4.5rem] text-sm font-medium text-slate-900 bg-white border border-slate-300 rounded-md py-1.5 px-2 outline-none transition-colors duration-150 focus:border-violet-600", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" } })] }), _jsxs("span", { className: "text-xs text-slate-500", children: ["per ", editUnitName || "unit"] })] })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx("button", { onClick: handleSave, className: "flex-1 py-2 px-3 text-[0.8125rem] font-semibold rounded-[10px] cursor-pointer transition-all duration-150 bg-violet-600 text-white border-none hover:enabled:bg-violet-700 disabled:opacity-50 disabled:cursor-not-allowed", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Save" }), _jsx("button", { onClick: handleCancel, className: "flex-1 py-2 px-3 text-[0.8125rem] font-semibold rounded-[10px] cursor-pointer transition-all duration-150 bg-slate-200 text-slate-700 border-none hover:bg-slate-300", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: "Cancel" })] })] }));
|
|
1388
|
-
}
|
|
1389
|
-
return (_jsxs("div", { className: "group/limititem flex items-center gap-3 p-3 bg-slate-50 border border-slate-200 rounded-[10px] mb-3", children: [_jsxs("div", { className: "flex-1 cursor-pointer p-1 -m-1 rounded-md transition-all duration-150 hover:bg-slate-200", onClick: () => setIsEditing(true), children: [_jsx("div", { className: "text-sm font-semibold text-slate-900", style: { fontFamily: "'DM Sans', system-ui, sans-serif" }, children: limit.metric }), _jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("div", { className: "text-[0.8125rem] text-slate-500", children: limit.freeLimit != null
|
|
1390
|
-
? `Free: ${limit.freeLimit}${limit.paidLimit != null ? ` / Paid: ${limit.paidLimit}` : ""}`
|
|
1391
|
-
: (limit.notes ?? "—") }), limit.resetCycle && (_jsxs("div", { style: { fontSize: "0.6875rem", color: "#64748b" }, children: ["Resets ", limit.resetCycle.toLowerCase()] })), overageDisplay && (_jsx("div", { className: "text-[0.6875rem] text-emerald-600 font-medium", style: { fontFamily: "'DM Mono', 'SF Mono', monospace" }, children: overageDisplay }))] })] }), _jsxs("div", { className: "flex gap-1 opacity-0 group-hover/limititem:opacity-100 transition-all duration-150", children: [_jsx("button", { onClick: () => setIsEditing(true), className: "p-1 bg-transparent border-none text-slate-400 cursor-pointer rounded-md transition-all duration-150 hover:bg-slate-200 hover:text-violet-600", title: "Edit metric", children: _jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" }) }) }), _jsx("button", { onClick: onRemove, className: "p-1 bg-transparent border-none text-slate-400 cursor-pointer rounded-md transition-all duration-150 hover:bg-slate-200 hover:text-rose-600", title: "Remove metric", children: _jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })] })] }));
|
|
1392
|
-
}
|