//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{}
)

// StoryReactionClassArray is adapter for slice of StoryReactionClass.
type StoryReactionClassArray []StoryReactionClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsStoryReaction returns copy with only StoryReaction constructors.
func ( StoryReactionClassArray) () ( StoryReactionArray) {
	for ,  := range  {
		,  := .(*StoryReaction)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsStoryReactionPublicForward returns copy with only StoryReactionPublicForward constructors.
func ( StoryReactionClassArray) () ( StoryReactionPublicForwardArray) {
	for ,  := range  {
		,  := .(*StoryReactionPublicForward)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsStoryReactionPublicRepost returns copy with only StoryReactionPublicRepost constructors.
func ( StoryReactionClassArray) () ( StoryReactionPublicRepostArray) {
	for ,  := range  {
		,  := .(*StoryReactionPublicRepost)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// StoryReactionArray is adapter for slice of StoryReaction.
type StoryReactionArray []StoryReaction

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SortByDate sorts slice of StoryReaction by Date.
func ( StoryReactionArray) () StoryReactionArray {
	return .Sort(func(,  StoryReaction) bool {
		return .GetDate() < .GetDate()
	})
}

// SortStableByDate sorts slice of StoryReaction by Date.
func ( StoryReactionArray) () StoryReactionArray {
	return .SortStable(func(,  StoryReaction) bool {
		return .GetDate() < .GetDate()
	})
}

// StoryReactionPublicForwardArray is adapter for slice of StoryReactionPublicForward.
type StoryReactionPublicForwardArray []StoryReactionPublicForward

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// StoryReactionPublicRepostArray is adapter for slice of StoryReactionPublicRepost.
type StoryReactionPublicRepostArray []StoryReactionPublicRepost

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}