{"version":3,"file":"geometricpanda-ng-storyblok-config.mjs","sources":["../../../../projects/geometricpanda/ng-storyblok/config/storyblok-client.provider.ts","../../../../projects/geometricpanda/ng-storyblok/config/provide-ng-storyblok.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/provide-storyblok-loader.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/_features.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/with-access-token.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/with-api-endpoint.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/with-api-fetcher.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/with-api-headers.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/with-api-region.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/with-bloks.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/with-bridge.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/with-cache.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/with-oauth-token.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/with-preview.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/with-resolve-links.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/with-resolve-relations.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/with-slug-rewrite.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/with-title-template.config.ts","../../../../projects/geometricpanda/ng-storyblok/config/geometricpanda-ng-storyblok-config.ts"],"sourcesContent":["import { FactoryProvider, inject } from '@angular/core';\nimport {\n    NG_STORYBLOK_ACCESS_TOKEN,\n    NG_STORYBLOK_API_ENDPOINT,\n    NG_STORYBLOK_API_FETCHER,\n    NG_STORYBLOK_API_HEADERS,\n    NG_STORYBLOK_API_REGION,\n    NG_STORYBLOK_BRIDGE,\n    NG_STORYBLOK_CACHE,\n    NG_STORYBLOK_CLIENT,\n    NG_STORYBLOK_OAUTH_TOKEN,\n} from '@geometricpanda/ng-storyblok/tokens';\nimport { apiPlugin, storyblokInit } from '@storyblok/js';\n\n/**\n * Provides the Storyblok API client.\n *\n * @returns The provider for the Storyblok API client.\n */\nexport const StoryblokClientProvider: FactoryProvider = {\n    provide: NG_STORYBLOK_CLIENT,\n    useFactory: () => {\n        const ACCESS_TOKEN = inject(NG_STORYBLOK_ACCESS_TOKEN, { optional: true });\n        const OAUTH_TOKEN = inject(NG_STORYBLOK_OAUTH_TOKEN, { optional: true });\n        const API_REGION = inject(NG_STORYBLOK_API_REGION, { optional: true });\n        const API_ENDPOINT = inject(NG_STORYBLOK_API_ENDPOINT, { optional: true });\n        const API_FETCHER = inject(NG_STORYBLOK_API_FETCHER, { optional: true });\n        const API_HEADERS = inject(NG_STORYBLOK_API_HEADERS, { optional: true });\n        const CACHE = inject(NG_STORYBLOK_CACHE, { optional: true });\n        const BRIDGE = inject(NG_STORYBLOK_BRIDGE, { optional: true });\n\n        if (!ACCESS_TOKEN && !OAUTH_TOKEN) {\n            throw new Error(`ngStoryblok - NO_ACCESS_TOKEN\nNo access token or OAuth token provided for the Storyblok API client,\nif this is intentional please provide ngStoryblok with\n\"withAccessToken()\" or \"withOAuthToken()\"`);\n        }\n\n        const { storyblokApi } = storyblokInit({\n            accessToken: ACCESS_TOKEN ?? undefined,\n            use: [apiPlugin],\n            bridge: !!BRIDGE,\n            apiOptions: {\n                oauthToken: OAUTH_TOKEN ?? undefined,\n                region: API_REGION ?? undefined,\n                endpoint: API_ENDPOINT ?? undefined,\n                cache: CACHE ?? undefined,\n                headers: API_HEADERS ?? undefined,\n                fetch: API_FETCHER ?? undefined,\n            },\n        });\n\n        if (!storyblokApi) {\n            console.warn(`ngStoryblok - NO_API_CLIENT\\nStoryblok API client failed to initialize`);\n        }\n\n        return storyblokApi;\n    },\n};\n","import { provideHttpClient, withInterceptors } from '@angular/common/http';\nimport { makeEnvironmentProviders } from '@angular/core';\nimport { storyblokInterceptor } from '@geometricpanda/ng-storyblok/services';\nimport { NgStoryblokFeatures } from './_features.config';\nimport { StoryblokClientProvider } from './storyblok-client.provider';\n\n/**\n * Provides the Storyblok configuration.\n *\n * @param features The features to provide.\n * @returns The providers for the Storyblok configuration.\n */\nexport const provideNgStoryblok = (...features: Array<NgStoryblokFeatures | false>) =>\n    makeEnvironmentProviders([\n        features.filter(Boolean).map((feature) => feature && feature?.ɵproviders),\n        StoryblokClientProvider,\n        provideHttpClient(withInterceptors([storyblokInterceptor])),\n    ]);\n","import { IMAGE_LOADER, ImageLoaderConfig } from '@angular/common';\n\nimport { Provider, isDevMode } from '@angular/core';\n\nconst ngDevMode = isDevMode();\n\n/** Taken from https://github.com/angular/angular/blob/main/packages/common/src/directives/ng_optimized_image/url.ts */\n\nexport type ImageLoaderInfo = {\n    name: string;\n    testUrl: (url: string) => boolean;\n};\n\nexport function isAbsoluteUrl(src: string): boolean {\n    return /^https?:\\/\\//.test(src);\n}\n\n/** End of Taken from https://github.com/angular/angular/blob/main/packages/common/src/directives/ng_optimized_image/url.ts */\n\n/**\n * Name and URL tester for Netlify.\n */\nexport const StoryblokLoaderInfo: ImageLoaderInfo = {\n    name: 'Storyblok',\n    testUrl: isStoryblokUrl,\n};\n\nconst STORYBLOK_LOADER_REGEX = /https?:\\/\\/a.storyblok\\.com\\/.+/;\n\n/**\n * Tests whether a URL is from the Storyblok Asset CDN. This won't catch sites with a custom domain,\n * but it's a good start for sites in development. This is only used to warn users who haven't\n * configured an image loader.\n */\nfunction isStoryblokUrl(url: string): boolean {\n    return STORYBLOK_LOADER_REGEX.test(url);\n}\n\ninterface ProvideStoryblokLoaderProps {\n    quality?: number;\n}\n\n/**\n * Function that generates an ImageLoader for Storyblok and turns it into an Angular provider.\n *\n * @param options - Configuration options for the Storyblok loader.\n */\nexport function provideStoryblokLoader(options?: ProvideStoryblokLoaderProps): Array<Provider> {\n    const loaderFn = (config: ImageLoaderConfig) => {\n        return createStoryblokUrl(config, options);\n    };\n\n    return [\n        {\n            provide: IMAGE_LOADER,\n            useValue: loaderFn,\n        },\n    ];\n}\n\n// The radius of the blur to apply to the image, between 0  and 150\ntype BlurRadius = number;\n// The sigma value to use in Gaussian blur.\ntype BlurSigma = number;\n\n// The rounded corners to apply to the image\ntype RoundedRadius = number;\n// RGB color to use for the rounded corners\ntype RoundedRgb = [number, number, number];\n// Opacity of the rounded corners\ntype RoundedOpacity = number;\n\nexport interface StoryblokImageLoaderParams {\n    // The format to convert the image to.\n    format?: 'webp' | 'png' | 'jpeg';\n    // The quality of the image, from 0 to 100\n    quality?: number;\n    // Whether to convert the image to greyscale.\n    greyscale?: boolean;\n    // The amount of blur to apply to the image. Use second value for sigma to use in Gaussian blur.\n    blur?: BlurRadius | [BlurRadius, BlurSigma];\n    // The amount to rotate the image, in degrees.\n    rotate?: 90 | 180 | 270;\n    // Whether to flip the image horizontally, vertically, or both.\n    flip?: 'horizontal' | 'vertical' | 'both';\n    // The brightness of the image, from -100 to 100\n    brightness?: number;\n    // The rounded corners to apply to the image\n    rounded?: RoundedRadius | [RoundedRadius, RoundedRgb] | [RoundedRadius, RoundedRgb, RoundedOpacity];\n}\n\nfunction createStoryblokUrl(config: ImageLoaderConfig, options: ProvideStoryblokLoaderProps = {}): string {\n    try {\n        // Note: `src` can be undefined, in which case we throw an error, which will return the original URL.\n        const url = new URL(config.src);\n\n        if (url.pathname.endsWith('.svg') || !config.width) {\n            // If we try and perform Image CDN operations an SVG, storyblok will try and format it as WEBP\n            return config.src;\n        }\n\n        const loaderParams = <StoryblokImageLoaderParams | undefined>config.loaderParams;\n\n        const width =\n            loaderParams?.flip === 'horizontal' || loaderParams?.flip === 'both' ? config.width * -1 : config.width;\n\n        const height = loaderParams?.flip === 'vertical' || loaderParams?.flip === 'both' ? '-0' : '0';\n\n        url.pathname = `${url.pathname}/m/${width}x${height}`;\n\n        // Filters\n\n        const filters = new Map();\n\n        if (loaderParams?.quality) {\n            filters.set('quality', loaderParams.quality);\n        } else if (options.quality) {\n            filters.set('quality', options.quality);\n        }\n\n        if (loaderParams?.format) {\n            filters.set('format', loaderParams.format);\n        }\n\n        if (loaderParams?.greyscale) {\n            filters.set('greyscale', '');\n        }\n\n        if (loaderParams?.blur) {\n            Array.isArray(loaderParams.blur)\n                ? filters.set('blur', loaderParams.blur.join(','))\n                : filters.set('blur', loaderParams.blur);\n        }\n\n        if (loaderParams?.rotate) {\n            filters.set('rotate', loaderParams.rotate);\n        }\n\n        if (loaderParams?.flip) {\n            filters.set('flip', loaderParams.flip);\n        }\n\n        if (loaderParams?.brightness) {\n            filters.set('brightness', loaderParams.brightness);\n        }\n\n        if (loaderParams?.rounded) {\n            if (Array.isArray(loaderParams.rounded)) {\n                const [radius, rgb, alpha] = loaderParams.rounded;\n\n                // Storyblok uses a 0-1 scale for transparency, so we need to invert it for alpha to make sense.\n                const transparency = alpha ? 1 - alpha : 1;\n                const rgbValue = rgb || [255, 255, 255];\n                filters.set('round_corner', `${[radius, rgbValue, transparency]}`);\n            } else {\n                const radius = loaderParams.rounded;\n                const rgbValue = [255, 255, 255];\n                filters.set('round_corner', `${[radius, rgbValue, 1]}`);\n            }\n        }\n\n        if (!filters.size) {\n            return url.toString();\n        }\n\n        const filterString = Array.from(filters.entries())\n            .map(([key, value]) => `${key}(${value})`)\n            .join(':');\n\n        url.pathname = `${url.pathname}/filters:${filterString}`;\n\n        return url.toString();\n    } catch (e) {\n        if (ngDevMode && isAbsoluteUrl(config.src)) {\n            console.error(\n                `Image loader has detected an invalid absolute path (\\`${config.src}\\`). ` +\n                    `To fix this, please ensure that the path is a valid Storyblok asset URL. `,\n            );\n        }\n    }\n    return config.src;\n}\n","import { Provider } from '@angular/core';\n\n/**\n * The list of features as an enum to uniquely type each feature.\n */\nexport const enum NgStoryblokFeatureKind {\n    AccessTokenFeature,\n    ApiPluginFeature,\n    ApiRegionFeature,\n    ApiEndpointFeature,\n    ApiHeadersFeature,\n    ApiFetcherFeature,\n    BlokFeature,\n    CacheFeature,\n    DefaultPathFeature,\n    OAuthTokenFeature,\n    NgOptimizedImageFeature,\n    PreviewFeature,\n    ResolveRelationsFeature,\n    ResolveLinksFeature,\n    BridgeFeature,\n    TitleTemplateFeature,\n    SlugRewriteFeature,\n}\n\nexport type NgStoryblokAccessTokenFeature = NgStoryblokFeature<NgStoryblokFeatureKind.AccessTokenFeature>;\nexport type NgStoryblokApiPluginFeature = NgStoryblokFeature<NgStoryblokFeatureKind.ApiPluginFeature>;\nexport type NgStoryblokApiRegionFeature = NgStoryblokFeature<NgStoryblokFeatureKind.ApiRegionFeature>;\nexport type NgStoryblokApiEndpointFeature = NgStoryblokFeature<NgStoryblokFeatureKind.ApiEndpointFeature>;\nexport type NgStoryblokApiHeadersFeature = NgStoryblokFeature<NgStoryblokFeatureKind.ApiHeadersFeature>;\nexport type NgStoryblokApiFetcherFeature = NgStoryblokFeature<NgStoryblokFeatureKind.ApiFetcherFeature>;\nexport type NgStoryblokBloksFeature = NgStoryblokFeature<NgStoryblokFeatureKind.BlokFeature>;\nexport type NgStoryblokCacheFeature = NgStoryblokFeature<NgStoryblokFeatureKind.CacheFeature>;\nexport type NgStoryblokDefaultPathFeature = NgStoryblokFeature<NgStoryblokFeatureKind.DefaultPathFeature>;\nexport type NgStoryblokOAuthTokenFeature = NgStoryblokFeature<NgStoryblokFeatureKind.OAuthTokenFeature>;\nexport type NgStoryblokNgOptimizedImageFeature = NgStoryblokFeature<NgStoryblokFeatureKind.NgOptimizedImageFeature>;\nexport type NgStoryblokPreviewFeature = NgStoryblokFeature<NgStoryblokFeatureKind.PreviewFeature>;\nexport type NgStoryblokResolveRelationsFeature = NgStoryblokFeature<NgStoryblokFeatureKind.ResolveRelationsFeature>;\nexport type NgStoryblokResolveLinksFeature = NgStoryblokFeature<NgStoryblokFeatureKind.ResolveLinksFeature>;\nexport type NgStoryblokBridgeFeature = NgStoryblokFeature<NgStoryblokFeatureKind.BridgeFeature>;\nexport type NgStoryblokTitleTemplateFeature = NgStoryblokFeature<NgStoryblokFeatureKind.TitleTemplateFeature>;\nexport type NgStoryblokSlugRewriteFeature = NgStoryblokFeature<NgStoryblokFeatureKind.SlugRewriteFeature>;\n\nexport interface NgStoryblokFeature<FeatureKind extends NgStoryblokFeatureKind> {\n    ɵkind: FeatureKind;\n    ɵproviders: Provider[];\n}\n\nexport function createNgSbFeature<FeatureKind extends NgStoryblokFeatureKind>(\n    kind: FeatureKind,\n    providers: Provider[],\n): NgStoryblokFeature<FeatureKind> {\n    return {\n        ɵkind: kind,\n        ɵproviders: providers,\n    };\n}\n\nexport type NgStoryblokFeatures =\n    | NgStoryblokAccessTokenFeature\n    | NgStoryblokApiPluginFeature\n    | NgStoryblokApiRegionFeature\n    | NgStoryblokApiEndpointFeature\n    | NgStoryblokBloksFeature\n    | NgStoryblokCacheFeature\n    | NgStoryblokDefaultPathFeature\n    | NgStoryblokOAuthTokenFeature\n    | NgStoryblokNgOptimizedImageFeature\n    | NgStoryblokPreviewFeature\n    | NgStoryblokResolveRelationsFeature\n    | NgStoryblokResolveLinksFeature\n    | NgStoryblokBridgeFeature\n    | NgStoryblokTitleTemplateFeature\n    | NgStoryblokSlugRewriteFeature\n    | NgStoryblokApiHeadersFeature\n    | NgStoryblokApiFetcherFeature;\n","import { NG_STORYBLOK_ACCESS_TOKEN } from '@geometricpanda/ng-storyblok/tokens';\nimport { NgStoryblokAccessTokenFeature, NgStoryblokFeatureKind, createNgSbFeature } from './_features.config';\n\n/**\n * Provides the Storyblok access token.\n *\n * @param token The Storyblok access token.\n * @returns The provider for the Storyblok access token.\n */\nexport function withAccessToken(token: string): NgStoryblokAccessTokenFeature {\n    return createNgSbFeature(NgStoryblokFeatureKind.AccessTokenFeature, [\n        {\n            provide: NG_STORYBLOK_ACCESS_TOKEN,\n            useValue: token,\n        },\n    ]);\n}\n","import { NG_STORYBLOK_API_ENDPOINT } from '@geometricpanda/ng-storyblok/tokens';\nimport { NgStoryblokApiEndpointFeature, NgStoryblokFeatureKind, createNgSbFeature } from './_features.config';\n\n/**\n * Provides a custom Storyblok endpoint URL. API Region provider will have no affect if this is set.\n *\n * @param endpoint The Storyblok API endpoint base URL.\n * @returns The provider for the Storyblok API custom endpoint.\n */\nexport function withApiEndpoint(endpoint: string): NgStoryblokApiEndpointFeature {\n    return createNgSbFeature(NgStoryblokFeatureKind.ApiEndpointFeature, [\n        {\n            provide: NG_STORYBLOK_API_ENDPOINT,\n            useValue: endpoint,\n        },\n    ]);\n}\n","import { NG_STORYBLOK_API_FETCHER } from '@geometricpanda/ng-storyblok/tokens';\nimport { NgStoryblokApiFetcherFeature, NgStoryblokFeatureKind, createNgSbFeature } from './_features.config';\n\n/**\n * Provides the Storyblok API region.\n *\n * @param fetcher The Storyblok API fetcher\n * @returns The provider for the Storyblok API region.\n */\nexport function withApiFetcher(fetcher: typeof fetch): NgStoryblokApiFetcherFeature {\n    return createNgSbFeature(NgStoryblokFeatureKind.ApiFetcherFeature, [\n        {\n            provide: NG_STORYBLOK_API_FETCHER,\n            useValue: fetcher,\n        },\n    ]);\n}\n","import { NG_STORYBLOK_API_HEADERS } from '@geometricpanda/ng-storyblok/tokens';\nimport { NgStoryblokApiHeadersFeature, NgStoryblokFeatureKind, createNgSbFeature } from './_features.config';\n\n/**\n * Provides the Storyblok API Headers\n *\n * @param headers The Storyblok API headers.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function withApiHeaders(headers: any): NgStoryblokApiHeadersFeature {\n    return createNgSbFeature(NgStoryblokFeatureKind.ApiHeadersFeature, [\n        {\n            provide: NG_STORYBLOK_API_HEADERS,\n            useValue: headers,\n        },\n    ]);\n}\n","import { NG_STORYBLOK_API_REGION } from '@geometricpanda/ng-storyblok/tokens';\nimport { NgStoryblokApiRegionFeature, NgStoryblokFeatureKind, createNgSbFeature } from './_features.config';\n\n/**\n * Provides the Storyblok API region.\n *\n * @param region The Storyblok API region.\n * @returns The provider for the Storyblok API region.\n */\nexport function withApiRegion(region: string): NgStoryblokApiRegionFeature {\n    return createNgSbFeature(NgStoryblokFeatureKind.ApiRegionFeature, [\n        {\n            provide: NG_STORYBLOK_API_REGION,\n            useValue: region,\n        },\n    ]);\n}\n","import {\n    BlokLoader,\n    BlokLoaders,\n    NG_STORYBLOK_FALLBACK_LOADER,\n    NG_STORYBLOK_LOADERS,\n} from '@geometricpanda/ng-storyblok/tokens';\nimport { NgStoryblokBloksFeature, NgStoryblokFeatureKind, createNgSbFeature } from './_features.config';\n\nconst fallbackLoader = () =>\n    import('@geometricpanda/ng-storyblok/components/fallback-blok').then((m) => m.FallbackBlokComponent);\n\nexport function withBloks(bloks: BlokLoaders, fallback: BlokLoader = fallbackLoader): NgStoryblokBloksFeature {\n    return createNgSbFeature(NgStoryblokFeatureKind.BlokFeature, [\n        {\n            provide: NG_STORYBLOK_LOADERS,\n            useValue: bloks,\n        },\n        {\n            provide: NG_STORYBLOK_FALLBACK_LOADER,\n            useValue: fallback,\n        },\n    ]);\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport { inject, PLATFORM_ID } from '@angular/core';\nimport {\n    BridgeCallback,\n    NG_STORYBLOK_BRIDGE,\n    NG_STORYBLOK_RESOLVE_LINKS,\n    NG_STORYBLOK_RESOLVE_RELATIONS,\n} from '@geometricpanda/ng-storyblok/tokens';\nimport { useStoryblokBridge } from '@storyblok/js';\nimport { createNgSbFeature, NgStoryblokBridgeFeature, NgStoryblokFeatureKind } from './_features.config';\n\nexport function withBridge(): NgStoryblokBridgeFeature {\n    return createNgSbFeature(NgStoryblokFeatureKind.BridgeFeature, [\n        {\n            provide: NG_STORYBLOK_BRIDGE,\n            useFactory: () => {\n                const resolveRelations = inject(NG_STORYBLOK_RESOLVE_RELATIONS, { optional: true });\n                const resolveLinks = inject(NG_STORYBLOK_RESOLVE_LINKS, { optional: true });\n                const platform = inject(PLATFORM_ID);\n                return (id: number, callback: BridgeCallback) => {\n                    if (isPlatformBrowser(platform)) {\n                        useStoryblokBridge(id, (story) => callback(story), {\n                            resolveRelations: resolveRelations ?? undefined,\n                            resolveLinks: resolveLinks ?? undefined,\n                        });\n                    }\n                };\n            },\n        },\n    ]);\n}\n","import { NG_STORYBLOK_CACHE, NG_STORYBLOK_TRANSFER_CACHE } from '@geometricpanda/ng-storyblok/tokens';\nimport { ISbCache } from 'storyblok-js-client/src/interfaces';\nimport { NgStoryblokCacheFeature, NgStoryblokFeatureKind, createNgSbFeature } from './_features.config';\n\n/**\n * Provides the Storyblok cache configuration.\n *\n * When using Angular SSR, it is recommended to disable the cache.\n * ```ts\n * import { withCacheConfig } from '@geometricpanda/ng-storyblok/config';\n * ...\n * provideNgStoryblok(..., withCacheConfig({type: 'none'}));\n * ```\n *\n * @param config The Storyblok cache configuration.\n * @returns The provider for the Storyblok cache configuration.\n */\nexport function withCache(): NgStoryblokCacheFeature {\n    return createNgSbFeature(NgStoryblokFeatureKind.CacheFeature, [\n        {\n            provide: NG_STORYBLOK_CACHE,\n            useValue: <ISbCache>{\n                type: 'none',\n            },\n        },\n        {\n            provide: NG_STORYBLOK_TRANSFER_CACHE,\n            useValue: true,\n        },\n    ]);\n}\n","import { NG_STORYBLOK_OAUTH_TOKEN } from '@geometricpanda/ng-storyblok/tokens';\nimport { createNgSbFeature, NgStoryblokFeatureKind, NgStoryblokOAuthTokenFeature } from './_features.config';\n\n/**\n * Provides the Storyblok OAuth token.\n *\n * @param token The Storyblok OAuth token.\n * @returns The provider for the Storyblok OAuth token.\n */\nexport function withOAuthToken(token: string): NgStoryblokOAuthTokenFeature {\n    return createNgSbFeature(NgStoryblokFeatureKind.OAuthTokenFeature, [\n        {\n            provide: NG_STORYBLOK_OAUTH_TOKEN,\n            useValue: token,\n        },\n    ]);\n}\n","import { inject } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { NG_STORYBLOK_ACCESS_TOKEN, NG_STORYBLOK_PREVIEW, StoryblokPreview } from '@geometricpanda/ng-storyblok/tokens';\nimport { NgStoryblokFeatureKind, NgStoryblokPreviewFeature, createNgSbFeature } from './_features.config';\n\nexport interface ValidateStoryblokPreview {\n    spaceId: string;\n    accessToken: string;\n    timestamp: string;\n    token: string;\n}\n\nconst validateStoryblokPreview = async ({\n    spaceId,\n    accessToken,\n    timestamp,\n    token,\n}: ValidateStoryblokPreview): Promise<void> => {\n    const enc = new TextEncoder();\n    const validationString = [spaceId, accessToken, timestamp].join(':');\n    const hash = await crypto.subtle.digest('SHA-1', enc.encode(validationString));\n    const computed = Array.from(new Uint8Array(hash))\n        .map((v) => v.toString(16).padStart(2, '0'))\n        .join('');\n\n    if (token !== computed) {\n        throw new Error('ngStoryblok: INVALID_PREVIEW_TOKEN');\n    }\n};\n\nexport interface WithPreviewOptions {\n    validateToken?: boolean;\n    from_release?: string;\n}\n\nexport function withPreview({ validateToken = true, from_release }: WithPreviewOptions): NgStoryblokPreviewFeature {\n    return createNgSbFeature(NgStoryblokFeatureKind.PreviewFeature, [\n        {\n            provide: NG_STORYBLOK_PREVIEW,\n            useValue: <StoryblokPreview>{\n                preview: async () => {\n                    const router = inject(Router);\n                    const accessToken = inject(NG_STORYBLOK_ACCESS_TOKEN);\n                    const navigation = router.getCurrentNavigation();\n\n                    if (!navigation) {\n                        throw new Error('ngStoryblok: NO_ROUTER_NAVIGATION');\n                    }\n\n                    const { queryParams } = navigation.extractedUrl;\n\n                    const release = from_release ?? queryParams['_storyblok_release'];\n                    const spaceId = queryParams['_storyblok_tk[space_id]'];\n                    const timestamp = queryParams['_storyblok_tk[timestamp]'];\n                    const token = queryParams['_storyblok_tk[token]'];\n\n                    try {\n                        if (validateToken) {\n                            await validateStoryblokPreview({ spaceId, accessToken, timestamp, token });\n                        }\n\n                        return {\n                            version: 'draft',\n                            from_release: release !== '0' ? release : undefined,\n                        };\n                    } catch (e) {\n                        return undefined;\n                    }\n                },\n            },\n        },\n    ]);\n}\n","import { NG_STORYBLOK_RESOLVE_LINKS } from '@geometricpanda/ng-storyblok/tokens';\nimport { ISbStoryParams } from 'storyblok-js-client/src/interfaces';\nimport { NgStoryblokFeatureKind, NgStoryblokResolveLinksFeature, createNgSbFeature } from './_features.config';\n\nexport function withResolveLinks(links: ISbStoryParams['resolve_links']): NgStoryblokResolveLinksFeature {\n    return createNgSbFeature(NgStoryblokFeatureKind.ResolveLinksFeature, [\n        {\n            provide: NG_STORYBLOK_RESOLVE_LINKS,\n            useValue: links,\n        },\n    ]);\n}\n","import { NG_STORYBLOK_RESOLVE_RELATIONS } from '@geometricpanda/ng-storyblok/tokens';\nimport { createNgSbFeature, NgStoryblokFeatureKind, NgStoryblokResolveRelationsFeature } from './_features.config';\n\nexport function withResolveRelations(relations: string[]): NgStoryblokResolveRelationsFeature {\n    return createNgSbFeature(NgStoryblokFeatureKind.ResolveRelationsFeature, [\n        {\n            provide: NG_STORYBLOK_RESOLVE_RELATIONS,\n            useValue: relations,\n        },\n    ]);\n}\n","import { NG_STORYBLOK_SLUG_REWRITE, RewriteFn, SlugRewrite } from '@geometricpanda/ng-storyblok/tokens';\nimport { NgStoryblokFeatureKind, NgStoryblokSlugRewriteFeature, createNgSbFeature } from './_features.config';\n\nexport function withSlugRewrite(\n    toStory: RewriteFn,\n    toUrl: RewriteFn,\n    toRichtextUrl: RewriteFn, // Specific handler for richtext links that don't use the Angular router\n): NgStoryblokSlugRewriteFeature {\n    return createNgSbFeature(NgStoryblokFeatureKind.SlugRewriteFeature, [\n        {\n            provide: NG_STORYBLOK_SLUG_REWRITE,\n            useValue: <SlugRewrite>{\n                toStory,\n                toUrl,\n                toRichtextUrl,\n            },\n        },\n    ]);\n}\n","import { NG_STORYBLOK_TITLE_TEMPLATE, TitleTemplate } from '@geometricpanda/ng-storyblok/tokens';\nimport { render } from 'squirrelly';\nimport type { PartialConfig } from 'squirrelly/dist/types/config';\nimport type { CallbackFn } from 'squirrelly/dist/types/file-handlers';\nimport { NgStoryblokFeatureKind, NgStoryblokTitleTemplateFeature, createNgSbFeature } from './_features.config';\n\nexport function withTitleTemplate(\n    // Squirelly render function\n    template: string,\n    // SqrlConfig config\n    env?: PartialConfig,\n    // CallbackFn callback\n    cb?: CallbackFn,\n): NgStoryblokTitleTemplateFeature {\n    return createNgSbFeature(NgStoryblokFeatureKind.TitleTemplateFeature, [\n        {\n            provide: NG_STORYBLOK_TITLE_TEMPLATE,\n            useValue: <TitleTemplate>{\n                render,\n                template,\n                env,\n                cb,\n            },\n        },\n    ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAcA;;;;AAIG;AACI,MAAM,uBAAuB,GAAoB;AACpD,IAAA,OAAO,EAAE,mBAAmB;IAC5B,UAAU,EAAE,MAAK;AACb,QAAA,MAAM,YAAY,GAAG,MAAM,CAAC,yBAAyB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3E,QAAA,MAAM,WAAW,GAAG,MAAM,CAAC,wBAAwB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACzE,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,uBAAuB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACvE,QAAA,MAAM,YAAY,GAAG,MAAM,CAAC,yBAAyB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3E,QAAA,MAAM,WAAW,GAAG,MAAM,CAAC,wBAAwB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACzE,QAAA,MAAM,WAAW,GAAG,MAAM,CAAC,wBAAwB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACzE,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7D,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAE/D,QAAA,IAAI,CAAC,YAAY,IAAI,CAAC,WAAW,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,CAAA;;;AAGc,yCAAA,CAAA,CAAC,CAAC;SACnC;AAED,QAAA,MAAM,EAAE,YAA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