<commit_before>/* global GhostAdmin */
import React, {Suspense} from 'react';

class ErrorHandler extends React.Component {
    state = {
        hasError: false
    };

    static getDerivedStateFromError() {
        return {hasError: true};
    }

    render() {
        if (this.state.hasError) {
            return (
                <p>Loading has failed. Try refreshing the browser!</p>
            );
        }

        return this.props.children;
    }
}

const fetchKoenig = function () {
    let status = 'pending';
    let response;

    const fetchPackage = async () => {
        if (window.koenigEditor) {
            return window.koenigEditor.default;
        }

        // the removal of `https://` and it's manual addition to the import template string is
        // required to work around ember-auto-import complaining about an unknown dynamic import
        // during the build step
        const url = GhostAdmin.__container__.lookup('service:config').get('editor.url').replace('https://', '');<commit_msg>Fixed loading of react editor in production<commit_after>import React, {Suspense} from 'react';

class ErrorHandler extends React.Component {
    state = {
        hasError: false
    };

    static getDerivedStateFromError() {
        return {hasError: true};
    }

    render() {
        if (this.state.hasError) {
            return (
                <p>Loading has failed. Try refreshing the browser!</p>
            );
        }

        return this.props.children;
    }
}

const fetchKoenig = function () {
    let status = 'pending';
    let response;

    const fetchPackage = async () => {
        if (window.koenigEditor) {
            return window.koenigEditor.default;
        }

        // the removal of `https://` and it's manual addition to the import template string is
        // required to work around ember-auto-import complaining about an unknown dynamic import
        // during the build step
        const GhostAdmin = window.Ember.Namespace.NAMESPACES.find(ns => ns.name === 'ghost-admin');
        const url = GhostAdmin.__container__.lookup('service:config').get('editor.url').replace('https://', '');
{'fraction_non_alphanumeric': 0.11260426320667284, 'fraction_numerical': 0.0, 'mean_word_length': 2.2564102564102564, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 10, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2008393', 'n_tokens_mistral': 587, 'n_tokens_neox': 560, 'n_words': 168}