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AQ,UAChC,EAAQ,SAElB,KAAM,aAAuB,aACzB,MAAM,IAAI,MACN,qBAAqB,EAAQ,+BAGrC,EAAS,SAAS,KAAK,SAClB,SAAS,IACT,MAAM,KAEX,MAAM,EAAS,SAAS,cAAc,UAEtC,EAAO,aAAa,cAAe,KACnC,EAAO,aAAa,SAAU,QAC9B,EAAO,aAAa,OAAQ,GAC5B,EAAO,aAAa,YAAa,MACjC,EAAO,aAAa,QAAS,QAE7B,EAAO,MAAM,UAAY,QACzB,EAAO,MAAM,SAAW,SACxB,EAAO,MAAM,MAAQ,OAErB,EAAY,YAAY,E,CAG5B,MAAM,EAAW,EAAQ,SACnB,EAAQ,SAAS,QAAQ,MAAO,IAndhB,yBAsdtB,EAAK,OAAS,GAAG,KAAY,IAC7B,EAAK,OAAS,OACd,EAAK,OAAS,EAEd,SAAS,KAAK,YAAY,GAE1B,EAAK,SAEL,SAAS,KAAK,YAAY,EAC9B,E","file":"/npm/@plnkr/sdk@1.0.0-pre.1/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@plnkr/sdk@1.0.0-pre.1/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const DEFAULT_EDITOR_URL = 'https://next.plnkr.co/edit/';\nconst DEFAULT_EMBED_URL = 'https://embed.plnkr.co';\n\nexport enum EncodingKind {\n    Utf8 = 'utf8',\n    Base64 = 'base64',\n}\n\nexport enum SidebarKind {\n    Preview = 'tree',\n    Config = 'config',\n}\n\nexport enum TargetKind {\n    Blank = '_blank',\n    Self = '_self',\n}\n\nexport type FileContent = string;\nexport type FileEncoding = EncodingKind;\nexport type FilePath = string;\n\nexport type PreviewIdentifier = 'preview';\n\nexport type ProjectTitle = string;\nexport type ProjectTag = string;\n\nexport interface FileSpecification {\n    pathname: FilePath;\n    content: FileContent;\n    encoding?: FileEncoding;\n}\n\nexport interface ProjectSpecification {\n    files: FileSpecification[];\n    title?: ProjectTitle;\n    tags?: ProjectTag[];\n}\n\nexport interface EditorProjectSpecification extends ProjectSpecification {}\n\nexport interface EmbedProjectSpecification extends ProjectSpecification {\n    source?: {\n        type: string;\n        url: string;\n    };\n}\n\nexport interface DynamicOptions {\n    parentEl?: string | HTMLElement;\n    preview?: FilePath;\n    show?: (FilePath | PreviewIdentifier)[];\n    sidebar?: SidebarKind;\n    target?: TargetKind;\n}\n\nexport interface DynamicEditorOptions extends DynamicOptions {\n    editorUrl?: string;\n}\n\nexport interface DynamicEmbedOptions extends DynamicOptions {\n    autoCloseSidebar?: boolean;\n    deferRun?: boolean;\n    embedUrl?: string;\n}\n\nfunction buildDynamicEditorQueryString(options: DynamicEditorOptions): string {\n    if (\n        options.show &&\n        (!Array.isArray(options.show) ||\n            !options.show.every(show => show && typeof show === 'string'))\n    )\n        throw new TypeError(\n            'options.show, if specified, must be an array containing a list of filename fragments and/or \"preview\"'\n        );\n\n    if (options.preview && typeof options.preview !== 'string')\n        throw new TypeError('options.preview, if specified, must be a string');\n\n    if (\n        options.sidebar &&\n        Object.values(SidebarKind).indexOf(options.sidebar) === -1\n    )\n        throw new TypeError(\n            `options.sidebar, if specified, must be one of the following values ${Object.values(\n                SidebarKind\n            ).join(', ')}`\n        );\n\n    const query = [];\n\n    if (options.preview) {\n        query.push(`preview=${encodeURIComponent(options.preview)}`);\n    }\n\n    if (options.show) {\n        query.push(`open=${options.show.map(encodeURIComponent).join(',')}`);\n    }\n\n    if (options.sidebar) {\n        query.push(`sidebar=${encodeURIComponent(options.sidebar)}`);\n    }\n\n    return query.length ? `?${query.join('&')}` : '';\n}\n\nfunction buildDynamicEmbedQueryString(options: DynamicEmbedOptions): string {\n    if (\n        options.show &&\n        (!Array.isArray(options.show) ||\n            !options.show.every(show => show && typeof show === 'string'))\n    )\n        throw new TypeError(\n            'options.show, if specified, must be an array containing a list of filename fragments and/or \"preview\"'\n        );\n\n    if (options.preview && typeof options.preview !== 'string')\n        throw new TypeError('options.preview, if specified, must be a string');\n\n    if (\n        options.sidebar &&\n        Object.values(SidebarKind).indexOf(options.sidebar) === -1\n    )\n        throw new TypeError(\n            `options.sidebar, if specified, must be one of the following values ${Object.values(\n                SidebarKind\n            ).join(', ')}`\n        );\n\n    const query = [];\n\n    if (options.autoCloseSidebar) {\n        query.push('autoCloseSidebar');\n    } else if (options.autoCloseSidebar === false) {\n        query.push('autoCloseSidebar=false');\n    }\n\n    if (options.deferRun) {\n        query.push('deferRun');\n    } else if (options.deferRun === false) {\n        query.push('deferRun=false');\n    }\n\n    if (options.preview) {\n        query.push(`preview=${encodeURIComponent(options.preview)}`);\n    }\n\n    if (options.show) {\n        query.push(`show=${options.show.map(encodeURIComponent).join(',')}`);\n    }\n\n    if (options.sidebar) {\n        query.push(`sidebar=${encodeURIComponent(options.sidebar)}`);\n    }\n\n    return query.length ? `?${query.join('&')}` : '';\n}\n\nfunction normalizeProject(\n    projectSpec: ProjectSpecification\n): ProjectSpecification {\n    if (!Array.isArray(projectSpec.files))\n        throw new TypeError('projectSpec.files must be an array');\n    if (!projectSpec.files.length)\n        throw new TypeError('projectSpec.files must have at least one file');\n    if (\n        projectSpec.tags &&\n        (!Array.isArray(projectSpec.tags) ||\n            !projectSpec.tags.every(tag => typeof tag === 'string'))\n    )\n        throw new TypeError(\n            'projectSpec.tags, if specified, must be an array of strings'\n        );\n\n    const files = projectSpec.files.map(validateProjectFile);\n    const uniquePathnames = new Set();\n    const tags = Array.from(new Set(projectSpec.tags || []));\n\n    for (const file of files) {\n        if (uniquePathnames.has(file.pathname)) {\n            throw new TypeError(\n                'projectSpec.files must not contain two files having equivalent pathnames'\n            );\n        }\n\n        uniquePathnames.add(file.pathname);\n    }\n\n    return {\n        files,\n        title: projectSpec.title || 'Untitled project',\n        tags,\n    };\n}\n\nfunction validateProjectFile(\n    projectFile: FileSpecification\n): FileSpecification {\n    if (typeof projectFile.pathname !== 'string')\n        throw new TypeError('projectSpec.files.pathname must be a string');\n    if (\n        projectFile.encoding &&\n        !(\n            projectFile.encoding === EncodingKind.Base64 ||\n            projectFile.encoding === EncodingKind.Utf8\n        )\n    )\n        throw new TypeError(\n            `projectSpec.files.pathname must be one of ${Object.values(\n                EncodingKind\n            ).join(', ')}`\n        );\n    if (typeof projectFile.content !== 'string')\n        throw new TypeError('projectSpec.files.content must be a string');\n\n    const pathname = projectFile.pathname\n        .split('/')\n        .filter(Boolean)\n        .join('/');\n\n    return {\n        pathname,\n        content: projectFile.content,\n        encoding: projectFile.encoding || EncodingKind.Utf8,\n    };\n}\n\nexport function showDynamicEditor(\n    projectSpec: EditorProjectSpecification,\n    options: DynamicEditorOptions = {}\n): void {\n    if (options.editorUrl && typeof options.editorUrl !== 'string')\n        throw new TypeError(\n            'options.editorUrl, if specified, must be a string'\n        );\n\n    if (\n        options.target &&\n        Object.values(TargetKind).indexOf(options.target) === -1\n    )\n        throw new TypeError(\n            `options.target, if specified, must be one of the following values ${Object.values(\n                TargetKind\n            ).join(', ')}`\n        );\n\n    if (\n        options.parentEl &&\n        !(\n            typeof options.parentEl === 'string' ||\n            options.parentEl instanceof HTMLElement\n        )\n    )\n        throw new TypeError(\n            'options.parentEl, if specified, must be a string or an instance of an HTMLElement'\n        );\n\n    if (options.parentEl && options.target)\n        throw new TypeError(\n            'options.parentEl is incompatible with options.target'\n        );\n\n    const projectDef = normalizeProject(projectSpec);\n    const query = buildDynamicEmbedQueryString(options);\n    const form = window.document.createElement('form');\n    const input = window.document.createElement('input');\n\n    form.style.display = 'none';\n    input.type = 'hidden';\n\n    const setArrayField = (path: string | string[], values: string[]) => {\n        if (typeof path === 'string') path = path.split('.');\n\n        path.push('');\n\n        values.forEach(function(value) {\n            setField(path, value);\n        });\n    };\n\n    const setField = (path: string | string[], value: string) => {\n        if (typeof path === 'string') path = path.split('.');\n\n        const name =\n            path.shift() + path.map(segment => '[' + segment + ']').join('');\n\n        input.name = name;\n        input.value = value;\n\n        form.appendChild(input.cloneNode());\n    };\n\n    setArrayField('tags', projectDef.tags);\n    setField('title', projectDef.title);\n\n    for (const file of projectDef.files) {\n        setField(['entries', file.pathname, 'content'], file.content);\n        setField(['entries', file.pathname, 'encoding'], file.encoding);\n    }\n\n    let target: string = options.target || '_blank';\n\n    if (options.parentEl) {\n        const containerEl =\n            typeof options.parentEl === 'string'\n                ? document.getElementById(options.parentEl)\n                : options.parentEl;\n\n        if (!(containerEl instanceof HTMLElement))\n            throw new Error(\n                `Unable to resolve ${options.parentEl} to an html element`\n            );\n\n        target = `plnkr-${Math.random()\n            .toString(36)\n            .slice(2)}`;\n\n        const iframe = document.createElement('iframe');\n\n        iframe.setAttribute('frameborder', '0');\n        iframe.setAttribute('height', '100%');\n        iframe.setAttribute('name', target);\n        iframe.setAttribute('scrolling', 'no');\n        iframe.setAttribute('width', '100%');\n\n        iframe.style.minHeight = '250px';\n        iframe.style.overflow = 'hidden';\n        iframe.style.width = '100%';\n\n        containerEl.appendChild(iframe);\n    }\n\n    const editorUrl = options.editorUrl\n        ? options.editorUrl.replace(/\\/$/, '')\n        : DEFAULT_EDITOR_URL;\n\n    form.action = `${editorUrl}/${query}`;\n    form.method = 'POST';\n    form.target = target;\n\n    document.body.appendChild(form);\n\n    form.submit();\n\n    document.body.removeChild(form);\n}\n\nexport function showDynamicEmbed(\n    projectSpec: EmbedProjectSpecification,\n    options: DynamicEmbedOptions = {}\n): void {\n    if (\n        typeof projectSpec.source === 'object' &&\n        (!projectSpec.source ||\n            typeof projectSpec.source.type !== 'string' ||\n            !projectSpec.source.type ||\n            typeof projectSpec.source.url !== 'string' ||\n            !projectSpec.source.url)\n    )\n        throw new TypeError(\n            'projectSpec.source, if specified, must be an object with non-empty values for the type and url properties'\n        );\n\n    if (options.embedUrl && typeof options.embedUrl !== 'string')\n        throw new TypeError('options.embedUrl, if specified, must be a string');\n\n    if (\n        options.target &&\n        Object.values(TargetKind).indexOf(options.target) === -1\n    )\n        throw new TypeError(\n            `options.target, if specified, must be one of the following values ${Object.values(\n                TargetKind\n            ).join(', ')}`\n        );\n\n    if (\n        options.parentEl &&\n        !(\n            typeof options.parentEl === 'string' ||\n            options.parentEl instanceof HTMLElement\n        )\n    )\n        throw new TypeError(\n            'options.parentEl, if specified, must be a string or an instance of an HTMLElement'\n        );\n\n    if (options.parentEl && options.target)\n        throw new TypeError(\n            'options.parentEl is incompatible with options.target'\n        );\n\n    const projectDef = normalizeProject(projectSpec);\n    const query = buildDynamicEmbedQueryString(options);\n    const form = window.document.createElement('form');\n    const input = window.document.createElement('input');\n\n    form.style.display = 'none';\n    input.type = 'hidden';\n\n    const setArrayField = (path: string | string[], values: string[]) => {\n        if (typeof path === 'string') path = path.split('.');\n\n        path.push('');\n\n        values.forEach(function(value) {\n            setField(path, value);\n        });\n    };\n\n    const setField = (path: string | string[], value: string) => {\n        if (typeof path === 'string') path = path.split('.');\n\n        const name =\n            path.shift() + path.map(segment => '[' + segment + ']').join('');\n\n        input.name = name;\n        input.value = value;\n\n        form.appendChild(input.cloneNode());\n    };\n\n    setArrayField('tags', projectDef.tags);\n    setField('title', projectDef.title);\n\n    for (const file of projectDef.files) {\n        setField(['entries', file.pathname, 'content'], file.content);\n        setField(['entries', file.pathname, 'encoding'], file.encoding);\n    }\n\n    if (projectSpec.source) {\n        setField('source.type', projectSpec.source.type);\n        setField('source.url', projectSpec.source.url);\n    }\n\n    let target: string = options.target || '_blank';\n\n    if (options.parentEl) {\n        const containerEl =\n            typeof options.parentEl === 'string'\n                ? document.getElementById(options.parentEl)\n                : options.parentEl;\n\n        if (!(containerEl instanceof HTMLElement))\n            throw new Error(\n                `Unable to resolve ${options.parentEl} to an html element`\n            );\n\n        target = `plnkr-${Math.random()\n            .toString(36)\n            .slice(2)}`;\n\n        const iframe = document.createElement('iframe');\n\n        iframe.setAttribute('frameborder', '0');\n        iframe.setAttribute('height', '100%');\n        iframe.setAttribute('name', target);\n        iframe.setAttribute('scrolling', 'no');\n        iframe.setAttribute('width', '100%');\n\n        iframe.style.minHeight = '250px';\n        iframe.style.overflow = 'hidden';\n        iframe.style.width = '100%';\n\n        containerEl.appendChild(iframe);\n    }\n\n    const embedUrl = options.embedUrl\n        ? options.embedUrl.replace(/\\/$/, '')\n        : DEFAULT_EMBED_URL;\n\n    form.action = `${embedUrl}/${query}`;\n    form.method = 'POST';\n    form.target = target;\n\n    document.body.appendChild(form);\n\n    form.submit();\n\n    document.body.removeChild(form);\n}\n"]}