<?php if (! $__env->hasRenderedOnce('00a42fb0-fc4a-4116-acee-56fb5ace6d7d')): $__env->markAsRenderedOnce('00a42fb0-fc4a-4116-acee-56fb5ace6d7d'); ?>
    <script>
        var lazyLoadShortcodeBlocks = function () {
            $('.shortcode-lazy-loading').each(function (index, element) {
                var $element = $(element);
                var name = $element.data('name');
                var attributes = $element.data('attributes');

                $.ajax({
                    url: '<?php echo e(route('public.ajax.render-ui-block')); ?>',
                    type: 'POST',
                    data: {
                        name,
                        attributes: {
                            ...attributes,
                        },
                    },
                    headers: {
                        'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>'
                    },
                    success: function ({ error, data }) {
                        if (error) {
                            return;
                        }

                        $element.replaceWith(data);

                        document.dispatchEvent(new CustomEvent('shortcode.loaded', {
                            detail: {
                                name,
                                attributes,
                                html: data,
                            }
                        }));
                    },
                });
            });
        };

        window.addEventListener('load', function () {
            lazyLoadShortcodeBlocks();
        });
    </script>
<?php endif; ?>
<?php /**PATH /home/bangla34/SadikHossain/platform/packages/shortcode/resources/views/partials/lazy-loading-script.blade.php ENDPATH**/ ?>