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

// WebDocumentClassArray is adapter for slice of WebDocumentClass.
type WebDocumentClassArray []WebDocumentClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsWebDocument returns copy with only WebDocument constructors.
func ( WebDocumentClassArray) () ( WebDocumentArray) {
	for ,  := range  {
		,  := .(*WebDocument)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsWebDocumentNoProxy returns copy with only WebDocumentNoProxy constructors.
func ( WebDocumentClassArray) () ( WebDocumentNoProxyArray) {
	for ,  := range  {
		,  := .(*WebDocumentNoProxy)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// WebDocumentArray is adapter for slice of WebDocument.
type WebDocumentArray []WebDocument

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// WebDocumentNoProxyArray is adapter for slice of WebDocumentNoProxy.
type WebDocumentNoProxyArray []WebDocumentNoProxy

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}