slidge-whatsapp 0.2.5__cp313-cp313-manylinux_2_36_aarch64.whl → 0.2.6__cp313-cp313-manylinux_2_36_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of slidge-whatsapp might be problematic. Click here for more details.

Files changed (320) hide show
  1. slidge_whatsapp/config.py +3 -0
  2. slidge_whatsapp/event.go +23 -24
  3. slidge_whatsapp/gateway.go +13 -9
  4. slidge_whatsapp/gateway.py +2 -2
  5. slidge_whatsapp/generated/_whatsapp.cpython-313-aarch64-linux-gnu.h +181 -181
  6. slidge_whatsapp/generated/_whatsapp.cpython-313-aarch64-linux-gnu.so +0 -0
  7. slidge_whatsapp/generated/build.py +155 -155
  8. slidge_whatsapp/generated/whatsapp.c +1507 -1507
  9. slidge_whatsapp/generated/whatsapp.go +907 -907
  10. slidge_whatsapp/generated/whatsapp.py +1318 -1318
  11. slidge_whatsapp/generated/whatsapp_go.h +181 -181
  12. slidge_whatsapp/go.mod +15 -12
  13. slidge_whatsapp/go.sum +41 -29
  14. slidge_whatsapp/media/media.go +16 -10
  15. slidge_whatsapp/session.go +73 -66
  16. slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn.go +4 -4
  17. slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn_darwin.go +0 -5
  18. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/go_libinit.go +3 -0
  19. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/symbols.go +40 -20
  20. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/CHANGELOG.md +14 -1
  21. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/ffi.go +2 -2
  22. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/fun.go +10 -2
  23. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib.go +1 -1
  24. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib_unix.go +1 -1
  25. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib_windows.go +1 -1
  26. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/README.md +2 -7
  27. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/callback.go +2 -1
  28. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c +8510 -5090
  29. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h +344 -150
  30. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3.go +57 -23
  31. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_unlock_notify.c +4 -0
  32. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_unlock_notify.go +4 -0
  33. slidge_whatsapp/vendor/github.com/petermattis/goid/.gitignore +4 -0
  34. slidge_whatsapp/vendor/github.com/petermattis/goid/LICENSE +202 -0
  35. slidge_whatsapp/vendor/github.com/petermattis/goid/README.md +4 -0
  36. slidge_whatsapp/vendor/github.com/petermattis/goid/goid.go +35 -0
  37. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_gccgo.go +26 -0
  38. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.3.c +23 -0
  39. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.3.go +22 -0
  40. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.4.go +35 -0
  41. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.4.s +18 -0
  42. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.5.go +28 -0
  43. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.5.s +44 -0
  44. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_slow.go +24 -0
  45. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_gccgo_go1.8.go +17 -0
  46. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.23.go +38 -0
  47. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.5.go +57 -0
  48. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.6.go +43 -0
  49. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.9.go +37 -0
  50. slidge_whatsapp/vendor/github.com/rs/zerolog/CONTRIBUTING.md +43 -0
  51. slidge_whatsapp/vendor/github.com/rs/zerolog/README.md +31 -0
  52. slidge_whatsapp/vendor/github.com/rs/zerolog/console.go +20 -5
  53. slidge_whatsapp/vendor/github.com/rs/zerolog/log/log.go +131 -0
  54. slidge_whatsapp/vendor/github.com/rs/zerolog/log.go +1 -1
  55. slidge_whatsapp/vendor/github.com/rs/zerolog/sampler.go +4 -1
  56. slidge_whatsapp/vendor/github.com/rs/zerolog/writer.go +9 -0
  57. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/GroupCipher.go +17 -6
  58. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/GroupSessionBuilder.go +17 -7
  59. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/state/store/SenderKeyStore.go +4 -2
  60. slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/chain/ChainKey.go +1 -0
  61. slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/identity/IdentityKey.go +1 -0
  62. slidge_whatsapp/vendor/go.mau.fi/libsignal/logger/DefaultLogger.go +2 -2
  63. slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/FingerprintProtocol.pb.go +3 -2
  64. slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/LocalStorageProtocol.pb.go +3 -2
  65. slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/WhisperTextProtocol.pb.go +3 -2
  66. slidge_whatsapp/vendor/go.mau.fi/libsignal/session/Session.go +41 -17
  67. slidge_whatsapp/vendor/go.mau.fi/libsignal/session/SessionCipher.go +64 -30
  68. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/IdentityKeyStore.go +5 -3
  69. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/MessageKeyStore.go +6 -4
  70. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/PreKeyStore.go +6 -4
  71. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/SessionStore.go +8 -6
  72. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/SignedPreKeyStore.go +7 -5
  73. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/connlog.go +257 -0
  74. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/database.go +309 -0
  75. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/iter.go +233 -0
  76. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/json.go +47 -0
  77. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/log.go +129 -0
  78. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/massinsert.go +164 -0
  79. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/queryhelper.go +137 -0
  80. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/reflectscan.go +30 -0
  81. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/transaction.go +180 -0
  82. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/upgrades.go +250 -0
  83. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/upgradetable.go +331 -0
  84. slidge_whatsapp/vendor/go.mau.fi/util/exerrors/dualerror.go +33 -0
  85. slidge_whatsapp/vendor/go.mau.fi/util/exerrors/must.go +23 -0
  86. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/cors.go +32 -0
  87. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/handleerrors.go +64 -0
  88. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/json.go +41 -0
  89. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/middleware.go +30 -0
  90. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/networkerror.go +37 -0
  91. slidge_whatsapp/vendor/go.mau.fi/util/exsync/event.go +88 -0
  92. slidge_whatsapp/vendor/go.mau.fi/util/exsync/returnonce.go +25 -0
  93. slidge_whatsapp/vendor/go.mau.fi/util/exsync/ringbuffer.go +139 -0
  94. slidge_whatsapp/vendor/go.mau.fi/util/exsync/syncmap.go +94 -0
  95. slidge_whatsapp/vendor/go.mau.fi/util/exsync/syncset.go +136 -0
  96. slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/callermarshal.go +28 -0
  97. slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/defaults.go +32 -0
  98. slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/generics.go +45 -0
  99. slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/writer.go +81 -0
  100. slidge_whatsapp/vendor/go.mau.fi/util/ptr/ptr.go +43 -0
  101. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/decode.go +27 -26
  102. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/encode.go +4 -3
  103. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/keys.go +5 -4
  104. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate.go +27 -25
  105. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/armadillomessage.go +3 -2
  106. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/broadcast.go +5 -4
  107. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/client.go +60 -15
  108. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/connectionevents.go +25 -9
  109. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download-to-file.go +45 -19
  110. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download.go +52 -28
  111. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/errors.go +1 -0
  112. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/group.go +59 -29
  113. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/internals.go +166 -146
  114. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/keepalive.go +2 -2
  115. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/mediaconn.go +5 -3
  116. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/mediaretry.go +2 -1
  117. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/message.go +270 -111
  118. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/msgsecret.go +118 -31
  119. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/notification.go +67 -36
  120. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair-code.go +7 -4
  121. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair.go +42 -18
  122. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/prekeys.go +9 -5
  123. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/presence.go +2 -1
  124. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/privacysettings.go +10 -11
  125. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waAdv/WAAdv.pb.go +39 -9
  126. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.pb.go +354 -175
  127. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.proto +5 -5
  128. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.pb.go +158 -15
  129. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.proto +1 -0
  130. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCert/WACert.pb.go +29 -9
  131. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waChatLockSettings/WAProtobufsChatLockSettings.pb.go +13 -9
  132. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.pb.go +344 -31
  133. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.proto +26 -0
  134. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/{WAWebProtobufsCompanionReg.pb.go → WACompanionReg.pb.go} +170 -84
  135. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/{WAWebProtobufsCompanionReg.proto → WACompanionReg.proto} +1 -1
  136. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waConsumerApplication/WAConsumerApplication.pb.go +173 -9
  137. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.pb.go +78 -16
  138. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.proto +5 -0
  139. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.go +6747 -2230
  140. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.proto +294 -43
  141. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.go +456 -135
  142. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.proto +14 -0
  143. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.pb.go +162 -9
  144. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.proto +1 -0
  145. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.pb.go +32 -9
  146. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.proto +1 -0
  147. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.pb.go +192 -52
  148. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.proto +8 -0
  149. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/WAMsgTransport.pb.go +60 -9
  150. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMultiDevice/WAMultiDevice.pb.go +39 -9
  151. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waServerSync/WAServerSync.pb.go +61 -9
  152. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.go +1051 -382
  153. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.proto +32 -0
  154. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waUserPassword/WAProtobufsUserPassword.pb.go +27 -9
  155. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waVnameCert/WAWebProtobufsVnameCert.pb.go +59 -9
  156. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.go +382 -78
  157. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.proto +8 -0
  158. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.go +555 -9
  159. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.proto +2 -0
  160. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/receipt.go +13 -3
  161. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/retry.go +29 -19
  162. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/send.go +244 -73
  163. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/sendfb.go +27 -16
  164. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/clientpayload.go +3 -1
  165. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/noop.go +85 -43
  166. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/signal.go +75 -88
  167. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go +79 -61
  168. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/lidmap.go +186 -0
  169. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go +291 -167
  170. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/00-latest-schema.sql +153 -0
  171. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/03-message-secrets.sql +11 -0
  172. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/04-privacy-tokens.sql +8 -0
  173. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/05-account-jid-format.sql +2 -0
  174. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/06-facebook-uuid.sql +2 -0
  175. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/07-account-lid.sql +2 -0
  176. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/08-lid-mapping.sql +5 -0
  177. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/09-decryption-buffer.sql +10 -0
  178. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/upgrades.go +22 -0
  179. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/store.go +105 -56
  180. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/botmap.go +210 -0
  181. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/events/events.go +8 -0
  182. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/group.go +15 -6
  183. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/jid.go +7 -8
  184. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/message.go +17 -0
  185. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/update.go +3 -2
  186. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/upload.go +1 -1
  187. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/user.go +45 -29
  188. slidge_whatsapp/vendor/golang.org/x/exp/LICENSE +27 -0
  189. slidge_whatsapp/vendor/golang.org/x/exp/PATENTS +22 -0
  190. slidge_whatsapp/vendor/golang.org/x/exp/constraints/constraints.go +54 -0
  191. slidge_whatsapp/vendor/golang.org/x/net/http/httpguts/guts.go +50 -0
  192. slidge_whatsapp/vendor/golang.org/x/net/http/httpguts/httplex.go +347 -0
  193. slidge_whatsapp/vendor/golang.org/x/net/http2/.gitignore +2 -0
  194. slidge_whatsapp/vendor/golang.org/x/net/http2/ascii.go +53 -0
  195. slidge_whatsapp/vendor/golang.org/x/net/http2/ciphers.go +641 -0
  196. slidge_whatsapp/vendor/golang.org/x/net/http2/client_conn_pool.go +311 -0
  197. slidge_whatsapp/vendor/golang.org/x/net/http2/config.go +122 -0
  198. slidge_whatsapp/vendor/golang.org/x/net/http2/config_go124.go +61 -0
  199. slidge_whatsapp/vendor/golang.org/x/net/http2/config_pre_go124.go +16 -0
  200. slidge_whatsapp/vendor/golang.org/x/net/http2/databuffer.go +149 -0
  201. slidge_whatsapp/vendor/golang.org/x/net/http2/errors.go +145 -0
  202. slidge_whatsapp/vendor/golang.org/x/net/http2/flow.go +120 -0
  203. slidge_whatsapp/vendor/golang.org/x/net/http2/frame.go +1702 -0
  204. slidge_whatsapp/vendor/golang.org/x/net/http2/gotrack.go +170 -0
  205. slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/encode.go +245 -0
  206. slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/hpack.go +523 -0
  207. slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/huffman.go +226 -0
  208. slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/static_table.go +188 -0
  209. slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/tables.go +403 -0
  210. slidge_whatsapp/vendor/golang.org/x/net/http2/http2.go +432 -0
  211. slidge_whatsapp/vendor/golang.org/x/net/http2/pipe.go +184 -0
  212. slidge_whatsapp/vendor/golang.org/x/net/http2/server.go +3350 -0
  213. slidge_whatsapp/vendor/golang.org/x/net/http2/timer.go +20 -0
  214. slidge_whatsapp/vendor/golang.org/x/net/http2/transport.go +3287 -0
  215. slidge_whatsapp/vendor/golang.org/x/net/http2/unencrypted.go +32 -0
  216. slidge_whatsapp/vendor/golang.org/x/net/http2/write.go +381 -0
  217. slidge_whatsapp/vendor/golang.org/x/net/http2/writesched.go +251 -0
  218. slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_priority.go +451 -0
  219. slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_random.go +77 -0
  220. slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_roundrobin.go +119 -0
  221. slidge_whatsapp/vendor/golang.org/x/net/idna/go118.go +13 -0
  222. slidge_whatsapp/vendor/golang.org/x/net/idna/idna10.0.0.go +769 -0
  223. slidge_whatsapp/vendor/golang.org/x/net/idna/idna9.0.0.go +717 -0
  224. slidge_whatsapp/vendor/golang.org/x/net/idna/pre_go118.go +11 -0
  225. slidge_whatsapp/vendor/golang.org/x/net/idna/punycode.go +217 -0
  226. slidge_whatsapp/vendor/golang.org/x/net/idna/tables10.0.0.go +4559 -0
  227. slidge_whatsapp/vendor/golang.org/x/net/idna/tables11.0.0.go +4653 -0
  228. slidge_whatsapp/vendor/golang.org/x/net/idna/tables12.0.0.go +4733 -0
  229. slidge_whatsapp/vendor/golang.org/x/net/idna/tables13.0.0.go +4959 -0
  230. slidge_whatsapp/vendor/golang.org/x/net/idna/tables15.0.0.go +5144 -0
  231. slidge_whatsapp/vendor/golang.org/x/net/idna/tables9.0.0.go +4486 -0
  232. slidge_whatsapp/vendor/golang.org/x/net/idna/trie.go +51 -0
  233. slidge_whatsapp/vendor/golang.org/x/net/idna/trie12.0.0.go +30 -0
  234. slidge_whatsapp/vendor/golang.org/x/net/idna/trie13.0.0.go +30 -0
  235. slidge_whatsapp/vendor/golang.org/x/net/idna/trieval.go +119 -0
  236. slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/ascii.go +53 -0
  237. slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/headermap.go +115 -0
  238. slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/request.go +467 -0
  239. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_darwin.go +148 -1
  240. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux.go +16 -26
  241. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +84 -0
  242. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +20 -0
  243. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +84 -0
  244. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +20 -0
  245. slidge_whatsapp/vendor/golang.org/x/sys/windows/security_windows.go +44 -5
  246. slidge_whatsapp/vendor/golang.org/x/sys/windows/syscall_windows.go +4 -2
  247. slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows.go +239 -0
  248. slidge_whatsapp/vendor/golang.org/x/sys/windows/zsyscall_windows.go +9 -0
  249. slidge_whatsapp/vendor/golang.org/x/text/LICENSE +27 -0
  250. slidge_whatsapp/vendor/golang.org/x/text/PATENTS +22 -0
  251. slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule.go +336 -0
  252. slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go +11 -0
  253. slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go +14 -0
  254. slidge_whatsapp/vendor/golang.org/x/text/transform/transform.go +709 -0
  255. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/bidi.go +359 -0
  256. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/bracket.go +335 -0
  257. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/core.go +1071 -0
  258. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/prop.go +206 -0
  259. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go +1815 -0
  260. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go +1887 -0
  261. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go +1923 -0
  262. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go +1955 -0
  263. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables15.0.0.go +2042 -0
  264. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go +1781 -0
  265. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/trieval.go +48 -0
  266. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/composition.go +512 -0
  267. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/forminfo.go +279 -0
  268. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/input.go +109 -0
  269. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/iter.go +458 -0
  270. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/normalize.go +610 -0
  271. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/readwriter.go +125 -0
  272. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go +7657 -0
  273. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go +7693 -0
  274. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go +7710 -0
  275. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go +7760 -0
  276. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables15.0.0.go +7907 -0
  277. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go +7637 -0
  278. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/transform.go +88 -0
  279. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/trie.go +54 -0
  280. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb +0 -0
  281. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/editions.go +3 -0
  282. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +16 -0
  283. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/strs/{strings_unsafe_go121.go → strings_unsafe.go} +0 -2
  284. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/version/version.go +1 -1
  285. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/merge.go +6 -0
  286. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +2 -0
  287. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/{value_unsafe_go121.go → value_unsafe.go} +0 -2
  288. slidge_whatsapp/vendor/modules.txt +38 -13
  289. {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.6.dist-info}/METADATA +1 -1
  290. {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.6.dist-info}/RECORD +293 -180
  291. {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.6.dist-info}/WHEEL +1 -1
  292. slidge_whatsapp/vendor/github.com/rs/zerolog/CNAME +0 -1
  293. slidge_whatsapp/vendor/github.com/rs/zerolog/_config.yml +0 -1
  294. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waAdv/WAAdv.pb.raw +0 -0
  295. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.pb.raw +0 -0
  296. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.pb.raw +0 -0
  297. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCert/WACert.pb.raw +0 -23
  298. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waChatLockSettings/WAProtobufsChatLockSettings.pb.raw +0 -7
  299. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.pb.raw +0 -0
  300. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WAWebProtobufsCompanionReg.pb.raw +0 -0
  301. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waConsumerApplication/WAConsumerApplication.pb.raw +0 -0
  302. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.pb.raw +0 -0
  303. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.raw +0 -0
  304. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.raw +0 -0
  305. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.pb.raw +0 -0
  306. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.pb.raw +0 -0
  307. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.pb.raw +0 -0
  308. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/WAMsgTransport.pb.raw +0 -0
  309. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMultiDevice/WAMultiDevice.pb.raw +0 -0
  310. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waServerSync/WAServerSync.pb.raw +0 -0
  311. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.raw +0 -0
  312. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waUserPassword/WAProtobufsUserPassword.pb.raw +0 -0
  313. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waVnameCert/WAWebProtobufsVnameCert.pb.raw +0 -0
  314. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.raw +0 -0
  315. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.raw +0 -0
  316. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrade.go +0 -296
  317. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go120.go +0 -94
  318. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go +0 -98
  319. {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.6.dist-info}/LICENSE +0 -0
  320. {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.6.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,48 @@
1
+ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
2
+
3
+ package bidi
4
+
5
+ // Class is the Unicode BiDi class. Each rune has a single class.
6
+ type Class uint
7
+
8
+ const (
9
+ L Class = iota // LeftToRight
10
+ R // RightToLeft
11
+ EN // EuropeanNumber
12
+ ES // EuropeanSeparator
13
+ ET // EuropeanTerminator
14
+ AN // ArabicNumber
15
+ CS // CommonSeparator
16
+ B // ParagraphSeparator
17
+ S // SegmentSeparator
18
+ WS // WhiteSpace
19
+ ON // OtherNeutral
20
+ BN // BoundaryNeutral
21
+ NSM // NonspacingMark
22
+ AL // ArabicLetter
23
+ Control // Control LRO - PDI
24
+
25
+ numClass
26
+
27
+ LRO // LeftToRightOverride
28
+ RLO // RightToLeftOverride
29
+ LRE // LeftToRightEmbedding
30
+ RLE // RightToLeftEmbedding
31
+ PDF // PopDirectionalFormat
32
+ LRI // LeftToRightIsolate
33
+ RLI // RightToLeftIsolate
34
+ FSI // FirstStrongIsolate
35
+ PDI // PopDirectionalIsolate
36
+
37
+ unknownClass = ^Class(0)
38
+ )
39
+
40
+ // A trie entry has the following bits:
41
+ // 7..5 XOR mask for brackets
42
+ // 4 1: Bracket open, 0: Bracket close
43
+ // 3..0 Class type
44
+
45
+ const (
46
+ openMask = 0x10
47
+ xorMaskShift = 5
48
+ )
@@ -0,0 +1,512 @@
1
+ // Copyright 2011 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package norm
6
+
7
+ import "unicode/utf8"
8
+
9
+ const (
10
+ maxNonStarters = 30
11
+ // The maximum number of characters needed for a buffer is
12
+ // maxNonStarters + 1 for the starter + 1 for the GCJ
13
+ maxBufferSize = maxNonStarters + 2
14
+ maxNFCExpansion = 3 // NFC(0x1D160)
15
+ maxNFKCExpansion = 18 // NFKC(0xFDFA)
16
+
17
+ maxByteBufferSize = utf8.UTFMax * maxBufferSize // 128
18
+ )
19
+
20
+ // ssState is used for reporting the segment state after inserting a rune.
21
+ // It is returned by streamSafe.next.
22
+ type ssState int
23
+
24
+ const (
25
+ // Indicates a rune was successfully added to the segment.
26
+ ssSuccess ssState = iota
27
+ // Indicates a rune starts a new segment and should not be added.
28
+ ssStarter
29
+ // Indicates a rune caused a segment overflow and a CGJ should be inserted.
30
+ ssOverflow
31
+ )
32
+
33
+ // streamSafe implements the policy of when a CGJ should be inserted.
34
+ type streamSafe uint8
35
+
36
+ // first inserts the first rune of a segment. It is a faster version of next if
37
+ // it is known p represents the first rune in a segment.
38
+ func (ss *streamSafe) first(p Properties) {
39
+ *ss = streamSafe(p.nTrailingNonStarters())
40
+ }
41
+
42
+ // insert returns a ssState value to indicate whether a rune represented by p
43
+ // can be inserted.
44
+ func (ss *streamSafe) next(p Properties) ssState {
45
+ if *ss > maxNonStarters {
46
+ panic("streamSafe was not reset")
47
+ }
48
+ n := p.nLeadingNonStarters()
49
+ if *ss += streamSafe(n); *ss > maxNonStarters {
50
+ *ss = 0
51
+ return ssOverflow
52
+ }
53
+ // The Stream-Safe Text Processing prescribes that the counting can stop
54
+ // as soon as a starter is encountered. However, there are some starters,
55
+ // like Jamo V and T, that can combine with other runes, leaving their
56
+ // successive non-starters appended to the previous, possibly causing an
57
+ // overflow. We will therefore consider any rune with a non-zero nLead to
58
+ // be a non-starter. Note that it always hold that if nLead > 0 then
59
+ // nLead == nTrail.
60
+ if n == 0 {
61
+ *ss = streamSafe(p.nTrailingNonStarters())
62
+ return ssStarter
63
+ }
64
+ return ssSuccess
65
+ }
66
+
67
+ // backwards is used for checking for overflow and segment starts
68
+ // when traversing a string backwards. Users do not need to call first
69
+ // for the first rune. The state of the streamSafe retains the count of
70
+ // the non-starters loaded.
71
+ func (ss *streamSafe) backwards(p Properties) ssState {
72
+ if *ss > maxNonStarters {
73
+ panic("streamSafe was not reset")
74
+ }
75
+ c := *ss + streamSafe(p.nTrailingNonStarters())
76
+ if c > maxNonStarters {
77
+ return ssOverflow
78
+ }
79
+ *ss = c
80
+ if p.nLeadingNonStarters() == 0 {
81
+ return ssStarter
82
+ }
83
+ return ssSuccess
84
+ }
85
+
86
+ func (ss streamSafe) isMax() bool {
87
+ return ss == maxNonStarters
88
+ }
89
+
90
+ // GraphemeJoiner is inserted after maxNonStarters non-starter runes.
91
+ const GraphemeJoiner = "\u034F"
92
+
93
+ // reorderBuffer is used to normalize a single segment. Characters inserted with
94
+ // insert are decomposed and reordered based on CCC. The compose method can
95
+ // be used to recombine characters. Note that the byte buffer does not hold
96
+ // the UTF-8 characters in order. Only the rune array is maintained in sorted
97
+ // order. flush writes the resulting segment to a byte array.
98
+ type reorderBuffer struct {
99
+ rune [maxBufferSize]Properties // Per character info.
100
+ byte [maxByteBufferSize]byte // UTF-8 buffer. Referenced by runeInfo.pos.
101
+ nbyte uint8 // Number or bytes.
102
+ ss streamSafe // For limiting length of non-starter sequence.
103
+ nrune int // Number of runeInfos.
104
+ f formInfo
105
+
106
+ src input
107
+ nsrc int
108
+ tmpBytes input
109
+
110
+ out []byte
111
+ flushF func(*reorderBuffer) bool
112
+ }
113
+
114
+ func (rb *reorderBuffer) init(f Form, src []byte) {
115
+ rb.f = *formTable[f]
116
+ rb.src.setBytes(src)
117
+ rb.nsrc = len(src)
118
+ rb.ss = 0
119
+ }
120
+
121
+ func (rb *reorderBuffer) initString(f Form, src string) {
122
+ rb.f = *formTable[f]
123
+ rb.src.setString(src)
124
+ rb.nsrc = len(src)
125
+ rb.ss = 0
126
+ }
127
+
128
+ func (rb *reorderBuffer) setFlusher(out []byte, f func(*reorderBuffer) bool) {
129
+ rb.out = out
130
+ rb.flushF = f
131
+ }
132
+
133
+ // reset discards all characters from the buffer.
134
+ func (rb *reorderBuffer) reset() {
135
+ rb.nrune = 0
136
+ rb.nbyte = 0
137
+ }
138
+
139
+ func (rb *reorderBuffer) doFlush() bool {
140
+ if rb.f.composing {
141
+ rb.compose()
142
+ }
143
+ res := rb.flushF(rb)
144
+ rb.reset()
145
+ return res
146
+ }
147
+
148
+ // appendFlush appends the normalized segment to rb.out.
149
+ func appendFlush(rb *reorderBuffer) bool {
150
+ for i := 0; i < rb.nrune; i++ {
151
+ start := rb.rune[i].pos
152
+ end := start + rb.rune[i].size
153
+ rb.out = append(rb.out, rb.byte[start:end]...)
154
+ }
155
+ return true
156
+ }
157
+
158
+ // flush appends the normalized segment to out and resets rb.
159
+ func (rb *reorderBuffer) flush(out []byte) []byte {
160
+ for i := 0; i < rb.nrune; i++ {
161
+ start := rb.rune[i].pos
162
+ end := start + rb.rune[i].size
163
+ out = append(out, rb.byte[start:end]...)
164
+ }
165
+ rb.reset()
166
+ return out
167
+ }
168
+
169
+ // flushCopy copies the normalized segment to buf and resets rb.
170
+ // It returns the number of bytes written to buf.
171
+ func (rb *reorderBuffer) flushCopy(buf []byte) int {
172
+ p := 0
173
+ for i := 0; i < rb.nrune; i++ {
174
+ runep := rb.rune[i]
175
+ p += copy(buf[p:], rb.byte[runep.pos:runep.pos+runep.size])
176
+ }
177
+ rb.reset()
178
+ return p
179
+ }
180
+
181
+ // insertOrdered inserts a rune in the buffer, ordered by Canonical Combining Class.
182
+ // It returns false if the buffer is not large enough to hold the rune.
183
+ // It is used internally by insert and insertString only.
184
+ func (rb *reorderBuffer) insertOrdered(info Properties) {
185
+ n := rb.nrune
186
+ b := rb.rune[:]
187
+ cc := info.ccc
188
+ if cc > 0 {
189
+ // Find insertion position + move elements to make room.
190
+ for ; n > 0; n-- {
191
+ if b[n-1].ccc <= cc {
192
+ break
193
+ }
194
+ b[n] = b[n-1]
195
+ }
196
+ }
197
+ rb.nrune += 1
198
+ pos := uint8(rb.nbyte)
199
+ rb.nbyte += utf8.UTFMax
200
+ info.pos = pos
201
+ b[n] = info
202
+ }
203
+
204
+ // insertErr is an error code returned by insert. Using this type instead
205
+ // of error improves performance up to 20% for many of the benchmarks.
206
+ type insertErr int
207
+
208
+ const (
209
+ iSuccess insertErr = -iota
210
+ iShortDst
211
+ iShortSrc
212
+ )
213
+
214
+ // insertFlush inserts the given rune in the buffer ordered by CCC.
215
+ // If a decomposition with multiple segments are encountered, they leading
216
+ // ones are flushed.
217
+ // It returns a non-zero error code if the rune was not inserted.
218
+ func (rb *reorderBuffer) insertFlush(src input, i int, info Properties) insertErr {
219
+ if rune := src.hangul(i); rune != 0 {
220
+ rb.decomposeHangul(rune)
221
+ return iSuccess
222
+ }
223
+ if info.hasDecomposition() {
224
+ return rb.insertDecomposed(info.Decomposition())
225
+ }
226
+ rb.insertSingle(src, i, info)
227
+ return iSuccess
228
+ }
229
+
230
+ // insertUnsafe inserts the given rune in the buffer ordered by CCC.
231
+ // It is assumed there is sufficient space to hold the runes. It is the
232
+ // responsibility of the caller to ensure this. This can be done by checking
233
+ // the state returned by the streamSafe type.
234
+ func (rb *reorderBuffer) insertUnsafe(src input, i int, info Properties) {
235
+ if rune := src.hangul(i); rune != 0 {
236
+ rb.decomposeHangul(rune)
237
+ }
238
+ if info.hasDecomposition() {
239
+ // TODO: inline.
240
+ rb.insertDecomposed(info.Decomposition())
241
+ } else {
242
+ rb.insertSingle(src, i, info)
243
+ }
244
+ }
245
+
246
+ // insertDecomposed inserts an entry in to the reorderBuffer for each rune
247
+ // in dcomp. dcomp must be a sequence of decomposed UTF-8-encoded runes.
248
+ // It flushes the buffer on each new segment start.
249
+ func (rb *reorderBuffer) insertDecomposed(dcomp []byte) insertErr {
250
+ rb.tmpBytes.setBytes(dcomp)
251
+ // As the streamSafe accounting already handles the counting for modifiers,
252
+ // we don't have to call next. However, we do need to keep the accounting
253
+ // intact when flushing the buffer.
254
+ for i := 0; i < len(dcomp); {
255
+ info := rb.f.info(rb.tmpBytes, i)
256
+ if info.BoundaryBefore() && rb.nrune > 0 && !rb.doFlush() {
257
+ return iShortDst
258
+ }
259
+ i += copy(rb.byte[rb.nbyte:], dcomp[i:i+int(info.size)])
260
+ rb.insertOrdered(info)
261
+ }
262
+ return iSuccess
263
+ }
264
+
265
+ // insertSingle inserts an entry in the reorderBuffer for the rune at
266
+ // position i. info is the runeInfo for the rune at position i.
267
+ func (rb *reorderBuffer) insertSingle(src input, i int, info Properties) {
268
+ src.copySlice(rb.byte[rb.nbyte:], i, i+int(info.size))
269
+ rb.insertOrdered(info)
270
+ }
271
+
272
+ // insertCGJ inserts a Combining Grapheme Joiner (0x034f) into rb.
273
+ func (rb *reorderBuffer) insertCGJ() {
274
+ rb.insertSingle(input{str: GraphemeJoiner}, 0, Properties{size: uint8(len(GraphemeJoiner))})
275
+ }
276
+
277
+ // appendRune inserts a rune at the end of the buffer. It is used for Hangul.
278
+ func (rb *reorderBuffer) appendRune(r rune) {
279
+ bn := rb.nbyte
280
+ sz := utf8.EncodeRune(rb.byte[bn:], rune(r))
281
+ rb.nbyte += utf8.UTFMax
282
+ rb.rune[rb.nrune] = Properties{pos: bn, size: uint8(sz)}
283
+ rb.nrune++
284
+ }
285
+
286
+ // assignRune sets a rune at position pos. It is used for Hangul and recomposition.
287
+ func (rb *reorderBuffer) assignRune(pos int, r rune) {
288
+ bn := rb.rune[pos].pos
289
+ sz := utf8.EncodeRune(rb.byte[bn:], rune(r))
290
+ rb.rune[pos] = Properties{pos: bn, size: uint8(sz)}
291
+ }
292
+
293
+ // runeAt returns the rune at position n. It is used for Hangul and recomposition.
294
+ func (rb *reorderBuffer) runeAt(n int) rune {
295
+ inf := rb.rune[n]
296
+ r, _ := utf8.DecodeRune(rb.byte[inf.pos : inf.pos+inf.size])
297
+ return r
298
+ }
299
+
300
+ // bytesAt returns the UTF-8 encoding of the rune at position n.
301
+ // It is used for Hangul and recomposition.
302
+ func (rb *reorderBuffer) bytesAt(n int) []byte {
303
+ inf := rb.rune[n]
304
+ return rb.byte[inf.pos : int(inf.pos)+int(inf.size)]
305
+ }
306
+
307
+ // For Hangul we combine algorithmically, instead of using tables.
308
+ const (
309
+ hangulBase = 0xAC00 // UTF-8(hangulBase) -> EA B0 80
310
+ hangulBase0 = 0xEA
311
+ hangulBase1 = 0xB0
312
+ hangulBase2 = 0x80
313
+
314
+ hangulEnd = hangulBase + jamoLVTCount // UTF-8(0xD7A4) -> ED 9E A4
315
+ hangulEnd0 = 0xED
316
+ hangulEnd1 = 0x9E
317
+ hangulEnd2 = 0xA4
318
+
319
+ jamoLBase = 0x1100 // UTF-8(jamoLBase) -> E1 84 00
320
+ jamoLBase0 = 0xE1
321
+ jamoLBase1 = 0x84
322
+ jamoLEnd = 0x1113
323
+ jamoVBase = 0x1161
324
+ jamoVEnd = 0x1176
325
+ jamoTBase = 0x11A7
326
+ jamoTEnd = 0x11C3
327
+
328
+ jamoTCount = 28
329
+ jamoVCount = 21
330
+ jamoVTCount = 21 * 28
331
+ jamoLVTCount = 19 * 21 * 28
332
+ )
333
+
334
+ const hangulUTF8Size = 3
335
+
336
+ func isHangul(b []byte) bool {
337
+ if len(b) < hangulUTF8Size {
338
+ return false
339
+ }
340
+ b0 := b[0]
341
+ if b0 < hangulBase0 {
342
+ return false
343
+ }
344
+ b1 := b[1]
345
+ switch {
346
+ case b0 == hangulBase0:
347
+ return b1 >= hangulBase1
348
+ case b0 < hangulEnd0:
349
+ return true
350
+ case b0 > hangulEnd0:
351
+ return false
352
+ case b1 < hangulEnd1:
353
+ return true
354
+ }
355
+ return b1 == hangulEnd1 && b[2] < hangulEnd2
356
+ }
357
+
358
+ func isHangulString(b string) bool {
359
+ if len(b) < hangulUTF8Size {
360
+ return false
361
+ }
362
+ b0 := b[0]
363
+ if b0 < hangulBase0 {
364
+ return false
365
+ }
366
+ b1 := b[1]
367
+ switch {
368
+ case b0 == hangulBase0:
369
+ return b1 >= hangulBase1
370
+ case b0 < hangulEnd0:
371
+ return true
372
+ case b0 > hangulEnd0:
373
+ return false
374
+ case b1 < hangulEnd1:
375
+ return true
376
+ }
377
+ return b1 == hangulEnd1 && b[2] < hangulEnd2
378
+ }
379
+
380
+ // Caller must ensure len(b) >= 2.
381
+ func isJamoVT(b []byte) bool {
382
+ // True if (rune & 0xff00) == jamoLBase
383
+ return b[0] == jamoLBase0 && (b[1]&0xFC) == jamoLBase1
384
+ }
385
+
386
+ func isHangulWithoutJamoT(b []byte) bool {
387
+ c, _ := utf8.DecodeRune(b)
388
+ c -= hangulBase
389
+ return c < jamoLVTCount && c%jamoTCount == 0
390
+ }
391
+
392
+ // decomposeHangul writes the decomposed Hangul to buf and returns the number
393
+ // of bytes written. len(buf) should be at least 9.
394
+ func decomposeHangul(buf []byte, r rune) int {
395
+ const JamoUTF8Len = 3
396
+ r -= hangulBase
397
+ x := r % jamoTCount
398
+ r /= jamoTCount
399
+ utf8.EncodeRune(buf, jamoLBase+r/jamoVCount)
400
+ utf8.EncodeRune(buf[JamoUTF8Len:], jamoVBase+r%jamoVCount)
401
+ if x != 0 {
402
+ utf8.EncodeRune(buf[2*JamoUTF8Len:], jamoTBase+x)
403
+ return 3 * JamoUTF8Len
404
+ }
405
+ return 2 * JamoUTF8Len
406
+ }
407
+
408
+ // decomposeHangul algorithmically decomposes a Hangul rune into
409
+ // its Jamo components.
410
+ // See https://unicode.org/reports/tr15/#Hangul for details on decomposing Hangul.
411
+ func (rb *reorderBuffer) decomposeHangul(r rune) {
412
+ r -= hangulBase
413
+ x := r % jamoTCount
414
+ r /= jamoTCount
415
+ rb.appendRune(jamoLBase + r/jamoVCount)
416
+ rb.appendRune(jamoVBase + r%jamoVCount)
417
+ if x != 0 {
418
+ rb.appendRune(jamoTBase + x)
419
+ }
420
+ }
421
+
422
+ // combineHangul algorithmically combines Jamo character components into Hangul.
423
+ // See https://unicode.org/reports/tr15/#Hangul for details on combining Hangul.
424
+ func (rb *reorderBuffer) combineHangul(s, i, k int) {
425
+ b := rb.rune[:]
426
+ bn := rb.nrune
427
+ for ; i < bn; i++ {
428
+ cccB := b[k-1].ccc
429
+ cccC := b[i].ccc
430
+ if cccB == 0 {
431
+ s = k - 1
432
+ }
433
+ if s != k-1 && cccB >= cccC {
434
+ // b[i] is blocked by greater-equal cccX below it
435
+ b[k] = b[i]
436
+ k++
437
+ } else {
438
+ l := rb.runeAt(s) // also used to compare to hangulBase
439
+ v := rb.runeAt(i) // also used to compare to jamoT
440
+ switch {
441
+ case jamoLBase <= l && l < jamoLEnd &&
442
+ jamoVBase <= v && v < jamoVEnd:
443
+ // 11xx plus 116x to LV
444
+ rb.assignRune(s, hangulBase+
445
+ (l-jamoLBase)*jamoVTCount+(v-jamoVBase)*jamoTCount)
446
+ case hangulBase <= l && l < hangulEnd &&
447
+ jamoTBase < v && v < jamoTEnd &&
448
+ ((l-hangulBase)%jamoTCount) == 0:
449
+ // ACxx plus 11Ax to LVT
450
+ rb.assignRune(s, l+v-jamoTBase)
451
+ default:
452
+ b[k] = b[i]
453
+ k++
454
+ }
455
+ }
456
+ }
457
+ rb.nrune = k
458
+ }
459
+
460
+ // compose recombines the runes in the buffer.
461
+ // It should only be used to recompose a single segment, as it will not
462
+ // handle alternations between Hangul and non-Hangul characters correctly.
463
+ func (rb *reorderBuffer) compose() {
464
+ // Lazily load the map used by the combine func below, but do
465
+ // it outside of the loop.
466
+ recompMapOnce.Do(buildRecompMap)
467
+
468
+ // UAX #15, section X5 , including Corrigendum #5
469
+ // "In any character sequence beginning with starter S, a character C is
470
+ // blocked from S if and only if there is some character B between S
471
+ // and C, and either B is a starter or it has the same or higher
472
+ // combining class as C."
473
+ bn := rb.nrune
474
+ if bn == 0 {
475
+ return
476
+ }
477
+ k := 1
478
+ b := rb.rune[:]
479
+ for s, i := 0, 1; i < bn; i++ {
480
+ if isJamoVT(rb.bytesAt(i)) {
481
+ // Redo from start in Hangul mode. Necessary to support
482
+ // U+320E..U+321E in NFKC mode.
483
+ rb.combineHangul(s, i, k)
484
+ return
485
+ }
486
+ ii := b[i]
487
+ // We can only use combineForward as a filter if we later
488
+ // get the info for the combined character. This is more
489
+ // expensive than using the filter. Using combinesBackward()
490
+ // is safe.
491
+ if ii.combinesBackward() {
492
+ cccB := b[k-1].ccc
493
+ cccC := ii.ccc
494
+ blocked := false // b[i] blocked by starter or greater or equal CCC?
495
+ if cccB == 0 {
496
+ s = k - 1
497
+ } else {
498
+ blocked = s != k-1 && cccB >= cccC
499
+ }
500
+ if !blocked {
501
+ combined := combine(rb.runeAt(s), rb.runeAt(i))
502
+ if combined != 0 {
503
+ rb.assignRune(s, combined)
504
+ continue
505
+ }
506
+ }
507
+ }
508
+ b[k] = b[i]
509
+ k++
510
+ }
511
+ rb.nrune = k
512
+ }