PageSourceSearch

https://podtoo.com/_next/static/chunks/pages/dashboard/audiobook/[id]/[episodeid]/edit-ec9e9f647d6afa66.js

js podtoo.com collected 2026-09-25 00:47:11 UTC 21,317 bytes, 406 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e91b3c85-89f9-4999-a789-2015963d01e2",e._sentryDebugIdIdentifier="sentry-dbid-e91b3c85-89f9-4999-a789-2015963d01e2");}catch(e){}}();
2(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[4929],{
3
4/***/ 28261:
5/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
6
7
8    (window.__NEXT_P = window.__NEXT_P || []).push([
9      "/dashboard/audiobook/[id]/[episodeid]/edit",
10      function () {
11        return __webpack_require__(42490);
12      }
13    ]);
14    if(false) {}
15  
16
17/***/ }),
18
19/***/ 68439:
20/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
21
22"use strict";
23/* harmony export */ __webpack_require__.d(__webpack_exports__, {
24/* harmony export */   Z: function() { return /* binding */ MyEditor; }
25/* harmony export */ });
26/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85893);
27/* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5152);
28/* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_dynamic__WEBPACK_IMPORTED_MODULE_1__);
29/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67294);
30/* harmony import */ var react_quill_new_dist_quill_snow_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9676);
31/* harmony import */ var react_quill_new_dist_quill_snow_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_quill_new_dist_quill_snow_css__WEBPACK_IMPORTED_MODULE_3__);
32// /src/components/quilljs/editor.js
33
34
35
36
37const QuillNoSSRWrapper = next_dynamic__WEBPACK_IMPORTED_MODULE_1___default()(async ()=>{
38    const { default: RQ } = await Promise.all(/* import() */[__webpack_require__.e(570), __webpack_require__.e(1240)]).then(__webpack_require__.bind(__webpack_require__, 71240)
38);
39    const DynamicQuill = (param)=>{
40        let { ...props } = param;
41        return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(RQ, {
42            ...props
43        });
44    };
45    DynamicQuill.displayName = "DynamicQuill";
46    return DynamicQuill;
47}, {
48    loadableGenerated: {
49        webpack: ()=>[
50                /*require.resolve*/(71240)
51            ]
52    },
53    ssr: false
54});
55const modules = {
56    toolbar: [
57        [
58            "bold",
59            "link"
60        ],
61        [
62            {
63                list: "ordered"
64            },
65            {
66                list: "bullet"
67            }
68        ],
69        [
70            "clean"
71        ]
72    ],
73    clipboard: {
74        matchVisual: false,
75        matchers: [
76            [
77                3,
78                (node, delta)=>{
79                    delta.ops = delta.ops.map((op)=>{
80                        if (typeof op.insert === "string") {
81                            return {
82                                ...op,
83                                insert: op.insert.replace(/\u00A0/g, " ")
84                            };
85                        }
86                        return op;
87                    });
88                    return delta;
89                }
90            ]
91        ]
92    }
93};
94const customStyles = "\n  .quill {\n    margin-top: 1em;\n    margin-bottom: 1em;\n  }\n  .ql-editor {\n    min-height: 200px;\n  }\n  .ql-editor p {\n    margin-bottom: 0.75em;\n  }\n";
95function MyEditor(props) {
96    const qRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
97    const [content, setContent] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)("");
98    const [isInitialized, setIsInitialized] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
99    // Sync from database/parent state exactly once when data asynchronously loads
100    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
101        if (props.value && !isInitialized) {
102            // Clean up historic database entries that have residual   strings
103            const cleanInitial = props.value.replace(/ /gi, " ");
104            setContent(cleanInitial);
105            setIsInitialized(true);
106        }
107    }, [
108        props.value,
109        isInitialized
110    ]);
111    const handleChange = (newValue)=>{
112        setContent(newValue);
113        // Directly pass the raw updates back up to the form parent layout
114        if (props.setValue) {
115            props.setValue(newValue);
116        }
117    };
118    return  true ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
119        children: [
120            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("style", {
121                children: customStyles
122            }),
123            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(QuillNoSSRWrapper, {
124                ref: qRef,
125                modules: modules,
126                value: content,
127                onChange: handleChange,
128                theme: "snow",
129                placeholder: "Episode Description..."
130            })
131        ]
132    }) : 0;
133}
134
135
136/***/ }),
137
138/***/ 42490:
139/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
140
141"use strict";
142__webpack_require__.r(__webpack_exports__);
143/* harmony export */ __webpack_require__.d(__webpack_exports__, {
144/* harmony export */   __N_SSP: function() { return /* binding */ __N_SSP; }
145/* harmony export */ });
146/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85893);
147/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67294);
148/* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(11163);
149/* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_router__WEBPACK_IMPORTED_MODULE_2__);
150/* harmony import */ var _hocs_withTheme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23818);
151/* harmony import */ var _barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3314);
152/* harmony import */ var _barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(10190);
153/* harmony import */ var _barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(60762);
154/* harmony import */ var _barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(34375);
155/* harmony import */ var _barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(71919);
156/* harmony import */ var _barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(40492);
157/* harmony import */ var _barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(51015);
158/* harmony import */ var _components_quilljs_editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(68439);
159/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(87066);
160
161
162
163
164
165
166
167const EditPodcastEpisode = (param)=>{
168    let { token, data, SyndicationId, EpisodeId, minimized, apiData } = param;
169    const submitButtonRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
170    const router = (0,next_router__WEBPACK_IMPORTED_MODULE_2__.useRouter)();
171    const [uuid, setUUID] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(token);
172    const [title, setTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
173    const [season, setSeasonNo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0);
174    const [episodeNo, setEpisodeNo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0);
175    const [description, setEpisodeDescription] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
176    const [full_episode, setFullEpisode] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
177    const [mediatype, setMediaType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
178    //const [explicit, setExplicit] = useState("");
179    const [show, setShow] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
180    const [headText, setHeadText] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("Episode is Updating...");
181    const [bodyText, setBodyText] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("Bravo! We are in the process of updating your episode. Please hold....");
182    const handleClose = ()=>setShow(false);
183    const handleShow = ()=>setShow(true);
184    const handleInputChange = (event, stateSetter)=>{
185        stateSetter(event.target.value);
186    };
187    const handleNumberChange = (event, stateSetter)=>{
188        const value = parseFloat(event.target.value);
189        stateSetter(value);
190    };
191    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
192        setUUID(apiData.data._id);
193    }, [
194        apiData
195    ]);
196    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
197        const datas = JSON.parse(data);
198        const createAudioPlayer = (path)=>{
199            const audioPlayer = document.createElement("audio");
200            audioPlayer.controls = true;
201            audioPlayer.preload = "auto";
202            // Use controlsList to modify the displayed controls
203            audioPlayer.controlsList = "nodownload"; // Use type assertion here
204            const source = document.createElement("source");
205            source.src = path; // Replace with your audio file URL
206            //source.type = mediatype; // Replace with the appropriate MIME type
207            audioPlayer.appendChild(source);
208            // Append the audio player to the "playerr" div
209            const playerrDiv = document.getElementById("player");
210            if (playerrDiv) {
211                playerrDiv.appendChild(audioPlayer);
212            }
213        };
214        if (datas.length === 1) {
215            setTitle(datas[0].title);
216            if (datas[0].season === null) {
217                setSeasonNo(0);
218            } else {
219                setSeasonNo(datas[0].season);
220            }
221            setTitle(datas[0].title);
222            if (datas[0].episode_no === null) {
223                setEpisodeNo(0);
224            } else {
225                setEpisodeNo(datas[0].episode_no);
226            }
227            setEpisodeDescription(datas[0].description);
228            setFullEpisode(datas[0].mediafiles.full_episode.media_path);
229            setMediaType(datas[0].mediafiles.full_episode.type);
230            setTimeout(function() {
231                createAudioPlayer(datas[0].mediafiles.full_episode.media_path);
232            }, 1000);
233        }
234    }, [
235        data
236    ]);
237    const contentStyle = {
238        paddingLeft: minimized ? "70px" : "260px",
239        marginRight: "1em",
240        marginBottom: "1em"
241    };
242    let submitButton = null;
243    if (true) {
244        submitButton = document.getElementById("submitButton");
245    }
246    var axiosInstance = axios__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.create();
247    axiosInstance.interceptors.request.use(function(config) {
248        // Do something before request is sent
249        console.log("we are uploading your file.");
250        handleShow();
251        if (submitButton) {
252            submitButton.disabled = true;
253        }
254        return config;
255    }, function(error) {
256        // Do something with request error
257        setHeadText("ERROR");
258        setBodyText("<p>Please reload the page and try again.</p><p>If this issue continues please start a support ticket letting us know you're having podcast upload issues.</p>");
259        return Promise.reject(error);
260    });
261    axiosInstance.interceptors.response.use(function(response) {
262        // Do something with response data
263        console.log("We have completed creating your show.");
264        setHeadText("Episode Updated - Completed.");
265        setBodyText('<p>Thank you we have successfully updated your show.</p><p>You will be redirected shortly.</br>Alternatively you can click the button below..</p>
265<a href="http://podtoo.com/dashboard/syndication/mine" alt="PodToo" class="btn btn-primary">Go To Radio Show Page</a>');
266        setTimeout(()=>{
267            router.push("/dashboard/syndication/".concat(SyndicationId));
268        }, 10000);
269        //handleHide();
270        if (submitButton) {
271            submitButton.disabled = true;
272        }
273        return response;
274    }, function(error) {
275        console.log("We have an error creating your show.");
276        setHeadText("Error: 500");
277        setBodyText(error);
278        if (submitButton) {
279            submitButton.disabled = false;
280        }
281        // Do something with response error
282        return Promise.reject(error);
283    });
284    const handleSubmit = async (event)=>{
285        event.preventDefault();
286        const formData = new FormData();
287        // Append the state variables to the FormData object
288        formData.append("episode_id", EpisodeId);
289        formData.append("title", title);
290        formData.append("season", season.toString()); // Keeping season as number
291        formData.append("episode", episodeNo.toString()); // Keeping episode as number
292        formData.append("description", description);
293        //formData.append('pubdate', pubdate.toISOString());
294        const config = {
295            method: "post",
296            url: "/api/syndicate/editEpisode",
297            headers: {
298                "Content-Type": "multipart/form-data",
299                "x-user-id": uuid
300            },
301            data: formData
302        };
303        axiosInstance(config).then(function(response) {
304            console.log(JSON.stringify(response.data));
305        }).catch(function(error) {
306            console.log(error);
307        });
308    };
309    if (data) {
310        return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
311            pt: 10,
312            sx: contentStyle,
313            children: [
314                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
315                    open: show,
316                    onClose: handleClose,
317                    children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
318                        children: [
319                            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
320                                title: headText
321                            }),
322                            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
323                                children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
324                                    dangerouslySetInnerHTML: {
325                                        __html: bodyText
326                                    }
327                                })
328                            })
329                        ]
330                    })
331                }),
332                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
333                    children: [
334                        /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
335                            title: "Edit Episode"
336                        }),
337                        /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
338                            children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", {
339                                noValidate: true,
340                                autoComplete: "off",
341                                onSubmit: handleSubmit,
342                                children: [
343                                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
344                                        id: "episode-title",
345                                        label: "Episode Title",
346                                        fullWidth: true,
347                                        margin: "normal",
348                                        value: title,
349                                        placeholder: title,
350                                        onChange: (event)=>handleInputChange(event, setTitle)
351                                    }),
352                                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
353                                        id: "episode-season",
354                                        label: "Season",
355                                        type: "number",
356                                        fullWidth: true,
357                                        margin: "normal",
358                                        value: season,
359                                        onChange: (event)=>handleNumberChange(event, setSeasonNo)
360                                    }),
361                                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
362                                        id: "episode-number",
363                                        label: "Episode Number",
364                                        type: "number",
365                                        fullWidth: true,
366                                        margin: "normal",
367                                        value: episodeNo,
368                                        onChange: (event)=>handleNumberChange(event, setEpisodeNo)
369                                    }),
370                                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_quilljs_editor__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
371                                        value: description,
372                                        setValue: setEpisodeDescription
373                                    }),
374                                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
375                                        id: "player"
376                                    }),
377                                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_barrel_optimize_names_Box_Button_Card_CardContent_CardHeader_Modal_TextField_mui_material__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
378                                        variant: "contained",
379                                        fullWidth: true,
380                                        type: "submit",
381                                        ref: submitButtonRef,
382                                        children: "Submit"
383                                    })
384                                ]
385                            })
386                        })
387                    ]
388                })
389            ]
390        });
391    }
392};
393var __N_SSP = true;
394/* harmony default export */ __webpack_exports__["default"] = ((0,_hocs_withTheme__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(EditPodcastEpisode, "dashboard", true));
395
396
397/***/ })
398
399},
400/******/ function(__webpack_require__) { // webpackRuntimeModules
401/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
402/******/ __webpack_require__.O(0, [7466,1664,9120,7066,9585,3818,2888,9774,179], function() { return __webpack_exec__(28261); });
403/******/ var __webpack_exports__ = __webpack_require__.O();
404/******/ _N_E = __webpack_exports__;
405/******/ }
406]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.