async function create_and_insert_section({ index, symbol_id, palette_id, entries, page_id }) {
	// create new section object
	const new_section = Section({
		index,
		page: page_id,
		palette: palette_id,
		symbol: symbol_id,
		entries: db_utils.remap_entry_ids(entries)
	})

	// STORE: set updated sections
	const original_sections = _.cloneDeep(get(stores.sections))
	const original_palette_sections = original_sections.filter((s) => s.palette === new_section.palette).sort((a, b) => a.index - b.index)
	const updated_palette_sections = [...original_palette_sections.slice(0, new_section.index), new_section, ...original_palette_sections.slice(new_section.index)].map((s, i) => ({ ...s, index: i }))
	const updated_sections = original_sections.flatMap((section) => {
		if (section.palette) {
			const updated_palette_section = updated_palette_sections.find((s) => s.id === section.id)
			return updated_palette_section
		} else return section
	})
	updated_sections.push(new_section)
	stores.sections.set(updated_sections)

	// DB: insert new section
	await dataChanged({
		table: 'sections',
		action: 'insert',
		data: _.omit(new_section, ['entries'])
	})

	// DB: insert section entries
	await dataChanged({
		table: 'entries',
		action: 'insert',
		data: new_section.entries.map(e => ({ ...e, symbol: null, section: new_section.id }))
	})

	// DB: update palette section indeces
	await Promise.all(
		updated_palette_sections.map((s) =>
			dataChanged({
				table: 'sections',
				action: 'update',
				id: s.id,
				data: { index: s.index }
			})
		)
	)

	return new_section.id
}
Inserts a new section into the database and returns its ID.

@param {Object} params
@param {number} params.index - The index of the new section.
@param {string} params.symbol_id - The ID of the symbol associated with the section.
@param {string} params.palette_id - The ID of the palette the section belongs to.
@param {Array} params.entries - The entries of the section.
@param {string} params.page_id - The ID of the page the section belongs to.
@returns {Promise<string>} The newly inserted section's ID.