//go:build !no_gotd_slices
// +build !no_gotd_slices

// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// MediaAreaClassArray is adapter for slice of MediaAreaClass.
type MediaAreaClassArray []MediaAreaClass

// Sort sorts slice of MediaAreaClass.
func ( MediaAreaClassArray) ( func(,  MediaAreaClass) bool) MediaAreaClassArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of MediaAreaClass.
func ( MediaAreaClassArray) ( func(,  MediaAreaClass) bool) MediaAreaClassArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of MediaAreaClass.
func ( MediaAreaClassArray) ( func( MediaAreaClass) bool) MediaAreaClassArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( MediaAreaClassArray) () ( MediaAreaClass,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( MediaAreaClassArray) () ( MediaAreaClass,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *MediaAreaClassArray) () ( MediaAreaClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  MediaAreaClass
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *MediaAreaClassArray) () ( MediaAreaClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// AsMediaAreaVenue returns copy with only MediaAreaVenue constructors.
func ( MediaAreaClassArray) () ( MediaAreaVenueArray) {
	for ,  := range  {
		,  := .(*MediaAreaVenue)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaAreaVenue returns copy with only InputMediaAreaVenue constructors.
func ( MediaAreaClassArray) () ( InputMediaAreaVenueArray) {
	for ,  := range  {
		,  := .(*InputMediaAreaVenue)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMediaAreaGeoPoint returns copy with only MediaAreaGeoPoint constructors.
func ( MediaAreaClassArray) () ( MediaAreaGeoPointArray) {
	for ,  := range  {
		,  := .(*MediaAreaGeoPoint)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMediaAreaSuggestedReaction returns copy with only MediaAreaSuggestedReaction constructors.
func ( MediaAreaClassArray) () ( MediaAreaSuggestedReactionArray) {
	for ,  := range  {
		,  := .(*MediaAreaSuggestedReaction)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMediaAreaChannelPost returns copy with only MediaAreaChannelPost constructors.
func ( MediaAreaClassArray) () ( MediaAreaChannelPostArray) {
	for ,  := range  {
		,  := .(*MediaAreaChannelPost)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaAreaChannelPost returns copy with only InputMediaAreaChannelPost constructors.
func ( MediaAreaClassArray) () ( InputMediaAreaChannelPostArray) {
	for ,  := range  {
		,  := .(*InputMediaAreaChannelPost)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// MediaAreaVenueArray is adapter for slice of MediaAreaVenue.
type MediaAreaVenueArray []MediaAreaVenue

// Sort sorts slice of MediaAreaVenue.
func ( MediaAreaVenueArray) ( func(,  MediaAreaVenue) bool) MediaAreaVenueArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of MediaAreaVenue.
func ( MediaAreaVenueArray) ( func(,  MediaAreaVenue) bool) MediaAreaVenueArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of MediaAreaVenue.
func ( MediaAreaVenueArray) ( func( MediaAreaVenue) bool) MediaAreaVenueArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( MediaAreaVenueArray) () ( MediaAreaVenue,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( MediaAreaVenueArray) () ( MediaAreaVenue,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *MediaAreaVenueArray) () ( MediaAreaVenue,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  MediaAreaVenue
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *MediaAreaVenueArray) () ( MediaAreaVenue,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// InputMediaAreaVenueArray is adapter for slice of InputMediaAreaVenue.
type InputMediaAreaVenueArray []InputMediaAreaVenue

// Sort sorts slice of InputMediaAreaVenue.
func ( InputMediaAreaVenueArray) ( func(,  InputMediaAreaVenue) bool) InputMediaAreaVenueArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of InputMediaAreaVenue.
func ( InputMediaAreaVenueArray) ( func(,  InputMediaAreaVenue) bool) InputMediaAreaVenueArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of InputMediaAreaVenue.
func ( InputMediaAreaVenueArray) ( func( InputMediaAreaVenue) bool) InputMediaAreaVenueArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( InputMediaAreaVenueArray) () ( InputMediaAreaVenue,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( InputMediaAreaVenueArray) () ( InputMediaAreaVenue,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *InputMediaAreaVenueArray) () ( InputMediaAreaVenue,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  InputMediaAreaVenue
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *InputMediaAreaVenueArray) () ( InputMediaAreaVenue,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// MediaAreaGeoPointArray is adapter for slice of MediaAreaGeoPoint.
type MediaAreaGeoPointArray []MediaAreaGeoPoint

// Sort sorts slice of MediaAreaGeoPoint.
func ( MediaAreaGeoPointArray) ( func(,  MediaAreaGeoPoint) bool) MediaAreaGeoPointArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of MediaAreaGeoPoint.
func ( MediaAreaGeoPointArray) ( func(,  MediaAreaGeoPoint) bool) MediaAreaGeoPointArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of MediaAreaGeoPoint.
func ( MediaAreaGeoPointArray) ( func( MediaAreaGeoPoint) bool) MediaAreaGeoPointArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( MediaAreaGeoPointArray) () ( MediaAreaGeoPoint,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( MediaAreaGeoPointArray) () ( MediaAreaGeoPoint,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *MediaAreaGeoPointArray) () ( MediaAreaGeoPoint,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  MediaAreaGeoPoint
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *MediaAreaGeoPointArray) () ( MediaAreaGeoPoint,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// MediaAreaSuggestedReactionArray is adapter for slice of MediaAreaSuggestedReaction.
type MediaAreaSuggestedReactionArray []MediaAreaSuggestedReaction

// Sort sorts slice of MediaAreaSuggestedReaction.
func ( MediaAreaSuggestedReactionArray) ( func(,  MediaAreaSuggestedReaction) bool) MediaAreaSuggestedReactionArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of MediaAreaSuggestedReaction.
func ( MediaAreaSuggestedReactionArray) ( func(,  MediaAreaSuggestedReaction) bool) MediaAreaSuggestedReactionArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of MediaAreaSuggestedReaction.
func ( MediaAreaSuggestedReactionArray) ( func( MediaAreaSuggestedReaction) bool) MediaAreaSuggestedReactionArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( MediaAreaSuggestedReactionArray) () ( MediaAreaSuggestedReaction,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( MediaAreaSuggestedReactionArray) () ( MediaAreaSuggestedReaction,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *MediaAreaSuggestedReactionArray) () ( MediaAreaSuggestedReaction,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  MediaAreaSuggestedReaction
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *MediaAreaSuggestedReactionArray) () ( MediaAreaSuggestedReaction,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// MediaAreaChannelPostArray is adapter for slice of MediaAreaChannelPost.
type MediaAreaChannelPostArray []MediaAreaChannelPost

// Sort sorts slice of MediaAreaChannelPost.
func ( MediaAreaChannelPostArray) ( func(,  MediaAreaChannelPost) bool) MediaAreaChannelPostArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of MediaAreaChannelPost.
func ( MediaAreaChannelPostArray) ( func(,  MediaAreaChannelPost) bool) MediaAreaChannelPostArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of MediaAreaChannelPost.
func ( MediaAreaChannelPostArray) ( func( MediaAreaChannelPost) bool) MediaAreaChannelPostArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( MediaAreaChannelPostArray) () ( MediaAreaChannelPost,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( MediaAreaChannelPostArray) () ( MediaAreaChannelPost,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *MediaAreaChannelPostArray) () ( MediaAreaChannelPost,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  MediaAreaChannelPost
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *MediaAreaChannelPostArray) () ( MediaAreaChannelPost,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// InputMediaAreaChannelPostArray is adapter for slice of InputMediaAreaChannelPost.
type InputMediaAreaChannelPostArray []InputMediaAreaChannelPost

// Sort sorts slice of InputMediaAreaChannelPost.
func ( InputMediaAreaChannelPostArray) ( func(,  InputMediaAreaChannelPost) bool) InputMediaAreaChannelPostArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of InputMediaAreaChannelPost.
func ( InputMediaAreaChannelPostArray) ( func(,  InputMediaAreaChannelPost) bool) InputMediaAreaChannelPostArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of InputMediaAreaChannelPost.
func ( InputMediaAreaChannelPostArray) ( func( InputMediaAreaChannelPost) bool) InputMediaAreaChannelPostArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( InputMediaAreaChannelPostArray) () ( InputMediaAreaChannelPost,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( InputMediaAreaChannelPostArray) () ( InputMediaAreaChannelPost,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *InputMediaAreaChannelPostArray) () ( InputMediaAreaChannelPost,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  InputMediaAreaChannelPost
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *InputMediaAreaChannelPostArray) () ( InputMediaAreaChannelPost,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}